diff options
author | Gustav Wikström | 2021-02-24 17:21:27 +0100 |
---|---|---|
committer | Gustav Wikström | 2021-02-24 17:21:27 +0100 |
commit | a5126d19ac80833a1dbde6abae151127431e4e22 (patch) | |
tree | 0e8f7838e3e1fec9632d52b5377bcb7988de30b3 | |
parent | e6ecd9f5f687415bfc3e6336127d22a01ebcccc2 (diff) | |
download | nroam-a5126d19ac80833a1dbde6abae151127431e4e22.tar.gz nroam-a5126d19ac80833a1dbde6abae151127431e4e22.zip |
Set visibility of backlinks section
* nroam.el (nroam--insert): Set visibility according to
startup-options.
-rw-r--r-- | nroam.el | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -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." |