Skip to content

Commit

Permalink
zoutline.el (zo-hide-heading): Add
Browse files Browse the repository at this point in the history
  • Loading branch information
abo-abo committed Sep 13, 2021
1 parent 3c0b507 commit dd7abcf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions zoutline.el
Expand Up @@ -201,6 +201,16 @@ Insert any that doesn't exist."
(set-match-data
(list (line-beginning-position) (line-end-position)))))

(defun zo-hide-heading (heading)
"Search for HEADING and hide it.
When HEADING is 'current, hide the current heading."
(save-excursion
(when (or (eq heading 'current)
(progn
(goto-char (point-min))
(re-search-forward (concat "^\\*+ " (regexp-quote heading)) nil t)))
(outline-flag-subtree t))))

(provide 'zoutline)

;;; zoutline.el ends here

0 comments on commit dd7abcf

Please sign in to comment.