From 13cbd90ec63977583797dab0683026c25f463c8d Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Tue, 21 Mar 2023 16:52:27 +0100 Subject: [PATCH] Improve checklist insertion Do not reveal whole subtree, but only the body. Also jump to first open checklist item after checklist insertion. --- site-lisp/db-org.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index 7a13231..f6c0c9c 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -995,7 +995,7 @@ inserting the checklist." ;; Checklists are inserted directly before first child, if existent, or ;; at end of subtree - (org-show-subtree) + (org-show-entry) (or (org-goto-first-child) (org-end-of-subtree 'invisible-ok 'to-heading)) ;; Move back from heading, unless we are at the end of the buffer @@ -1049,7 +1049,8 @@ inserting the checklist." (insert " none.\n") (db/org-copy-body-from-item-to-point template-marker))) - (org-entry-put (point) "CHECKLIST_INSERTED_P" "t")))) + (org-entry-put (point) "CHECKLIST_INSERTED_P" "t") + (db/org-goto-first-open-checkbox-in-subtree)))) (define-obsolete-function-alias 'db/org-copy-template 'db/org-insert-checklist