emacs-helm / helm-org

53 stars 9 forks source link

Read multiple todo keywords when multiple are marked #12

Closed akater closed 4 years ago

akater commented 4 years ago

When reading todo keywords, e.g. in (org-todo-list '(4)), it is possible to mark multiple candidates but it has no effect in the sense that only a single candidate gets read. It would be natural to read (mapconcat #'identity (helm-marked-candidates) "|") instead.

thierryvolpiatto commented 4 years ago

akater notifications@github.com writes:

When reading todo keywords, e.g. in (org-todo-list '(4)), it is possible to mark multiple candidates but it has no effect in the sense that only a single candidate gets read. It would be natural to read (mapconcat #'identity (helm-marked-candidates) "|") instead.

This have nothing to do with helm-org. When you do M-x org-todo-list you have a generic helm command (because you use helm-mode) that does just like original command i.e. it returns a single candidate, not a list.

-- Thierry

Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997

akater commented 4 years ago

I see. completing-read-multiple returns a list; I can propose a patch to org-agenda (not yet sure it won't break anything though). generic helm command would hook to crm-complete properly, so the proposed feature almost works, with some UI-related caveats but I guess those are general issues with helm interaction with crm-complete. I'll discuss it somewhere else if needed.

thierryvolpiatto commented 4 years ago

akater notifications@github.com writes:

I see. completing-read-multiple returns a list; I can propose a patch to org-agenda (not yet sure it won't break anything though). generic helm command would hook to crm-complete properly, and the proposed feature almost works, with some UI-related caveats but I guess those are general issues with helm interaction for crm-complete.

CRM is handled by completion-in-region which is working fine AFAIK. Please open a bug in helm with a recipe showing what you think is a bug.

Here is a test where helm returns a list with completing-read-multiple:

(defun crm-init-test-environ ()
  "Set up some variables for testing."
  (interactive)
  (setq my-prompt "Prompt: ")
  (setq my-table
    '(("hi") ("there") ("man") ("may") ("mouth") ("ma")
      ("a") ("ab") ("abc") ("abd") ("abf") ("zab") ("acb")
      ("da") ("dab") ("dabc") ("dabd") ("dabf") ("dzab") ("dacb")
      ("fda") ("fdab") ("fdabc") ("fdabd") ("fdabf") ("fdzab") ("fdacb")
      ("gda") ("gdab") ("gdabc") ("gdabd") ("gdabf") ("gdzab") ("gdacb")
      ))
  (setq my-separator ","))

M-x crm-init-test-environ RET

Eval in scratch:

(completing-read-multiple my-prompt my-table)

Use "," as separator.

-- Thierry

Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997

thierryvolpiatto commented 4 years ago

Note also that CRM don't need marked candidates.

akater commented 4 years ago

Please open a bug in helm with a recipe showing what you think is a bug.

My main gripe with it is, user has to hit TAB initially to see the completions list for crm-complete. I suspect it has to do with crm, not helm.

thierryvolpiatto commented 4 years ago

akater notifications@github.com writes:

Please open a bug in helm with a recipe showing what you think is a bug.

My main gripe with it is, user has to hit TAB initially to see the completions list for crm-complete. I suspect it has to do with crm, not helm.

Yes, it's how CRM works, there is nothing to do on helm side.

-- Thierry

Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997

thierryvolpiatto commented 4 years ago

Forget to mention (as I use rarely CRM) that once completion popup after pressing TAB you can mark several candidates and press ENTER instead of adding each time the separator and then pressing TAB.

akater commented 4 years ago

Yes, that's exactly what I meant when I said “the proposed feature almost works” and that's why I employed c-r-m in the first place.