diff --git a/org/init.el b/org/init.el index fd0c437..2c7651b 100644 --- a/org/init.el +++ b/org/init.el @@ -111,12 +111,27 @@ (load "~/.emacs.d.profiles/common/helm-org.el") (require 'helm-org) (helm-mode 1) -; fix helm multi-tag select (needs custom seprator. default is comma -(setq helm-crm-default-separator ":") (add-to-list 'helm-completing-read-handlers-alist '(org-capture . helm-org-completing-read-tags)) (add-to-list 'helm-completing-read-handlers-alist '(org-set-tags . helm-org-completing-read-tags)) (add-to-list 'helm-completing-read-handlers-alist '(org-set-tags-command . helm-org-completing-read-tags)) +; fix helm multi-tag select (needs custom seprator. default is comma +;(setq helm-crm-default-separator ":" +(define-advice helm--completion-in-region (:around (helm-fun origfun start end collection &optional predicate) temporary-helm-crm-separator-for-tags) + (setq tcrmds helm-crm-default-separator) + ;; If the last command was any of these values, we're looking at tags most likely + (when (or (member last-command '(org-capture org-ctrl-c-ctrl-c org-set-tags org-set-tags-command)) + ;;This is a workaround for completions when you've already started typing. + (and (eq this-command 'crm-complete) + (eq major-mode 'org-mode)) + ;; This is probably the only thing we really need, but it doesn't handle custom "Tags" prompts + (and (active-minibuffer-window) + (eq "Tags: " (minibuffer-prompt)))) + (setq helm-crm-default-separator ":")) + ;; Call the original Helm Completion function with all the original arguments + (funcall helm-fun origfun start end collection predicate) + (setq helm-crm-default-separator tcrmds)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ui tuning (diminish 'projectile-mode)