Function: outline--hidden-headings-restore-paths

outline--hidden-headings-restore-paths is a byte-compiled function defined in outline.el.gz.

Signature

(outline--hidden-headings-restore-paths PATHS CURRENT-PATH)

Documentation

Restore hidden outlines from a hash of hidden headings.

This is useful after reverting the buffer to restore the outlines hidden by outline--hidden-headings-paths. Also restore point on the same outline where point was before reverting the buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/outline.el.gz
(defun outline--hidden-headings-restore-paths (paths current-path)
  "Restore hidden outlines from a hash of hidden headings.
This is useful after reverting the buffer to restore the outlines
hidden by `outline--hidden-headings-paths'.  Also restore point
on the same outline where point was before reverting the buffer."
  (let (path current-point outline-view-change-hook)
    (outline-map-region
     (lambda ()
       (let* ((level (funcall outline-level))
              (heading (buffer-substring (pos-bol) (pos-eol))))
         (while (and path (>= (cdar path) level))
           (pop path))
         (push (cons heading level) path)
         (when (gethash (mapcar #'car path) paths)
           (outline-hide-subtree))
         (when (and current-path (equal current-path (mapcar #'car path)))
           (setq current-point (point)))))
     (point-min) (point-max))
    (when current-point (goto-char current-point))))