summaryrefslogtreecommitdiffstatshomepage
path: root/nroam.el
diff options
context:
space:
mode:
authorGravatar Nicolas Petton2021-02-24 20:15:02 +0100
committerGravatar GitHub2021-02-24 20:15:02 +0100
commitf25c89adc8abc61f7184b29ef628dd0c534a5dac (patch)
treee28e1728a5f33fa23e228cf669ba8c5c76bf3f00 /nroam.el
parente6ecd9f5f687415bfc3e6336127d22a01ebcccc2 (diff)
parent57e6e0f99495fdb819f57fabd1ff4452eed87189 (diff)
downloadnroam-f25c89adc8abc61f7184b29ef628dd0c534a5dac.tar.gz
nroam-f25c89adc8abc61f7184b29ef628dd0c534a5dac.zip
Merge pull request #2 from Whil-/master
Set visibility of backlinks section
Diffstat (limited to 'nroam.el')
-rw-r--r--nroam.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/nroam.el b/nroam.el
index e7cf780..7c3f379 100644
--- a/nroam.el
+++ b/nroam.el
@@ -185,12 +185,16 @@ 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)
+ (save-restriction
+ (narrow-to-region p (point-max))
+ (org-set-startup-visibility)))))))
(defun nroam--get-backlinks ()
"Return a list of backlinks for the current buffer."