Improve checklist insertion

Do not reveal whole subtree, but only the body.  Also jump to first open
checklist item after checklist insertion.
This commit is contained in:
Daniel - 2023-03-21 16:52:27 +01:00
parent ba9edc5f12
commit 13cbd90ec6
No known key found for this signature in database
GPG Key ID: 784AA8DF0CCDF625
1 changed files with 3 additions and 2 deletions

View File

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