[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: debugger with pop-up-frames non-nil: keeps creating new frames

From: Stefan Monnier
Subject: Re: debugger with pop-up-frames non-nil: keeps creating new frames
Date: Mon, 06 Jun 2005 15:40:43 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> I get the same bugged behavior (in Emacs -q) when these are both `t':
>> pop-up-frames
>> display-buffer-reuse-frames
>> In fact, it is in such a setup that I first discovered the bug.
>     Could you post a detailed recipe, so I can try and reproduce 
>     the problem?
>     A detailed recipe starts with "emacs -q --no-site-file" and 
>     lists every
>     key typed along with the expected result.
> 1. runemacs.exe -q --no-site-file
> 2. M-x set-variable RET pop-up-frames RET t RET
> 3. M-x set-variable RET display-buffer-reuse-frames RET t RET
> 4. M-x debug-on-entry RET describe-variable RET
> 5. M-x describe-variable RET display-buffer-reuse-frames RET
> 6. (in debugger): d d d d...

> With each `d' in the debugger, a new frame is created.

Oh, I didn't realize you were talking about a new problem not present in
Emacs-21.4.  I actually introduced this problem in the following change:

   revision 1.65
   date: 2005/02/26 05:28:24;  author: monnier;  state: Exp;  lines: +46 -47
   (debug): Hide the buffer if it's not killed.
   Remove unused and inexistent var `inhibit-trace'.
   (debugger-mode): Use run-mode-hooks.
   (debugger-list-functions): Add buttons; setup xref stack.

Can you try the fix below and confirm that it solves your problem?


--- orig/lisp/emacs-lisp/debug.el
+++ mod/lisp/emacs-lisp/debug.el
@@ -213,12 +213,18 @@
              ;; Still visible despite the save-window-excursion?  Maybe it
              ;; it's in a pop-up frame.  It would be annoying to delete and
              ;; recreate it every time the debugger stops, so instead we'll
-             ;; erase it and hide it but keep it alive.
+             ;; erase it (and maybe hide it) but keep it alive.
              (with-current-buffer debugger-buffer
                (with-selected-window (get-buffer-window debugger-buffer 0)
-                 (bury-buffer)))
+                  (when (window-dedicated-p (selected-window))
+                    ;; If the window is not dedicated, burying the buffer
+                    ;; will mean that the frame created for it is left
+                    ;; around showing smoe random buffer, and next time we
+                    ;; pop to the debugger buffer we'll create yet
+                    ;; another frame.
+                    (bury-buffer))))
            (kill-buffer debugger-buffer))
          (set-match-data debugger-outer-match-data)))
       ;; Put into effect the modified values of these variables

reply via email to

[Prev in Thread] Current Thread [Next in Thread]