From 2a4bba82389b16c02258671c59cf6813cfd3cc78 Mon Sep 17 00:00:00 2001 From: TEC Date: Tue, 3 Nov 2020 23:00:26 +0800 Subject: [PATCH] Initialise capture templates after frame, not use This is to avoid an issue when the first capture template used is a roam capture template. --- config.org | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/config.org b/config.org index 8301940..4678428 100644 --- a/config.org +++ b/config.org @@ -3777,7 +3777,7 @@ Let's setup some org-capture templates, and make them visually nice to access. (setq doct-after-conversion-functions '(+doct-iconify-capture-templates)) - (add-transient-hook! 'org-capture-select-template + (defun set-org-capture-templates () (setq org-capture-templates (doct `(("Personal todo" :keys "t" :icon ("checklist" :set "octicon" :color "green") @@ -3934,7 +3934,16 @@ Let's setup some org-capture templates, and make them visually nice to access. :time-or-todo "%U" :heading "Unreleased" :file +org-capture-central-project-changelog-file)) - )))))) + ))))) + + (set-org-capture-templates) + (unless (display-graphic-p) + (add-hook 'server-after-make-frame-hook + (defun org-capture-reinitialise-hook () + (when (display-graphic-p) + (set-org-capture-templates) + (remove-hook 'server-after-make-frame-hook + #'org-capture-reinitialise-hook)))))) #+end_src It would also be nice to improve how the capture dialogue looks #+name: prettify-capture