Function: c-clear-char-property-with-value-on-char

c-clear-char-property-with-value-on-char is a macro defined in cc-defs.el.gz.

Signature

(c-clear-char-property-with-value-on-char FROM TO PROPERTY VALUE CHAR)

Documentation

Remove all text-properties PROPERTY with value VALUE on characters with value CHAR from the region [FROM, TO), as tested by equal. These properties are assumed to be over individual characters, having been put there by c-put-char-property. POINT remains unchanged. Return the position of the first removed property, or nil.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-defs.el.gz
(defmacro c-clear-char-property-with-value-on-char (from to property value char)
  "Remove all text-properties PROPERTY with value VALUE on
characters with value CHAR from the region [FROM, TO), as tested
by `equal'.  These properties are assumed to be over individual
characters, having been put there by c-put-char-property.  POINT
remains unchanged.  Return the position of the first removed
property, or nil."
  (declare (debug t))
  (if c-use-extents
      ;; XEmacs
      `(let ((-property- ,property)
	     (-char- ,char)
	     (first (1+ (point-max))))
	 (map-extents (lambda (ext val)
			;; In the following, the test on the extent's property
			;; is probably redundant.  See documentation of
			;; map-extents.  NO!  See
			;; `c-clear-char-property-with-value'.
			(when (and (equal (extent-property ext -property-)
					  val)
				   (eq (char-after
					(extent-start-position ext))
				       -char-))
			  (setq first (min first (extent-start-position ext)))
			  (delete-extent ext))
			nil)
		      nil ,from ,to ,value nil -property-)
	 (and (<= first (point-max)) first))
    ;; Gnu Emacs
    `(c-clear-char-property-with-value-on-char-function ,from ,to ,property
							,value ,char)))