diff options
author | Miles Bader <miles@gnu.org> | 2004-06-04 06:00:59 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2004-06-04 06:00:59 +0000 |
commit | 9717e36cff1ceda0bbebb2209c9fbbbd420af6d0 (patch) | |
tree | 4bcc228ea273eed5cf6e2f4134cb41d63635fca8 /lisp/faces.el | |
parent | 5129f10c94db38789a92f396f568f993d726e7bd (diff) | |
download | emacs-9717e36cff1ceda0bbebb2209c9fbbbd420af6d0.tar.gz |
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-370
Move `display-supports-face-attributes-p' entirely into C code
Previously only the tty-related portion of display-supports-face-attributes-p
was done in C. This just moves the graphical-display related bits into C
too, which allows us to implement them properly (the previous attempt to do a
halfway-proper job in lisp didn't work because of funny conditions during
emacs startup).
Diffstat (limited to 'lisp/faces.el')
-rw-r--r-- | lisp/faces.el | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index cdc56075711..419ff42c894 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1505,47 +1505,6 @@ If omitted or nil, that stands for the selected frame's display." (t (> (tty-color-gray-shades display) 2))))) -(defun display-supports-face-attributes-p (attributes &optional display) - "Return non-nil if all the face attributes in ATTRIBUTES are supported. -The optional argument DISPLAY can be a display name, a frame, or -nil (meaning the selected frame's display) - -The definition of `supported' is somewhat heuristic, but basically means -that a face containing all the attributes in ATTRIBUTES, when merged -with the default face for display, can be represented in a way that's - - (1) different in appearance than the default face, and - (2) `close in spirit' to what the attributes specify, if not exact. - -Point (2) implies that a `:weight black' attribute will be satisfied by -any display that can display bold, and a `:foreground \"yellow\"' as long -as it can display a yellowish color, but `:slant italic' will _not_ be -satisfied by the tty display code's automatic substitution of a `dim' -face for italic." - (let ((frame - (if (framep display) - display - (car (frames-on-display-list display))))) - (if (not (memq (framep frame) '(x w32 mac))) - ;; On ttys, `tty-supports-face-attributes-p' does all the work we need. - (tty-supports-face-attributes-p attributes frame) - ;; For now, we assume that non-tty displays can support everything, - ;; and so we just check to see if any of the specified attributes is - ;; different from the default -- though this probably isn't always - ;; accurate for font-related attributes. Later, we should add the - ;; ability to query about specific fonts, colors, etc. - (while (and attributes - (let* ((attr (car attributes)) - (val (cadr attributes)) - (default-val (face-attribute 'default attr frame))) - (if (and (stringp val) (stringp default-val)) - ;; compare string attributes case-insensitively - (eq (compare-strings val nil nil default-val nil nil t) - t) - (equal val default-val)))) - (setq attributes (cddr attributes))) - (not (null attributes))))) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Background mode. |