Archived
1
0
Fork 0

fix from granit for org tag completion via helm. seems a bug/behavior change with org 9 is the cause per granit

This commit is contained in:
KemoNine 2022-09-08 12:49:35 -04:00
parent 1d1b2a4d4f
commit 62c8e8cfb2

View file

@ -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)