Mercurial > emacs
changeset 67969:3ca8b2234237
* mh-customize.el: Sync docstrings with manual for faces and sort them
alphabetically.
(mh-faces): Move below mh-hooks. (mh-folder-faces, mh-index-faces,
mh-letter-faces)
(mh-show-faces, mh-speed-faces): Delete. Organize faces like hooks.
(mh-speed-update-interval): Fix group (mh-speedbar, not mh-speed).
(facemenu-unlisted-faces): Might as well ignore all MH-E faces.
(mh-folder-body-face, mh-folder-cur-msg-face)
(mh-folder-cur-msg-number-face, mh-folder-date-face)
(mh-folder-followup-face, mh-folder-msg-number-face)
(mh-folder-deleted-face, mh-folder-refiled-face)
(mh-folder-subject-face, mh-folder-address-face)
(mh-folder-scan-format-face, mh-folder-to-face) (mh-index-folder-face,
mh-show-cc-face, mh-show-date-face) (mh-show-header-face,
mh-show-pgg-good-face) (mh-show-pgg-unknown-face,
mh-show-pgg-bad-face)
(mh-show-to-face, mh-show-from-face, mh-show-subject-face): Delete.
(mh-folder-cur-msg): Unused. Delete.
(mh-folder-address): Use defface; inherit from mh-folder-subject.
(mh-folder-body, mh-folder-cur-msg-number, mh-folder-date): Inherit
from mh-folder-msg-number.
(mh-folder-deleted): Use defface. Inherit from mh-folder-msg-number.
(mh-folder-sent-to-me-hint): New face. Inherit from mh-folder-date.
(mh-folder-sent-to-me-sender): Rename from mh-folder-scan-format. Use
defface. Inherit from mh-folder-followup.
(mh-show-xface): Inherit from mh-show-from and highlight.
(bw-face-generation, bw-toggle-faces)
(bw-new-face-to-old, bw-old-face-to-new): New (tempoarary) variables,
functions for toggling between old and new faces.
* mh-e.el (font-lock-auto-fontify, font-lock-defaults): Hide in
eval-when-compile. We should probably do this throughout.
(mh-scan-good-msg-regexp, mh-scan-deleted-msg-regexp)
(mh-scan-refiled-msg-regexp, mh-scan-cur-msg-number-regexp)
(mh-scan-date-regexp, mh-scan-rcpt-regexp, mh-scan-body-regexp)
(mh-scan-subject-regexp): Sync docstrings with manual
(mh-scan-format-regexp): Rename to mh-scan-sent-to-me-sender-regexp.
Drop date parenthesized expression. Make expression more like the
others (anchored at the beginning of line). Sync docstrings with
manual.
(mh-folder-font-lock-keywords): Use faces directly rather than -face
variables. Use mh-scan-sent-to-me-sender-regexp instead of
mh-scan-format-regexp, and within that expression, use faces
mh-folder-sent-to-me-hint and mh-folder-sent-to-me-sender instead of
mh-folder-date-face and mh-folder-scan-format-face which were
misleading.
* mh-mime.el (mh-mime-security-button-face): Use faces directly rather
than -face variables.
* mh-utils.el (mh-show-font-lock-keywords): Use faces directly rather
than -face variables.
(mh-face-foreground-compat, mh-face-background-compat): New macros.
(mh-face-display-function): Use mh-face-foreground-compat and
mh-face-background-compat to use inherited attributes of mh-show-xface
on Emacs 22 while still working on Emacs 21.
author | Bill Wohler <wohler@newt.com> |
---|---|
date | Sun, 01 Jan 2006 18:51:18 +0000 |
parents | 4a0f6ab2fb20 |
children | ece93c7b34d4 |
files | lisp/mh-e/ChangeLog lisp/mh-e/mh-customize.el lisp/mh-e/mh-e.el lisp/mh-e/mh-init.el lisp/mh-e/mh-mime.el lisp/mh-e/mh-utils.el |
diffstat | 6 files changed, 447 insertions(+), 343 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/mh-e/ChangeLog Sun Jan 01 11:41:36 2006 +0000 +++ b/lisp/mh-e/ChangeLog Sun Jan 01 18:51:18 2006 +0000 @@ -1,3 +1,66 @@ +2006-01-01 Bill Wohler <wohler@newt.com> + + * mh-customize.el: Sync docstrings with manual for faces and sort + them alphabetically. + (mh-faces): Move below mh-hooks. + (mh-folder-faces, mh-index-faces, mh-letter-faces) + (mh-show-faces, mh-speed-faces): Delete. Organize faces like + hooks. + (mh-speed-update-interval): Fix group (mh-speedbar, not mh-speed). + (facemenu-unlisted-faces): Might as well ignore all MH-E faces. + (mh-folder-body-face, mh-folder-cur-msg-face) + (mh-folder-cur-msg-number-face, mh-folder-date-face) + (mh-folder-followup-face, mh-folder-msg-number-face) + (mh-folder-deleted-face, mh-folder-refiled-face) + (mh-folder-subject-face, mh-folder-address-face) + (mh-folder-scan-format-face, mh-folder-to-face) + (mh-index-folder-face, mh-show-cc-face, mh-show-date-face) + (mh-show-header-face, mh-show-pgg-good-face) + (mh-show-pgg-unknown-face, mh-show-pgg-bad-face) + (mh-show-to-face, mh-show-from-face, mh-show-subject-face): + Delete. + (mh-folder-cur-msg): Unused. Delete. + (mh-folder-address): Use defface; inherit from mh-folder-subject. + (mh-folder-body, mh-folder-cur-msg-number, mh-folder-date): + Inherit from mh-folder-msg-number. + (mh-folder-deleted): Use defface. Inherit from + mh-folder-msg-number. + (mh-folder-sent-to-me-hint): New face. Inherit from + mh-folder-date. + (mh-folder-sent-to-me-sender): Rename from mh-folder-scan-format. + Use defface. Inherit from mh-folder-followup. + (mh-show-xface): Inherit from mh-show-from and highlight. + (bw-face-generation, bw-toggle-faces) + (bw-new-face-to-old, bw-old-face-to-new): New (tempoarary) + variables, functions for toggling between old and new faces. + + * mh-e.el (font-lock-auto-fontify, font-lock-defaults): Hide in + eval-when-compile. We should probably do this throughout. + (mh-scan-good-msg-regexp, mh-scan-deleted-msg-regexp) + (mh-scan-refiled-msg-regexp, mh-scan-cur-msg-number-regexp) + (mh-scan-date-regexp, mh-scan-rcpt-regexp, mh-scan-body-regexp) + (mh-scan-subject-regexp): Sync docstrings with manual + (mh-scan-format-regexp): Rename to + mh-scan-sent-to-me-sender-regexp. Drop date parenthesized + expression. Make expression more like the others (anchored at the + beginning of line). Sync docstrings with manual. + (mh-folder-font-lock-keywords): Use faces directly rather than + -face variables. Use mh-scan-sent-to-me-sender-regexp instead of + mh-scan-format-regexp, and within that expression, use faces + mh-folder-sent-to-me-hint and mh-folder-sent-to-me-sender instead + of mh-folder-date-face and mh-folder-scan-format-face which were + misleading. + + * mh-mime.el (mh-mime-security-button-face): Use faces directly + rather than -face variables. + + * mh-utils.el (mh-show-font-lock-keywords): Use faces directly + rather than -face variables. + (mh-face-foreground-compat, mh-face-background-compat): New macros. + (mh-face-display-function): Use mh-face-foreground-compat and + mh-face-background-compat to use inherited attributes of + mh-show-xface on Emacs 22 while still working on Emacs 21. + 2005-12-28 Bill Wohler <wohler@newt.com> * mh-comp.el (mh-e-user-agent): Move here from simple.el. Use
--- a/lisp/mh-e/mh-customize.el Sun Jan 01 11:41:36 2006 +0000 +++ b/lisp/mh-e/mh-customize.el Sun Jan 01 18:51:18 2006 +0000 @@ -204,6 +204,12 @@ :prefix "mh-" :group 'mh-e) +(defgroup mh-hooks nil + "MH-E hooks." + :link '(custom-manual "(mh-e)Top") + :prefix "mh-" + :group 'mh-e) + (defgroup mh-faces nil "Faces used in MH-E." :link '(custom-manual "(mh-e)Top") @@ -211,51 +217,6 @@ :group 'faces :group 'mh-e) -(defgroup mh-hooks nil - "MH-E hooks." - :link '(custom-manual "(mh-e)Top") - :prefix "mh-" - :group 'mh-e) - - - -;;; Faces - -(defgroup mh-folder-faces nil - "Faces used in scan listing." - :link '(custom-manual "(mh-e)Folders") - :prefix "mh-" - :group 'mh-faces - :group 'mh-folder) - -(defgroup mh-index-faces nil - "Faces used in searching." - :link '(custom-manual "(mh-e)Searching") - :prefix "mh-" - :group 'mh-faces - :group 'mh-index) - -(defgroup mh-letter-faces nil - "Faces used in message drafts." - :link '(custom-manual "(mh-e)Editing Drafts") - :prefix "mh-" - :group 'mh-faces - :group 'mh-letter) - -(defgroup mh-show-faces nil - "Faces used in message display." - :link '(custom-manual "(mh-e)Reading Mail") - :prefix "mh-" - :group 'mh-faces - :group 'mh-show) - -(defgroup mh-speed-faces nil - "Faces used in speedbar." - :link '(custom-manual "(mh-e)Speedbar") - :prefix "mh-" - :group 'mh-faces - :group 'mh-speed) - ;;; Emacs interface to the MH mail system (:group mh-e) @@ -1883,13 +1844,13 @@ -;;; The Speedbar (:group 'mh-speed) +;;; The Speedbar (:group 'mh-speedbar) (defcustom mh-speed-update-interval 60 "Time between speedbar updates in seconds. Set to 0 to disable automatic update." :type 'integer - :group 'mh-speed) + :group 'mh-speedbar) @@ -2526,81 +2487,42 @@ -;;; Faces (:group 'mh-*-faces + group where faces described) - - - -;;; Faces Used in Scan Listing (:group 'mh-folder-faces) - -(defvar mh-folder-body-face 'mh-folder-body - "Face used to highlight body text in MH-Folder buffers.") +;;; Faces (:group 'mh-faces + group where faces described) + +(if (boundp 'facemenu-unlisted-faces) + (add-to-list 'facemenu-unlisted-faces "^mh-")) + +(defface mh-folder-address '((t (:inherit mh-folder-subject))) + "Recipient face." + :group 'mh-faces + :group 'mh-folder) + (defface mh-folder-body - (mh-defface-compat - '((((class color) (min-colors 88) (background light)) - (:foreground "RosyBrown")) - (((class color) (min-colors 88) (background dark)) - (:foreground "LightSalmon")) - (((class color)) - (:foreground "green")) - (((class grayscale) (background light)) - (:foreground "DimGray" :italic t)) - (((class grayscale) (background dark)) - (:foreground "LightGray" :italic t)) - (t - (:italic t)))) - "Face used to highlight body text in MH-Folder buffers." - :group 'mh-folder-faces) - -(defvar mh-folder-cur-msg-face 'mh-folder-cur-msg - "Face used for the current message line in MH-Folder buffers.") -(defface mh-folder-cur-msg - (mh-defface-compat - '((((class color) (min-colors 88) (background light)) - (:background "LightGreen") ;Use this for solid background colour - ;; (:underline t) ;Use this for underlining - ) - (((class color) (min-colors 88) (background dark)) - (:background "DarkOliveGreen4")) - (((class color)) - (:background "LightGreen")) - (t - (:underline t)))) - "Face used for the current message line in MH-Folder buffers." - :group 'mh-folder-faces) - -(defvar mh-folder-cur-msg-number-face 'mh-folder-cur-msg-number - "Face used to highlight the current message in MH-Folder buffers.") + '((((class color)) + (:inherit mh-folder-msg-number)) + (t + (:inherit mh-folder-msg-number :italic t))) + "Body text face." + :group 'mh-faces + :group 'mh-folder) + (defface mh-folder-cur-msg-number - (mh-defface-compat - '((((class color) (min-colors 88) (background light)) - (:foreground "Purple")) - (((class color) (min-colors 88) (background dark)) - (:foreground "Cyan")) - (((class color)) - (:foreground "cyan" :weight bold)) - (((class grayscale) (background light)) - (:foreground "LightGray" :bold t)) - (((class grayscale) (background dark)) - (:foreground "DimGray" :bold t)) - (t - (:bold t)))) - "Face used to highlight the current message in MH-Folder buffers." - :group 'mh-folder-faces) - -(defvar mh-folder-date-face 'mh-folder-date - "Face used to highlight the date in MH-Folder buffers.") -(defface mh-folder-date - '((((class color) (background light)) - (:foreground "snow4")) - (((class color) (background dark)) - (:foreground "snow3")) - (t - (:bold t))) - "Face used to highlight the date in MH-Folder buffers." - :group 'mh-folder-faces) - -(defvar mh-folder-followup-face 'mh-folder-followup - "Face used to highlight Re: subject text in MH-Folder buffers.") + '((t + (:inherit mh-folder-msg-number :bold t))) + "Current message number face." + :group 'mh-faces + :group 'mh-folder) + +(defface mh-folder-date '((t (:inherit mh-folder-msg-number))) + "Date face." + :group 'mh-faces + :group 'mh-folder) + +(defface mh-folder-deleted '((t (:inherit mh-folder-msg-number))) + "Deleted message face." + :group 'mh-faces + :group 'mh-folder) + (defface mh-folder-followup '((((class color) (background light)) (:foreground "blue3")) @@ -2608,27 +2530,19 @@ (:foreground "LightGoldenRod")) (t (:bold t))) - "Face used to highlight Re: subject text in MH-Folder buffers." - :group 'mh-folder-faces) - -(defvar mh-folder-msg-number-face 'mh-folder-msg-number - "Face used to highlight the message number in MH-Folder buffers.") + "\"Re:\" face." + :group 'mh-faces + :group 'mh-folder) + (defface mh-folder-msg-number '((((class color) (background light)) (:foreground "snow4")) (((class color) (background dark)) - (:foreground "snow3")) - (t - (:bold t))) - "Face used to highlight the message number in MH-Folder buffers." - :group 'mh-folder-faces) - -(defvar mh-folder-deleted-face 'mh-folder-deleted - "Face used to highlight deleted messages in MH-Folder buffers.") -(copy-face 'mh-folder-msg-number 'mh-folder-deleted) - -(defvar mh-folder-refiled-face 'mh-folder-refiled - "Face used to highlight refiled messages in MH-Folder buffers.") + (:foreground "snow3"))) + "Message number face." + :group 'mh-faces + :group 'mh-folder) + (defface mh-folder-refiled (mh-defface-compat '((((class color) (min-colors 88) (background light)) @@ -2643,13 +2557,26 @@ (:foreground "DimGray" :bold t :italic t)) (t (:bold t :italic t)))) - "Face used to highlight refiled messages in MH-Folder buffers." - :group 'mh-folder-faces) - -(defvar mh-folder-subject-face 'mh-folder-subject - "Face used to highlight subject text in MH-Folder buffers.") -(if (boundp 'facemenu-unlisted-faces) - (add-to-list 'facemenu-unlisted-faces "^mh-folder")) + "Refiled message face." + :group 'mh-faces + :group 'mh-folder) + +(defface mh-folder-sent-to-me-hint '((t (:inherit mh-folder-date))) + "Fontification hint face in messages sent directly to us. +The detection of messages sent to us is governed by the scan +format `mh-scan-format-nmh' and the regular expression +`mh-scan-sent-to-me-sender-regexp'." + :group 'mh-faces + :group 'mh-folder) + +(defface mh-folder-sent-to-me-sender '((t (:inherit mh-folder-followup))) + "Sender face in messages sent directly to us. +The detection of messages sent to us is governed by the scan +format `mh-scan-format-nmh' and the regular expression +`mh-scan-sent-to-me-sender-regexp'." + :group 'mh-faces + :group 'mh-folder) + (defface mh-folder-subject '((((class color) (background light)) (:foreground "blue4")) @@ -2657,8 +2584,9 @@ (:foreground "yellow")) (t (:bold t))) - "Face used to highlight subject text in MH-Folder buffers." - :group 'mh-folder-faces) + "Subject face." + :group 'mh-faces + :group 'mh-folder) (defface mh-folder-tick '((((class color) (background dark)) @@ -2667,19 +2595,10 @@ (:background "#dddf7e")) (t (:underline t))) - "Face used to show ticked messages." - :group 'mh-folder-faces) - -(defvar mh-folder-address-face 'mh-folder-address - "Face used to highlight the address in MH-Folder buffers.") -(copy-face 'mh-folder-subject 'mh-folder-address) - -(defvar mh-folder-scan-format-face 'mh-folder-scan-format - "Face used to highlight `mh-scan-format-regexp' matches in MH-Folder buffers.") -(copy-face 'mh-folder-followup 'mh-folder-scan-format) - -(defvar mh-folder-to-face 'mh-folder-to - "Face used to highlight the To: string in MH-Folder buffers.") + "Ticked message face." + :group 'mh-faces + :group 'mh-folder) + (defface mh-folder-to (mh-defface-compat '((((class color) (min-colors 88) (background light)) @@ -2694,15 +2613,10 @@ (:foreground "LightGray" :italic t)) (t (:italic t)))) - "Face used to highlight the To: string in MH-Folder buffers." - :group 'mh-folder-faces) - - - -;;; Faces Used in Searching (:group 'mh-index-faces) - -(defvar mh-index-folder-face 'mh-index-folder - "Face used to highlight folders in MH-Index buffers.") + "\"To:\" face." + :group 'mh-faces + :group 'mh-folder) + (defface mh-index-folder '((((class color) (background light)) (:foreground "dark green" :bold t)) @@ -2710,12 +2624,9 @@ (:foreground "indian red" :bold t)) (t (:bold t))) - "Face used to highlight folders in MH-Index buffers." - :group 'mh-index-faces) - - - -;;; Faces Used in Message Drafts (:group 'mh-letter-faces) + "Folder heading face in MH-Folder buffers created by searches." + :group 'mh-faces + :group 'mh-index) (defface mh-letter-header-field '((((class color) (background light)) @@ -2724,15 +2635,10 @@ (:background "gray10")) (t (:bold t))) - "Face used to display header fields in draft buffers." - :group 'mh-letter-faces) - - - -;;; Faces Used in Message Display (:group 'mh-show-faces) - -(defvar mh-show-cc-face 'mh-show-cc - "Face used to highlight cc: header fields.") + "Editable header field value face in draft buffers." + :group 'mh-faces + :group 'mh-letter) + (defface mh-show-cc (mh-defface-compat '((((class color) (min-colors 88) (background light)) @@ -2747,11 +2653,10 @@ (:foreground "DimGray" :bold t :italic t)) (t (:bold t :italic t)))) - "Face used to highlight cc: header fields." - :group 'mh-show-faces) - -(defvar mh-show-date-face 'mh-show-date - "Face used to highlight the Date: header field.") + "Face used to highlight \"cc:\" header fields." + :group 'mh-faces + :group 'mh-show) + (defface mh-show-date (mh-defface-compat '((((class color) (min-colors 88) (background light)) @@ -2766,11 +2671,21 @@ (:foreground "DimGray" :bold t)) (t (:bold t :underline t)))) - "Face used to highlight the Date: header field." - :group 'mh-show-faces) - -(defvar mh-show-header-face 'mh-show-header - "Face used to deemphasize unspecified header fields.") + "Face used to highlight \"Date:\" header fields." + :group 'mh-faces + :group 'mh-show) + +(defface mh-show-from + '((((class color) (background light)) + (:foreground "red3")) + (((class color) (background dark)) + (:foreground "cyan")) + (t + (:bold t))) + "Face used to highlight \"From:\" header fields." + :group 'mh-faces + :group 'mh-show) + (defface mh-show-header (mh-defface-compat '((((class color) (min-colors 88) (background light)) @@ -2785,46 +2700,35 @@ (:foreground "LightGray" :italic t)) (t (:italic t)))) - "Face used to deemphasize unspecified header fields." - :group 'mh-show-faces) - -(defvar mh-show-pgg-good-face 'mh-show-pgg-good - "Face used to highlight a good PGG signature.") -(defface mh-show-pgg-good - '((t - (:bold t :foreground "LimeGreen"))) - "Face used to highlight a good PGG signature." - :group 'mh-show-faces) - -(defvar mh-show-pgg-unknown-face 'mh-show-pgg-unknown - "Face used to highlight a PGG signature whose status is unknown. -This face is also used for a signature when the signer is -untrusted.") -(defface mh-show-pgg-unknown - '((t - (:bold t :foreground "DarkGoldenrod2"))) - "Face used to highlight a PGG signature whose status is unknown. -This face is also used for a signature when the signer is untrusted." - :group 'mh-show-faces) - -(defvar mh-show-pgg-bad-face 'mh-show-pgg-bad - "Face used to highlight a bad PGG signature.") -(defface mh-show-pgg-bad - '((t - (:bold t :foreground "DeepPink1"))) - "Face used to highlight a bad PGG signature." - :group 'mh-show-faces) - -(defface mh-show-signature - '((t - (:italic t))) - "Face used to highlight the message signature." - :group 'mh-show-faces) - -(defvar mh-show-to-face 'mh-show-to - "Face used to highlight the To: header field.") -(if (boundp 'facemenu-unlisted-faces) - (add-to-list 'facemenu-unlisted-faces "^mh-show")) + "Face used to deemphasize less interesting header fields." + :group 'mh-faces + :group 'mh-show) + +(defface mh-show-pgg-bad '((t (:bold t :foreground "DeepPink1"))) + "Bad PGG signature face." + :group 'mh-faces + :group 'mh-show) + +(defface mh-show-pgg-good '((t (:bold t :foreground "LimeGreen"))) + "Good PGG signature face." + :group 'mh-faces + :group 'mh-show) + +(defface mh-show-pgg-unknown '((t (:bold t :foreground "DarkGoldenrod2"))) + "Unknown or untrusted PGG signature face." + :group 'mh-faces + :group 'mh-show) + +(defface mh-show-signature '((t (:italic t))) + "Signature face." + :group 'mh-faces + :group 'mh-show) + +(defface mh-show-subject '((t (:inherit mh-folder-subject))) + "Face used to highlight \"Subject:\" header fields." + :group 'mh-faces + :group 'mh-show) + (defface mh-show-to '((((class color) (background light)) (:foreground "SaddleBrown")) @@ -2835,43 +2739,31 @@ (((class grayscale) (background dark)) (:foreground "LightGray" :underline t)) (t (:underline t))) - "Face used to highlight the To: header field." - :group 'mh-show-faces) - -(defvar mh-show-from-face 'mh-show-from - "Face used to highlight the From: header field.") -(defface mh-show-from - '((((class color) (background light)) - (:foreground "red3")) - (((class color) (background dark)) - (:foreground "cyan")) - (t - (:bold t))) - "Face used to highlight the From: header field." - :group 'mh-show-faces) - -(defface mh-show-xface - '((t - (:foreground "black" :background "white"))) - "Face used to display the X-Face image. -The background and foreground is used in the image." - :group 'mh-show-faces) - -(defvar mh-show-subject-face 'mh-show-subject - "Face used to highlight the Subject: header field.") -(copy-face 'mh-folder-subject 'mh-show-subject) - - - -;;; Faces Used in Speedbar (:group 'mh-speed-faces) + "Face used to highlight \"To:\" header fields." + :group 'mh-faces + :group 'mh-show) + +(defface mh-show-xface '((t (:inherit (mh-show-from highlight)))) + "X-Face image face. +The background and foreground are used in the image." + :group 'mh-faces + :group 'mh-show) (defface mh-speedbar-folder '((((class color) (background light)) (:foreground "blue4")) (((class color) (background dark)) (:foreground "light blue"))) - "Face used for folders in the speedbar buffer." - :group 'mh-speed-faces) + "Basic folder face." + :group 'mh-faces + :group 'mh-speedbar) + +(defface mh-speedbar-folder-with-unseen-messages + '((t + (:inherit mh-speedbar-folder :bold t))) + "Folder face when folder contains unread messages." + :group 'mh-faces + :group 'mh-speedbar) (defface mh-speedbar-selected-folder '((((class color) (background light)) @@ -2880,20 +2772,111 @@ (:foreground "red1" :underline t)) (t (:underline t))) - "Face used for the current folder." - :group 'mh-speed-faces) - -(defface mh-speedbar-folder-with-unseen-messages - '((t - (:inherit mh-speedbar-folder :bold t))) - "Face used for folders in the speedbar buffer which have unread messages." - :group 'mh-speed-faces) + "Selected folder face." + :group 'mh-faces + :group 'mh-speedbar) (defface mh-speedbar-selected-folder-with-unseen-messages '((t (:inherit mh-speedbar-selected-folder :bold t))) - "Face used for the current folder when it has unread messages." - :group 'mh-speed-faces) + "Selected folder face when folder contains unread messages." + :group 'mh-faces + :group 'mh-speedbar) + +;;; XXX Temporary function for comparing old and new faces. Delete +;;; when everybody is happy. +(defvar bw-face-generation 'new) + +(defun bw-toggle-faces () + "Toggle between old and new faces." + (interactive) + (cond ((eq bw-face-generation 'new) + (message "Going from new to old...") + (bw-new-face-to-old) + (message "Going from new to old...done") + (setq bw-face-generation 'old)) + ((eq bw-face-generation 'old) + (message "Going from old to new...") + (bw-old-face-to-new) + (message "Going from old to new...done") + (setq bw-face-generation 'new)))) + +(defun bw-new-face-to-old () + "Sets old faces." + (face-spec-set 'mh-folder-body + (mh-defface-compat + '((((class color) (min-colors 88) (background light)) + (:foreground "RosyBrown")) + (((class color) (min-colors 88) (background dark)) + (:foreground "LightSalmon")) + (((class color)) + (:foreground "green")) + (((class grayscale) (background light)) + (:foreground "DimGray" :italic t)) + (((class grayscale) (background dark)) + (:foreground "LightGray" :italic t)) + (t + (:italic t))))) + + (face-spec-set 'mh-folder-msg-number + '((((class color) (background light)) + (:foreground "snow4")) + (((class color) (background dark)) + (:foreground "snow3")) + (t + (:bold t)))) + + (face-spec-set 'mh-folder-cur-msg-number + (mh-defface-compat + '((((class color) (min-colors 88) (background light)) + (:foreground "Purple")) + (((class color) (min-colors 88) (background dark)) + (:foreground "Cyan")) + (((class color)) + (:foreground "cyan" :weight bold)) + (((class grayscale) (background light)) + (:foreground "LightGray" :bold t)) + (((class grayscale) (background dark)) + (:foreground "DimGray" :bold t)) + (t + (:bold t))))) + + (face-spec-set 'mh-folder-date + '((((class color) (background light)) + (:foreground "snow4")) + (((class color) (background dark)) + (:foreground "snow3")) + (t + (:bold t)))) + + (face-spec-set 'mh-folder-msg-number + '((((class color) (background light)) + (:foreground "snow4")) + (((class color) (background dark)) + (:foreground "snow3")) + (t + (:bold t))))) + +(defun bw-old-face-to-new () + "Sets new faces." + (face-spec-set 'mh-folder-body + '((((class color)) + (:inherit mh-folder-msg-number)) + (t + (:inherit mh-folder-msg-number :italic t)))) + + (face-spec-set 'mh-folder-cur-msg-number + '((t + (:inherit mh-folder-msg-number :bold t)))) + + (face-spec-set 'mh-folder-date '((t (:inherit mh-folder-msg-number)))) + + (face-spec-set 'mh-folder-msg-number + '((((class color) (background light)) + (:foreground "snow4")) + (((class color) (background dark)) + (:foreground "snow3"))))) + ;; Local Variables: ;; indent-tabs-mode: nil
--- a/lisp/mh-e/mh-e.el Sun Jan 01 11:41:36 2006 +0000 +++ b/lisp/mh-e/mh-e.el Sun Jan 01 18:51:18 2006 +0000 @@ -95,8 +95,9 @@ (require 'easymenu) ;; Shush the byte-compiler -(defvar font-lock-auto-fontify) -(defvar font-lock-defaults) +(eval-when-compile + (defvar font-lock-auto-fontify) + (defvar font-lock-defaults)) (defconst mh-version "7.85+cvs" "Version number of MH-E.") @@ -194,7 +195,8 @@ \"^\\\\( *[0-9]+\\\\)[^D^0-9]\". This expression includes the leading space within the parenthesis -since it looks better to highlight it as well. This regular +since it looks better to highlight it as well. The highlighting +is done with the face `mh-folder-msg-number'. This regular expression should be correct as it is needed by non-fontification functions.") @@ -209,7 +211,8 @@ \"^\\\\( *[0-9]+\\\\)D\". This expression includes the leading space within the parenthesis -since it looks better to highlight it as well. This regular +since it looks better to highlight it as well. The highlighting +is done with the face `mh-folder-deleted'. This regular expression should be correct as it is needed by non-fontification functions. See also `mh-note-deleted'.") @@ -224,7 +227,8 @@ \"^\\\\( *[0-9]+\\\\)\\\\^\". This expression includes the leading space within the parenthesis -since it looks better to highlight it as well. This regular +since it looks better to highlight it as well. The highlighting +is done with the face `mh-folder-refiled'. This regular expression should be correct as it is needed by non-fontification functions. See also `mh-note-refiled'.") @@ -246,9 +250,10 @@ This expression includes the leading space and current message marker \"+\" within the parenthesis since it looks better to -highlight these items as well. This regular expression should be -correct as it is needed by non-fontification functions. See also -`mh-note-cur'.") +highlight these items as well. The highlighting is done with the +face `mh-folder-cur-msg-number'. This regular expression should +be correct as it is needed by non-fontification functions. See +also `mh-note-cur'.") (defvar mh-scan-date-regexp "\\([0-9][0-9]/[0-9][0-9]\\)" "This regular expression matches a valid date. @@ -258,8 +263,8 @@ expects this expression to contain only one parenthesized expression which matches the date field as in the default of \"\\\\([0-9][0-9]/[0-9][0-9]\\\\)\"}. If this regular expression -is not correct, the date will not be highlighted. See also -`mh-scan-format-regexp'.") +is not correct, the date will not be highlighted with the face +`mh-folder-date'.") (defvar mh-scan-rcpt-regexp "\\(To:\\)\\(..............\\)" "This regular expression specifies the recipient in messages you sent. @@ -270,8 +275,9 @@ format file generates. The second is expected to match the recipient's name as in the default of \"\\\\(To:\\\\)\\\\(..............\\\\)\". If this regular -expression is not correct, the recipient will not be -highlighted.") +expression is not correct, the \"To:\" string will not be +highlighted with the face `mh-folder-to' and the recipient will +not be highlighted with the face `mh-folder-address'") (defvar mh-scan-body-regexp "\\(<<\\([^\n]+\\)?\\)" "This regular expression matches the message body fragment. @@ -280,7 +286,8 @@ expects this expression to contain at least one parenthesized expression which matches the body text as in the default of \"\\\\(<<\\\\([^\\n]+\\\\)?\\\\)\". If this regular expression is -not correct, the body fragment will not be highlighted.") +not correct, the body fragment will not be highlighted with the +face `mh-folder-body'.") (defvar mh-scan-subject-regexp "^ *[0-9]+........[ ]*...................\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)" @@ -289,12 +296,13 @@ It must match from the beginning of the line. Note that the default setting of `mh-folder-font-lock-keywords' expects this expression to contain at least three parenthesized expressions. -The first is expected to match the \"Re:\" string, if any. The -second matches an optional bracketed number after \"Re:\", such as -in \"Re[2]:\" (and is thus a sub-expression of the first -expression) and the third is expected to match the subject line -itself as in the default of (broken on multiple lines for -readability): +The first is expected to match the \"Re:\" string, if any, and is +highlighted with the face `mh-folder-followup'. The second +matches an optional bracketed number after \"Re:\", such as in +\"Re[2]:\" (and is thus a sub-expression of the first expression) +and the third is expected to match the subject line itself which +is highlighted with the face `mh-folder-subject'. For example, +the default (broken on multiple lines for readability) is ^ *[0-9]+........[ ]*................... \\\\([Rr][Ee]\\\\(\\\\\\=[[0-9]+\\\\]\\\\)?:\\\\s-*\\\\)* @@ -303,22 +311,22 @@ This regular expression should be correct as it is needed by non-fontification functions.") -(defvar mh-scan-format-regexp - (concat "\\([bct]\\)" mh-scan-date-regexp " *\\(..................\\)") - "This regular expression matches the output of scan. +(defvar mh-scan-sent-to-me-sender-regexp + "^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)" + "This regular expression matches messages sent to us. Note that the default setting of `mh-folder-font-lock-keywords' -expects this expression to contain at least three parenthesized +expects this expression to contain at least two parenthesized expressions. The first should match the fontification hint (see -`mh-scan-format-nmh'), the second is found in -`mh-scan-date-regexp', and the third should match the user name +`mh-scan-format-nmh') and the second should match the user name as in the default of - \"(concat \"\\\\([bct]\\\\)\" mh-scan-date-regexp - \"*\\\\(..................\\\\)\")\". - -If this regular expression is not correct, the notation hints and -the sender will not be highlighted.") + ^ *[0-9]+.\\\\([bct]\\\\).....[ ]*\\\\(..................\\\\) + +If this regular expression is not correct, the notation hints +will not be highlighted with the face +`mh-mh-folder-sent-to-me-hint' and the sender will not be +highlighted with the face `mh-folder-sent-to-me-sender'.") @@ -326,31 +334,37 @@ (list ;; Folders when displaying index buffer (list "^\\+.*" - '(0 mh-index-folder-face)) + '(0 'mh-index-folder)) ;; Marked for deletion (list (concat mh-scan-deleted-msg-regexp ".*") - '(0 mh-folder-deleted-face)) + '(0 'mh-folder-deleted)) ;; Marked for refile (list (concat mh-scan-refiled-msg-regexp ".*") - '(0 mh-folder-refiled-face)) - ;;after subj - (list mh-scan-body-regexp '(1 mh-folder-body-face nil t)) + '(0 'mh-folder-refiled)) + ;; After subject + (list mh-scan-body-regexp + '(1 'mh-folder-body nil t)) + ;; Subject '(mh-folder-font-lock-subject - (1 mh-folder-followup-face append t) - (2 mh-folder-subject-face append t)) - ;;current msg + (1 'mh-folder-followup append t) + (2 'mh-folder-subject append t)) + ;; Current message number (list mh-scan-cur-msg-number-regexp - '(1 mh-folder-cur-msg-number-face)) + '(1 'mh-folder-cur-msg-number)) + ;; Message number (list mh-scan-good-msg-regexp - '(1 mh-folder-msg-number-face)) ;; Msg number - (list mh-scan-date-regexp '(1 mh-folder-date-face)) ;; Date + '(1 'mh-folder-msg-number)) + ;; Date + (list mh-scan-date-regexp + '(1 'mh-folder-date)) + ;; Messages from me (To:) (list mh-scan-rcpt-regexp - '(1 mh-folder-to-face) ;; To: - '(2 mh-folder-address-face)) ;; address - ;; scan font-lock name - (list mh-scan-format-regexp - '(1 mh-folder-date-face) - '(3 mh-folder-scan-format-face))) + '(1 'mh-folder-to) + '(2 'mh-folder-address)) + ;; Messages to me + (list mh-scan-sent-to-me-sender-regexp + '(1 'mh-folder-sent-to-me-hint) + '(2 'mh-folder-sent-to-me-sender))) "Keywords (regular expressions) used to fontify the MH-Folder buffer.") (defvar mh-scan-cmd-note-width 1
--- a/lisp/mh-e/mh-init.el Sun Jan 01 11:41:36 2006 +0000 +++ b/lisp/mh-e/mh-init.el Sun Jan 01 18:51:18 2006 +0000 @@ -1,6 +1,6 @@ ;;; mh-init.el --- MH-E initialization -;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ;; Author: Peter S. Galbraith <psg@debian.org> ;; Maintainer: Bill Wohler <wohler@newt.com> @@ -334,7 +334,7 @@ (defun mh-defface-compat (spec) "Convert SPEC for defface if necessary to run on older platforms. -See `defface' for the spec definition. +Modifies SPEC in place and returns it. See `defface' for the spec definition. When `mh-min-colors-defined-flag' is nil, this function finds a display with a single \"class\" requirement with a \"color\" @@ -351,7 +351,8 @@ (loop for entry in spec do (when (not (eq (car entry) t)) (if (assoc 'min-colors (car entry)) - (delq (assoc 'min-colors (car entry)) (car entry))))))) + (delq (assoc 'min-colors (car entry)) (car entry)))))) + spec) (provide 'mh-init)
--- a/lisp/mh-e/mh-mime.el Sun Jan 01 11:41:36 2006 +0000 +++ b/lisp/mh-e/mh-mime.el Sun Jan 01 18:51:18 2006 +0000 @@ -1407,14 +1407,15 @@ (defun mh-mime-security-button-face (info) "Return the button face to use for encrypted/signed mail based on INFO." (cond ((string-match "OK" info) ;Decrypted mail - mh-show-pgg-good-face) + 'mh-show-pgg-good) ((string-match "Failed" info) ;Decryption failed or signature invalid - mh-show-pgg-bad-face) + 'mh-show-pgg-bad) ((string-match "Undecided" info);Unprocessed mail - mh-show-pgg-unknown-face) + 'mh-show-pgg-unknown) ((string-match "Untrusted" info);Key not trusted - mh-show-pgg-unknown-face) - (t mh-show-pgg-good-face))) + 'mh-show-pgg-unknown) + (t + 'mh-show-pgg-good))) (defun mh-mime-security-press-button (handle) "Callback from security button for part HANDLE."
--- a/lisp/mh-e/mh-utils.el Sun Jan 01 11:41:36 2006 +0000 +++ b/lisp/mh-e/mh-utils.el Sun Jan 01 18:51:18 2006 +0000 @@ -402,18 +402,30 @@ (eval-and-compile ;; Otherwise byte-compilation fails on `mh-show-font-lock-keywords-with-cite' (defvar mh-show-font-lock-keywords - '(("^\\(From:\\|Sender:\\)\\(.*\\)" (1 'default) (2 mh-show-from-face)) - (mh-header-to-font-lock (0 'default) (1 mh-show-to-face)) - (mh-header-cc-font-lock (0 'default) (1 mh-show-cc-face)) + '(("^\\(From:\\|Sender:\\)\\(.*\\)" + (1 'default) + (2 'mh-show-from)) + (mh-header-to-font-lock + (0 'default) + (1 'mh-show-to)) + (mh-header-cc-font-lock + (0 'default) + (1 'mh-show-cc)) ("^\\(Reply-To:\\|Return-Path:\\)\\(.*\\)$" - (1 'default) (2 mh-show-from-face)) - (mh-header-subject-font-lock (0 'default) (1 mh-show-subject-face)) + (1 'default) + (2 'mh-show-from)) + (mh-header-subject-font-lock + (0 'default) + (1 'mh-show-subject)) ("^\\(Apparently-To:\\|Newsgroups:\\)\\(.*\\)" - (1 'default) (2 mh-show-cc-face)) + (1 'default) + (2 'mh-show-cc)) ("^\\(In-reply-to\\|Date\\):\\(.*\\)$" - (1 'default) (2 mh-show-date-face)) - (mh-letter-header-font-lock (0 mh-show-header-face append t))) - "Additional expressions to highlight in MH-show mode.")) + (1 'default) + (2 'mh-show-date)) + (mh-letter-header-font-lock + (0 'mh-show-header append t))) + "Additional expressions to highlight in MH-Show buffers.")) (defvar mh-show-font-lock-keywords-with-cite (eval-when-compile @@ -432,11 +444,13 @@ (beginning-of-line) (end-of-line) (2 font-lock-constant-face nil t) (4 font-lock-comment-face nil t))))))) - "Additional expressions to highlight in MH-show mode.") + "Additional expressions to highlight in MH-Show buffers.") (defvar mh-letter-font-lock-keywords `(,@mh-show-font-lock-keywords-with-cite - (mh-font-lock-field-data (1 'mh-letter-header-field prepend t)))) + (mh-font-lock-field-data + (1 'mh-letter-header-field prepend t))) + "Additional expressions to highlight in MH-Letter buffers.") (defun mh-show-font-lock-fontify-region (beg end loudly) "Limit font-lock in `mh-show-mode' to the header. @@ -1229,6 +1243,32 @@ (mh-do-in-xemacs (defvar default-enable-multibyte-characters)) +(defmacro mh-face-foreground-compat (face &optional frame inherit) + "Return the foreground color name of FACE, or nil if unspecified. +See documentation for `face-foreground' for a description of the +arguments FACE, FRAME, and INHERIT. + +Calls `face-foreground' correctly in older environments. Versions +of Emacs prior to version 22 lacked an INHERIT argument which +when t tells `face-foreground' to consider an inherited value for +the foreground if the face does not define one itself." + (if (>= emacs-major-version 22) + `(face-foreground ,face ,frame ,inherit) + `(face-foreground ,face ,frame))) + +(defmacro mh-face-background-compat (face &optional frame inherit) + "Return the background color name of face, or nil if unspecified. +See documentation for `back-foreground' for a description of the +arguments FACE, FRAME, and INHERIT. + +Calls `face-background' correctly in older environments. Versions +of Emacs prior to version 22 lacked an INHERIT argument which +when t tells `face-background' to consider an inherited value for +the background if the face does not define one itself." + (if (>= emacs-major-version 22) + `(face-background ,face ,frame ,inherit) + `(face-background ,face ,frame))) + (defun mh-face-display-function () "Display a Face, X-Face, or X-Image-URL header field. If more than one of these are present, then the first one found @@ -1259,9 +1299,11 @@ (mh-funcall-if-exists insert-image (create-image raw type t - :foreground (face-foreground 'mh-show-xface) - :background (face-background 'mh-show-xface)) - " "))) + :foreground + (mh-face-foreground-compat 'mh-show-xface nil t) + :background + (mh-face-background-compat 'mh-show-xface nil t)) + " "))) ;; XEmacs (mh-do-in-xemacs (cond