unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Ed Avis <eda@waniasset.com>, 20472@debbugs.gnu.org
Subject: bug#20472: 24.4; Cannot switch buffers in a dedicated window - report this error earlier
Date: Thu, 30 Apr 2015 18:30:00 +0200	[thread overview]
Message-ID: <55425888.6080106@gmx.at> (raw)
In-Reply-To: <7E039918541B4C4183BFDB8F015C743032E18D99@WCL-EXCH02.wcl.local>

 > 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






  reply	other threads:[~2015-04-30 16:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30 15:33 bug#20472: 24.4; Cannot switch buffers in a dedicated window - report this error earlier Ed Avis
2015-04-30 16:30 ` martin rudalics [this message]
2015-05-01  1:46   ` Stefan Monnier
2015-05-01 10:41     ` martin rudalics
2015-05-01 18:06       ` Stefan Monnier
2015-05-02  8:57         ` martin rudalics
2015-05-04  1:31           ` Stefan Monnier
2015-05-05  9:18             ` martin rudalics
2015-05-20  9:47               ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55425888.6080106@gmx.at \
    --to=rudalics@gmx.at \
    --cc=20472@debbugs.gnu.org \
    --cc=eda@waniasset.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).