/[emacs]/emacs/lisp/faces.el
ViewVC logotype

Diff of /emacs/lisp/faces.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.266.2.7 by miles, Tue Jul 6 09:41:25 2004 UTC revision 1.266.2.8 by miles, Tue Jul 6 09:42:25 2004 UTC
# Line 244  If FRAME is omitted or nil, use the sele Line 244  If FRAME is omitted or nil, use the sele
244  If the optional argument FRAME is given, report on face FACE in that frame.  If the optional argument FRAME is given, report on face FACE in that frame.
245  If FRAME is t, report on the defaults for face FACE (for new frames).  If FRAME is t, report on the defaults for face FACE (for new frames).
246  If FRAME is omitted or nil, use the selected frame."  If FRAME is omitted or nil, use the selected frame."
247    (if (not (equal (face-font face frame) (face-font 'default frame)))    (let ((attrs
248        ;; The font is different from the default face's font, so clearly it           '(:family :width :height :weight :slant :foreground
249        ;; differs.  This only really works on window-systems; on ttys, the             :foreground :background :underline :overline
250        ;; "font" is a constant, with attributes layered on top of it.             :strike-through :box :inverse-video))
251        :font          (differs nil))
252      ;; General face attribute check.  On graphical displays      (while (and attrs (not differs))
253      ;; `display-supports-face-attributes-p' just checks whether each        (let* ((attr (pop attrs))
254      ;; attribute is different that the default face, so we just check to               (attr-val (face-attribute face attr frame t)))
255      ;; make sure each attribute of the merged face is not `unspecified';          (when (and
256      ;; we already checked the font above, so font-related attributes are                 (not (eq attr-val 'unspecified))
257      ;; omitted for that reason.  On a tty,                 (display-supports-face-attributes-p (list attr attr-val)
258      ;; display-supports-face-attributes-p actually does do further                                                     frame))
259      ;; checks, and correctly deals with the display's capabilities, so            (setq differs attr))))
260      ;; we use it to check all attributes.      differs))
     (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)))  
261    
262    
263  (defun face-nontrivial-p (face &optional frame)  (defun face-nontrivial-p (face &optional frame)

Legend:
Removed from v.1.266.2.7  
changed lines
  Added in v.1.266.2.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26