all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: martin rudalics <rudalics@gmx.at>
Cc: 20472@debbugs.gnu.org, Ed Avis <eda@waniasset.com>
Subject: bug#20472: 24.4; Cannot switch buffers in a dedicated window - report this error earlier
Date: Sun, 03 May 2015 21:31:42 -0400	[thread overview]
Message-ID: <jwvr3qx5dtc.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <5544916C.3020200@gmx.at> (martin rudalics's message of "Sat, 02 May 2015 10:57:16 +0200")

> 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







  reply	other threads:[~2015-05-04  1:31 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
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 [this message]
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

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

  git send-email \
    --in-reply-to=jwvr3qx5dtc.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=20472@debbugs.gnu.org \
    --cc=eda@waniasset.com \
    --cc=rudalics@gmx.at \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.