GNU bug report logs -
#20472
24.4; Cannot switch buffers in a dedicated window - report this error earlier
Previous Next
Reported by: Ed Avis <eda <at> waniasset.com>
Date: Thu, 30 Apr 2015 15:34:02 UTC
Severity: minor
Found in version 24.4
Done: martin rudalics <rudalics <at> gmx.at>
Bug is archived. No further changes may be made.
Full log
Message #23 received at 20472 <at> debbugs.gnu.org (full text, mbox):
> At your service.
Looks OK, thanks (I'm not 100% sure prompting will turn out to be a good
idea, but we can give it a try)
Stefan
> --- a/lisp/window.el
> +++ b/lisp/window.el
> @@ -6887,10 +6887,11 @@ WARNING: This is NOT the way to work on another buffer temporarily
> within a Lisp program! Use `set-buffer' instead. That avoids
> messing with the window-buffer correspondences.
> -If the selected window cannot display the specified
> -buffer (e.g. if it is a minibuffer window or strongly dedicated
> -to another buffer), call `pop-to-buffer' to select the buffer in
> -another window.
> +If the selected window cannot display the specified buffer
> +because it is a minibuffer window or strongly dedicated to
> +another buffer, call `pop-to-buffer' to select the buffer in
> +another window. In interactive use offer to undedicate the
> +selected window before.
> If called interactively, read the buffer name using the
> minibuffer. The variable `confirm-nonexistent-file-or-buffer'
> @@ -6916,7 +6917,15 @@ window.
> Return the buffer switched to."
> (interactive
> - (list (read-buffer-to-switch "Switch to buffer: ") nil 'force-same-window))
> + (let ((force-same-window
> + (and (not (window-minibuffer-p))
> + (or (not (eq (window-dedicated-p) t))
> + (and (y-or-n-p
> + (format "Window is dedicated to %s; undedicate it"
> + (window-buffer)))
> + (or (set-window-dedicated-p nil nil) t)))
> + 'force-same-window)))
> + (list (read-buffer-to-switch "Switch to buffer: ") nil force-same-window)))
> (let ((buffer (window-normalize-buffer-to-switch-to buffer-or-name)))
> (cond
> ;; Don't call set-window-buffer if it's not needed since it
This bug report was last modified 10 years and 84 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.