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

From: martin rudalics <[email-masked]>
Date: Mon, 08 Sep 2008 15:29:40 +0200

> This is what I get if I toggle-debug-on-error
 > (I hope this is useful?):
 >
 > Debugger entered--Lisp error: (error "Variable binding depth exceeds max-specpdl-size")
 >   framep-on-display(#<frame emacs@baso 0xed2800>)
 >   display-color-cells(#<frame emacs@baso 0xed2800>)
 >   face-spec-set-match-display(((min-colors 88) (class color)) #<frame emacs@baso 0xed2800>)
 >   face-spec-choose((((... ...) (:foreground "white" :background "blue1")) ((...) (:foreground "white" :background "blue")) (t (:slant italic))) #<frame emacs@baso 0xed2800>)
 >   face-spec-match-p(custom-themed (((... ...) (:foreground "white" :background "blue1")) ((...) (:foreground "white" :background "blue")) (t (:slant italic))) #<frame emacs@baso 0xed2800>)
 >   frame-set-background-mode(#<frame emacs@baso 0x10107a0>)
 >   internal-set-lisp-face-attribute(default :background "#ffffff" #<frame emacs@baso 0x10107a0>)
 >   set-face-attribute(default #<frame emacs@baso 0x10107a0> :background "#ffffff")
 >   face-spec-set-2(default #<frame emacs@baso 0x10107a0> ((t :stipple nil :background "#ffffff" :foreground "#000000" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 90 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))
 >   face-spec-recalc(default #<frame emacs@baso 0x10107a0>)
 >   frame-set-background-mode(#<frame emacs@baso 0x10107a0>)
 >   internal-set-lisp-face-attribute(default :background "DarkSlateGray" #<frame emacs@baso 0x10107a0>)
 >   set-face-attribute(default #<frame emacs@baso 0x10107a0> :background "DarkSlateGray")
 >   face-spec-set-2(default #<frame emacs@baso 0x10107a0> ((t (:stipple nil :background "DarkSlateGray" :foreground "wheat" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 121 :width normal :foundry "unknown" :family "DejaVu Sans Mono"))))
 >   face-spec-recalc(default #<frame emacs@baso 0x10107a0>)
 >   frame-set-background-mode(#<frame emacs@baso 0x10107a0>)
[...]
 >   internal-set-lisp-face-attribute(default :background "#ffffff" #<frame emacs@baso 0x10107a0>)
 >   set-face-attribute(default #<frame emacs@baso 0x10107a0> :background "#ffffff")
 >   face-spec-set-2(default #<frame emacs@baso 0x10107a0> ((t :stipple nil :background "#ffffff" :foreground "#000000" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 90 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))
 >   face-spec-recalc(default #<frame emacs@baso 0x10107a0>)
 >   frame-set-background-mode(#<frame emacs@baso 0x10107a0>)
 >   internal-set-lisp-face-attribute(default :background "DarkSlateGray" #<frame emacs@baso 0x10107a0>)
 >   set-face-attribute(default #<frame emacs@baso 0x10107a0> :background "DarkSlateGray")
 >   face-spec-set-2(default #<frame emacs@baso 0x10107a0> ((t (:stipple nil :background "DarkSlateGray" :foreground "wheat" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 121 :width normal :foundry "unknown" :family "DejaVu Sans Mono"))))
 >   face-spec-recalc(default #<frame emacs@baso 0x10107a0>)
 >   frame-set-background-mode(#<frame emacs@baso 0x10107a0>)
 >   x-create-frame-with-faces(nil)
 >   make-frame()
 >   make-frame-command()
 >   call-interactively(make-frame-command nil nil)

IIUC it has entered infinite recursion where `frame-set-background-mode'
is entered over and over again.  Somehow alternating between a "#ffffff"
and "DarkSlateGray" background, very interesting.

But I don't really understand where this happens :-(

martin