1

helm sources have a slot named match-part which, IIUC, is the part of the transformed candidate that will be matched. In particular, the source helm-files-in-current-dir-source has the following match-part:

(match-part :initform (lambda (candidate)
                           (if (or helm-ff-transformer-show-only-basename
                                   helm-recentf--basename-flag)
                               (helm-basename candidate) candidate)))

This source also has fuzzy-match set to t. With helm-ff-transformer-show-only-basename set to t, I still see this source, when used as part of helm-for-files, doing fuzzy-matching on the full file name and not just the basename. For example, abc matches the file aaa/bbb/ccc. I had assumed match-part would transform the candidate aaa/bbb/ccc to just ccc, which abc would fail to match even with fuzzy matching on. What am I doing wrong?

The fuzzy match function which kicks in for the source helm-files-in-current-dir-source is the default helm-fuzzy-match.

1
  • 1
    I'm also looking to achieve the same thing: it's pretty rare that you want to match a filename based on the directory that it is in, though sometimes it can be helpful to see the full path in order to be able to disambiguate multiple matches. It seems that the author of helm takes a different stance though looking at the support threads on fuzzy matching. – jkp Jul 27 '15 at 5:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.