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 07:13:06 -0700 Message-ID: <41f8f6f3$1_1@news3.es.net> References: <41f81888$1_2@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 1106835458 32520 80.91.229.6 (27 Jan 2005 14:17:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 27 Jan 2005 14:17:38 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 27 15:17:32 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 1CuASh-0001mQ-00 for ; Thu, 27 Jan 2005 15:17:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CuAf4-0007jU-Dr for geh-help-gnu-emacs@m.gmane.org; Thu, 27 Jan 2005 09:30:18 -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 1106835187 128.165.205.14 (27 Jan 2005 06:13:07 -0800) Original-Lines: 30 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!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:128190 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:23692 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23692 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