[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/faces.el,v
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/faces.el,v |
Date: |
Thu, 02 Oct 2008 20:19:25 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Chong Yidong <cyd> 08/10/02 20:19:25
Index: faces.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/faces.el,v
retrieving revision 1.425
retrieving revision 1.426
diff -u -b -r1.425 -r1.426
--- faces.el 24 Sep 2008 16:15:09 -0000 1.425
+++ faces.el 2 Oct 2008 20:19:24 -0000 1.426
@@ -1839,10 +1839,13 @@
(declare-function x-get-resource "frame.c"
(attribute class &optional component subclass))
+(defvar inhibit-frame-set-background-mode nil)
+
(defun frame-set-background-mode (frame)
"Set up display-dependent faces on FRAME.
Display-dependent faces are those which have different definitions
according to the `background-mode' and `display-type' frame parameters."
+ (unless inhibit-frame-set-background-mode
(let* ((bg-resource
(and (window-system frame)
(x-get-resource "backgroundMode" "BackgroundMode")))
@@ -1851,8 +1854,7 @@
(tty-type (tty-type frame))
(bg-mode
(cond (frame-background-mode)
- (bg-resource
- (intern (downcase bg-resource)))
+ (bg-resource (intern (downcase bg-resource)))
(terminal-bg-mode)
((and (null (window-system frame))
;; Unspecified frame background color can only
@@ -1893,13 +1895,17 @@
(frame-parameter frame 'display-type)))
(unless (and (eq bg-mode old-bg-mode) (eq display-type old-display-type))
- (let ((locally-modified-faces nil))
- ;; Before modifying the frame parameters, we collect a list of
- ;; faces that don't match what their face-spec says they should
- ;; look like; we then avoid changing these faces below.
- ;; These are the faces whose attributes were modified on FRAME.
- ;; We use a negative list on the assumption that most faces will
- ;; be unmodified, so we can avoid consing in the common case.
+ (let ((locally-modified-faces nil)
+ ;; Prevent face-spec-recalc from calling this function
+ ;; again, resulting in a loop (bug#911).
+ (inhibit-frame-set-background-mode t))
+ ;; Before modifying the frame parameters, collect a list of
+ ;; faces that don't match what their face-spec says they
+ ;; should look like. We then avoid changing these faces
+ ;; below. These are the faces whose attributes were
+ ;; modified on FRAME. We use a negative list on the
+ ;; assumption that most faces will be unmodified, so we can
+ ;; avoid consing in the common case.
(dolist (face (face-list))
(and (not (get face 'face-override-spec))
(not (face-spec-match-p face
@@ -1914,7 +1920,7 @@
;; parameters, unless they have been locally modified.
(dolist (face (face-list))
(unless (memq face locally-modified-faces)
- (face-spec-recalc face frame)))))))
+ (face-spec-recalc face frame))))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- [Emacs-diffs] Changes to emacs/lisp/faces.el,v,
Chong Yidong <=
- [Emacs-diffs] Changes to emacs/lisp/faces.el,v, Dan Nicolaescu, 2008/10/03
- [Emacs-diffs] Changes to emacs/lisp/faces.el,v, Dan Nicolaescu, 2008/10/06
- [Emacs-diffs] Changes to emacs/lisp/faces.el,v, Chong Yidong, 2008/10/12
- [Emacs-diffs] Changes to emacs/lisp/faces.el,v, Chong Yidong, 2008/10/14
- [Emacs-diffs] Changes to emacs/lisp/faces.el,v, Chong Yidong, 2008/10/17
- [Emacs-diffs] Changes to emacs/lisp/faces.el,v, Stefan Monnier, 2008/10/26