Function: face-spec-set-match-display
face-spec-set-match-display is a byte-compiled function defined in
faces.el.gz.
Signature
(face-spec-set-match-display DISPLAY FRAME)
Documentation
Non-nil if DISPLAY matches FRAME.
DISPLAY is part of a spec such as can be used in defface.
If FRAME is nil, the current FRAME is used.
Source Code
;; Defined in /usr/src/emacs/lisp/faces.el.gz
(defun face-spec-set-match-display (display frame)
"Non-nil if DISPLAY matches FRAME.
DISPLAY is part of a spec such as can be used in `defface'.
If FRAME is nil, the current FRAME is used."
(let* ((conjuncts display)
conjunct req options
;; t means we have succeeded against all the conjuncts in
;; DISPLAY that have been tested so far.
(match t))
(if (eq conjuncts t)
(setq conjuncts nil))
(while (and conjuncts match)
(setq conjunct (car conjuncts)
conjuncts (cdr conjuncts)
req (car conjunct)
options (cdr conjunct)
match (cond ((eq req 'type)
(or (memq (window-system frame) options)
(and (memq 'graphic options)
(memq (window-system frame) '(x w32 ns pgtk)))
;; FIXME: This should be revisited to use
;; display-graphic-p, provided that the
;; color selection depends on the number
;; of supported colors, and all defface's
;; are changed to look at number of colors
;; instead of (type graphic) etc.
(if (null (window-system frame))
(memq 'tty options)
(or (and (memq 'motif options)
(featurep 'motif))
(and (memq 'gtk options)
(featurep 'gtk))
(and (memq 'lucid options)
(featurep 'x-toolkit)
(not (featurep 'motif))
(not (featurep 'gtk)))
(and (memq 'x-toolkit options)
(featurep 'x-toolkit))))))
((eq req 'min-colors)
(>= (display-color-cells frame) (car options)))
((eq req 'class)
(memq (frame-parameter frame 'display-type) options))
((eq req 'background)
(memq (frame-parameter frame 'background-mode)
options))
((eq req 'supports)
(display-supports-face-attributes-p options frame))
(t (error "Unknown req `%S' with options `%S'"
req options)))))
match))