Function: c-clear-char-properties

c-clear-char-properties is a macro defined in cc-defs.el.gz.

Signature

(c-clear-char-properties FROM TO PROPERTY)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-defs.el.gz
(defmacro c-clear-char-properties (from to property)
  ;; Remove all the occurrences of the given property in the given
  ;; region that has been put with `c-put-char-property'.  PROPERTY is
  ;; assumed to be constant.
  ;;
  ;; The returned value is the buffer position of the lowest character
  ;; whose PROPERTY was removed, or nil if there was none.
  ;;
  ;; Note that this function does not clean up the property from the
  ;; lists of the `rear-nonsticky' properties in the region, if such
  ;; are used.  Thus it should not be used for common properties like
  ;; `syntax-table'.
  ;;
  ;; This macro does hidden buffer changes.
  (declare (debug t))
  (setq property (eval property))
  `(let* ((-to- ,to)
	  (ret (c-min-property-position ,from -to- ',property)))
     (if (< ret -to-)
	 (progn
	   ,(cond
	     (c-use-extents
	      ;; XEmacs
	      `(map-extents (lambda (ext ignored)
				(delete-extent ext)
				nil) ; To prevent exit from `map-extents'.
			    nil ret -to- nil nil ',property))
	     ((and (fboundp 'syntax-ppss)
		   (eq property 'syntax-table))
	      ;; Emacs 'syntax-table
	      `(progn
		     (setq c-syntax-table-hwm
			   (min c-syntax-table-hwm ret))
		     (remove-text-properties ret -to- '(,property nil))))
	     (t
	      ;; Emacs other property.
	      `(remove-text-properties ret -to- '(,property nil))))
	   ret)
       nil)))