emacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-commit] emacs/lisp/mh-e mh-customize.el ChangeLog


From: Bill Wohler
Subject: [Emacs-commit] emacs/lisp/mh-e mh-customize.el ChangeLog
Date: Fri, 04 Nov 2005 20:57:36 -0500

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Branch:         
Changes by:     Bill Wohler <address@hidden>    05/11/05 01:57:36

Modified files:
        lisp/mh-e      : mh-customize.el ChangeLog 

Log message:
        (mh-min-colors-defined-flag): New variable.
        (mh-defface-compat): New function. Provides backward compatibility for
        face specs.
        (mh-show-header, mh-show-date, mh-show-cc, mh-folder-to)
        (mh-folder-refiled, mh-folder-cur-msg-number, mh-folder-cur-msg)
        (mh-folder-body): Use mh-defface-compat.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/mh-e/mh-customize.el.diff?tr1=1.33&tr2=1.34&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/mh-e/ChangeLog.diff?tr1=1.64&tr2=1.65&r1=text&r2=text

Patches:
Index: emacs/lisp/mh-e/ChangeLog
diff -u emacs/lisp/mh-e/ChangeLog:1.64 emacs/lisp/mh-e/ChangeLog:1.65
--- emacs/lisp/mh-e/ChangeLog:1.64      Fri Nov  4 23:42:28 2005
+++ emacs/lisp/mh-e/ChangeLog   Sat Nov  5 01:57:35 2005
@@ -2,6 +2,12 @@
 
        * mh-customize.el: Refactor faces. Move grayscale requirements
        last before t. Use uniform line breaks.
+       (mh-min-colors-defined-flag): New variable.
+       (mh-defface-compat): New function. Provides backward compatibility
+       for face specs.
+       (mh-show-header, mh-show-date, mh-show-cc, mh-folder-to) 
+       (mh-folder-refiled, mh-folder-cur-msg-number, mh-folder-cur-msg) 
+       (mh-folder-body): Use mh-defface-compat.
 
 2005-11-03  Dan Nicolaescu  <address@hidden>
 
Index: emacs/lisp/mh-e/mh-customize.el
diff -u emacs/lisp/mh-e/mh-customize.el:1.33 
emacs/lisp/mh-e/mh-customize.el:1.34
--- emacs/lisp/mh-e/mh-customize.el:1.33        Fri Nov  4 23:42:28 2005
+++ emacs/lisp/mh-e/mh-customize.el     Sat Nov  5 01:57:35 2005
@@ -2248,57 +2248,84 @@
 
 ;;; Faces (:group 'mh-*-faces + group where faces described)
 
+(defvar mh-min-colors-defined-flag (and (not mh-xemacs-flag)
+                                        (>= emacs-major-version 22))
+  "Non-nil means defface supports min-colors display requirement.")
+
+(defun mh-defface-compat (spec)
+  "Converts SPEC for defface if necessary to run on older platforms.
+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\" item, renames the requirement to
+\"tty\" and moves it to the beginning of the list. It then strips any
+\"min-colors\" requirements."
+  (when (not mh-min-colors-defined-flag)
+    ;; Insert ((class tty)) display with ((class color)) attributes.
+    (let ((attributes (cdr (assoc '((class color)) spec))))
+      (cons (cons '((class tty)) attributes) spec))
+    ;; Delete ((class color)) display.
+    (delq (assoc '((class color)) spec) spec)
+    ;; Strip min-colors.
+    (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)))))))
+  
 ;;; 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.")
 (defface mh-folder-body
-  '((((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)))
+  (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
-  '((((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)))
+  (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.")
 (defface mh-folder-cur-msg-number
-  '((((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)))
+  (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)
 
@@ -2345,18 +2372,19 @@
 (defvar mh-folder-refiled-face 'mh-folder-refiled
   "Face used to highlight refiled messages in MH-Folder buffers.")
 (defface mh-folder-refiled
-  '((((class color) (min-colors 88) (background light))
-     (:foreground "DarkGoldenrod"))
-    (((class color) (min-colors 88) (background dark))
-     (:foreground "LightGoldenrod"))
-    (((class color))
-     (:foreground "yellow" :weight light))
-    (((class grayscale) (background light))
-     (:foreground "Gray90" :bold t :italic t))
-    (((class grayscale) (background dark))
-     (:foreground "DimGray" :bold t :italic t))
-    (t
-     (:bold t :italic t)))
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "DarkGoldenrod"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "LightGoldenrod"))
+     (((class color))
+      (:foreground "yellow" :weight light))
+     (((class grayscale) (background light))
+      (:foreground "Gray90" :bold t :italic t))
+     (((class grayscale) (background dark))
+      (: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)
 
@@ -2395,18 +2423,19 @@
 (defvar mh-folder-to-face 'mh-folder-to
   "Face used to highlight the To: string in MH-Folder buffers.")
 (defface mh-folder-to
-  '((((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)))
+  (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 the To: string in MH-Folder buffers."
   :group 'mh-folder-faces)
 
@@ -2447,54 +2476,57 @@
 (defvar mh-show-cc-face 'mh-show-cc
   "Face used to highlight cc: header fields.")
 (defface mh-show-cc
-  '((((class color) (min-colors 88) (background light))
-     (:foreground "DarkGoldenrod"))
-    (((class color) (min-colors 88) (background dark))
-     (:foreground "LightGoldenrod"))
-    (((class color))
-     (:foreground "yellow" :weight light))
-    (((class grayscale) (background light))
-     (:foreground "Gray90" :bold t :italic t))
-    (((class grayscale) (background dark))
-     (:foreground "DimGray" :bold t :italic t))
-    (t
-     (:bold t :italic t)))
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "DarkGoldenrod"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "LightGoldenrod"))
+     (((class color))
+      (:foreground "yellow" :weight light))
+     (((class grayscale) (background light))
+      (:foreground "Gray90" :bold t :italic t))
+     (((class grayscale) (background dark))
+      (: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.")
 (defface mh-show-date
-  '((((class color) (min-colors 88) (background light))
-     (:foreground "ForestGreen"))
-    (((class color) (min-colors 88) (background dark))
-     (:foreground "PaleGreen"))
-    (((class color))
-     (:foreground "green"))
-    (((class grayscale) (background light))
-     (:foreground "Gray90" :bold t))
-    (((class grayscale) (background dark))
-     (:foreground "DimGray" :bold t))
-    (t
-     (:bold t :underline t)))
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "ForestGreen"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "PaleGreen"))
+     (((class color))
+      (:foreground "green"))
+     (((class grayscale) (background light))
+      (:foreground "Gray90" :bold t))
+     (((class grayscale) (background dark))
+      (: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.")
 (defface mh-show-header
-  '((((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)))
+  (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 deemphasize unspecified header fields."
   :group 'mh-show-faces)
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]