From: Richard M. Stallman Date: Mon, 24 Oct 2005 00:10:02 +0000 (+0000) Subject: (inhibit-face-set-after-frame-default): New variable. X-Git-Tag: emacs-pretest-22.0.90~6362 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1df6425458e255f775a7e32588dffa15dc6ea036;p=emacs.git (inhibit-face-set-after-frame-default): New variable. (set-face-attribute): Bind it. (face-set-after-frame-default): Test it. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index baba652072a..bd144672fe3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,10 @@ 2005-10-23 Richard M. Stallman + * faces.el (inhibit-face-set-after-frame-default): New variable. + (set-face-attribute): Bind it. + (face-set-after-frame-default): Test it. + * help-fns.el (describe-simplify-lib-file-name): New function. (describe-function-1, describe-variable): Use it. 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 @@ (autoload 'xw-defined-colors "x-win")) (defvar help-xref-stack-item) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Font selection. @@ -547,6 +546,9 @@ If FACE is a face-alias, get the documentation for the target face." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defvar inhibit-face-set-after-frame-default nil + "If non-nil, that tells `face-set-after-frame-default' to do nothing.") + (defun set-face-attribute (face frame &rest args) "Set attributes of FACE on FRAME from ARGS. @@ -677,9 +679,12 @@ like an underlying face would be, with higher priority than underlying faces." (if (memq where '(0 t)) (put (or (get face 'face-alias) face) 'face-modified t)) (while args - (internal-set-lisp-face-attribute face (car args) - (purecopy (cadr args)) - where) + ;; Don't recursively set the attributes from the frame's font param + ;; when we update the frame's font param fro the attributes. + (let ((inhibit-face-set-after-frame-default t)) + (internal-set-lisp-face-attribute face (car args) + (purecopy (cadr args)) + where)) (setq args (cdr (cdr args)))))) @@ -1730,23 +1735,23 @@ Value is the new frame created." (delete-frame frame))) frame)) - (defun face-set-after-frame-default (frame) "Set frame-local faces of FRAME from face specs and resources. Initialize colors of certain faces from frame parameters." - (if (face-attribute 'default :font t) - (set-face-attribute 'default frame :font - (face-attribute 'default :font t)) - (set-face-attribute 'default frame :family - (face-attribute 'default :family t)) - (set-face-attribute 'default frame :height - (face-attribute 'default :height t)) - (set-face-attribute 'default frame :slant - (face-attribute 'default :slant t)) - (set-face-attribute 'default frame :weight - (face-attribute 'default :weight t)) - (set-face-attribute 'default frame :width - (face-attribute 'default :width t))) + (unless inhibit-face-set-after-frame-default + (if (face-attribute 'default :font t) + (set-face-attribute 'default frame :font + (face-attribute 'default :font t)) + (set-face-attribute 'default frame :family + (face-attribute 'default :family t)) + (set-face-attribute 'default frame :height + (face-attribute 'default :height t)) + (set-face-attribute 'default frame :slant + (face-attribute 'default :slant t)) + (set-face-attribute 'default frame :weight + (face-attribute 'default :weight t)) + (set-face-attribute 'default frame :width + (face-attribute 'default :width t)))) (dolist (face (face-list)) ;; Don't let frame creation fail because of an invalid face spec. (condition-case ()