Add function to flag region above first heading

* lisp/org.el (org-flag-above-first-heading): New function.
This commit is contained in:
Marco Wahl 2019-07-11 12:08:47 +02:00
parent 4e6222f188
commit add2614cf9
1 changed files with 9 additions and 0 deletions

View File

@ -17908,6 +17908,15 @@ Use `\\[org-edit-special]' to edit table.el tables"))
(org-reset-file-cache)) (org-reset-file-cache))
(message "%s restarted" major-mode)) (message "%s restarted" major-mode))
(defun org-flag-above-first-heading (&optional arg)
"Hide from bob up to the first heading.
Move point to the beginning of first heading or end of buffer."
(goto-char (point-min))
(unless (org-at-heading-p)
(outline-next-heading))
(unless (bobp)
(org-flag-region 1 (1- (point)) (not arg) 'outline)))
(defun org-kill-note-or-show-branches () (defun org-kill-note-or-show-branches ()
"Abort storing current note, or call `outline-show-branches'." "Abort storing current note, or call `outline-show-branches'."
(interactive) (interactive)