Function: diff--filter-substring
diff--filter-substring is a byte-compiled function defined in
diff-mode.el.gz.
Signature
(diff--filter-substring STR)
Source Code
;; Defined in /usr/src/emacs/lisp/vc/diff-mode.el.gz
(defun diff--filter-substring (str)
(when diff-font-lock-prettify
;; Strip the `display' properties added by diff-font-lock-prettify,
;; since they look weird when you kill&yank!
(remove-text-properties 0 (length str) '(display nil) str)
;; We could also try to only remove those `display' properties actually
;; added by diff-font-lock-prettify rather than removing them all blindly.
;; E.g.:
;;(let ((len (length str))
;; (i 0))
;; (while (and (< i len)
;; (setq i (text-property-not-all i len 'display nil str)))
;; (let* ((val (get-text-property i 'display str))
;; (end (or (text-property-not-all i len 'display val str) len)))
;; ;; FIXME: Check for display props that prettify the file header!
;; (when (eq 'left-fringe (car-safe val))
;; ;; FIXME: Should we check that it's a diff-fringe-* bitmap?
;; (remove-text-properties i end '(display nil) str))
;; (setq i end))))
)
str)