aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/diff-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/diff-mode.el')
-rw-r--r--lisp/diff-mode.el79
1 files changed, 48 insertions, 31 deletions
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index aabd09e98ee..1cb5111dcfb 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -175,7 +175,7 @@ when editing big diffs)."
175;;;; font-lock support 175;;;; font-lock support
176;;;; 176;;;;
177 177
178(defface diff-header-face 178(defface diff-header
179 '((((class color) (min-colors 88) (background light)) 179 '((((class color) (min-colors 88) (background light))
180 :background "grey85") 180 :background "grey85")
181 (((class color) (min-colors 88) (background dark)) 181 (((class color) (min-colors 88) (background dark))
@@ -187,9 +187,11 @@ when editing big diffs)."
187 (t :weight bold)) 187 (t :weight bold))
188 "`diff-mode' face inherited by hunk and index header faces." 188 "`diff-mode' face inherited by hunk and index header faces."
189 :group 'diff-mode) 189 :group 'diff-mode)
190(defvar diff-header-face 'diff-header-face) 190;; backward-compatibility alias
191(put 'diff-header-face 'face-alias 'diff-header)
192(defvar diff-header-face 'diff-header)
191 193
192(defface diff-file-header-face 194(defface diff-file-header
193 '((((class color) (min-colors 88) (background light)) 195 '((((class color) (min-colors 88) (background light))
194 :background "grey70" :weight bold) 196 :background "grey70" :weight bold)
195 (((class color) (min-colors 88) (background dark)) 197 (((class color) (min-colors 88) (background dark))
@@ -201,61 +203,76 @@ when editing big diffs)."
201 (t :weight bold)) ; :height 1.3 203 (t :weight bold)) ; :height 1.3
202 "`diff-mode' face used to highlight file header lines." 204 "`diff-mode' face used to highlight file header lines."
203 :group 'diff-mode) 205 :group 'diff-mode)
204(defvar diff-file-header-face 'diff-file-header-face) 206;; backward-compatibility alias
207(put 'diff-file-header-face 'face-alias 'diff-file-header)
208(defvar diff-file-header-face 'diff-file-header)
205 209
206(defface diff-index-face 210(defface diff-index
207 '((t :inherit diff-file-header-face)) 211 '((t :inherit diff-file-header))
208 "`diff-mode' face used to highlight index header lines." 212 "`diff-mode' face used to highlight index header lines."
209 :group 'diff-mode) 213 :group 'diff-mode)
210(defvar diff-index-face 'diff-index-face) 214;; backward-compatibility alias
215(put 'diff-index-face 'face-alias 'diff-index)
216(defvar diff-index-face 'diff-index)
211 217
212(defface diff-hunk-header-face 218(defface diff-hunk-header
213 '((t :inherit diff-header-face)) 219 '((t :inherit diff-header))
214 "`diff-mode' face used to highlight hunk header lines." 220 "`diff-mode' face used to highlight hunk header lines."
215 :group 'diff-mode) 221 :group 'diff-mode)
216(defvar diff-hunk-header-face 'diff-hunk-header-face) 222;; backward-compatibility alias
223(put 'diff-hunk-header-face 'face-alias 'diff-hunk-header)
224(defvar diff-hunk-header-face 'diff-hunk-header)
217 225
218(defface diff-removed-face 226(defface diff-removed
219 '((t :inherit diff-changed-face)) 227 '((t :inherit diff-changed))
220 "`diff-mode' face used to highlight removed lines." 228 "`diff-mode' face used to highlight removed lines."
221 :group 'diff-mode) 229 :group 'diff-mode)
222(defvar diff-removed-face 'diff-removed-face) 230;; backward-compatibility alias
231(put 'diff-removed-face 'face-alias 'diff-removed)
232(defvar diff-removed-face 'diff-removed)
223 233
224(defface diff-added-face 234(defface diff-added
225 '((t :inherit diff-changed-face)) 235 '((t :inherit diff-changed))
226 "`diff-mode' face used to highlight added lines." 236 "`diff-mode' face used to highlight added lines."
227 :group 'diff-mode) 237 :group 'diff-mode)
228(defvar diff-added-face 'diff-added-face) 238;; backward-compatibility alias
239(put 'diff-added-face 'face-alias 'diff-added)
240(defvar diff-added-face 'diff-added)
229 241
230(defface diff-changed-face 242(defface diff-changed
231 '((((type tty pc) (class color) (background light)) 243 '((((type tty pc) (class color) (background light))
232 :foreground "magenta" :weight bold :slant italic) 244 :foreground "magenta" :weight bold :slant italic)
233 (((type tty pc) (class color) (background dark)) 245 (((type tty pc) (class color) (background dark))
234 :foreground "yellow" :weight bold :slant italic)) 246 :foreground "yellow" :weight bold :slant italic))
235 "`diff-mode' face used to highlight changed lines." 247 "`diff-mode' face used to highlight changed lines."
236 :group 'diff-mode) 248 :group 'diff-mode)
237(defvar diff-changed-face 'diff-changed-face) 249;; backward-compatibility alias
250(put 'diff-changed-face 'face-alias 'diff-changed)
251(defvar diff-changed-face 'diff-changed)
238 252
239(defface diff-function-face 253(defface diff-function
240 '((t :inherit diff-context-face)) 254 '((t :inherit diff-context))
241 "`diff-mode' face used to highlight function names produced by \"diff -p\"." 255 "`diff-mode' face used to highlight function names produced by \"diff -p\"."
242 :group 'diff-mode) 256 :group 'diff-mode)
243(defvar diff-function-face 'diff-function-face) 257;; backward-compatibility alias
258(put 'diff-function-face 'face-alias 'diff-function)
259(defvar diff-function-face 'diff-function)
244 260
245(defface diff-context-face 261(defface diff-context
246 '((((class color) (background light)) 262 '((t :inherit shadow))
247 :foreground "grey50")
248 (((class color) (background dark))
249 :foreground "grey70"))
250 "`diff-mode' face used to highlight context and other side-information." 263 "`diff-mode' face used to highlight context and other side-information."
251 :group 'diff-mode) 264 :group 'diff-mode)
252(defvar diff-context-face 'diff-context-face) 265;; backward-compatibility alias
266(put 'diff-context-face 'face-alias 'diff-context)
267(defvar diff-context-face 'diff-context)
253 268
254(defface diff-nonexistent-face 269(defface diff-nonexistent
255 '((t :inherit diff-file-header-face)) 270 '((t :inherit diff-file-header))
256 "`diff-mode' face used to highlight nonexistent files in recursive diffs." 271 "`diff-mode' face used to highlight nonexistent files in recursive diffs."
257 :group 'diff-mode) 272 :group 'diff-mode)
258(defvar diff-nonexistent-face 'diff-nonexistent-face) 273;; backward-compatibility alias
274(put 'diff-nonexistent-face 'face-alias 'diff-nonexistent)
275(defvar diff-nonexistent-face 'diff-nonexistent)
259 276
260(defconst diff-yank-handler '(diff-yank-function)) 277(defconst diff-yank-handler '(diff-yank-function))
261(defun diff-yank-function (text) 278(defun diff-yank-function (text)
@@ -918,7 +935,7 @@ See `after-change-functions' for the meaning of BEG, END and LEN."
918Supports unified and context diffs as well as (to a lesser extent) 935Supports unified and context diffs as well as (to a lesser extent)
919normal diffs. 936normal diffs.
920When the buffer is read-only, the ESC prefix is not necessary. 937When the buffer is read-only, the ESC prefix is not necessary.
921IF you edit the buffer manually, diff-mode will try to update the hunk 938If you edit the buffer manually, diff-mode will try to update the hunk
922headers for you on-the-fly. 939headers for you on-the-fly.
923 940
924You can also switch between context diff and unified diff with \\[diff-context->unified], 941You can also switch between context diff and unified diff with \\[diff-context->unified],