comparison lisp/diff-mode.el @ 90203:187d6a1f84f7

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-71 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 485-492) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 92-94) - Merge from emacs--cvs-trunk--0 - Update from CVS
author Miles Bader <miles@gnu.org>
date Fri, 22 Jul 2005 08:27:27 +0000
parents f9a65d7ebd29 a4d1eb8d55e6
children 2d92f5c9d6ae
comparison
equal deleted inserted replaced
90202:7597b4a23c3b 90203:187d6a1f84f7
195 '((((class color) (min-colors 88) (background light)) 195 '((((class color) (min-colors 88) (background light))
196 :background "grey70" :weight bold) 196 :background "grey70" :weight bold)
197 (((class color) (min-colors 88) (background dark)) 197 (((class color) (min-colors 88) (background dark))
198 :background "grey60" :weight bold) 198 :background "grey60" :weight bold)
199 (((class color) (background light)) 199 (((class color) (background light))
200 :foreground "yellow" :weight bold) 200 :foreground "green" :weight bold)
201 (((class color) (background dark)) 201 (((class color) (background dark))
202 :foreground "cyan" :weight bold) 202 :foreground "cyan" :weight bold)
203 (t :weight bold)) ; :height 1.3 203 (t :weight bold)) ; :height 1.3
204 "`diff-mode' face used to highlight file header lines." 204 "`diff-mode' face used to highlight file header lines."
205 :group 'diff-mode) 205 :group 'diff-mode)
248 :group 'diff-mode) 248 :group 'diff-mode)
249 ;; backward-compatibility alias 249 ;; backward-compatibility alias
250 (put 'diff-changed-face 'face-alias 'diff-changed) 250 (put 'diff-changed-face 'face-alias 'diff-changed)
251 (defvar diff-changed-face 'diff-changed) 251 (defvar diff-changed-face 'diff-changed)
252 252
253 (defface diff-indicator-removed
254 '((t :inherit diff-removed))
255 "`diff-mode' face used to highlight indicator of removed lines (-, <)."
256 :group 'diff-mode
257 :version "22.1")
258 (defvar diff-indicator-removed-face 'diff-indicator-removed)
259
260 (defface diff-indicator-added
261 '((t :inherit diff-added))
262 "`diff-mode' face used to highlight indicator of added lines (+, >)."
263 :group 'diff-mode
264 :version "22.1")
265 (defvar diff-indicator-added-face 'diff-indicator-added)
266
267 (defface diff-indicator-changed
268 '((t :inherit diff-changed))
269 "`diff-mode' face used to highlight indicator of changed lines."
270 :group 'diff-mode
271 :version "22.1")
272 (defvar diff-indicator-changed-face 'diff-indicator-changed)
273
253 (defface diff-function 274 (defface diff-function
254 '((t :inherit diff-context)) 275 '((t :inherit diff-context))
255 "`diff-mode' face used to highlight function names produced by \"diff -p\"." 276 "`diff-mode' face used to highlight function names produced by \"diff -p\"."
256 :group 'diff-mode) 277 :group 'diff-mode)
257 ;; backward-compatibility alias 278 ;; backward-compatibility alias
258 (put 'diff-function-face 'face-alias 'diff-function) 279 (put 'diff-function-face 'face-alias 'diff-function)
259 (defvar diff-function-face 'diff-function) 280 (defvar diff-function-face 'diff-function)
260 281
261 (defface diff-context 282 (defface diff-context
262 '((t :inherit shadow)) 283 '((((class color grayscale) (min-colors 88)) :inherit shadow))
263 "`diff-mode' face used to highlight context and other side-information." 284 "`diff-mode' face used to highlight context and other side-information."
264 :group 'diff-mode) 285 :group 'diff-mode)
265 ;; backward-compatibility alias 286 ;; backward-compatibility alias
266 (put 'diff-context-face 'face-alias 'diff-context) 287 (put 'diff-context-face 'face-alias 'diff-context)
267 (defvar diff-context-face 'diff-context) 288 (defvar diff-context-face 'diff-context)
296 (while (re-search-backward re start t) 317 (while (re-search-backward re start t)
297 (replace-match "" t t))))))) 318 (replace-match "" t t)))))))
298 319
299 320
300 (defvar diff-font-lock-keywords 321 (defvar diff-font-lock-keywords
301 `(("^\\(@@ -[0-9,]+ \\+[0-9,]+ @@\\)\\(.*\\)$" ;unified 322 `(("^\\(@@ -[0-9,]+ \\+[0-9,]+ @@\\)\\(.*\\)$" ;unified
302 (1 diff-hunk-header-face) 323 (1 diff-hunk-header-face) (2 diff-function-face))
303 (2 diff-function-face)) 324 ("^\\(\\*\\{15\\}\\)\\(.*\\)$" ;context
304 ("^--- .+ ----$" . diff-hunk-header-face) ;context 325 (1 diff-hunk-header-face) (2 diff-function-face))
305 ("^\\(\\*\\{15\\}\\)\\(.*\\)$" ;context
306 (1 diff-hunk-header-face)
307 (2 diff-function-face))
308 ("^\\*\\*\\* .+ \\*\\*\\*\\*". diff-hunk-header-face) ;context 326 ("^\\*\\*\\* .+ \\*\\*\\*\\*". diff-hunk-header-face) ;context
327 ("^--- .+ ----$" . diff-hunk-header-face) ;context
328 ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) ;normal
329 ("^---$" . diff-hunk-header-face) ;normal
309 ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\(\\S-+\\)\\(.*[^*-]\\)?\n" 330 ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\(\\S-+\\)\\(.*[^*-]\\)?\n"
310 (0 diff-header-face) (2 diff-file-header-face prepend)) 331 (0 diff-header-face) (2 diff-file-header-face prepend))
311 ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) 332 ("^\\([-<]\\)\\(.*\n\\)"
312 ("^!.*\n" (0 diff-changed-face)) 333 (1 diff-indicator-removed-face) (2 diff-removed-face))
313 ("^[+>].*\n" (0 diff-added-face)) 334 ("^\\([+>]\\)\\(.*\n\\)"
314 ("^[-<].*\n" (0 diff-removed-face)) 335 (1 diff-indicator-added-face) (2 diff-added-face))
315 ("^Index: \\(.+\\).*\n" (0 diff-header-face) (1 diff-index-face prepend)) 336 ("^\\(!\\)\\(.*\n\\)"
337 (1 diff-indicator-changed-face) (2 diff-changed-face))
338 ("^Index: \\(.+\\).*\n"
339 (0 diff-header-face) (1 diff-index-face prepend))
316 ("^Only in .*\n" . diff-nonexistent-face) 340 ("^Only in .*\n" . diff-nonexistent-face)
317 ("^#.*" . font-lock-string-face) 341 ("^\\(#\\)\\(.*\\)"
318 ("^[^-=+*!<>].*\n" (0 diff-context-face)))) 342 (1 font-lock-comment-delimiter-face)
343 (2 font-lock-comment-face))
344 ("^[^-=+*!<>#].*\n" (0 diff-context-face))))
319 345
320 (defconst diff-font-lock-defaults 346 (defconst diff-font-lock-defaults
321 '(diff-font-lock-keywords t nil nil nil (font-lock-multiline . nil))) 347 '(diff-font-lock-keywords t nil nil nil (font-lock-multiline . nil)))
322 348
323 (defvar diff-imenu-generic-expression 349 (defvar diff-imenu-generic-expression