Add newlines when inserting templates

I find myself inserting these newlines whenever I insert a template, so let's
let them insert them automatically.
This commit is contained in:
Daniel - 2022-01-02 09:31:29 +01:00
parent 1fa15e6736
commit 407f5d70f2
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
1 changed files with 5 additions and 5 deletions

View File

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