Mercurial > emacs
changeset 55902:084530cb1b2f
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-372
Simplify face-differs-from-default-p; don't consider :stipple.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Fri, 04 Jun 2004 10:12:53 +0000 |
parents | 7814348a02ec |
children | 822bab94f6a3 |
files | lisp/ChangeLog lisp/faces.el |
diffstat | 2 files changed, 18 insertions(+), 33 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Fri Jun 04 06:00:59 2004 +0000 +++ b/lisp/ChangeLog Fri Jun 04 10:12:53 2004 +0000 @@ -12,6 +12,10 @@ was done in C; however the previous attempt to do a halfway-proper job for non-tty displays in lisp didn't work properly because of funny conditions during emacs startup. + (face-differs-from-default-p): Simplify, now that + display-supports-face-attributes-p works properly on all display + types. Remove :stipple from comparison; it doesn't really work + in emacs anyway. 2004-06-04 Miles Bader <miles@gnu.org>
--- a/lisp/faces.el Fri Jun 04 06:00:59 2004 +0000 +++ b/lisp/faces.el Fri Jun 04 10:12:53 2004 +0000 @@ -244,39 +244,20 @@ If the optional argument FRAME is given, report on face FACE in that frame. If FRAME is t, report on the defaults for face FACE (for new frames). If FRAME is omitted or nil, use the selected frame." - (if (not (equal (face-font face frame) (face-font 'default frame))) - ;; The font is different from the default face's font, so clearly it - ;; differs. This only really works on window-systems; on ttys, the - ;; "font" is a constant, with attributes layered on top of it. - :font - ;; General face attribute check. On graphical displays - ;; `display-supports-face-attributes-p' just checks whether each - ;; attribute is different that the default face, so we just check to - ;; make sure each attribute of the merged face is not `unspecified'; - ;; we already checked the font above, so font-related attributes are - ;; omitted for that reason. On a tty, - ;; display-supports-face-attributes-p actually does do further - ;; checks, and correctly deals with the display's capabilities, so - ;; we use it to check all attributes. - (let ((attrs - (if (memq (framep (or frame (selected-frame))) '(x w32 mac)) - ;; Omit font-related attributes on a window-system - '(:foreground :foreground :background :underline :overline - :strike-through :box :inverse-video :stipple) - ;; On a tty, check all attributes - '(:family :width :height :weight :slant :foreground - :foreground :background :underline :overline - :strike-through :box :inverse-video :stipple))) - (differs nil)) - (while (and attrs (not differs)) - (let* ((attr (pop attrs)) - (attr-val (face-attribute face attr frame t))) - (when (and - (not (eq attr-val 'unspecified)) - (display-supports-face-attributes-p (list attr attr-val) - frame)) - (setq differs attr)))) - differs))) + (let ((attrs + '(:family :width :height :weight :slant :foreground + :foreground :background :underline :overline + :strike-through :box :inverse-video)) + (differs nil)) + (while (and attrs (not differs)) + (let* ((attr (pop attrs)) + (attr-val (face-attribute face attr frame t))) + (when (and + (not (eq attr-val 'unspecified)) + (display-supports-face-attributes-p (list attr attr-val) + frame)) + (setq differs attr)))) + differs)) (defun face-nontrivial-p (face &optional frame)