From 564990a1af0fb38e84907b7d840b95f2bbb1c4d1 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sun, 9 Oct 2022 10:25:39 +0200 Subject: [PATCH] Automatically add backlinks when copying templates Experimental Backlinks are an integral part of the checklist for the item at point, so why not include them per default? Copying is for now done unconditionally and without any customization. If those will turn out necessary, then they will be added later. --- site-lisp/db-org.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index ae900c2..e9b50b4 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -870,6 +870,11 @@ otherwise." (unless template-pom (user-error "Cannot find template via TEMPLATE_ID property or top-most sibling")) + (insert "\nBacklinks (not DONE, all parents, no archives):\n\n") + (org-dblock-write:db/org-backlinks '(:org-ql-match (not (done)) + :parent-depth nil + :archive nil)) + (insert "\n\nTemplate:\n") (db/org-copy-body-from-item-to-point template-pom))) (defun db/org-copy-body-from-item-to-point (pom)