From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: switch-to-buffer: for interactive use only Date: Tue, 05 Jul 2011 22:27:24 -0400 Message-ID: References: <0aiprg76eu.fsf@fencepost.gnu.org> <9x62ngw53l.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1309919266 21432 80.91.229.12 (6 Jul 2011 02:27:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 6 Jul 2011 02:27:46 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 06 04:27:42 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QeHq1-0006ll-N3 for ged-emacs-devel@m.gmane.org; Wed, 06 Jul 2011 04:27:41 +0200 Original-Received: from localhost ([::1]:51084 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeHq0-00069M-8q for ged-emacs-devel@m.gmane.org; Tue, 05 Jul 2011 22:27:40 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeHpm-00068p-HJ for emacs-devel@gnu.org; Tue, 05 Jul 2011 22:27:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QeHpl-0005dr-N3 for emacs-devel@gnu.org; Tue, 05 Jul 2011 22:27:26 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:37716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeHpl-0005dn-IN for emacs-devel@gnu.org; Tue, 05 Jul 2011 22:27:25 -0400 Original-Received: from localhost ([127.0.0.1]:53349) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeHpk-0000LC-MC; Tue, 05 Jul 2011 22:27:24 -0400 X-Spook: Guantanamo Nazi Ceridian SDI doctrine Tony Blair anthrax X-Ran: gv(]/i (Glenn Morris's message of "Tue, 05 Jul 2011 21:49:34 -0400") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.10 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:141637 Archived-At: 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 code.