comparison lisp/diff-mode.el @ 54540:2449619c7ccf

(diff-font-lock-keywords): Disable yank-handler.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 24 Mar 2004 21:35:40 +0000
parents 67419634950d
children ea036372013a
comparison
equal deleted inserted replaced
54539:fc216c548749 54540:2449619c7ccf
243 "`diff-mode' face used to highlight nonexistent files in recursive diffs.") 243 "`diff-mode' face used to highlight nonexistent files in recursive diffs.")
244 (defvar diff-nonexistent-face 'diff-nonexistent-face) 244 (defvar diff-nonexistent-face 'diff-nonexistent-face)
245 245
246 (defconst diff-yank-handler '(diff-yank-function)) 246 (defconst diff-yank-handler '(diff-yank-function))
247 (defun diff-yank-function (text) 247 (defun diff-yank-function (text)
248 ;; FIXME: the yank-handler is now called separately on each piece of text
249 ;; with a yank-handler property, so the next-single-property-change call
250 ;; below will always return nil :-( --stef
248 (let ((mixed (next-single-property-change 0 'yank-handler text)) 251 (let ((mixed (next-single-property-change 0 'yank-handler text))
249 (start (point))) 252 (start (point)))
250 ;; First insert the text. 253 ;; First insert the text.
251 (insert text) 254 (insert text)
252 ;; If the text does not include any diff markers and if we're not 255 ;; If the text does not include any diff markers and if we're not
273 (2 diff-function-face)) 276 (2 diff-function-face))
274 ("^\\*\\*\\* .+ \\*\\*\\*\\*". diff-hunk-header-face) ;context 277 ("^\\*\\*\\* .+ \\*\\*\\*\\*". diff-hunk-header-face) ;context
275 ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\(\\S-+\\)\\(.*[^*-]\\)?\n" 278 ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\(\\S-+\\)\\(.*[^*-]\\)?\n"
276 (0 diff-header-face) (2 diff-file-header-face prepend)) 279 (0 diff-header-face) (2 diff-file-header-face prepend))
277 ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) 280 ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face)
278 ("^!.*\n" (0 '(face diff-changed-face yank-handler ,diff-yank-handler))) 281 ("^!.*\n" (0 diff-changed-face))
279 ("^[+>].*\n" (0 '(face diff-added-face yank-handler ,diff-yank-handler))) 282 ("^[+>].*\n" (0 diff-added-face))
280 ("^[-<].*\n" (0 '(face diff-removed-face yank-handler ,diff-yank-handler))) 283 ("^[-<].*\n" (0 diff-removed-face))
281 ("^Index: \\(.+\\).*\n" (0 diff-header-face) (1 diff-index-face prepend)) 284 ("^Index: \\(.+\\).*\n" (0 diff-header-face) (1 diff-index-face prepend))
282 ("^Only in .*\n" . diff-nonexistent-face) 285 ("^Only in .*\n" . diff-nonexistent-face)
283 ("^#.*" . font-lock-string-face) 286 ("^#.*" . font-lock-string-face)
284 ("^[^-=+*!<>].*\n" 287 ("^[^-=+*!<>].*\n" (0 diff-context-face))))
285 (0 '(face diff-context-face yank-handler ,diff-yank-handler)))))
286 288
287 (defconst diff-font-lock-defaults 289 (defconst diff-font-lock-defaults
288 '(diff-font-lock-keywords t nil nil nil (font-lock-multiline . nil))) 290 '(diff-font-lock-keywords t nil nil nil (font-lock-multiline . nil)))
289 291
290 (defvar diff-imenu-generic-expression 292 (defvar diff-imenu-generic-expression