5

If I write a command that calls (interactive "f"), Emacs will prompt the user to select a file when the command is run interactively. With Helm enabled, this selection is done through Helm with no additional effort -- this is great!

However, if I mark multiple files in the Helm selection window, it is not clear to me that this information is passed on to the command. Is there a way to get custom commands to cooperate with Helm and multiple selections?

3
  • Are you sure about the 'no additional effort' bit? I just recently installed Helm and (defun my-test (files) (interactive "f") (message "%S" files)) isn't invoking Helm for me. Nov 4, 2014 at 3:48
  • With only (require 'helm) (require 'helm-config) (require 'helm-files) (helm-mode 1) my commands work with Helm (tried from emacs -Q). Nov 4, 2014 at 21:09
  • Interesting; I see what you mean. The above defun messages only the file under point when Helm exits. Nov 4, 2014 at 21:15

1 Answer 1

3

If you want to pass multiple selections, you have to explicitly retrieve:

(helm-marked-candidates :with-wildcard t)

and explicitly process the selections. Try printing the return value of the above form to see if you get correct set of candidates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.