From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Riley Newsgroups: gmane.emacs.help Subject: Re: ido buffer select - restrict buffer types Date: Thu, 02 Sep 2010 00:24:04 +0200 Organization: aich tea tea pea dicky riley dot net Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1283379905 22902 80.91.229.12 (1 Sep 2010 22:25:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 1 Sep 2010 22:25:05 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 02 00:25:04 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Oqvjr-0001oh-36 for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Sep 2010 00:25:03 +0200 Original-Received: from localhost ([127.0.0.1]:33133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oqvjq-0003Jt-8X for geh-help-gnu-emacs@m.gmane.org; Wed, 01 Sep 2010 18:25:02 -0400 Original-Received: from [140.186.70.92] (port=57632 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OqvjE-0003I5-Az for help-gnu-emacs@gnu.org; Wed, 01 Sep 2010 18:24:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OqvjD-0000cT-2S for help-gnu-emacs@gnu.org; Wed, 01 Sep 2010 18:24:24 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:35024) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OqvjC-0000cF-TP for help-gnu-emacs@gnu.org; Wed, 01 Sep 2010 18:24:23 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OqvjB-0001Th-VT for help-gnu-emacs@gnu.org; Thu, 02 Sep 2010 00:24:21 +0200 Original-Received: from 85.183.18.158 ([85.183.18.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Sep 2010 00:24:21 +0200 Original-Received: from rileyrg by 85.183.18.158 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Sep 2010 00:24:21 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 39 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 85.183.18.158 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: news.gmane.org gmane.emacs.help:74853 Archived-At: Richard Riley writes: > Can someone please show me how I might use IDO buffer select to restrict > from a subset of buffers? > > e.g ido select between erc buffers for example. > > The benefit over the existing iswitchb mode being the fuzzy (flex) > select capabilities for us sloppy typists. > Digging around in (erc-buffer-list) I now have this working solution with erc flex matching. --8<---------------cut here---------------start------------->8--- (defun rgr/ido-erc-buffer() (interactive) (switch-to-buffer (ido-completing-read "Channel:" (save-excursion (delq nil (mapcar (lambda (buf) (when (buffer-live-p buf) (with-current-buffer buf (and (eq major-mode 'erc-mode) (buffer-name buf))))) (buffer-list))))))) (global-set-key (kbd "C-c e") 'rgr/ido-erc-buffer) --8<---------------cut here---------------end--------------->8--- -- ☘ http://www.shamrockirishbar.com, http://www.richardriley.net "Learning French is trivial: the word for horse is 'cheval' and everything follows thusly." : quotemaster, #emacs on irc.freenode.net