From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ben Barrowes Newsgroups: gmane.emacs.help Subject: Re: how to switch to last visited buffer in other window ? Date: Thu, 27 Jan 2005 11:34:59 -0700 Message-ID: <41f93453$1_5@news3.es.net> References: <41f81888$1_2@news3.es.net> <41f8f6f3$1_1@news3.es.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1106851151 21100 80.91.229.6 (27 Jan 2005 18:39:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 27 Jan 2005 18:39:11 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 27 19:38:44 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CuEXU-0002kj-00 for ; Thu, 27 Jan 2005 19:38:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CuEjq-0001hP-2o for geh-help-gnu-emacs@m.gmane.org; Thu, 27 Jan 2005 13:51:30 -0500 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en Original-Newsgroups: gnu.emacs.help In-Reply-To: Original-NNTP-Posting-Host: barrowes.lanl.gov Original-X-Trace: news3.es.net 1106850899 128.165.205.14 (27 Jan 2005 10:34:59 -0800) Original-Lines: 44 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!newsfeed2.telusplanet.net!newsfeed.telus.net!news.glorb.com!mpls-transit-01.news.qwest.net!feed.news.qwest.net!news3.es.net!not-for-mail Original-Xref: shelby.stanford.edu gnu.emacs.help:128201 Original-To: help-gnu-emacs@gnu.org 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: main.gmane.org gmane.emacs.help:23703 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23703 switch-to-buffer isn't sufficient. When switch-to-buffer is called, it defaults to taking you to currently undusplayed buffer, or you can scroll through buffer-name-history, which doesn't always list the last buffer you visited last. I want to visit the last buffer I visited before the present one in the other buffer's window. Problem is I can't seem to find out a way to switch back when I don't know the name of the buffer I came from. Ben Dodge, Edwardx K wrote: > Ben Barrowes writes: > > M-x switch-to-buffer > >>This just switches to the next buffer window in some predetermined >>list. I want to go to the last buffer visited before the current >>buffer regardless of how I got there. >> >>BTW, other-buffer didn't do anything on my emacs, other-window worked, >>though... >> >> >>Mathias Dahl wrote: >> >>>Ben Barrowes writes: >>> >>> >>>>When using emacs, I typically have 5 or so windows open in the same >>>>session. >>>> >>>>Is there any way to save the current buffer name into a register? or >>>>somewhere where I can get it back? >>> >>>I'm not sure I understand exactly what you want, but I use this: >>>(defun switch-prev-buffer () >>> (interactive) >>> (switch-to-buffer (other-buffer))) >>>(global-set-key [f1] 'switch-prev-buffer) >>>Try it and see. >>>/Mathias > >