Function: hyrolo-show-levels

hyrolo-show-levels is a byte-compiled function defined in hyrolo.el.

Signature

(hyrolo-show-levels LEVELS-TO-SHOW)

Documentation

Show only the first line of up to LEVELS-TO-SHOW of HyRolo matches.

LEVELS-TO-SHOW must be 1 or greater and is relative to the first level of matches, so if LEVELS-TO-SHOW is 2 and the first level matched from an outline is level 3, then levels 3 and 4 will be shown.

Any call to this function should be wrapped in a call to hyrolo-map-matches.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hyrolo.el
(defun hyrolo-show-levels (levels-to-show)
  "Show only the first line of up to LEVELS-TO-SHOW of HyRolo matches.
LEVELS-TO-SHOW must be 1 or greater and is relative to the first
level of matches, so if LEVELS-TO-SHOW is 2 and the first level
matched from an outline is level 3, then levels 3 and 4 will be
shown.

Any call to this function should be wrapped in a call to
`hyrolo-map-matches'."
  (save-excursion
    (hyrolo-verify)
    (outline-show-all)
    ;; Use {t} to display top-level cells only
    (hyrolo-map-matches
     (lambda ()
       (save-excursion
	 (save-restriction
	   (goto-char (point-min))
	   (hyrolo-hdr-move-after-p)
	   ;; Prevent collapsing of initial file header
	   (narrow-to-region (point) (point-max))
	   (let ((max-level-to-show (+ (hyrolo-min-matched-level)
				       (1- levels-to-show))))
	     (outline-hide-sublevels max-level-to-show)
	     (goto-char (point-min))))))
     t)))