From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: switch-to-buffer: for interactive use only Date: Wed, 13 Jul 2011 19:18:02 +0200 Message-ID: <4E1DD34A.2040007@gmx.at> References: <0aiprg76eu.fsf@fencepost.gnu.org> <8739ihlsry.fsf@stupidchicken.com> <4E16A728.5040002@gmx.at> <4E170E48.5040408@gmx.at> <4E173412.3090804@gmx.at> <87d3hkmt0k.fsf@stupidchicken.com> <87vcvcmr8y.fsf@stupidchicken.com> <87zkkokwp7.fsf@stupidchicken.com> <871uxzxnme.fsf@stupidchicken.com> <87vcv8c1d7.fsf@stupidchicken.com> <4E1C078A.5090809@gmx.at> <87vcv6191e.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1310579134 30191 80.91.229.12 (13 Jul 2011 17:45:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2011 17:45:34 +0000 (UTC) Cc: Juanma Barranquero , Stefan Monnier , emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 13 19:45:30 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 1Qh3V3-0007yd-0J for ged-emacs-devel@m.gmane.org; Wed, 13 Jul 2011 19:45:29 +0200 Original-Received: from localhost ([::1]:55659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qh3V1-0005Nk-4U for ged-emacs-devel@m.gmane.org; Wed, 13 Jul 2011 13:45:27 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:52104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qh34c-0006Lz-MB for emacs-devel@gnu.org; Wed, 13 Jul 2011 13:18:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qh34a-0007ak-I5 for emacs-devel@gnu.org; Wed, 13 Jul 2011 13:18:10 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:38403) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Qh34Z-0007aL-Up for emacs-devel@gnu.org; Wed, 13 Jul 2011 13:18:08 -0400 Original-Received: (qmail invoked by alias); 13 Jul 2011 17:18:05 -0000 Original-Received: from 62-47-33-116.adsl.highway.telekom.at (EHLO [62.47.33.116]) [62.47.33.116] by mail.gmx.net (mp042) with SMTP; 13 Jul 2011 19:18:05 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/guS86UBngdesj3cewY5Tbri2nZIY/BmeEl5rlYr K5H0x2R4dtlm36 User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: <87vcv6191e.fsf@stupidchicken.com> X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 213.165.64.22 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:142003 Archived-At: > I'm not so concerned about display-buffer-function; it's up to the users > of that to DTRT. As for display-buffer-alist, we can bind it to nil > within switch-to-buffer. 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. Anything wrong with this approach? martin