I'm trying to create a Helm source which matches the basename of files. I created a source which splits the basename of files in recentf list and puts the path behind it in parens (it uses the (DISPLAY . REAL) candidate format, so the real item is still available for opening the file.
I then added a :match attribute function which should match only the basename of the file when searching, but for some reason it still matches the path part.
Can someone tell me why?
(helm
:sources
(list
(helm-build-sync-source
"Recent Files Basenames"
:candidates
(lambda ()
(mapcar (lambda (f)
(cons (format
"%s (%s)"
(file-name-nondirectory f) f) f))
recentf-list))
:match (lambda (candidate)
(string-match
helm-pattern
(substring candidate 0
(string-match "(" candidate))))
:action '(("Find File" . find-file)))))