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
View this message in rfc822 format
> Sometimes Emacs creates a small window such as *log-edit-files*.
> If you go to that window and do C-x b, you enter the name of the buffer
> to switch to as usual, but then see the error
>
> Cannot switch buffers in a dedicated window
>
> This error message should appear earlier, as soon as C-x b is given.
> Emacs should not ask you to type in the new buffer name before it tells
> you that switching buffers is not allowed.
Indeed. Unless someone has a better idea I'll install something like the below.
martin
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -6916,7 +6916,13 @@ window.
Return the buffer switched to."
(interactive
- (list (read-buffer-to-switch "Switch to buffer: ") nil 'force-same-window))
+ (cond
+ ((eq (window-dedicated-p) t)
+ (user-error "Cannot switch buffers in a dedicated window"))
+ ((window-minibuffer-p)
+ (user-error "Cannot switch buffers in minibuffer window"))
+ (t
+ (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.