all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: martin rudalics <rudalics@gmx.at>
Cc: Juanma Barranquero <lekktu@gmail.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel@gnu.org
Subject: Re: switch-to-buffer: for interactive use only
Date: Wed, 13 Jul 2011 17:53:14 -0400	[thread overview]
Message-ID: <874o2p6e5x.fsf@stupidchicken.com> (raw)
In-Reply-To: <4E1DD34A.2040007@gmx.at> (martin rudalics's message of "Wed, 13 Jul 2011 19:18:02 +0200")

martin rudalics <rudalics@gmx.at> writes:

> I think that we want two types of `switch-to-buffer' functions:
>
> (1) The one where using any window but the selected doesn't make sense.
>     This seems the case for C-x b and maybe a few other cases.  We could
>     use a `set-window-buffer' based function here and error out if the
>     selected window is strongly dedicated or the minibuffer window.
>     Call this function `switch-to-buffer-same-window' and bind C-x b to
>     it.  This function would be marked as not callable from Elisp.
>
> (2) A function that pops to a buffer, preferably in the selected window.
>     This is the case for almost all other calls of `switch-to-buffer'.
>     For this we could rewrite `switch-to-buffer' to call `pop-to-buffer'
>     with the 'same-window argument and, if Stefan insists, make it reuse
>     the same window even if it's weakly dedicated.  This function would
>     be callable from Elisp.

C-x b is usually called because the user wants to go to another buffer,
so if the selected window absolutely can't be used then it's better for
the command should intelligently handle it by using another window.

As for non-interactive usage, that's addressed by the FORCE-SAME-WINDOW
argument.  Those callers that want to force selecting the same window
specific can use this arg, so we don't need a different function.

After discussing with Stefan off-list, I've committed the change to
switch-to-buffer that adds the FORCE-SAME-WINDOW argument.  I'll get to
changing the callers shortly.



  reply	other threads:[~2011-07-13 21:53 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05 21:40 switch-to-buffer: for interactive use only Glenn Morris
2011-07-05 23:23 ` Juanma Barranquero
2011-07-05 23:32   ` Glenn Morris
2011-07-05 23:34     ` Juanma Barranquero
2011-07-05 23:41     ` Juanma Barranquero
2011-07-06  1:18 ` Stefan Monnier
2011-07-06  1:49   ` Glenn Morris
2011-07-06  2:27     ` Glenn Morris
2011-07-06  5:55     ` Andreas Röhler
2011-07-06 21:10   ` Chong Yidong
2011-07-07  9:19     ` Štěpán Němec
2011-07-07 19:52     ` Stefan Monnier
2011-07-07 20:50       ` Chong Yidong
2011-07-07 21:11         ` Stefan Monnier
2011-07-07 23:39           ` Chong Yidong
2011-07-08  0:09             ` Juanma Barranquero
2011-07-08  1:12               ` Chong Yidong
2011-07-08  6:44               ` martin rudalics
2011-07-08  6:44             ` martin rudalics
2011-07-08  6:43           ` martin rudalics
2011-07-08 12:57             ` Stefan Monnier
2011-07-08 14:03               ` martin rudalics
2011-07-08 15:46                 ` Stefan Monnier
2011-07-08 16:45                   ` martin rudalics
2011-07-08 18:46                     ` Stefan Monnier
2011-07-08 20:12                       ` Chong Yidong
2011-07-08 20:34                         ` Juanma Barranquero
2011-07-08 20:50                           ` Chong Yidong
2011-07-08 23:16                             ` Juanma Barranquero
2011-07-09  2:35                               ` Chong Yidong
2011-07-09  3:09                                 ` Stefan Monnier
2011-07-09  8:45                                   ` martin rudalics
2011-07-11  3:41                                     ` Stefan Monnier
2011-07-11  9:43                                       ` martin rudalics
2011-07-09 19:25                                   ` Chong Yidong
2011-07-10  9:00                                     ` martin rudalics
2011-07-10 13:09                                       ` Chong Yidong
2011-07-10 13:31                                         ` martin rudalics
2011-07-11  3:45                                     ` Stefan Monnier
2011-07-11 14:56                                       ` Chong Yidong
2011-07-12  4:25                                         ` Stefan Monnier
2011-07-12  8:36                                           ` martin rudalics
2011-07-13 15:42                                             ` Chong Yidong
2011-07-13 17:18                                               ` martin rudalics
2011-07-13 21:53                                                 ` Chong Yidong [this message]
2011-07-09  8:45                                 ` martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2011-07-13 22:13 grischka

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=874o2p6e5x.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --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.