From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: switch-to-buffer: for interactive use only Date: Thu, 07 Jul 2011 19:39:56 -0400 Message-ID: <871uy1u0c3.fsf@stupidchicken.com> References: <0aiprg76eu.fsf@fencepost.gnu.org> <87hb6zt8rg.fsf@stupidchicken.com> <8739ihlsry.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1310082022 20677 80.91.229.12 (7 Jul 2011 23:40:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 7 Jul 2011 23:40:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 08 01:40:18 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 1QeyB6-0004QQ-MD for ged-emacs-devel@m.gmane.org; Fri, 08 Jul 2011 01:40:16 +0200 Original-Received: from localhost ([::1]:38907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeyB5-0005O8-GK for ged-emacs-devel@m.gmane.org; Thu, 07 Jul 2011 19:40:15 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeyAr-0005N0-Q1 for emacs-devel@gnu.org; Thu, 07 Jul 2011 19:40:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QeyAq-0006i6-UF for emacs-devel@gnu.org; Thu, 07 Jul 2011 19:40:01 -0400 Original-Received: from vm-emlprdomr-02.its.yale.edu ([130.132.50.143]:47163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeyAp-0006hq-C0; Thu, 07 Jul 2011 19:39:59 -0400 Original-Received: from furball (dhcp128036225024.central.yale.edu [128.36.225.24]) (authenticated bits=0) by vm-emlprdomr-02.its.yale.edu (8.14.4/8.14.4) with ESMTP id p67NduIX020259 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 7 Jul 2011 19:39:57 -0400 In-Reply-To: (Stefan Monnier's message of "Thu, 07 Jul 2011 17:11:56 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Scanned-By: MIMEDefang 2.71 on 130.132.50.143 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 130.132.50.143 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:141762 Archived-At: Stefan Monnier writes: > There are two different uses of switch-to-buffer: > - the ones like in unbury-buffer where the main point is that it > operates on the selected window. > - the ones like in find-file where the main point is that it wants to > display a given buffer. > > In single-frame circumstances, the two cases are identical, so most > authors who use Emacs in a single-frame mode don't even realize that > there's a choice to be made. > > Until Emacs-23, switch-to-buffer assumed the main point was to only > affect the selected-window (and hence signal an error if the switch is > not possible). > > In Emacs-23, I've changed it to assume that the main point is to > display the given buffer (by delegating the job to pop-to-buffer if > necessary). > > Recently, I reverted my Emacs-23 change because it introduced bugs > (e.g. in unbury-buffer and bs--cycle-next). How bout if switch-to-buffer tries to operate on the selected window, and calls pop-to-buffer if that is not possible?