GNU bug report logs - #20472
24.4; Cannot switch buffers in a dedicated window - report this error earlier

Previous Next

Package: emacs;

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 #8 received at 20472 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Ed Avis <eda <at> waniasset.com>, 20472 <at> debbugs.gnu.org
Subject: Re: bug#20472: 24.4; Cannot switch buffers in a dedicated window
 - report this error earlier
Date: Thu, 30 Apr 2015 18:30:00 +0200
> 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.