aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-09-21 14:48:08 +0000
committerGerd Moellmann2000-09-21 14:48:08 +0000
commit163f7b71fbb0a43e64fa6a2f169c3610b6ebde8a (patch)
tree46c9a34501b92792afc1eac7cdc0d08304687250
parent8b618804f85246e8345d3fdb64a94bb008c727ab (diff)
downloademacs-163f7b71fbb0a43e64fa6a2f169c3610b6ebde8a.tar.gz
emacs-163f7b71fbb0a43e64fa6a2f169c3610b6ebde8a.zip
(change-log-date-face, change-log-name-face)
(change-log-email-face, change-log-file-face) (change-log-list-face, change-log-conditionals-face) (change-log-function-face, change-log-acknowledgement-face): New faces, inheriting from font-lock faces. (change-log-font-lock-keywords): Use them.
-rw-r--r--lisp/add-log.el71
1 files changed, 59 insertions, 12 deletions
diff --git a/lisp/add-log.el b/lisp/add-log.el
index baed50419ee..5a137998f5d 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -145,40 +145,87 @@ Note: The search is conducted only within 10%, at the beginning of the file."
145 :type '(repeat regexp) 145 :type '(repeat regexp)
146 :group 'change-log) 146 :group 'change-log)
147 147
148(defface change-log-date-face
149 '((t (:inherit font-lock-string-face)))
150 "Face used to highlight dates in date lines."
151 :version "21.1"
152 :group 'change-log)
153
154(defface change-log-name-face
155 '((t (:inherit font-lock-constant-face)))
156 "Face for highlighting author names."
157 :version "21.1"
158 :group 'change-log)
159
160(defface change-log-email-face
161 '((t (:inherit font-lock-variable-name-face)))
162 "Face for highlighting author email addresses."
163 :version "21.1"
164 :group 'change-log)
165
166(defface change-log-file-face
167 '((t (:inherit font-lock-function-name-face)))
168 "Face for highlighting file names."
169 :version "21.1"
170 :group 'change-log)
171
172(defface change-log-list-face
173 '((t (:inherit font-lock-keyword-face)))
174 "Face for highlighting parenthesized lists of functions or variables."
175 :version "21.1"
176 :group 'change-log)
177
178(defface change-log-conditionals-face
179 '((t (:inherit font-lock-variable-name-face)))
180 "Face for highlighting conditionals of the form `[...]'."
181 :version "21.1"
182 :group 'change-log)
183
184(defface change-log-function-face
185 '((t (:inherit font-lock-variable-name-face)))
186 "Face for highlighting items of the form `<....>'."
187 :version "21.1"
188 :group 'change-log)
189
190(defface change-log-acknowledgement-face
191 '((t (:inherit font-lock-comment-face)))
192 "Face for highlighting acknowledgments."
193 :version "21.1"
194 :group 'change-log)
148 195
149(defvar change-log-font-lock-keywords 196(defvar change-log-font-lock-keywords
150 '(;; 197 '(;;
151 ;; Date lines, new and old styles. 198 ;; Date lines, new and old styles.
152 ("^\\sw.........[0-9:+ ]*" 199 ("^\\sw.........[0-9:+ ]*"
153 (0 font-lock-string-face) 200 (0 'change-log-date-face)
154 ;; Name and e-mail; some people put e-mail in parens, not angles. 201 ;; Name and e-mail; some people put e-mail in parens, not angles.
155 ("\\([^<(]+?\\)[ \t]*[(<]\\([A-Za-z0-9_.-]+@[A-Za-z0-9_.-]+\\)[>)]" nil nil 202 ("\\([^<(]+?\\)[ \t]*[(<]\\([A-Za-z0-9_.-]+@[A-Za-z0-9_.-]+\\)[>)]" nil nil
156 (1 font-lock-constant-face) 203 (1 'change-log-name-face)
157 (2 font-lock-variable-name-face))) 204 (2 'change-log-email-face)))
158 ;; 205 ;;
159 ;; File names. 206 ;; File names.
160 ("^\t\\* \\([^ ,:([\n]+\\)" 207 ("^\t\\* \\([^ ,:([\n]+\\)"
161 (1 font-lock-function-name-face) 208 (1 'change-log-file-face)
162 ;; Possibly further names in a list: 209 ;; Possibly further names in a list:
163 ("\\=, \\([^ ,:([\n]+\\)" nil nil (1 font-lock-function-name-face)) 210 ("\\=, \\([^ ,:([\n]+\\)" nil nil (1 'change-log-file-face))
164 ;; Possibly a parenthesized list of names: 211 ;; Possibly a parenthesized list of names:
165 ("\\= (\\([^) ,:\n]+\\)" nil nil (1 font-lock-keyword-face)) 212 ("\\= (\\([^) ,:\n]+\\)" nil nil (1 'change-log-list-face))
166 ("\\=, *\\([^) ,:\n]+\\)" nil nil (1 font-lock-keyword-face))) 213 ("\\=, *\\([^) ,:\n]+\\)" nil nil (1 'change-log-list-face)))
167 ;; 214 ;;
168 ;; Function or variable names. 215 ;; Function or variable names.
169 ("^\t(\\([^) ,:\n]+\\)" 216 ("^\t(\\([^) ,:\n]+\\)"
170 (1 font-lock-keyword-face) 217 (1 'change-log-list-face)
171 ("\\=, *\\([^) ,:\n]+\\)" nil nil (1 font-lock-keyword-face))) 218 ("\\=, *\\([^) ,:\n]+\\)" nil nil (1 'change-log-list-face)))
172 ;; 219 ;;
173 ;; Conditionals. 220 ;; Conditionals.
174 ("\\[!?\\([^]\n]+\\)\\]\\(:\\| (\\)" (1 font-lock-variable-name-face)) 221 ("\\[!?\\([^]\n]+\\)\\]\\(:\\| (\\)" (1 'change-log-conditionals-face))
175 ;; 222 ;;
176 ;; Function of change. 223 ;; Function of change.
177 ("<\\([^>\n]+\\)>\\(:\\| (\\)" (1 font-lock-variable-name-face)) 224 ("<\\([^>\n]+\\)>\\(:\\| (\\)" (1 'change-log-function-face))
178 ;; 225 ;;
179 ;; Acknowledgements. 226 ;; Acknowledgements.
180 ("\\(^\t\\| \\)\\(From\\|Patch\\(es\\)? by\\|Report\\(ed by\\| from\\)\\|Suggest\\(ed by\\|ion from\\)\\)" 227 ("\\(^\t\\| \\)\\(From\\|Patch\\(es\\)? by\\|Report\\(ed by\\| from\\)\\|Suggest\\(ed by\\|ion from\\)\\)"
181 2 font-lock-comment-face)) 228 2 'change-log-acknowledgement-face))
182 "Additional expressions to highlight in Change Log mode.") 229 "Additional expressions to highlight in Change Log mode.")
183 230
184(defvar change-log-mode-map (make-sparse-keymap) 231(defvar change-log-mode-map (make-sparse-keymap)