emacs-devel
[Top][All Lists]
Advanced

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

`q' in debugger with a dedicated *Backtrace* window


From: Drew Adams
Subject: `q' in debugger with a dedicated *Backtrace* window
Date: Sat, 17 Mar 2007 19:42:21 -0700

I use a dedicated window for the debugger: non-nil pop-up-frames and non-nil
window-dedicated-p.

In Emacs 22, when I use `q' in the debugger, the debugger frame is deleted
(disappears). This does not happen in Emacs 20 or 21. To me, this is an
annoying bug. Users might well position or resize the debugger frame
manually or with custom code. `q' means to quit the debugger, but it doesn't
mean to throw away the debugger buffer or frame. The debugger might well be
reentered later, and the user might want to reuse the same frame.

This appears to be the relevant code (in monster function `debug'). In Emacs
21, the code is simply this, which leaves the *Backtrace* frame empty and
available for future use - just what I want:

;; 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 but leave it visible.
(save-excursion
  (set-buffer debugger-buffer)
  (erase-buffer)
  (fundamental-mode))

I agree with that comment, BTW: it *is* now annoying that it is deleted and
recreated in Emacs 22 - the frame, that is.

In Emacs 22, that code has become the following:

(with-current-buffer debugger-buffer
  (erase-buffer)
  (fundamental-mode)
  (with-selected-window (get-buffer-window debugger-buffer 0)
    (when (and (window-dedicated-p (selected-window))
               (not debugger-will-be-back))
      ;; If the window is not dedicated, burying the buffer
      ;; will mean that the frame created for it is left
      ;; around showing some random buffer, and next time we
      ;; pop to the debugger buffer we'll create yet
      ;; another frame.
      ;; If debugger-will-be-back is non-nil, the frame
      ;; would need to be de-iconified anyway immediately
      ;; after when we re-enter the debugger, so iconifying it
      ;; here would cause flashing.
      ;; Use quit-window rather than bury-buffer to quieten
      ;; Drew Adams.  --Stef
      (quit-window))))

To speak to the comment about Drew Adams: Before this was changed to
quit-window, things were even worse - iconifying (with the flashing
mentioned) and bury-buffer were tried. Multiple debugger frames were
created, reproducing like rabbits.

Stefan fixed that problem by using quit-window, which is much better than
the previous Emacs 22 behavior - but it is still worse than what Emacs 20
and 21 did: *nothing*.

Could we please go back to the Emacs 21 behavior in the case of a dedicated,
one-window-p frame - just leave the buffer and frame alone?

If not, please leave the code alone. quit-window is a pain for me, but it is
a lot less of a pain than flashing, iconifying, or burying - I don't want to
risk having something like that again. If we could make the change back to
the simpler behavior for dedicated windows, that would be great. Thanks.

BTW - Judging by appearances, the `debug' function code is a bit haggard. It
seems to have been poked and tweaked to death, without ever having been
rewritten.






reply via email to

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