From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Looking for a buffer-cycling library Date: Sun, 16 Nov 2014 09:08:10 -0800 (PST) Message-ID: <828513f5-92dc-49f2-91e6-4711146f4356@default> References: < > <> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1416157725 23923 80.91.229.3 (16 Nov 2014 17:08:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Nov 2014 17:08:45 +0000 (UTC) To: Joost Kremers , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 16 18:08:39 2014 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 1Xq3JW-00032k-SL for geh-help-gnu-emacs@m.gmane.org; Sun, 16 Nov 2014 18:08:39 +0100 Original-Received: from localhost ([::1]:44496 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xq3JW-00043k-DN for geh-help-gnu-emacs@m.gmane.org; Sun, 16 Nov 2014 12:08:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xq3JE-0003uJ-Vw for help-gnu-emacs@gnu.org; Sun, 16 Nov 2014 12:08:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xq3J8-0007Qi-Bs for help-gnu-emacs@gnu.org; Sun, 16 Nov 2014 12:08:20 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:40391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xq3J8-0007Qc-5w for help-gnu-emacs@gnu.org; Sun, 16 Nov 2014 12:08:14 -0500 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id sAGH8A6o011108 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 16 Nov 2014 17:08:11 GMT Original-Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sAGH8ANs025059 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Sun, 16 Nov 2014 17:08:10 GMT Original-Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sAGH8Alb025048; Sun, 16 Nov 2014 17:08:10 GMT In-Reply-To: <> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 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:100960 Archived-At: > >>> I'm looking for a buffer cycling mechanism that will ignore > >>> any buffer not loaded from or written to a file. > >>> > >>> Example - any buffer whose name begins with '*' would be > >>> "jumped over" > > > > Just my 2 cents: why not use Icicles? >=20 > Because, AFAIU, with Icicles you still need to type `C-x b` to > switch buffers. Correct. Or whatever key you bind to `icicle-buffer'. > swbuff displays a list of buffers and allows you to cycle > through them. Yep. I used `swbuff.el' for a while, long, long ago. (http://www.emacswiki.org/SwBuff) If there is no control over what the "list of buffers" is, or if it is long, then cycling is less interesting (IMO). The OP asked for file buffers only. And yes, `swbuff.el' does provide an option, `swbuff-exclude-buffer-regexps' that filters the list. Still, the list can be long, and that filtering is a customization, not on-the-fly. FWIW, for cycling when there are few buffers and I don't need to match names etc., I use `next-buffer-repeat' and `previous-buffer-repeat', which are just repeatable versions of the standard `next-buffer' and `previous-buffer' (repeatable in the sense of being able to repeat the last key hit on a prefix key: `C-x C-right C-right C-right' or `C-x right right right'. (Those commands are here: http://www.emacswiki.org/emacs-en/download/misc-cmds.el) I filed an Emacs enhancement request to add a user option that excludes or includes, from `(next|previous)-buffer' cycling, any buffers whose names match a user-defined regexp. IOW, to provide an equivalent to `swbuff-exclude-buffer-regexps' for vanilla Emacs. (That would automatically apply also to `next-buffer-repeat' and `previous-buffer-repeat'.) That enhancement request is here: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D19070) > I've bound the relevant cycling commands to `C-TAB` and > `S-C-TAB`, so I can just press the control key and hit TAB > a number of times to get to the buffer I want. See above. > I usually don't have too many open files, I often have lots of buffers, including lots of open files. > so most of the time I only need to hit TAB a few times. Buffer > switching is much faster that way than by pressing `C-x b` and > typing part of the buffer name. Agreed. If you don't have a lot to cycle through, cycling can be faster than narrowing by name-matching. An advantage of Icicles (and similar approaches) in this regard is that you can either cycle or name-match - or both. Typically, typing just a few chars narrows the candidate set to a few that you can then cycle among. FWIW: I started down the road to cycling things with Do Re Mi. You can use it to cycle among various things or increment various things (hence the name). But in the cycling cases I have, Icicles generally gives better behavior, because it lets you combine cycling with matching (completion). One of the things I admonish new Icicles users about is this (in the section about cycling): Do not become a cycling drone! Input some text to narrow the set of candidates, before cycling among them to choose one. This is a good habit to adopt, generally, in Icicles. Most of the power of Icicles comes in your ability to filter a set of candidates. This is especially true when it comes to regexp filtering (see "Apropos Completions"). Cycling and filtering work hand in hand. If the set of candidates is small to begin with, then just cycling might be quick enough - that is the case if you move among a small set of buffers, for instance. But with Icicles you can profitably use cycling on even a very large set of candidates - by filtering the set first. (http://www.emacswiki.org/Icicles_-_Cycling_Completions) > I've recently bound `ido-switch-buffer` to `s-g`, making it a bit > quicker than `C-x b`, but I notice I still prefer to use C-TAB.