Ensure CHECKLIST_INSERTED_P
will be inserted at original heading
When a checklist template contains headings on its own, the `CHECKLIST_INSERTED_P` property until now would be inserted at the last heading in this template, instead of at the heading where the template is supposed to be inserted in the first place. Fixed this.
This commit is contained in:
parent
7db9f8d56c
commit
fa56dfdd4d
|
@ -1090,6 +1090,11 @@ inserting the checklist."
|
||||||
|
|
||||||
(t ;; Default action: insert complete checklist.
|
(t ;; Default action: insert complete checklist.
|
||||||
|
|
||||||
|
;; Let's remember where we are, so that latter on CHECKLIST_INSERTED_P
|
||||||
|
;; will be inserted at the original heading (where we are now) and not
|
||||||
|
;; at possible new subtrees coming from the template.
|
||||||
|
(save-mark-and-excursion
|
||||||
|
|
||||||
;; Checklists are inserted directly before first child, if existent, or
|
;; Checklists are inserted directly before first child, if existent, or
|
||||||
;; at end of subtree
|
;; at end of subtree
|
||||||
(org-show-entry)
|
(org-show-entry)
|
||||||
|
@ -1144,7 +1149,7 @@ inserting the checklist."
|
||||||
(insert "\n\nTemplate:")
|
(insert "\n\nTemplate:")
|
||||||
(if (not template-marker)
|
(if (not template-marker)
|
||||||
(insert " none.\n")
|
(insert " none.\n")
|
||||||
(db/org-copy-body-from-item-to-point template-marker)))
|
(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))))
|
(db/org-goto-first-open-checkbox-in-subtree))))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user