help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ido buffer select - restrict buffer types


From: Richard Riley
Subject: Re: ido buffer select - restrict buffer types
Date: Thu, 02 Sep 2010 00:24:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Richard Riley <rileyrg@gmail.com> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]