+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
:prefix "mh-"
:group 'mh-e)
-(defgroup mh-faces nil
- "Faces used in MH-E."
- :link '(custom-manual "(mh-e)Top")
- :prefix "mh-"
- :group 'faces
- :group 'mh-e)
-
(defgroup mh-hooks nil
"MH-E hooks."
:link '(custom-manual "(mh-e)Top")
:prefix "mh-"
:group 'mh-e)
-\f
-
-;;; 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")
+(defgroup mh-faces nil
+ "Faces used in MH-E."
+ :link '(custom-manual "(mh-e)Top")
:prefix "mh-"
- :group 'mh-faces
- :group 'mh-speed)
+ :group 'faces
+ :group 'mh-e)
\f
\f
-;;; 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)
\f
\f
-;;; Faces (:group 'mh-*-faces + group where faces described)
+;;; Faces (:group 'mh-faces + group where faces described)
-\f
+(if (boundp 'facemenu-unlisted-faces)
+ (add-to-list 'facemenu-unlisted-faces "^mh-"))
-;;; Faces Used in Scan Listing (:group 'mh-folder-faces)
+(defface mh-folder-address '((t (:inherit mh-folder-subject)))
+ "Recipient face."
+ :group 'mh-faces
+ :group 'mh-folder)
-(defvar mh-folder-body-face 'mh-folder-body
- "Face used to highlight body text in MH-Folder buffers.")
(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)
+ '((((class color))
+ (:inherit mh-folder-msg-number))
+ (t
+ (:inherit mh-folder-msg-number :italic t)))
+ "Body text face."
+ :group 'mh-faces
+ :group 'mh-folder)
-(defvar mh-folder-cur-msg-number-face 'mh-folder-cur-msg-number
- "Face used to highlight the current message in MH-Folder buffers.")
(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)
+ '((t
+ (:inherit mh-folder-msg-number :bold t)))
+ "Current message number face."
+ :group 'mh-faces
+ :group 'mh-folder)
-(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)
+(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)
-(defvar mh-folder-followup-face 'mh-folder-followup
- "Face used to highlight Re: subject text in MH-Folder buffers.")
(defface mh-folder-followup
'((((class color) (background light))
(:foreground "blue3"))
(:foreground "LightGoldenRod"))
(t
(:bold t)))
- "Face used to highlight Re: subject text in MH-Folder buffers."
- :group 'mh-folder-faces)
+ "\"Re:\" face."
+ :group 'mh-faces
+ :group 'mh-folder)
-(defvar mh-folder-msg-number-face 'mh-folder-msg-number
- "Face used to highlight the message number in MH-Folder buffers.")
(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)
+ (:foreground "snow3")))
+ "Message number face."
+ :group 'mh-faces
+ :group 'mh-folder)
-(defvar mh-folder-refiled-face 'mh-folder-refiled
- "Face used to highlight refiled messages in MH-Folder buffers.")
(defface mh-folder-refiled
(mh-defface-compat
'((((class color) (min-colors 88) (background light))
(: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)
+ "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)
-(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"))
(defface mh-folder-subject
'((((class color) (background light))
(:foreground "blue4"))
(: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))
(: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)
+ "Ticked message face."
+ :group 'mh-faces
+ :group 'mh-folder)
-(defvar mh-folder-to-face 'mh-folder-to
- "Face used to highlight the To: string in MH-Folder buffers.")
(defface mh-folder-to
(mh-defface-compat
'((((class color) (min-colors 88) (background light))
(:foreground "LightGray" :italic t))
(t
(:italic t))))
- "Face used to highlight the To: string in MH-Folder buffers."
- :group 'mh-folder-faces)
-
-\f
-
-;;; Faces Used in Searching (:group 'mh-index-faces)
+ "\"To:\" face."
+ :group 'mh-faces
+ :group 'mh-folder)
-(defvar mh-index-folder-face 'mh-index-folder
- "Face used to highlight folders in MH-Index buffers.")
(defface mh-index-folder
'((((class color) (background light))
(:foreground "dark green" :bold t))
(:foreground "indian red" :bold t))
(t
(:bold t)))
- "Face used to highlight folders in MH-Index buffers."
- :group 'mh-index-faces)
-
-\f
-
-;;; 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))
(:background "gray10"))
(t
(:bold t)))
- "Face used to display header fields in draft buffers."
- :group 'mh-letter-faces)
-
-\f
-
-;;; Faces Used in Message Display (:group 'mh-show-faces)
+ "Editable header field value face in draft buffers."
+ :group 'mh-faces
+ :group 'mh-letter)
-(defvar mh-show-cc-face 'mh-show-cc
- "Face used to highlight cc: header fields.")
(defface mh-show-cc
(mh-defface-compat
'((((class color) (min-colors 88) (background light))
(:foreground "DimGray" :bold t :italic t))
(t
(:bold t :italic t))))
- "Face used to highlight cc: header fields."
- :group 'mh-show-faces)
+ "Face used to highlight \"cc:\" header fields."
+ :group 'mh-faces
+ :group 'mh-show)
-(defvar mh-show-date-face 'mh-show-date
- "Face used to highlight the Date: header field.")
(defface mh-show-date
(mh-defface-compat
'((((class color) (min-colors 88) (background light))
(:foreground "DimGray" :bold t))
(t
(:bold t :underline t))))
- "Face used to highlight the Date: header field."
- :group 'mh-show-faces)
+ "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)
-(defvar mh-show-header-face 'mh-show-header
- "Face used to deemphasize unspecified header fields.")
(defface mh-show-header
(mh-defface-compat
'((((class color) (min-colors 88) (background light))
(:foreground "LightGray" :italic t))
(t
(:italic t))))
- "Face used to deemphasize unspecified header fields."
- :group 'mh-show-faces)
+ "Face used to deemphasize less interesting header fields."
+ :group 'mh-faces
+ :group 'mh-show)
-(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-pgg-bad '((t (:bold t :foreground "DeepPink1")))
+ "Bad PGG signature face."
+ :group 'mh-faces
+ :group 'mh-show)
-(defface mh-show-signature
- '((t
- (:italic t)))
- "Face used to highlight the message signature."
- :group 'mh-show-faces)
+(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)
-(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"))
(defface mh-show-to
'((((class color) (background light))
(:foreground "SaddleBrown"))
(((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)
-
-\f
+ "Face used to highlight \"To:\" header fields."
+ :group 'mh-faces
+ :group 'mh-show)
-;;; Faces Used in Speedbar (:group 'mh-speed-faces)
+(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))
(: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
(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.")
\"^\\\\( *[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.")
\"^\\\\( *[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'.")
\"^\\\\( *[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'.")
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.
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.
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.
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]*\\)"
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-*\\\\)*
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
- \"*\\\\(..................\\\\)\")\".
+ ^ *[0-9]+.\\\\([bct]\\\\).....[ ]*\\\\(..................\\\\)
-If this regular expression is not correct, the notation hints and
-the sender will not be highlighted.")
+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'.")
\f
(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
;;; 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>
(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\"
(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)
(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."
(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
(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.
(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
(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