comparison lisp/diff-mode.el @ 32588:afbcd960831b

(diff-header-face, diff-file-header-face): Add specific setting for dark background. (diff-context-face): Renamed from diff-comment-face. Set explicitly rather than inheriting from font-lock-comment-face.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 17 Oct 2000 15:55:09 +0000
parents c6eb63e9c25c
children 87af45b9ad99
comparison
equal deleted inserted replaced
32587:b3918817f15f 32588:afbcd960831b
2 2
3 ;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. 3 ;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
4 4
5 ;; Author: Stefan Monnier <monnier@cs.yale.edu> 5 ;; Author: Stefan Monnier <monnier@cs.yale.edu>
6 ;; Keywords: patch diff 6 ;; Keywords: patch diff
7 ;; Revision: $Id: diff-mode.el,v 1.29 2000/10/15 04:49:55 monnier Exp $ 7 ;; Revision: $Id: diff-mode.el,v 1.30 2000/10/17 12:12:00 eliz Exp $
8 8
9 ;; This file is part of GNU Emacs. 9 ;; This file is part of GNU Emacs.
10 10
11 ;; GNU Emacs is free software; you can redistribute it and/or modify 11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by 12 ;; it under the terms of the GNU General Public License as published by
172 (:foreground "lightblue")) 172 (:foreground "lightblue"))
173 (((type tty pc) (class color) (background dark)) 173 (((type tty pc) (class color) (background dark))
174 (:foreground "green")) 174 (:foreground "green"))
175 (((class color) (background light)) 175 (((class color) (background light))
176 (:background "grey85")) 176 (:background "grey85"))
177 (((class color) (background dark))
178 (:background "grey45"))
177 (t (:bold t))) 179 (t (:bold t)))
178 "`diff-mode' face inherited by hunk and index header faces." 180 "`diff-mode' face inherited by hunk and index header faces."
179 :group 'diff-mode) 181 :group 'diff-mode)
180 (defvar diff-header-face 'diff-header-face) 182 (defvar diff-header-face 'diff-header-face)
181 183
184 (:foreground "yellow")) 186 (:foreground "yellow"))
185 (((type tty pc) (class color) (background dark)) 187 (((type tty pc) (class color) (background dark))
186 (:foreground "cyan")) 188 (:foreground "cyan"))
187 (((class color) (background light)) 189 (((class color) (background light))
188 (:background "grey70" :bold t)) 190 (:background "grey70" :bold t))
191 (((class color) (background dark))
192 (:background "grey60" :bold t))
189 (t (:bold t))) ; :height 1.3 193 (t (:bold t))) ; :height 1.3
190 "`diff-mode' face used to highlight file header lines." 194 "`diff-mode' face used to highlight file header lines."
191 :group 'diff-mode) 195 :group 'diff-mode)
192 (defvar diff-file-header-face 'diff-file-header-face) 196 (defvar diff-file-header-face 'diff-file-header-face)
193 197
223 (t ())) 227 (t ()))
224 "`diff-mode' face used to highlight changed lines." 228 "`diff-mode' face used to highlight changed lines."
225 :group 'diff-mode) 229 :group 'diff-mode)
226 (defvar diff-changed-face 'diff-changed-face) 230 (defvar diff-changed-face 'diff-changed-face)
227 231
228 (defface diff-comment-face 232 (defface diff-context-face
229 '((t (:inherit font-lock-comment-face))) 233 '((((class color) (background light))
234 (:foreground "grey50"))
235 (((class color) (background dark))
236 (:foreground "grey70"))
237 (t ))
230 "`diff-mode' face used to highlight context and other side-information." 238 "`diff-mode' face used to highlight context and other side-information."
231 :group 'diff-mode) 239 :group 'diff-mode)
232 (defvar diff-comment-face 'diff-comment-face) 240 (defvar diff-context-face 'diff-context-face)
233 241
234 (defvar diff-font-lock-keywords 242 (defvar diff-font-lock-keywords
235 '(("^\\(@@ -[0-9,]+ \\+[0-9,]+ @@\\)\\(.*\\)$" ;unified 243 '(("^\\(@@ -[0-9,]+ \\+[0-9,]+ @@\\)\\(.*\\)$" ;unified
236 (1 diff-hunk-header-face) 244 (1 diff-hunk-header-face)
237 (2 diff-comment-face)) 245 (2 diff-context-face))
238 ("^--- .+ ----$" ;context 246 ("^--- .+ ----$" ;context
239 . diff-hunk-header-face) 247 . diff-hunk-header-face)
240 ("\\(\\*\\{15\\}\\)\\(.*\\)$" ;context 248 ("\\(\\*\\{15\\}\\)\\(.*\\)$" ;context
241 (1 diff-hunk-header-face) 249 (1 diff-hunk-header-face)
242 (2 diff-comment-face)) 250 (2 diff-context-face))
243 ("^\\*\\*\\* .+ \\*\\*\\*\\*". diff-hunk-header-face) ;context 251 ("^\\*\\*\\* .+ \\*\\*\\*\\*". diff-hunk-header-face) ;context
244 ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\(\\S-+\\)\\(.*[^*-]\\)?\n" 252 ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\(\\S-+\\)\\(.*[^*-]\\)?\n"
245 (0 diff-header-face) (2 diff-file-header-face prepend)) 253 (0 diff-header-face) (2 diff-file-header-face prepend))
246 ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) 254 ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face)
247 ("^!.*\n" . diff-changed-face) ;context 255 ("^!.*\n" . diff-changed-face) ;context
248 ("^[+>].*\n" . diff-added-face) 256 ("^[+>].*\n" . diff-added-face)
249 ("^[-<].*\n" . diff-removed-face) 257 ("^[-<].*\n" . diff-removed-face)
250 ("^Index: \\(.+\\).*\n" (0 diff-header-face) (1 diff-index-face prepend)) 258 ("^Index: \\(.+\\).*\n" (0 diff-header-face) (1 diff-index-face prepend))
251 ("^#.*" . font-lock-string-face) 259 ("^#.*" . font-lock-string-face)
252 ("^[^-=+*!<>].*\n" . diff-comment-face))) 260 ("^[^-=+*!<>].*\n" . diff-context-face)))
253 261
254 (defconst diff-font-lock-defaults 262 (defconst diff-font-lock-defaults
255 '(diff-font-lock-keywords t nil nil nil (font-lock-multiline . nil))) 263 '(diff-font-lock-keywords t nil nil nil (font-lock-multiline . nil)))
256 264
257 (defvar diff-imenu-generic-expression 265 (defvar diff-imenu-generic-expression