[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/faces.el [emacs-unicode-2]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/faces.el [emacs-unicode-2] |
Date: |
Mon, 28 Jun 2004 04:54:12 -0400 |
Index: emacs/lisp/faces.el
diff -c emacs/lisp/faces.el:1.279.4.3 emacs/lisp/faces.el:1.279.4.4
*** emacs/lisp/faces.el:1.279.4.3 Fri Apr 16 12:49:49 2004
--- emacs/lisp/faces.el Mon Jun 28 07:28:39 2004
***************
*** 240,266 ****
(defun face-differs-from-default-p (face &optional frame)
! "Non-nil if FACE displays differently from the default face.
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.
! A face is considered to be ``the same'' as the default face if it is
! actually specified in the same way (equal attributes) or if it is
! fully-unspecified, and thus inherits the attributes of any face it
! is displayed on top of."
! (cond ((eq frame t) (setq frame nil))
! ((null frame) (setq frame (selected-frame))))
! (let* ((v1 (internal-lisp-face-p face frame))
! (n (if v1 (length v1) 0))
! (v2 (internal-lisp-face-p 'default frame))
! (i 1))
! (unless v1
! (error "Not a face: %S" face))
! (while (and (< i n)
! (or (eq 'unspecified (aref v1 i))
! (equal (aref v1 i) (aref v2 i))))
! (setq i (1+ i)))
! (< i n)))
(defun face-nontrivial-p (face &optional frame)
--- 240,263 ----
(defun face-differs-from-default-p (face &optional frame)
! "Return non-nil if FACE displays differently from the default face.
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."
! (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)
***************
*** 1310,1318 ****
(memq 'tty options))
(and (memq 'motif options)
(featurep 'motif))
(and (memq 'lucid options)
(featurep 'x-toolkit)
! (not (featurep 'motif)))
(and (memq 'x-toolkit options)
(featurep 'x-toolkit))))
((eq req 'min-colors)
--- 1307,1318 ----
(memq 'tty options))
(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)
***************
*** 1487,1519 ****
(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)))))
- ;; For now, we assume that non-tty displays can support everything.
- ;; Later, we should add the ability to query about specific fonts,
- ;; colors, etc.
- (or (memq (framep frame) '(x w32 mac))
- (tty-supports-face-attributes-p attributes frame))))
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Background mode.
--- 1487,1492 ----
***************
*** 1777,1783 ****
;; Update a frame's faces when we change its default font.
! (defalias 'frame-update-faces 'ignore)
(make-obsolete 'frame-update-faces "no longer necessary." "21.1")
;; Update the colors of FACE, after FRAME's own colors have been
--- 1750,1756 ----
;; Update a frame's faces when we change its default font.
! (defalias 'frame-update-faces 'ignore "")
(make-obsolete 'frame-update-faces "no longer necessary." "21.1")
;; Update the colors of FACE, after FRAME's own colors have been
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/faces.el [emacs-unicode-2],
Miles Bader <=