From 40ba80de1a79b435f396adbe7d9045dfb99c6385 Mon Sep 17 00:00:00 2001 From: Nicolas Petton Date: Mon, 22 Feb 2021 22:44:53 +0100 Subject: Add the empty line as part of linked references section Do no add the empty line above the linked references section so that it is not written to files. --- nroam.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nroam.el b/nroam.el index 5c1de09..bbadffb 100644 --- a/nroam.el +++ b/nroam.el @@ -102,7 +102,6 @@ Make the region inserted by BODY read-only, and marked with (interactive) (nroam--setup-markers) (nroam--prune-backlinks) - (nroam--ensure-empty-line) (nroam--insert-backlinks)) (defun nroam--update-backlinks-maybe () @@ -139,6 +138,7 @@ Make the region inserted by BODY read-only, and marked with (save-excursion (goto-char (point-max)) (with-nroam-markers + (nroam--ensure-empty-line) (nroam--insert-backlinks-heading (seq-length backlinks)) (seq-do #'nroam--insert-backlink-group groups))) (nroam--hide-drawers)))) @@ -250,9 +250,8 @@ Temporary fix until `org-roam' v2 is out." (defun nroam--ensure-empty-line () "Insert a newline character if the buffer does not end with a newline." (let ((inhibit-read-only t)) - (save-excursion - (goto-char (point-max)) - (unless (eq ?\n (char-before (1- (point)))) (insert "\n"))))) + (goto-char (point-max)) + (unless (eq ?\n (char-before (1- (point)))) (insert "\n")))) (provide 'nroam) ;;; nroam.el ends here -- cgit v1.2.3-54-g00ecf