Browse Source

* nroam.el (nroam--insert): Extract `nroam--set-sections-visibility'.

master
Nicolas Petton 1 month ago
parent
commit
71dad15b6d
No known key found for this signature in database GPG Key ID: E8BCD7866AFCF978
1 changed files with 15 additions and 12 deletions
  1. +15
    -12
      nroam.el

+ 15
- 12
nroam.el View File

@ -185,18 +185,21 @@ Make the region inserted by BODY read-only, and marked with
(defun nroam--insert ()
"Insert nroam sections in the current buffer."
(let ((point (point-max)))
(with-buffer-modified-unmodified
(save-excursion
(goto-char point)
(unless (bobp)
(nroam--ensure-empty-line))
(with-nroam-markers
(nroam--do-separated-by-newlines #'funcall nroam-sections))
(when (nroam--sections-inserted-p)
(save-restriction
(narrow-to-region point (point-max))
(org-set-startup-visibility)))))))
(with-buffer-modified-unmodified
(save-excursion
(goto-char (point-max))
(unless (bobp)
(nroam--ensure-empty-line))
(with-nroam-markers
(nroam--do-separated-by-newlines #'funcall nroam-sections))
(nroam--set-sections-visibility))))
(defun nroam--set-sections-visibility ()
"Set nroam section visibility according to `org-set-startup-visibility'."
(when (nroam--sections-inserted-p)
(save-restriction
(narrow-to-region nroam-start-marker nroam-end-marker)
(org-set-startup-visibility))))
(defun nroam--get-backlinks ()
"Return a list of backlinks for the current buffer."


Loading…
Cancel
Save