Browse Source

Set visibility of backlinks section

* nroam.el (nroam--insert): Set visibility according to
startup-options.
master
Gustav Wikström 1 month ago
parent
commit
a5126d19ac
1 changed files with 12 additions and 6 deletions
  1. +12
    -6
      nroam.el

+ 12
- 6
nroam.el View File

@ -185,12 +185,18 @@ Make the region inserted by BODY read-only, and marked with
(defun nroam--insert ()
"Insert nroam sections in the current buffer."
(with-buffer-modified-unmodified
(save-excursion
(goto-char (point-max))
(with-nroam-markers
(seq-do #'funcall nroam-sections)))
(nroam--hide-drawers)))
(let ((p (point-max)))
(with-buffer-modified-unmodified
(save-excursion
(goto-char p)
(with-nroam-markers
(seq-do #'funcall nroam-sections))
(when (nroam--sections-inserted-p)
(goto-char (+ p 1)) ; maybe to implicit. But loc. of new
; backlinks section
(save-restriction
(org-narrow-to-subtree)
(org-set-startup-visibility)))))))
(defun nroam--get-backlinks ()
"Return a list of backlinks for the current buffer."


Loading…
Cancel
Save