I use helm for Emacs with several sources and wonder how I can extract the list of all entries that the user has marked with Ctrl+Space. As an example, execute the following in your *scratch*
buffer
(require 'helm)
(defun helm-test-action (candidate)
"Test."
(interactive)
(message (concat "candidate = " (prin1-to-string candidate)
"\n, helm-marked-candidates = " (prin1-to-string (helm-marked-candidates)))))
(defun helm-test-case ()
"Test."
(interactive)
(helm :sources (list (helm-build-sync-source "First Source"
:candidates '("one" "two" "three")
:action #'helm-test-action)
(helm-build-sync-source "Second Source"
:candidates '("four" "five")
:action #'helm-test-action))))
and then M-x helm-test-case
.
When you mark, say, "one" and "four" with Ctrl+Space and press Enter, how do I retrieve the two marked entries from my action? It seems candidate
is always the line on which the cursor has been placed and (helm-marked-candidates)
yields the list of marked entries of the current source. How do I get the list of marked entries across all sources?
Thanks for your help,
HPF