[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: creating new frame doesn't get faces right
From: |
Richard Stallman |
Subject: |
Re: creating new frame doesn't get faces right |
Date: |
Tue, 27 May 2003 08:46:00 -0400 |
(set-face-attribute 'mode-line nil
:foreground "DarkSlateGrey" :background "Wheat")
The face is set correctly in the current frame. For some reason,
however, M-x customize-face reports that "this face is unchanged from
its standard setting".
The change below fixes that for me.
If I then create a new frame, the mode-line face gets :inverse-video
turned on from somewhere, and loses its :box attribute. M-x
customize-face still doesn't think the face has changed.
That did not fail for me (after the changes below).
*** faces.el.~1.277.~ Mon May 19 10:44:22 2003
--- faces.el Tue May 27 07:02:34 2003
***************
*** 664,669 ****
--- 664,672 ----
like an underlying face would be, with higher priority than underlying faces."
(let ((where (if (null frame) 0 frame)))
(setq args (purecopy args))
+ ;; If we set the new-frame defaults, this face is modified outside Custom.
+ (if (memq where '(0 t))
+ (put face 'face-modified t))
(while args
(internal-set-lisp-face-attribute face (car args)
(purecopy (cadr args))
***************
*** 1378,1384 ****
(setq attribute nil))))
(when attribute
(set-face-attribute face frame attribute value)))
! (setq attrs (cdr (cdr attrs))))))
(defun face-attr-match-p (face attrs &optional frame)
--- 1381,1391 ----
(setq attribute nil))))
(when attribute
(set-face-attribute face frame attribute value)))
! (setq attrs (cdr (cdr attrs)))))
! ;; When we reset the face based on its spec, then it is unmodified
! ;; as far as Custom is concerned.
! (if (null frame)
! (put face 'face-modified nil)))
(defun face-attr-match-p (face attrs &optional frame)
***************
*** 1657,1664 ****
(progn
(x-handle-reverse-video frame parameters)
(frame-set-background-mode frame)
! ;; No need to call `face-set-after-frame-default'
! ;; since x-create-frame does that.
(if (or (null frame-list) (null visibility-spec))
(make-frame-visible frame)
(modify-frame-parameters frame (list visibility-spec)))
--- 1664,1670 ----
(progn
(x-handle-reverse-video frame parameters)
(frame-set-background-mode frame)
! (face-set-after-frame-default frame)
(if (or (null frame-list) (null visibility-spec))
(make-frame-visible frame)
(modify-frame-parameters frame (list visibility-spec)))
*** cus-edit.el.~1.180.~ Mon Mar 24 14:37:49 2003
--- cus-edit.el Tue May 27 06:55:12 2003
***************
*** 2982,3009 ****
"Set the state of WIDGET."
(let* ((symbol (widget-value widget))
(comment (get symbol 'face-comment))
! tmp temp)
! (widget-put widget :custom-state
! (cond ((progn
! (setq tmp (get symbol 'customized-face))
! (setq temp (get symbol 'customized-face-comment))
! (or tmp temp))
! (if (equal temp comment)
! 'set
! 'changed))
! ((progn
! (setq tmp (get symbol 'saved-face))
! (setq temp (get symbol 'saved-face-comment))
! (or tmp temp))
! (if (equal temp comment)
! 'saved
! 'changed))
! ((get symbol 'face-defface-spec)
! (if (equal comment nil)
! 'standard
! 'changed))
! (t
! 'rogue)))))
(defun custom-face-action (widget &optional event)
"Show the menu for `custom-face' WIDGET.
--- 2982,3013 ----
"Set the state of WIDGET."
(let* ((symbol (widget-value widget))
(comment (get symbol 'face-comment))
! tmp temp
! (state
! (cond ((progn
! (setq tmp (get symbol 'customized-face))
! (setq temp (get symbol 'customized-face-comment))
! (or tmp temp))
! (if (equal temp comment)
! 'set
! 'changed))
! ((progn
! (setq tmp (get symbol 'saved-face))
! (setq temp (get symbol 'saved-face-comment))
! (or tmp temp))
! (if (equal temp comment)
! 'saved
! 'changed))
! ((get symbol 'face-defface-spec)
! (if (equal comment nil)
! 'standard
! 'changed))
! (t
! 'rogue))))
! (if (and (not (eq state 'rogue))
! (get symbol 'face-modified))
! (setq state 'changed))
! (widget-put widget :custom-state state)))
(defun custom-face-action (widget &optional event)
"Show the menu for `custom-face' WIDGET.