summaryrefslogtreecommitdiffstatshomepage
path: root/nroam-utils.el
diff options
context:
space:
mode:
authorGravatar Damien Pollet2021-03-14 17:48:20 +0100
committerGravatar Damien Pollet2021-03-14 17:48:20 +0100
commit6b5fd99e2e3cc40e564e76ed568807d87221e745 (patch)
tree74f89504148f8229641a51076f86d112fcf5e1e0 /nroam-utils.el
parent7ae549a22225eb1dd099cd63726dc164109c92d7 (diff)
downloadnroam-6b5fd99e2e3cc40e564e76ed568807d87221e745.tar.gz
nroam-6b5fd99e2e3cc40e564e76ed568807d87221e745.zip
Organize backlinks under single heading
Diffstat (limited to 'nroam-utils.el')
-rw-r--r--nroam-utils.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/nroam-utils.el b/nroam-utils.el
index e94bdff..a4e58fc 100644
--- a/nroam-utils.el
+++ b/nroam-utils.el
@@ -34,6 +34,16 @@
(let ((inhibit-read-only t))
(unless (eq ?\n (char-before (1- (point)))) (insert "\n"))))
+(defun nroam--insert-heading (level title &optional tags)
+ "Insert a section heading"
+ (let ((pos (point))
+ (stars (make-string level ?*)))
+ (insert stars " " title "\n")
+ (when tags
+ (save-excursion
+ (goto-char pos)
+ (org-set-tags tags)))))
+
(defun nroam--do-separated-by-newlines (function sequence)
"Apply FUNCTION to each element of SEQUENCE.
Insert a single newline between each call to FUNCTION."