You will have to use text-property-any
to find the start of the offending face and text-property-not-all
to find its end. Then you will need to iterate.
(defun kill-text-with-property (start end property value &optional object)
"Delete the text with the PROPERTY in the part of OBJECT from START and END."
(interactive "r\nsProperty: \nsValue: ")
(let ((delenda ()) (here start))
;; collect the list of regions to kill
;; note that delenda contains the regions in the reverse order so that
;; deleting the later ones do not affect the boundaries of the ealier ones
(while (< here end)
(let ((beg (text-property-any here end property value object))
(stop (and beg (text-property-not-all beg end property value object) end)))
(if (null beg)
(setq here end) ; done
(push (cons beg stop) delenda)
(setq here stop))))
(if (stringp object)
;; collect the complements of delenda into a new string
(....)
;; buffer: kill the delenda regions
(with-current-buffer (or object (current-buffer))
(dolist (pair delenda)
(kill-region (car pair) (cdr pair)))))))