all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* `q' in debugger with a dedicated *Backtrace* window
@ 2007-03-18  2:42 Drew Adams
  2007-03-18  3:29 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Drew Adams @ 2007-03-18  2:42 UTC (permalink / raw)
  To: Emacs-Devel

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-03-18 21:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-18  2:42 `q' in debugger with a dedicated *Backtrace* window Drew Adams
2007-03-18  3:29 ` Stefan Monnier
2007-03-18  7:42   ` Drew Adams
2007-03-18 21:02     ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.