comparison lisp/mh-e/mh-init.el @ 68000:830e95c83d49

* mh-customize.el (mh-folder-msg-number): Snow is actually off-white on low color displays which turns to white when bold. This is unreadable on white backgrounds. Use snow with min-colors requirement. Use cyan on low-color displays. * mh-init.el (mh-defface-compat): On low-color displays, delete the high-color display rather than simply strip the min-colors requirement since the existing algorithm shadowed the desired display on low-color displays.
author Bill Wohler <wohler@newt.com>
date Tue, 03 Jan 2006 18:25:26 +0000
parents 7882fc7df359
children bbc0e52abce5
comparison
equal deleted inserted replaced
67999:08bdaa28d0d2 68000:830e95c83d49
334 334
335 (defun mh-defface-compat (spec) 335 (defun mh-defface-compat (spec)
336 "Convert SPEC for defface if necessary to run on older platforms. 336 "Convert SPEC for defface if necessary to run on older platforms.
337 Modifies SPEC in place and returns it. See `defface' for the spec definition. 337 Modifies SPEC in place and returns it. See `defface' for the spec definition.
338 338
339 When `mh-min-colors-defined-flag' is nil, this function finds a 339 When `mh-min-colors-defined-flag' is nil, this function finds
340 display with a single \"class\" requirement with a \"color\" 340 display entries with \"min-colors\" requirements and either
341 item, renames the requirement to \"tty\" and moves it to the 341 removes the \"min-colors\" requirement or strips the display
342 beginning of the list. It then strips any \"min-colors\" 342 entirely if the display does not support the number of specified
343 requirements." 343 colors."
344 (when (not mh-min-colors-defined-flag) 344 (if mh-min-colors-defined-flag
345 ;; Insert ((class tty)) display with ((class color)) attributes. 345 spec
346 (let ((attributes (cdr (assoc '((class color)) spec)))) 346 (let ((cells (display-color-cells))
347 (cons (cons '((class tty)) attributes) spec)) 347 new-spec)
348 ;; Delete ((class color)) display. 348 ;; Remove entries with min-colors, or delete them if we have fewer colors
349 (delq (assoc '((class color)) spec) spec) 349 ;; than they specify.
350 ;; Strip min-colors. 350 (loop for entry in (reverse spec) do
351 (loop for entry in spec do 351 (let ((requirement (if (eq (car entry) t)
352 (when (not (eq (car entry) t)) 352 nil
353 (if (assoc 'min-colors (car entry)) 353 (assoc 'min-colors (car entry)))))
354 (delq (assoc 'min-colors (car entry)) (car entry)))))) 354 (if requirement
355 spec) 355 (when (>= cells (nth 1 requirement))
356 (setq new-spec (cons (cons (delq requirement (car entry))
357 (cdr entry))
358 new-spec)))
359 (setq new-spec (cons entry new-spec)))))
360 new-spec)))
356 361
357 (provide 'mh-init) 362 (provide 'mh-init)
358 363
359 ;; Local Variables: 364 ;; Local Variables:
360 ;; indent-tabs-mode: nil 365 ;; indent-tabs-mode: nil