aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wohler2005-11-05 01:57:35 +0000
committerBill Wohler2005-11-05 01:57:35 +0000
commit3d2efec2f2e61f96e1c4fa3d68247ad7f0c2e037 (patch)
tree979a3d7dc7ab3ec111d7d6ff695b500d5ac21497
parentd54e276ade77dca0c077eac863f0bc9daf154ae5 (diff)
downloademacs-3d2efec2f2e61f96e1c4fa3d68247ad7f0c2e037.tar.gz
emacs-3d2efec2f2e61f96e1c4fa3d68247ad7f0c2e037.zip
(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.
-rw-r--r--lisp/mh-e/ChangeLog6
-rw-r--r--lisp/mh-e/mh-customize.el220
2 files changed, 132 insertions, 94 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 258ff5d11d7..b00a78df654 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -2,6 +2,12 @@
2 2
3 * mh-customize.el: Refactor faces. Move grayscale requirements 3 * mh-customize.el: Refactor faces. Move grayscale requirements
4 last before t. Use uniform line breaks. 4 last before t. Use uniform line breaks.
5 (mh-min-colors-defined-flag): New variable.
6 (mh-defface-compat): New function. Provides backward compatibility
7 for face specs.
8 (mh-show-header, mh-show-date, mh-show-cc, mh-folder-to)
9 (mh-folder-refiled, mh-folder-cur-msg-number, mh-folder-cur-msg)
10 (mh-folder-body): Use mh-defface-compat.
5 11
62005-11-03 Dan Nicolaescu <dann@ics.uci.edu> 122005-11-03 Dan Nicolaescu <dann@ics.uci.edu>
7 13
diff --git a/lisp/mh-e/mh-customize.el b/lisp/mh-e/mh-customize.el
index 24e73e0be3e..bf673b4fa52 100644
--- a/lisp/mh-e/mh-customize.el
+++ b/lisp/mh-e/mh-customize.el
@@ -2248,57 +2248,84 @@ will be removed from the unseen sequence."
2248 2248
2249;;; Faces (:group 'mh-*-faces + group where faces described) 2249;;; Faces (:group 'mh-*-faces + group where faces described)
2250 2250
2251(defvar mh-min-colors-defined-flag (and (not mh-xemacs-flag)
2252 (>= emacs-major-version 22))
2253 "Non-nil means defface supports min-colors display requirement.")
2254
2255(defun mh-defface-compat (spec)
2256 "Converts SPEC for defface if necessary to run on older platforms.
2257See `defface' for the spec definition.
2258
2259When `mh-min-colors-defined-flag' is nil, this function finds a display with a
2260single \"class\" requirement with a \"color\" item, renames the requirement to
2261\"tty\" and moves it to the beginning of the list. It then strips any
2262\"min-colors\" requirements."
2263 (when (not mh-min-colors-defined-flag)
2264 ;; Insert ((class tty)) display with ((class color)) attributes.
2265 (let ((attributes (cdr (assoc '((class color)) spec))))
2266 (cons (cons '((class tty)) attributes) spec))
2267 ;; Delete ((class color)) display.
2268 (delq (assoc '((class color)) spec) spec)
2269 ;; Strip min-colors.
2270 (loop for entry in spec do
2271 (when (not (eq (car entry) t))
2272 (if (assoc 'min-colors (car entry))
2273 (delq (assoc 'min-colors (car entry)) (car entry)))))))
2274
2251;;; Faces Used in Scan Listing (:group 'mh-folder-faces) 2275;;; Faces Used in Scan Listing (:group 'mh-folder-faces)
2252 2276
2253(defvar mh-folder-body-face 'mh-folder-body 2277(defvar mh-folder-body-face 'mh-folder-body
2254 "Face used to highlight body text in MH-Folder buffers.") 2278 "Face used to highlight body text in MH-Folder buffers.")
2255(defface mh-folder-body 2279(defface mh-folder-body
2256 '((((class color) (min-colors 88) (background light)) 2280 (mh-defface-compat
2257 (:foreground "RosyBrown")) 2281 '((((class color) (min-colors 88) (background light))
2258 (((class color) (min-colors 88) (background dark)) 2282 (:foreground "RosyBrown"))
2259 (:foreground "LightSalmon")) 2283 (((class color) (min-colors 88) (background dark))
2260 (((class color)) 2284 (:foreground "LightSalmon"))
2261 (:foreground "green")) 2285 (((class color))
2262 (((class grayscale) (background light)) 2286 (:foreground "green"))
2263 (:foreground "DimGray" :italic t)) 2287 (((class grayscale) (background light))
2264 (((class grayscale) (background dark)) 2288 (:foreground "DimGray" :italic t))
2265 (:foreground "LightGray" :italic t)) 2289 (((class grayscale) (background dark))
2266 (t 2290 (:foreground "LightGray" :italic t))
2267 (:italic t))) 2291 (t
2292 (:italic t))))
2268 "Face used to highlight body text in MH-Folder buffers." 2293 "Face used to highlight body text in MH-Folder buffers."
2269 :group 'mh-folder-faces) 2294 :group 'mh-folder-faces)
2270 2295
2271(defvar mh-folder-cur-msg-face 'mh-folder-cur-msg 2296(defvar mh-folder-cur-msg-face 'mh-folder-cur-msg
2272 "Face used for the current message line in MH-Folder buffers.") 2297 "Face used for the current message line in MH-Folder buffers.")
2273(defface mh-folder-cur-msg 2298(defface mh-folder-cur-msg
2274 '((((class color) (min-colors 88) (background light)) 2299 (mh-defface-compat
2275 (:background "LightGreen") ;Use this for solid background colour 2300 '((((class color) (min-colors 88) (background light))
2276 ;; (:underline t) ;Use this for underlining 2301 (:background "LightGreen") ;Use this for solid background colour
2277 ) 2302 ;; (:underline t) ;Use this for underlining
2278 (((class color) (min-colors 88) (background dark)) 2303 )
2279 (:background "DarkOliveGreen4")) 2304 (((class color) (min-colors 88) (background dark))
2280 (((class color)) 2305 (:background "DarkOliveGreen4"))
2281 (:background "LightGreen")) 2306 (((class color))
2282 (t 2307 (:background "LightGreen"))
2283 (:underline t))) 2308 (t
2309 (:underline t))))
2284 "Face used for the current message line in MH-Folder buffers." 2310 "Face used for the current message line in MH-Folder buffers."
2285 :group 'mh-folder-faces) 2311 :group 'mh-folder-faces)
2286 2312
2287(defvar mh-folder-cur-msg-number-face 'mh-folder-cur-msg-number 2313(defvar mh-folder-cur-msg-number-face 'mh-folder-cur-msg-number
2288 "Face used to highlight the current message in MH-Folder buffers.") 2314 "Face used to highlight the current message in MH-Folder buffers.")
2289(defface mh-folder-cur-msg-number 2315(defface mh-folder-cur-msg-number
2290 '((((class color) (min-colors 88) (background light)) 2316 (mh-defface-compat
2291 (:foreground "Purple")) 2317 '((((class color) (min-colors 88) (background light))
2292 (((class color) (min-colors 88) (background dark)) 2318 (:foreground "Purple"))
2293 (:foreground "Cyan")) 2319 (((class color) (min-colors 88) (background dark))
2294 (((class color)) 2320 (:foreground "Cyan"))
2295 (:foreground "cyan" :weight bold)) 2321 (((class color))
2296 (((class grayscale) (background light)) 2322 (:foreground "cyan" :weight bold))
2297 (:foreground "LightGray" :bold t)) 2323 (((class grayscale) (background light))
2298 (((class grayscale) (background dark)) 2324 (:foreground "LightGray" :bold t))
2299 (:foreground "DimGray" :bold t)) 2325 (((class grayscale) (background dark))
2300 (t 2326 (:foreground "DimGray" :bold t))
2301 (:bold t))) 2327 (t
2328 (:bold t))))
2302 "Face used to highlight the current message in MH-Folder buffers." 2329 "Face used to highlight the current message in MH-Folder buffers."
2303 :group 'mh-folder-faces) 2330 :group 'mh-folder-faces)
2304 2331
@@ -2345,18 +2372,19 @@ will be removed from the unseen sequence."
2345(defvar mh-folder-refiled-face 'mh-folder-refiled 2372(defvar mh-folder-refiled-face 'mh-folder-refiled
2346 "Face used to highlight refiled messages in MH-Folder buffers.") 2373 "Face used to highlight refiled messages in MH-Folder buffers.")
2347(defface mh-folder-refiled 2374(defface mh-folder-refiled
2348 '((((class color) (min-colors 88) (background light)) 2375 (mh-defface-compat
2349 (:foreground "DarkGoldenrod")) 2376 '((((class color) (min-colors 88) (background light))
2350 (((class color) (min-colors 88) (background dark)) 2377 (:foreground "DarkGoldenrod"))
2351 (:foreground "LightGoldenrod")) 2378 (((class color) (min-colors 88) (background dark))
2352 (((class color)) 2379 (:foreground "LightGoldenrod"))
2353 (:foreground "yellow" :weight light)) 2380 (((class color))
2354 (((class grayscale) (background light)) 2381 (:foreground "yellow" :weight light))
2355 (:foreground "Gray90" :bold t :italic t)) 2382 (((class grayscale) (background light))
2356 (((class grayscale) (background dark)) 2383 (:foreground "Gray90" :bold t :italic t))
2357 (:foreground "DimGray" :bold t :italic t)) 2384 (((class grayscale) (background dark))
2358 (t 2385 (:foreground "DimGray" :bold t :italic t))
2359 (:bold t :italic t))) 2386 (t
2387 (:bold t :italic t))))
2360 "Face used to highlight refiled messages in MH-Folder buffers." 2388 "Face used to highlight refiled messages in MH-Folder buffers."
2361 :group 'mh-folder-faces) 2389 :group 'mh-folder-faces)
2362 2390
@@ -2395,18 +2423,19 @@ will be removed from the unseen sequence."
2395(defvar mh-folder-to-face 'mh-folder-to 2423(defvar mh-folder-to-face 'mh-folder-to
2396 "Face used to highlight the To: string in MH-Folder buffers.") 2424 "Face used to highlight the To: string in MH-Folder buffers.")
2397(defface mh-folder-to 2425(defface mh-folder-to
2398 '((((class color) (min-colors 88) (background light)) 2426 (mh-defface-compat
2399 (:foreground "RosyBrown")) 2427 '((((class color) (min-colors 88) (background light))
2400 (((class color) (min-colors 88) (background dark)) 2428 (:foreground "RosyBrown"))
2401 (:foreground "LightSalmon")) 2429 (((class color) (min-colors 88) (background dark))
2402 (((class color)) 2430 (:foreground "LightSalmon"))
2403 (:foreground "green")) 2431 (((class color))
2404 (((class grayscale) (background light)) 2432 (:foreground "green"))
2405 (:foreground "DimGray" :italic t)) 2433 (((class grayscale) (background light))
2406 (((class grayscale) (background dark)) 2434 (:foreground "DimGray" :italic t))
2407 (:foreground "LightGray" :italic t)) 2435 (((class grayscale) (background dark))
2408 (t 2436 (:foreground "LightGray" :italic t))
2409 (:italic t))) 2437 (t
2438 (:italic t))))
2410 "Face used to highlight the To: string in MH-Folder buffers." 2439 "Face used to highlight the To: string in MH-Folder buffers."
2411 :group 'mh-folder-faces) 2440 :group 'mh-folder-faces)
2412 2441
@@ -2447,54 +2476,57 @@ will be removed from the unseen sequence."
2447(defvar mh-show-cc-face 'mh-show-cc 2476(defvar mh-show-cc-face 'mh-show-cc
2448 "Face used to highlight cc: header fields.") 2477 "Face used to highlight cc: header fields.")
2449(defface mh-show-cc 2478(defface mh-show-cc
2450 '((((class color) (min-colors 88) (background light)) 2479 (mh-defface-compat
2451 (:foreground "DarkGoldenrod")) 2480 '((((class color) (min-colors 88) (background light))
2452 (((class color) (min-colors 88) (background dark)) 2481 (:foreground "DarkGoldenrod"))
2453 (:foreground "LightGoldenrod")) 2482 (((class color) (min-colors 88) (background dark))
2454 (((class color)) 2483 (:foreground "LightGoldenrod"))
2455 (:foreground "yellow" :weight light)) 2484 (((class color))
2456 (((class grayscale) (background light)) 2485 (:foreground "yellow" :weight light))
2457 (:foreground "Gray90" :bold t :italic t)) 2486 (((class grayscale) (background light))
2458 (((class grayscale) (background dark)) 2487 (:foreground "Gray90" :bold t :italic t))
2459 (:foreground "DimGray" :bold t :italic t)) 2488 (((class grayscale) (background dark))
2460 (t 2489 (:foreground "DimGray" :bold t :italic t))
2461 (:bold t :italic t))) 2490 (t
2491 (:bold t :italic t))))
2462 "Face used to highlight cc: header fields." 2492 "Face used to highlight cc: header fields."
2463 :group 'mh-show-faces) 2493 :group 'mh-show-faces)
2464 2494
2465(defvar mh-show-date-face 'mh-show-date 2495(defvar mh-show-date-face 'mh-show-date
2466 "Face used to highlight the Date: header field.") 2496 "Face used to highlight the Date: header field.")
2467(defface mh-show-date 2497(defface mh-show-date
2468 '((((class color) (min-colors 88) (background light)) 2498 (mh-defface-compat
2469 (:foreground "ForestGreen")) 2499 '((((class color) (min-colors 88) (background light))
2470 (((class color) (min-colors 88) (background dark)) 2500 (:foreground "ForestGreen"))
2471 (:foreground "PaleGreen")) 2501 (((class color) (min-colors 88) (background dark))
2472 (((class color)) 2502 (:foreground "PaleGreen"))
2473 (:foreground "green")) 2503 (((class color))
2474 (((class grayscale) (background light)) 2504 (:foreground "green"))
2475 (:foreground "Gray90" :bold t)) 2505 (((class grayscale) (background light))
2476 (((class grayscale) (background dark)) 2506 (:foreground "Gray90" :bold t))
2477 (:foreground "DimGray" :bold t)) 2507 (((class grayscale) (background dark))
2478 (t 2508 (:foreground "DimGray" :bold t))
2479 (:bold t :underline t))) 2509 (t
2510 (:bold t :underline t))))
2480 "Face used to highlight the Date: header field." 2511 "Face used to highlight the Date: header field."
2481 :group 'mh-show-faces) 2512 :group 'mh-show-faces)
2482 2513
2483(defvar mh-show-header-face 'mh-show-header 2514(defvar mh-show-header-face 'mh-show-header
2484 "Face used to deemphasize unspecified header fields.") 2515 "Face used to deemphasize unspecified header fields.")
2485(defface mh-show-header 2516(defface mh-show-header
2486 '((((class color) (min-colors 88) (background light)) 2517 (mh-defface-compat
2487 (:foreground "RosyBrown")) 2518 '((((class color) (min-colors 88) (background light))
2488 (((class color) (min-colors 88) (background dark)) 2519 (:foreground "RosyBrown"))
2489 (:foreground "LightSalmon")) 2520 (((class color) (min-colors 88) (background dark))
2490 (((class color)) 2521 (:foreground "LightSalmon"))
2491 (:foreground "green")) 2522 (((class color))
2492 (((class grayscale) (background light)) 2523 (:foreground "green"))
2493 (:foreground "DimGray" :italic t)) 2524 (((class grayscale) (background light))
2494 (((class grayscale) (background dark)) 2525 (:foreground "DimGray" :italic t))
2495 (:foreground "LightGray" :italic t)) 2526 (((class grayscale) (background dark))
2496 (t 2527 (:foreground "LightGray" :italic t))
2497 (:italic t))) 2528 (t
2529 (:italic t))))
2498 "Face used to deemphasize unspecified header fields." 2530 "Face used to deemphasize unspecified header fields."
2499 :group 'mh-show-faces) 2531 :group 'mh-show-faces)
2500 2532