[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: switch-to-buffer: for interactive use only

From: Glenn Morris
Subject: Re: switch-to-buffer: for interactive use only
Date: Tue, 05 Jul 2011 22:27:24 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Glenn Morris wrote:

> Fix switch-to-buffer?
> Eg make it call pop-to-buffer-same-window in the non-interactive-case?
> Then make a new function
> switch-to-buffer-sometimes-fails-and-you-probably-dont-want-this
> that does what the old version used to?

Or better still, just add an optional MAYBE-FAIL argument to
switch-to-buffer, defaulting to nil, but t in interactive use.
If nil, s-t-b will choose another window if the current one is
unsuitable (eg dedicated or a minibuffer); otherwise it will return an
error. I think that would make the distinction clear.

I mean, say 90% of the current uses of s-t-b are "wrong".
If you fix s-t-b, you've reduced the amount of other code you have to
change by a factor of 9.

On the other hand, if more than say 10% of the current uses are "right",
then you probably should not be saying it should not be used in Lisp

reply via email to

[Prev in Thread] Current Thread [Next in Thread]