From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: C-x b w/Multiple Windows and Frames Date: Fri, 17 Nov 2006 09:52:08 -0700 Organization: IHS Message-ID: References: <814532.81035.qm@web32808.mail.mud.yahoo.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1163782563 21404 80.91.229.2 (17 Nov 2006 16:56:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 17 Nov 2006 16:56:03 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 17 17:56:03 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Gl6zZ-0007MD-8b for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Nov 2006 17:55:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gl6zY-0007ph-Rt for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Nov 2006 11:55:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gl6zJ-0007mP-E5 for help-gnu-emacs@gnu.org; Fri, 17 Nov 2006 11:54:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gl6zH-0007iI-Hb for help-gnu-emacs@gnu.org; Fri, 17 Nov 2006 11:54:48 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gl6zH-0007hw-Dm for help-gnu-emacs@gnu.org; Fri, 17 Nov 2006 11:54:47 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Gl6zH-0006pS-7o for help-gnu-emacs@gnu.org; Fri, 17 Nov 2006 11:54:47 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Gl6xz-0006ww-SG for help-gnu-emacs@gnu.org; Fri, 17 Nov 2006 17:53:28 +0100 Original-Received: from 207.167.42.206 ([207.167.42.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Nov 2006 17:53:27 +0100 Original-Received: from ihs_4664 by 207.167.42.206 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 17 Nov 2006 17:53:27 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 24 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.206 User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) In-Reply-To: <814532.81035.qm@web32808.mail.mud.yahoo.com> X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:38773 Archived-At: Alan Lue wrote: > Using `C-x b' without an argument displays the most > recent buffer among those not currently displayed. I > find this behavior annoying when I intend to keep the > same buffer displayed in multiple windows and frames; > oftentimes I need to briefly visit another file, and > when I return to a buffer that is already displayed in > another frames, I need to specify its name explicity. > > Is there some way I could modify the behavior of > `switch-to-buffer' so that invoking `C-x b' without an > argument will bring me back to the most recent buffer, > whether or not it is currently displayed in another > window/frame? Try this: (defadvice switch-to-buffer (before interactive-default-buffer activate) "Consider buffers that are already visible as the default BUFFER." (interactive (list (read-buffer "Switch to buffer: " (other-buffer (current-buffer) t))))) -- Kevin