Function: allout-annotate-hidden

allout-annotate-hidden is a byte-compiled function defined in allout.el.gz.

Signature

(allout-annotate-hidden BEGIN END)

Documentation

Qualify text with properties to indicate exposure status.

Source Code

;; Defined in /usr/src/emacs/lisp/allout.el.gz
;;;_    > allout-annotate-hidden (begin end)
(defun allout-annotate-hidden (begin end)
  "Qualify text with properties to indicate exposure status."

  (let ((was-modified (buffer-modified-p))
        (buffer-read-only nil))
    (allout-deannotate-hidden begin end)
    (save-excursion
      (goto-char begin)
      (let (done next prev overlay)
        (while (not done)
          ;; at or advance to start of next hidden region:
          (if (not (allout-hidden-p))
              (setq next
                    (max (1+ (point))
                         (next-single-char-property-change (point)
                                                           'invisible
                                                           nil end))))
          (if (or (not next) (eq prev next))
              ;; still not at start of hidden area -- must not be any left.
              (setq done t)
            (goto-char next)
            (setq prev next)
            (if (not (allout-hidden-p))
                ;; still not at start of hidden area.
                (setq done t)
              (setq overlay (allout-get-invisibility-overlay))
              (setq next (overlay-end overlay)
                    prev next)
              ;; advance to end of this hidden area:
              (when next
                (goto-char next)
                (allout-unprotected
                 (let ((buffer-undo-list t))
                   (put-text-property (overlay-start overlay) next
                                      'allout-was-hidden t)))))))))
    (set-buffer-modified-p was-modified)))