4

Something changed recently with Helm and now the matching order of helm-recentf has become less useful.

For instance, in the latest version of Helm (just downloaded from Melpa) if the last visited file was ~/.emacs.d/init.el, and in helm-recentf I type "ini", the first matched file will be ~/bin/unison (or some other file containing "i", "n", and "i").

The logical first match should have been ~/.emacs.d/init.el, as this is the most recently visited file and it has the three letters I'm typing together.

How can I go back to the previous (and correct) behavior? I imagine that this could be achieved by disabling fuzzy matching in helm-recentf or by changing the scoring rule. Is there an easy way to achieve any of this?

scaramouche
  • 1,734
  • 10
  • 26
  • More detail about the current behavior of helm-recentf: It seems once a key is pressed, the results are sorted according to the number of characters (e.g., a goes before aa, as the first has fewer characters). This way of sorting discards the useful information of which file has been used more recently. This behavior is ill-suited for helm-recentf. – scaramouche Dec 09 '14 at 23:59
  • This problem was solved in the new version of Helm (see comments by @Tu Do below). Now helm-recentf does not do fuzzy matching by default (unless enabled by setting helm-recentf-fuzzy-match to t). – scaramouche Dec 10 '14 at 20:27

1 Answers1

3

As answer by Helm maintainer in this thread

1) Fuzzy match against basename to match "ini" by either entering " -b" after "ini" or by switching to basename with `C-]'.

2) Adding a space after "ini" to make a regexp match (fall back to matchplugin as soon a space is detected).

Tu Do
  • 6,812
  • 21
  • 39
  • Thank you for pointing to the thread. But what I want to do is to programmatically disable fuzzy matching in helm-recentf (having to type a space or "-" or pressing C-] everytime I use this function is very un-Emacs). Is there a simple way of disabling fuzzy matching in a helm-recentf? – scaramouche Dec 10 '14 at 14:51
  • Well, you can redefine helm-source-recentf with :fuzzy-match slot removed. But if you raise an issue in the fuzzy matching thread, then the maintainer might fix it. – Tu Do Dec 10 '14 at 15:07
  • Done. I posted a comment in the fuzzy matching thread. Meanwhile I have reverted to an older version of Helm. – scaramouche Dec 10 '14 at 15:34
  • 1
    A new user is added: helm-recentf-fuzzy-match is added. You enable fuzzy match for helm-recentf with that variable. Now fuzzy match is off by default for helm-recentf. Anyway, helm-recentf matching is improved. Would you try it again? – Tu Do Dec 10 '14 at 18:14
  • Great! I just downloaded and tested the new version (from git), and helm-recentf is working as desired. Many thanks for the fast response! – scaramouche Dec 10 '14 at 20:23