annotate .elisp/diff-mode-.el @ 77:45d7441d0cf2

Modularize .emacs
author Augie Fackler <durin42@gmail.com>
date Thu, 09 Apr 2009 13:39:20 -0500
parents dc1c584707e6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
1 ;;; diff-mode-.el --- Extensions to `diff-mode.el'.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
2 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
3 ;; Filename: diff-mode-.el
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
4 ;; Description: Extensions to `diff-mode.el'.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
5 ;; Author: Drew Adams
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
6 ;; Maintainer: Drew Adams
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
7 ;; Copyright (C) 2004-2009, Drew Adams, all rights reserved.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
8 ;; Created: Mon Nov 08 16:36:09 2004
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
9 ;; Version: 21.0
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
10 ;; Last-Updated: Sat Dec 27 10:19:33 2008 (-0800)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
11 ;; By: dradams
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
12 ;; Update #: 646
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
13 ;; URL: http://www.emacswiki.org/cgi-bin/wiki/diff-mode-.el
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
14 ;; Keywords: data, matching, tools, unix, local, font, face
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
15 ;; Compatibility: GNU Emacs 21.x, GNU Emacs 22.x
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
16 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
17 ;; Features that might be required by this library:
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
18 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
19 ;; None
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
20 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
21 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
22 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
23 ;;; Commentary:
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
24 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
25 ;; Extensions to `diff-mode.el'.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
26 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
27 ;; "*Diff*" buffer is highlighted differently.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
28 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
29 ;; NOTE: The faces defined here look best on a medium-dark
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
30 ;; background, because some are light and some are dark.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
31 ;; Try, for example, setting the background to "LightSteelBlue"
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
32 ;; in your `~/.emacs' file: You can do this is via
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
33 ;; `special-display-buffer-names':
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
34 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
35 ;; (setq special-display-buffer-names
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
36 ;; (cons '("*Diff*" (background-color . "LightSteelBlue"))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
37 ;; special-display-buffer-names))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
38 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
39 ;; You can alternatively change the background value of
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
40 ;; `special-display-frame-alist' and set
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
41 ;; `special-display-regexps' to something matching "*info*":
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
42 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
43 ;; (setq special-display-frame-alist
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
44 ;; (cons '(background-color . "LightSteelBlue")
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
45 ;; special-display-frame-alist))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
46 ;; (setq special-display-regexps '("[ ]?[*][^*]+[*]"))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
47 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
48 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
49 ;; New faces defined here:
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
50 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
51 ;; `diff-file1-hunk-header', `diff-file2-hunk-header'.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
52 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
53 ;; New user options defined here:
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
54 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
55 ;; `diff-file1-hunk-header-face', `diff-file2-hunk-header-face'.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
56 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
57 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
58 ;; ***** NOTE: The following faces defined in `diff-mode.el' have
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
59 ;; been REDEFINED HERE:
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
60 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
61 ;; `diff-added', `diff-changed', `diff-context',
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
62 ;; `diff-file-header', `diff-header', `diff-hunk-header',
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
63 ;; `diff-index', `diff-indicator-added', `diff-indicator-changed',
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
64 ;; `diff-indicator-removed', `diff-nonexistent', `diff-removed'.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
65 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
66 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
67 ;; ***** NOTE: The following variable defined in `diff-mode.el' has
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
68 ;; been REDEFINED HERE:
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
69 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
70 ;; `diff-font-lock-keywords'.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
71 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
72 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
73 ;; This library should be loaded *before* library `diff-mode.el'.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
74 ;; Put this in your initialization file, `~/.emacs':
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
75 ;; (require 'diff-mode-)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
76 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
77 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
78 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
79 ;;; Change log:
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
80 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
81 ;; 2008/01/01 dadams
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
82 ;; Added :group for deffaces.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
83 ;; 2006/01/04 dadams
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
84 ;; Updated to use new Emacs 22 face names for indicator faces.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
85 ;; Thanks to Juri Linkov for the letting me know about the new faces.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
86 ;; Updated diff-font-lock-keywords to be = Emacs 22, except for file name.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
87 ;; 2006/01/01 dadams
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
88 ;; Renamed faces, without "-face".
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
89 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
90 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
91 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
92 ;; This program is free software; you can redistribute it and/or modify
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
93 ;; it under the terms of the GNU General Public License as published by
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
94 ;; the Free Software Foundation; either version 2, or (at your option)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
95 ;; any later version.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
96
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
97 ;; This program is distributed in the hope that it will be useful,
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
98 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
99 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
100 ;; GNU General Public License for more details.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
101
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
102 ;; You should have received a copy of the GNU General Public License
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
103 ;; along with this program; see the file COPYING. If not, write to
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
104 ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
105 ;; Floor, Boston, MA 02110-1301, USA.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
106 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
107 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
108 ;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
109 ;;; Code:
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
110
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
111 ;;;;;;;;;;;;;;;;;;;;;;;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
112
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
113
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
114 ;;; Define some additional faces.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
115 (defface diff-file1-hunk-header
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
116 '((t (:foreground "Blue" :background "DarkSeaGreen1")))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
117 "Face used to highlight a diff hunk for the first `diff' argument."
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
118 :group 'diff-mode)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
119 (defvar diff-file1-hunk-header-face 'diff-file1-hunk-header)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
120
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
121 (defface diff-file2-hunk-header
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
122 '((t (:foreground "Red" :background "PaleGoldenrod")))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
123 "Face used to highlight a diff hunk for the second `diff' argument."
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
124 :group 'diff-mode)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
125 (defvar diff-file2-hunk-header-face 'diff-file2-hunk-header)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
126
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
127 ;;; These faces are standard in Emacs 22, but they are new for Emacs 21.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
128 (defface diff-indicator-changed
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
129 '((t (:foreground "PaleGoldenrod" :background "MediumBlue")))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
130 "*Face used to highlight the line-start indicator of a modified line."
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
131 :group 'diff-mode)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
132 (defvar diff-indicator-changed-face 'diff-indicator-changed)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
133
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
134 (defface diff-indicator-added
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
135 '((t (:foreground "PaleGoldenrod" :background "DarkGreen")))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
136 "*Face used to highlight the line-start indicator of an inserted line."
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
137 :group 'diff-mode)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
138 (defvar diff-indicator-added-face 'diff-indicator-added)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
139
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
140 (defface diff-indicator-removed
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
141 '((t (:foreground "PaleGoldenrod" :background "DarkMagenta")))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
142 "*Face used to highlight the line-start indicator of a removed line."
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
143 :group 'diff-mode)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
144 (defvar diff-indicator-removed-face 'diff-indicator-removed)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
145
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
146 ;;; Change existing `diff-mode' faces too.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
147 (custom-set-faces
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
148 '(diff-added ((t (:foreground "DarkGreen"))) 'now)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
149 '(diff-changed ((t (:foreground "MediumBlue"))) 'now)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
150 '(diff-context ((t (:foreground "LightSteelBlue"))) 'now)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
151 '(diff-file-header ((t (:foreground "White"))) 'now)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
152 '(diff-header ((t (:foreground "White"))) 'now)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
153 '(diff-hunk-header ((t (:foreground "White"))) 'now)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
154 '(diff-index ((t (:foreground "Green"))) 'now)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
155 '(diff-nonexistent ((t (:foreground "DarkBlue"))) 'now)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
156 '(diff-removed ((t (:foreground "Red"))) 'now)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
157 )
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
158
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
159 ;;; The only real difference here now from the standard Emacs 22 version is the
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
160 ;;; use of diff-file1* and diff-file2*.
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
161 (defvar diff-font-lock-keywords
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
162 `(
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
163 ("^\\(@@ -[0-9,]+ \\+[0-9,]+ @@\\)\\(.*\\)$" ;unified
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
164 (1 diff-hunk-header-face) (2 diff-function-face))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
165 ("^\\(\\*\\{15\\}\\)\\(.*\\)$" ;context
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
166 (1 diff-hunk-header-face) (2 diff-function-face))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
167 ("^\\*\\*\\* .+ \\*\\*\\*\\*". diff-file1-hunk-header-face) ;context
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
168 ("^--- .+ ----$" . diff-file2-hunk-header-face) ;context
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
169 ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) ; normal
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
170 ("^---$" . diff-hunk-header-face) ;normal
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
171 ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\(\\S-+\\)\\(.*[^*-]\\)?\n"
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
172 (0 diff-header-face) (2 diff-file-header-face prepend))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
173 ("^\\([-<]\\)\\(.*\n\\)" (1 diff-indicator-removed-face) (2 diff-removed-face))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
174 ("^\\([+>]\\)\\(.*\n\\)" (1 diff-indicator-added-face) (2 diff-added-face))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
175 ("^\\(!\\)\\(.*\n\\)" (1 diff-indicator-changed-face) (2 diff-changed-face))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
176 ("^Index: \\(.+\\).*\n" (0 diff-header-face) (1 diff-index-face prepend))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
177 ("^Only in .*\n" . diff-nonexistent-face)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
178 ("^\\(#\\)\\(.*\\)"
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
179 (1 (if (facep 'font-lock-comment-delimiter-face)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
180 'font-lock-comment-face))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
181 (2 font-lock-comment-face))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
182 ("^[^-=+*!<>#].*\n" (0 diff-context-face))))
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
183
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
184 ;;;;;;;;;;;;;;;;;;;;;;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
185
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
186 (provide 'diff-mode-)
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
187
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
188 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
dc1c584707e6 Add some colorized diff stuff to emacs.
Augie Fackler <durin42@gmail.com>
parents:
diff changeset
189 ;;; diff-mode-.el ends here