Function: outline-show-by-heading-regexp

outline-show-by-heading-regexp is an interactive and byte-compiled function defined in outline.el.gz.

Signature

(outline-show-by-heading-regexp REGEXP)

Documentation

Show outlines whose headings match REGEXP.

View in manual

Probably introduced at or before Emacs version 30.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/outline.el.gz
(defun outline-show-by-heading-regexp (regexp)
  "Show outlines whose headings match REGEXP."
  (interactive (list (read-regexp "Regexp to show outlines")))
  (let (outline-view-change-hook)
    (outline-map-region
     (lambda ()
       (when (string-match-p regexp (buffer-substring (pos-bol) (pos-eol)))
         (outline-show-branches) ;; To reveal all parent headings
         (outline-show-entry)))
     (point-min) (point-max)))
  (run-hooks 'outline-view-change-hook))