Function: outline-flag-region

outline-flag-region is a byte-compiled function defined in outline.el.gz.

Signature

(outline-flag-region FROM TO FLAG)

Documentation

Hide or show lines from FROM to TO, according to FLAG.

If FLAG is nil then text is shown, while if FLAG is t the text is hidden.

This function has :around advice: outline-flag-region@fix-for-org-fold.

Source Code

;; Defined in /usr/src/emacs/lisp/outline.el.gz
(defun outline-flag-region (from to flag)
  "Hide or show lines from FROM to TO, according to FLAG.
If FLAG is nil then text is shown, while if FLAG is t the text is hidden."
  (remove-overlays from to 'invisible 'outline)
  (when flag
    ;; We use `front-advance' here because the invisible text begins at the
    ;; very end of the heading, before the newline, so text inserted at FROM
    ;; belongs to the heading rather than to the entry.
    (let ((o (make-overlay from to nil 'front-advance)))
      (overlay-put o 'evaporate t)
      (overlay-put o 'invisible 'outline)
      (overlay-put o 'isearch-open-invisible
		   (or outline-isearch-open-invisible-function
		       #'outline-isearch-open-invisible))))
  ;; Jit-lock won't be triggered because we only touched overlays, so we have
  ;; to update "by hand".
  (outline--fix-buttons from to)
  (run-hooks 'outline-view-change-hook))