diff --git a/init.el b/init.el index 3642b61..4e07da3 100644 --- a/init.el +++ b/init.el @@ -759,6 +759,7 @@ db/find-csv-in-org db/org-mark-current-default-task db/export-diary + db/org-insert-checklist db/org-copy-template db/org-copy-body-from-item-to-point db/org-find-links-to-current-item diff --git a/site-lisp/db-customize.el b/site-lisp/db-customize.el index 8f1180a..9444ddb 100644 --- a/site-lisp/db-customize.el +++ b/site-lisp/db-customize.el @@ -149,7 +149,7 @@ in the main agenda view." ("Info Lookup" ?I counsel-info-lookup-symbol) ("Unicode Lookup" ?U counsel-unicode-char) ("Timeline of Day" ?T timeline-tools-format-timeline-of-day) - ("Copy template to point" ?C db/org-copy-template)) + ("Copy template to point" ?C db/org-insert-checklist)) "Mapping of frequently used features to functions implementing them. Can be used in application shortcuts such as `db/helm-shortcuts’. Each entry is a list of three items: a diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index e9b50b4..08cd486 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -831,16 +831,22 @@ Work task and home task are determined by the current values of org-home-task-id)) (org-clock-mark-default-task)))) -(defun db/org-copy-template () - "Copy template for the current Org Mode item to point. -The template is determined by the TEMPLATE_ID property, which -must be an ID referencing the proper template item. If that -property is not set, search for the topmost sibling of the -current item and see whether its headline is matching -\"^Template.*\"; if so, use its body as template, and barf -otherwise." +(defun db/org-insert-checklist () + "Insert checklist for Org Mode item at point. + +The checklist consists of a listing of all backlinks to the +current item and its parents (without archives) as well as a +template. The template is determined by the TEMPLATE_ID +property, which must be an ID referencing the proper template +item. If that property is not set, search for the topmost +sibling of the current item and see whether its headline is +matching \"^Template.*\"; if so, use its body as template, and +barf otherwise." (interactive) + (unless (derived-mode-p 'org-mode) + (user-error "Not in Org mode, aborting")) + (let (template-pom) ;; Check for TEMPLATE_ID property @@ -877,6 +883,10 @@ otherwise." (insert "\n\nTemplate:\n") (db/org-copy-body-from-item-to-point template-pom))) +(define-obsolete-function-alias 'db/org-copy-template + 'db/org-insert-checklist + "2022-10-09") + (defun db/org-copy-body-from-item-to-point (pom) "Copy body from item given by POM to point. This can be used to copy checklists from templates to the current