From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: switch to previous buffer Date: Tue, 02 Apr 2013 23:23:21 +0200 Message-ID: <87fvz88w52.fsf@web.de> References: <382a2375-aed1-4deb-ad29-21952926c809@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1364937816 18632 80.91.229.3 (2 Apr 2013 21:23:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Apr 2013 21:23:36 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 02 23:24:04 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UN8gT-000057-Pm for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Apr 2013 23:24:01 +0200 Original-Received: from localhost ([::1]:34107 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN8g5-0004lM-0r for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Apr 2013 17:23:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN8ft-0004j7-8k for help-gnu-emacs@gnu.org; Tue, 02 Apr 2013 17:23:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UN8fs-0007np-Fd for help-gnu-emacs@gnu.org; Tue, 02 Apr 2013 17:23:25 -0400 Original-Received: from mout.web.de ([212.227.17.12]:59546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN8fs-0007na-64 for help-gnu-emacs@gnu.org; Tue, 02 Apr 2013 17:23:24 -0400 Original-Received: from drachen.dragon ([92.74.136.91]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0LkPnr-1UtRcP0fG7-00c24S; Tue, 02 Apr 2013 23:23:22 +0200 Mail-Followup-To: help-gnu-emacs@gnu.org In-Reply-To: <382a2375-aed1-4deb-ad29-21952926c809@googlegroups.com> (Rami A.'s message of "Fri, 29 Mar 2013 15:07:04 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Provags-ID: V02:K0:xxZn3YYGyVdu3WocI8iCr6N7gDAOv9QcjWtM3LUEmzk BeXcvVnbthxpGk289NIdmLAWMsfVE0CavHuadEWH5E5YGYJc5O 374/C9ZvKt3ZSbCabJwAoeOnc/ED1YkWwupbYRGI+8PIlD6q6L bF93Gnnb5LY7Cuxt9QXwvgNyJjo/OX/fe/WcbcJErAtHOlRL7o r2DgKZYhIUxrdveaRuX+EQKdiF4LY+2beUCYFJKx/o= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.17.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89909 Archived-At: Rami A writes: > Usually I switch between buffers going through the "buffer menu". > So I would be in Buffer 1 -> C-x C-b "bufer menu" -> buffer 2 > > I have the short cut: > (global-set-key "\M-a" 'switch-to-previous-buffer) > > So I could switch back to the previous buffer. > How is possible to skip the buffer menu when doing so. > > Basically, > Buffer 1 -> C-x C-b "bufer menu" -> buffer 2 -> M-a -> buffer 1 > "without going back to buffer menu" Have a look at winner.el, which is part of Gnu Emacs. `winner-undo' should do what you want. It is very handy when it's on a good key, I use it all the time. Basically, winner.el is about window configurations, but since changing a window's buffer is regarded as a change of the window configuration... calling `winner-undo' gives you the previously shown buffer in that window. Moreover, winner.el also records the window layout, so that you can "undo" popup windows etc. Regards, Michael.