emacs-helm / helm-org

53 stars 9 forks source link

How to use (helm-org-capture-templates) within other persistent actions? #7

Open leungbk opened 5 years ago

leungbk commented 5 years ago
(require 'helm)
(require 'helm-org)

;; [...]

(defun my-helm-extension/org-capture (cand)
  ;; [some code to add my own `org-capture' templates...]
  (helm-org-capture-templates))

(defvar my-helm-extension/helm-source
  (helm-build-sync-source " My extension"
    :candidates #'my-extension/compute-candidates
    :action (helm-make-actions
             "Org capture" #'my-helm-extension/org-capture)))

;;;###autoload
(defun my-helm-extension ()
  "My Helm extension"
  (interactive)
  (helm :sources my-helm-extension/helm-source
        :buffer "*my-helm-extension*"))

I've written a helm extension that is structured like this. The normal action my-helm-extension/org-capture works fine, but when I try to call the persistent version of this action with C-j, then helm-alive-p is t, (helm--alive-p) is nil, and I abort the helm session entirely at helm-keyboard-quit:

https://github.com/emacs-helm/helm/blob/c00b5826c1d5797debe92ed235d50b068a348c14/helm.el#L2455.

This is not what I expect; I want to perform the org-capture and subsequently return to the my-helm-extension helm session. Is it wrong of me to use helm-org-capture-templates in this manner?