GNU bug report logs - #911
23.0.60; custom-set-faces causes "New Frame" to fail (max-specpdl-size)

Previous Next

Package: emacs;

Reported by: Ian Miller <emacs <at> soroban.fastmail.fm>

Date: Sun, 7 Sep 2008 11:45:04 UTC

Severity: normal

Tags: unreproducible

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Chong Yidong <cyd <at> stupidchicken.com>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 911 <at> debbugs.gnu.org, Ian Miller <ian <at> soroban.fastmail.fm>
Subject: bug#911: 23.0.60; custom-set-faces causes "New Frame" to fail
Date: Sun, 28 Sep 2008 17:13:02 -0400
> > Why not in frame-set-background-mode itself?  Then, when it's set,
> > subsequent calls to that function could be no-ops.
>
> We have to reset it eventually.  And we have to cater for the situation
> that a user might want to open two frames in one and the same command.
> So I suppose the only reliable place is the command loop.  And we must
> make sure that the background determined by the user is considered.

I'm not sure what you mean.  To be precise, here's a patch implementing
the approach I'm suggesting (indentated for readability).  Would it
work?

(I can't reproduce the original bug myself, so maybe Ian can test it.)


*** trunk/lisp/faces.el.~1.425.~	2008-09-24 12:51:07.000000000 -0400
--- trunk/lisp/faces.el	2008-09-28 17:10:55.000000000 -0400
***************
*** 1839,1848 ****
--- 1839,1851 ----
  (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")))
***************
*** 1893,1899 ****
  	  (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.
--- 1896,1905 ----
  	  (frame-parameter frame 'display-type)))
  
      (unless (and (eq bg-mode old-bg-mode) (eq display-type old-display-type))
!       (let ((locally-modified-faces nil)
! 	    ;; Prevent face-spec-recalc from calling this function
! 	    ;; again, resulting in a loop.
! 	    (inhibit-frame-set-background-mode t))
  	;; 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.
***************
*** 1915,1920 ****
--- 1921,1927 ----
  	(dolist (face (face-list))
  	  (unless (memq face locally-modified-faces)
  	    (face-spec-recalc face frame)))))))
+ )
  
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;




This bug report was last modified 16 years and 234 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.