Function: enriched-map-property-regions
enriched-map-property-regions is a byte-compiled function defined in
enriched.el.gz.
Signature
(enriched-map-property-regions PROP FUNC &optional FROM TO)
Documentation
Apply a function to regions of the buffer based on a text property.
For each contiguous region of the buffer for which the value of PROPERTY is eq, the FUNCTION will be called. Optional arguments FROM and TO specify the region over which to scan.
The specified function receives three arguments: the VALUE of the property in the region, and the START and END of each region.
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/enriched.el.gz
;;;
;;; Some functions dealing with text-properties, especially indentation
;;;
(defun enriched-map-property-regions (prop func &optional from to)
"Apply a function to regions of the buffer based on a text property.
For each contiguous region of the buffer for which the value of PROPERTY is
eq, the FUNCTION will be called. Optional arguments FROM and TO specify the
region over which to scan.
The specified function receives three arguments: the VALUE of the property in
the region, and the START and END of each region."
(save-excursion
(save-restriction
(if to (narrow-to-region (point-min) to))
(goto-char (or from (point-min)))
(let ((begin (point))
end
(marker (make-marker))
(val (get-text-property (point) prop)))
(while (setq end (text-property-not-all begin (point-max) prop val))
(move-marker marker end)
(funcall func val begin (marker-position marker))
(setq begin (marker-position marker)
val (get-text-property marker prop)))
(if (< begin (point-max))
(funcall func val begin (point-max)))))))