reddit / emacs

When you cancel a helm completion how do you null the result?

vfclists ยท 2022-05-15 15:11
I have this piece of code in a helm completion, but when I cancel or press `Ctrl-G` the value of the input is set. (let (input (progn (helm :sources (list (helm-make-source "Select the right property:" 'helm-source-sync :candidates vh-task-property-completion-candidates))) (helm-marked-candidates))) ...) From the documentation `helm-marked-candidates` is the list of selected items, and the problem is there is always something selected even if I press `Ctrl-G` or `Esc`. How do I ensure `helm-marked-candidates` is nil when I press `Esc` or `Ctrl-G`? What other variable or method can be used which ensures the outcome of the completion is nil if it is cancelled via `Esc` or `Ctrl-G`?