I would like to have different fast tag selections depending on the capture template used.
- Personal template - org-tag-alist = gym, family, friends, chores
- Work template - org-tag-alist = mettings, docs, seminar
I run the org-set-tags-command at the end but the selection doesn't show up. The functions are being called cause I can see the org-tag-alist changed in describe-variable.
It's prompting me for tags 0 Tags [add more using TAB]
instead of the quick entry when I run org-set-tags-command
. If I set org-tag-alist outside of the function it works but then I don't have different tags on a per template.
(defvar org-capture-templates nil)
(defun my/work-tags ()
"Set work tags."
(interactive)
(setq org-tag-alist '(("meetings" . ?m) ("docs" . ?d) ("seminar" . ?s)))
(= 1 2) ; Need to return string or nil.
)
(defun my/personal-tags ()
"Set personal tags."
(interactive)
(setq org-tag-alist '(("gym" . ?g) ("family" . ?f) ("friends" . ?F)("chores" . ?c)))
(= 1 2) ; Need to return string or nil.
)
(add-to-list 'org-capture-templates
'("W" ; key
"Work" ; name
entry ; type
(file (lambda () (concat user-emacs-directory "todos.org" ))) ; target
"* %(my/work-tags) %^{Task}%^{DESCRIPTION}p" :prepend t))
(add-to-list 'org-capture-templates
'("P" ; key
"Personal" ; name
entry ; type
(file (lambda () (concat user-emacs-directory "todos.org" ))) ; target
"* %(my/personal-tags) %^{Task}%^{DESCRIPTION}p" :prepend t))
I use vanilla emacs, but tried it on doom to make sure it wasn't my configuration.
(info "(org) Setting Tags")
.