Function: alter-text-property

alter-text-property is a byte-compiled function defined in indent.el.gz.

Signature

(alter-text-property FROM TO PROP FUNC &optional OBJECT)

Documentation

Programmatically change value of a text-property.

For each region between FROM and TO that has a single value for PROPERTY, apply FUNCTION to that value and sets the property to the function's result. Optional fifth argument OBJECT specifies the string or buffer to operate on.

Source Code

;; Defined in /usr/src/emacs/lisp/indent.el.gz
(defun alter-text-property (from to prop func &optional object)
  "Programmatically change value of a text-property.
For each region between FROM and TO that has a single value for PROPERTY,
apply FUNCTION to that value and sets the property to the function's result.
Optional fifth argument OBJECT specifies the string or buffer to operate on."
  (let ((begin from)
	end val)
    (while (setq val (get-text-property begin prop object)
		 end (text-property-not-all begin to prop val object))
      (put-text-property begin end prop (funcall func val) object)
      (setq begin end))
    (if (< begin to)
	(put-text-property begin to prop (funcall func val) object))))