Function: font-lock--remove-face-from-text-property

font-lock--remove-face-from-text-property is a byte-compiled function defined in font-lock.el.gz.

Signature

(font-lock--remove-face-from-text-property START END PROP VALUE &optional OBJECT)

Documentation

Remove a specific property value from text from START to END.

Arguments PROP and VALUE specify the property and value to remove. The resulting property values are not eq to VALUE nor lists containing VALUE. Optional argument OBJECT is the string or buffer containing the text.

Source Code

;; Defined in /usr/src/emacs/lisp/font-lock.el.gz
(defun font-lock--remove-face-from-text-property (start
						  end
						  prop value &optional object)
  "Remove a specific property value from text from START to END.
Arguments PROP and VALUE specify the property and value to remove.  The
resulting property values are not `eq' to VALUE nor lists containing VALUE.
Optional argument OBJECT is the string or buffer containing the text."
  (let ((start (text-property-not-all start end prop nil object)) next prev)
    (while start
      (setq next (next-single-property-change start prop object end)
	    prev (get-text-property start prop object))
      (cond ((or (atom prev)
		 (keywordp (car prev))
		 (eq (car prev) 'foreground-color)
		 (eq (car prev) 'background-color))
	     (when (eq value prev)
	       (remove-list-of-text-properties start next (list prop) object)))
	    ((memq value prev)		;Assume prev is not dotted.
	     (let ((new (remq value prev)))
	       (cond ((null new)
		      (remove-list-of-text-properties start next (list prop)
						      object))
		     ((= (length new) 1)
		      (put-text-property start next prop (car new) object))
		     (t
		      (put-text-property start next prop new object))))))
      (setq start (text-property-not-all next end prop nil object)))))