aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2005-10-24 00:10:02 +0000
committerRichard M. Stallman2005-10-24 00:10:02 +0000
commit1df6425458e255f775a7e32588dffa15dc6ea036 (patch)
tree4bf36af642e6a76723b53adefab680e15e99b0be
parent96664fc024a17519ec5cc14f054a01bd7250975e (diff)
downloademacs-1df6425458e255f775a7e32588dffa15dc6ea036.tar.gz
emacs-1df6425458e255f775a7e32588dffa15dc6ea036.zip
(inhibit-face-set-after-frame-default): New variable.
(set-face-attribute): Bind it. (face-set-after-frame-default): Test it.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/faces.el41
2 files changed, 27 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index baba652072a..bd144672fe3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -4,6 +4,10 @@
4 4
52005-10-23 Richard M. Stallman <rms@gnu.org> 52005-10-23 Richard M. Stallman <rms@gnu.org>
6 6
7 * faces.el (inhibit-face-set-after-frame-default): New variable.
8 (set-face-attribute): Bind it.
9 (face-set-after-frame-default): Test it.
10
7 * help-fns.el (describe-simplify-lib-file-name): New function. 11 * help-fns.el (describe-simplify-lib-file-name): New function.
8 (describe-function-1, describe-variable): Use it. 12 (describe-function-1, describe-variable): Use it.
9 13
diff --git a/lisp/faces.el b/lisp/faces.el
index c69354f38fb..81a6a953aa5 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -33,7 +33,6 @@
33 (autoload 'xw-defined-colors "x-win")) 33 (autoload 'xw-defined-colors "x-win"))
34 34
35(defvar help-xref-stack-item) 35(defvar help-xref-stack-item)
36
37 36
38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
39;;; Font selection. 38;;; Font selection.
@@ -547,6 +546,9 @@ If FACE is a face-alias, get the documentation for the target face."
547;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 546;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
548 547
549 548
549(defvar inhibit-face-set-after-frame-default nil
550 "If non-nil, that tells `face-set-after-frame-default' to do nothing.")
551
550(defun set-face-attribute (face frame &rest args) 552(defun set-face-attribute (face frame &rest args)
551 "Set attributes of FACE on FRAME from ARGS. 553 "Set attributes of FACE on FRAME from ARGS.
552 554
@@ -677,9 +679,12 @@ like an underlying face would be, with higher priority than underlying faces."
677 (if (memq where '(0 t)) 679 (if (memq where '(0 t))
678 (put (or (get face 'face-alias) face) 'face-modified t)) 680 (put (or (get face 'face-alias) face) 'face-modified t))
679 (while args 681 (while args
680 (internal-set-lisp-face-attribute face (car args) 682 ;; Don't recursively set the attributes from the frame's font param
681 (purecopy (cadr args)) 683 ;; when we update the frame's font param fro the attributes.
682 where) 684 (let ((inhibit-face-set-after-frame-default t))
685 (internal-set-lisp-face-attribute face (car args)
686 (purecopy (cadr args))
687 where))
683 (setq args (cdr (cdr args)))))) 688 (setq args (cdr (cdr args))))))
684 689
685 690
@@ -1730,23 +1735,23 @@ Value is the new frame created."
1730 (delete-frame frame))) 1735 (delete-frame frame)))
1731 frame)) 1736 frame))
1732 1737
1733
1734(defun face-set-after-frame-default (frame) 1738(defun face-set-after-frame-default (frame)
1735 "Set frame-local faces of FRAME from face specs and resources. 1739 "Set frame-local faces of FRAME from face specs and resources.
1736Initialize colors of certain faces from frame parameters." 1740Initialize colors of certain faces from frame parameters."
1737 (if (face-attribute 'default :font t) 1741 (unless inhibit-face-set-after-frame-default
1738 (set-face-attribute 'default frame :font 1742 (if (face-attribute 'default :font t)
1739 (face-attribute 'default :font t)) 1743 (set-face-attribute 'default frame :font
1740 (set-face-attribute 'default frame :family 1744 (face-attribute 'default :font t))
1741 (face-attribute 'default :family t)) 1745 (set-face-attribute 'default frame :family
1742 (set-face-attribute 'default frame :height 1746 (face-attribute 'default :family t))
1743 (face-attribute 'default :height t)) 1747 (set-face-attribute 'default frame :height
1744 (set-face-attribute 'default frame :slant 1748 (face-attribute 'default :height t))
1745 (face-attribute 'default :slant t)) 1749 (set-face-attribute 'default frame :slant
1746 (set-face-attribute 'default frame :weight 1750 (face-attribute 'default :slant t))
1747 (face-attribute 'default :weight t)) 1751 (set-face-attribute 'default frame :weight
1748 (set-face-attribute 'default frame :width 1752 (face-attribute 'default :weight t))
1749 (face-attribute 'default :width t))) 1753 (set-face-attribute 'default frame :width
1754 (face-attribute 'default :width t))))
1750 (dolist (face (face-list)) 1755 (dolist (face (face-list))
1751 ;; Don't let frame creation fail because of an invalid face spec. 1756 ;; Don't let frame creation fail because of an invalid face spec.
1752 (condition-case () 1757 (condition-case ()