GNU bug report logs -
#8789
23.3; debug backtrace buffer changes window on step-through
Previous Next
Reported by: Pete Beardmore <pete.beardmore <at> msn.com>
Date: Thu, 2 Jun 2011 17:28:02 UTC
Severity: normal
Found in version 23.3
Done: martin rudalics <rudalics <at> gmx.at>
Bug is archived. No further changes may be made.
Full log
Message #35 received at 8789 <at> debbugs.gnu.org (full text, mbox):
> We could also try `window-prev-buffers' and `window-next-buffers' as in
> the rather untested patch below.
Sounds good for the backtrace buffer, but the patch you propose would
affect many more cases, and while I think it might be good to do it
globally like you suggest, I wouldn't want to make such a change so late
in the pretest.
Can you provide another patch that limits the effect to the
backtrace buffer?
Stefan
> === modified file 'lisp/window.el'
> --- lisp/window.el 2012-02-12 05:10:30 +0000
> +++ lisp/window.el 2012-02-15 16:54:41 +0000
> @@ -4846,6 +4846,39 @@
> (and pop-up-windows
> (display-buffer-pop-up-window buffer alist))))
> +(defun window-previously-showing (buffer &optional all-frames dedicated)
> + "Return a window that previously showed BUFFER.
> +A minibuffer window is never a candidate. A dedicated window is
> +never a candidate unless DEDICATED is non-nil, so if all windows
> +are dedicated, the value is nil. Avoid returning the selected
> +window if possible.
> +
> +The following non-nil values of the optional argument ALL-FRAMES
> +have special meanings:
> +
> +- t means consider all windows on all existing frames.
> +
> +- `visible' means consider all windows on all visible frames on
> + the current terminal.
> +
> +- 0 (the number zero) means consider all windows on all visible
> + and iconified frames on the current terminal.
> +
> +- A frame means consider all windows on that frame only.
> +
> +Any other value of ALL-FRAMES means consider all windows on the
> +selected frame and no others."
> + (let (best-window second-best-window)
> + (dolist (window (window-list-1 nil 'nomini all-frames))
> + (when (and (or (assq buffer (window-prev-buffers window))
> + (assq buffer (window-next-buffers window)))
> + (or dedicated (not (window-dedicated-p window))))
> + (if (eq window (selected-window))
> + (setq second-best-window window)
> + ;; We probably should throw WINDOW here.
> + (setq best-window window))))
> + (or best-window second-best-window)))
> +
> (defun display-buffer-use-some-window (buffer alist)
> "Display BUFFER in an existing window.
> Search for a usable window, set that window to the buffer, and
> @@ -4864,7 +4897,8 @@
> (unwind-protect
> (setq window
> ;; Reuse an existing window.
> - (or (get-lru-window frame)
> + (or (window-previously-showing buffer 'visible)
> + (get-lru-window frame)
> (let ((window (get-buffer-window buffer 'visible)))
> (unless (and not-this-window
> (eq window (selected-window)))
This bug report was last modified 12 years and 223 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.