comparison lisp/faces.el @ 5378:4f0a1f4cc111

Improve support for min-colors req in `defface'. lisp/faces.el (face-spec-set-match-display): Protect against `display-color-cells' returning nil. Delete unreferenced let-binding of `min-colors'. man/lispref/customize.texi (Face Definitions): New node. (Customization): Add entry to menu. (Variable Definitions): Add cross-ref for `defface'. (Customization Types): Fixup Previous link. man/lispref/faces.texi (Faces): Clarify that built-in properties of faces are computed at runtime.
author Stephen J. Turnbull <stephen@xemacs.org>
date Sat, 19 Mar 2011 22:13:14 +0900
parents b6e59ea11533
children 4dee0387b9de
comparison
equal deleted inserted replaced
5377:eac2e6bd5b2c 5378:4f0a1f4cc111
1700 t 1700 t
1701 (let* ((props (get-custom-frame-properties frame)) 1701 (let* ((props (get-custom-frame-properties frame))
1702 (type (plist-get props 'type)) 1702 (type (plist-get props 'type))
1703 (class (plist-get props 'class)) 1703 (class (plist-get props 'class))
1704 (background (plist-get props 'background)) 1704 (background (plist-get props 'background))
1705 (min-colors (plist-get props 'min-colors))
1706 (match t) 1705 (match t)
1707 (entries display) 1706 (entries display)
1708 entry req options) 1707 entry req options)
1709 (while (and entries match) 1708 (while (and entries match)
1710 (setq entry (car entries) 1709 (setq entry (car entries)
1713 options (cdr entry) 1712 options (cdr entry)
1714 match (case req 1713 match (case req
1715 (type (memq type options)) 1714 (type (memq type options))
1716 (class (memq class options)) 1715 (class (memq class options))
1717 (background (memq background options)) 1716 (background (memq background options))
1718 (min-colors (>= (display-color-cells frame) 1717 ;; `display-color-cells' can return nil (eg, TTYs).
1718 ;; If so, assume monochrome.
1719 (min-colors (>= (or (display-color-cells frame) 2)
1719 (car options))) 1720 (car options)))
1720 (t (warn "Unknown req `%S' with options `%S'" 1721 (t (warn "Unknown req `%S' with options `%S'"
1721 req options) 1722 req options)
1722 nil)))) 1723 nil))))
1723 match))) 1724 match)))