emacs-helm/helm

Wrong matches in helm-bibtex under some cases

hitswint opened this issue · 1 comments

What happened?

Hi there,
The candicates in helm-bibtex are in the format of (DISPLAY . REAL). when helm-bibtex is called in dired-mode, the matches shows the REAL part in candidates, not the DISPLAY part. Refer to tmalsburg/helm-bibtex#425 for details.

How to reproduce?

After some digging, i believe the problem lies with Helm, not the helm-bibtex. In helm-bibtex, there are two format functions applied on the original candidates: helm-bibtex-candidates-formatter and helm-fuzzy-highlight-matches. The two functions are applied sequentially on the original candidates. With the first one applied, it returns as expected. But the return value of latter function depends on the things at point because of the "helm-guess-filename-at-point" in it.

In most cases, helm-guess-filename-at-point returns nil, and when it is called in dired-mode, the return value is not nil.This behavior changes the return value of "helm-fuzzy-highlight-matches" to (REAL . REAL).

I have done three tests on this:

  1. Remove helm-guess-filename-at-point from helm-fuzzy-highlight-matches
  2. Redefine it to always return nil,
  3. Change the 'nohighlight attribute to t for helm-source-bibtex, which disables helm-fuzzy-highlight-matches

All the tests above corrected the bug, which make me believe the problem is on Helm's side.

Helm Version

Melpa or NonGnuElpa

Emacs Version

Emacs-28/29

OS

GNU/Linux

Relevant backtrace (if possible)

No response

Minimal configuration

  • I agree using a minimal configuration

This should be fixed by be98c8e, closing.