all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Cycle through buffers of the same mode?..
@ 2011-01-05 22:58 Leo Alekseyev
  2011-01-06 22:13 ` Drew Adams
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Alekseyev @ 2011-01-05 22:58 UTC (permalink / raw)
  To: help-gnu-emacs

I've started using the following bit of elisp recently, and I like it:
http://www.emacswiki.org/emacs/ShellMode#toc3

When I have several shell buffers open, this allows me to cycle
through those buffers with a keybinding (e.g. f7).  I'd like to
generalize this behavior as follows: if I am in a buffer with major
mode X, pressing a key will cycle me through all open buffers in major
mode X.  That way I could easily cycle through all my open org
buffers, dired buffers, etc.  Before I go off writing more elisp,
however, I wanted to check whether someone might have written
something like this already :)  So if you have any helpful code
snippets, feel free to post them here.

--Leo



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Cycle through buffers of the same mode?..
       [not found] <mailman.29.1294268309.13904.help-gnu-emacs@gnu.org>
@ 2011-01-06  6:56 ` rusi
  2011-01-06 10:58   ` Le Wang
  0 siblings, 1 reply; 4+ messages in thread
From: rusi @ 2011-01-06  6:56 UTC (permalink / raw)
  To: help-gnu-emacs

On Jan 6, 3:58 am, Leo Alekseyev <dnqu...@gmail.com> wrote:
> I've started using the following bit of elisp recently, and I like it:http://www.emacswiki.org/emacs/ShellMode#toc3
>
> When I have several shell buffers open, this allows me to cycle
> through those buffers with a keybinding (e.g. f7).  I'd like to
> generalize this behavior as follows: if I am in a buffer with major
> mode X, pressing a key will cycle me through all open buffers in major
> mode X.  That way I could easily cycle through all my open org
> buffers, dired buffers, etc.  Before I go off writing more elisp,
> however, I wanted to check whether someone might have written
> something like this already :)  So if you have any helpful code
> snippets, feel free to post them here.
>
> --Leo

You may want to look at http://www.emacswiki.org/emacs/CategoryBufferSwitching


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Cycle through buffers of the same mode?..
  2011-01-06  6:56 ` rusi
@ 2011-01-06 10:58   ` Le Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Le Wang @ 2011-01-06 10:58 UTC (permalink / raw)
  To: rusi; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1348 bytes --]

Buffer-stack does buffer-stacking where the most recently used buffer
bubbles to the top of the stack (think Alt-Tab on Windows).  It's quite
flexible and offers hooks for however you want to filter buffers.  I've
written a same major-mode filter -- buffer-stack-suppl.el

All the files and information you'll need are here:

http://www.emacswiki.org/emacs/ControlTABbufferCycling

On Thu, Jan 6, 2011 at 2:56 PM, rusi <rustompmody@gmail.com> wrote:

> On Jan 6, 3:58 am, Leo Alekseyev <dnqu...@gmail.com> wrote:
> > I've started using the following bit of elisp recently, and I like it:
> http://www.emacswiki.org/emacs/ShellMode#toc3
> >
> > When I have several shell buffers open, this allows me to cycle
> > through those buffers with a keybinding (e.g. f7).  I'd like to
> > generalize this behavior as follows: if I am in a buffer with major
> > mode X, pressing a key will cycle me through all open buffers in major
> > mode X.  That way I could easily cycle through all my open org
> > buffers, dired buffers, etc.  Before I go off writing more elisp,
> > however, I wanted to check whether someone might have written
> > something like this already :)  So if you have any helpful code
> > snippets, feel free to post them here.
> >
> > --Leo
>
> You may want to look at
> http://www.emacswiki.org/emacs/CategoryBufferSwitching
>



-- 
Le

[-- Attachment #2: Type: text/html, Size: 2082 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Cycle through buffers of the same mode?..
  2011-01-05 22:58 Cycle through buffers of the same mode? Leo Alekseyev
@ 2011-01-06 22:13 ` Drew Adams
  0 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2011-01-06 22:13 UTC (permalink / raw)
  To: 'Leo Alekseyev', help-gnu-emacs

> I'd like to generalize this behavior as follows: if I am in a
> buffer with major mode X, pressing a key will cycle me through
> all open buffers in major mode X. That way I could easily cycle
> through all my open org buffers, dired buffers, etc.

In Icicles, `C-0 C-x b' does that: Only buffers in the same mode are candidates.
You can then cycle among the candidates that match your input in the minibuffer
(e.g., hit `down' to cycle).

This is true for all Icicles commands that read a buffer name (`C-x k' etc.): a
zero prefix arg limits the candidates to buffers in the same mode.  A positive
arg limits them to buffers visiting files.  A negative arg limits them to
buffers associated with the selected frame.

You can instead filter the candidates on the fly to buffers in a given mode, by
using `C-x M' during completion.  (You are prompted for the mode, then
buffer-name completion continues.)

http://www.emacswiki.org/emacs/Icicles_-_Buffer-Name_Input

You can also filter completion candidates (any kind, not just buffer names) in
several different ways at the same time (e.g. buffers visiting files whose size
is > 10K), by using `M-&' during completion.  That prompts you for a predicate
to filter the current matches.  Use `M-&' as many times as you like, to combine
filters.

http://www.emacswiki.org/emacs/Icicles_-_Progressive_Completion#Predicates




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-06 22:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-05 22:58 Cycle through buffers of the same mode? Leo Alekseyev
2011-01-06 22:13 ` Drew Adams
     [not found] <mailman.29.1294268309.13904.help-gnu-emacs@gnu.org>
2011-01-06  6:56 ` rusi
2011-01-06 10:58   ` Le Wang

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.