#StackBounty: #helm #helm-sources Selecting a file via helm using multiple sources

Bounty: 50

I have a customized find-file that uses helm sources to help load a file into my buffer. Now, however, I would like to be able to select a file using the same algorithm and store that filename into a variable.

I can use helm-read-file-nameto select a file, but it doesn’t use any of the fancy sources or indeed anything very different from standard emacs read-file-name.

How can I get helm-read-file-name to use sources, or alternatively, use the helm function with a different action that will store the match (or matches) into a variable so I can access them?

I’ve included some code showing what I would like to conceptually have happen (providing a list of sources that helm-read-file-name might use to generate a filename to select).

(setq mhfile
    (helm-read-file-name "Attachment: " :sources '(helm-source-recentf
         helm-source-locate
         helm-source-findutils
         helm-source-buffers-list)))

Obviously I’m going down the wrong path, but I can’t figure out a way to override the default action that helm uses either.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.