From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: John Paul Wallington Newsgroups: gmane.emacs.help Subject: Re: swtching between buffers? Date: Sat, 10 May 2003 19:22:48 +0100 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87adduy83r.fsf@indigo.shootybangbang.com> References: <5v9va.3476$kH.1029551@twister.nyc.rr.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1052591060 18630 80.91.224.249 (10 May 2003 18:24:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 10 May 2003 18:24:20 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Sat May 10 20:24:17 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19EZ16-0004qC-00 for ; Sat, 10 May 2003 20:24:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19EZ2T-00043y-03 for gnu-help-gnu-emacs@m.gmane.org; Sat, 10 May 2003 14:25:41 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!host217-44-221-152.range217-44.btcentralplus.COM!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-NNTP-Posting-Host: host217-44-221-152.range217-44.btcentralplus.com (217.44.221.152) Original-X-Trace: fu-berlin.de 1052591063 14894205 217.44.221.152 (16 [170119]) X-Orig-Path: indigo.shootybangbang.com!news X-Attribution: jpw Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEWmcTZAEwDSpXcjAQD0 0K+eaSyRVhhpOAG0h1GYXyGweT9fLABVHwBzRQjDkl2GSQ1vVtvkAAACMElEQVR4nG2SL4+cUBTF r0FUkpVdRVa0KybZzDdo+gHW0IQvQDJqJIKsp4h1S/IccsoXGMEz6MEjGrJJ1WQEslWEnnMfzJ+m T57fPef+Afl6fl+CIBiOeeVFxXbs5AKgr4YsL/8FanAgvgKUZxDSkMi1vhqOWVVG276rrdzUE3jF 2KW2kRsdQ5Ve0QP4AA/BnIN6toj7LmGUK3cNCKJ47Psk/R/YOnAOwqxZVgnWQ5NaHm70fAFWgtU8 UMZXAaBHVzei4gJyBVPf03HRdxWeV8Dxs00lOGL+V5ePJwqsfyA4ZgC51ovghD3ARwlOnP+YS6Ug 1NuqI8/mtlUppYSctk9sC8c8J2JEvNBwjaSuZTihepc7HUkGF0nSupVfjxpeymLAGgqG0wWEaph4 KjsDVx5GNEzsAcfgUlgfGRMTJASvn8pZXgB+EYLscY5hA8MWAGyerUSeCcyb4UxcD2tY2Q2uGjHG taYOx+4kSwyCdKRUQXXy5vK4GN+h233a4klVLnq87fb4dveHWoH8OOv4pLyGpd4soAAYCWrWN40v z99NpDL6YiBs0LT3vg/wWXMwz6R63fr6JPygOa5eDf7dE4H5ttHLjW5+C8N6vSYoNtxr6tJ9TQDD mkRisynQeOQduDGiCNYSb2K9aKo6d9AsgJjgT3ox+Bom0/Qbp+7sQfWGuosC4EkBXIzrDdBjoilJ bWvbc7UD7w40buGnuwW8gLwnaev2vYpKXvqRoJ0tC/gL/+pDxYETs+oAAAAASUVORK5CYII= User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (powerpc-unknown-linux-gnu) Cancel-Lock: sha1:ibK/kJq4szd5Eb0OHBrEUbB2xwI= Original-Xref: shelby.stanford.edu gnu.emacs.help:113046 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:9541 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:9541 Miguel Ulloa wrote: > I would like to know if there is a command to circularly navigate all > opened buffers in emacs, thanks in advance. There are `prev-buffer' and `next-buffer', bound to C-x and C-x respectively, in the development sources: (define-key global-map [?\C-x right] 'next-buffer) (define-key global-map [?\C-x left] 'prev-buffer) (defun next-buffer () "Switch to the next buffer in cyclic order." (interactive) (let ((buffer (current-buffer))) (switch-to-buffer (other-buffer buffer)) (bury-buffer buffer))) (defun prev-buffer () "Switch to the previous buffer in cyclic order." (interactive) (let ((list (nreverse (buffer-list))) found) (while (and (not found) list) (let ((buffer (car list))) (if (and (not (get-buffer-window buffer)) (not (string-match "\\` " (buffer-name buffer)))) (setq found buffer))) (setq list (cdr list))) (switch-to-buffer found)))