Browse Source

Add function to show just every headline in buffer

* lisp/org.el (org-show-branches-buffer): New function.
Marco Wahl 6 years ago
parent
commit
ee4fcc2aaa
1 changed files with 10 additions and 0 deletions
  1. 10 0
      lisp/org.el

+ 10 - 0
lisp/org.el

@@ -17917,6 +17917,16 @@ Move point to the beginning of first heading or end of buffer."
   (unless (bobp)
     (org-flag-region 1 (1- (point)) (not arg) 'outline)))
 
+(defun org-show-branches-buffer ()
+  "Show all branches in the buffer."
+  (org-flag-above-first-heading)
+  (outline-hide-sublevels 1)
+  (unless (eobp)
+    (outline-show-branches)
+    (while (outline-get-next-sibling)
+      (outline-show-branches)))
+  (goto-char (point-min)))
+
 (defun org-kill-note-or-show-branches ()
   "Abort storing current note, or call `outline-show-branches'."
   (interactive)