From 407f5d70f25e1b977abae940e04b86c75799d3b8 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sun, 2 Jan 2022 09:31:29 +0100 Subject: [PATCH] Add newlines when inserting templates I find myself inserting these newlines whenever I insert a template, so let's let them insert them automatically. --- site-lisp/db-org.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index 1e3dd95..5574beb 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -647,12 +647,10 @@ otherwise." (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 -item, which might be an instance of a periodic task. - -If POM is not given, use `db/org-get-location' to interactively -query for it." +item, which might be an instance of a periodic task. If POM is +not given, use `db/org-get-location' to interactively query for +it. Adds newline before and after the template." (interactive (list (db/org-get-location t))) (unless (number-or-marker-p pom) (user-error "Argument is neither point nor mark: %s" pom)) @@ -679,7 +677,9 @@ query for it." (user-error "Cannot find content in template, or content is empty")) (string-trim-right (buffer-substring-no-properties content-begin content-end)))))))) + (insert "\n") (insert body) + (insert "\n") (org-update-statistics-cookies nil))) (defun db/org-update-headline-log-note (&optional new-headline)