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

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

RE: Hide extraneous buffers?


From: Drew Adams
Subject: RE: Hide extraneous buffers?
Date: Fri, 18 May 2012 13:39:09 -0700

> Is there any way to hide the *scratch*, Messages, Completions 
> etc buffers? I kill them but they always come back, and it's
> a pain to have to cycle through 6 buffers when I only really
> have 3 meaningful ones open.

They are _supposed_ to "always come back". ;-)

You need to define clearly (for yourself) what you mean by the "meaningful"
ones.  Then you can build a filter that does what you want.

If buffer names `*...*' are not meaninful for you in general, then you can
exclude them all using a regexp.  In Icicles you can just set option
`icicle-buffer-no-match-regexp' to "\\`\\*[^*]+\\*\\'" to do that.

If you want to exclude only certain buffers, explicitly, then you can define a
predicate that tests membership in your blacklist.  In Icicles you can set set
option `icicle-buffer-predicate' to that predicate to filter them out.

If you want to include buffers of some kind but you want them to be at the end
of the list of choices, then you can define a sort function that does that.  In
Icicles you can do that by setting option `icicle-buffer-sort' to that function.

There are several such Icicles user options that control buffer-name completion.

You can also define one or more "buffer configurations", each of which is a set
of such option settings that defines a set of buffers to use (choose from). 

For example, I have one buffer config that includes all buffer names but sorts
those with names matching `*...*' last.  It looks like this:

("All, *...* Buffers Last"     ; Config name
 nil                           ; Match regexp (none)
 nil                           ; Don't-match regexp (none)
 nil                           ; Predicate (none)
 nil                           ; List of extra buffers to
                               ;  always include (none)
 icicle-buffer-sort-*...*-last ; Sort function
)

Sort function `icicle-buffer-*...*-last' is predefined, but you can roll your
own sort function - it's just a predicate that compares two buffer names
(strings).

You can have as many buffer configs as you like.  You can choose a different one
at any time using `M-x icicle-buffer-config'.  You can use command
`icicle-add-buffer-config' to define a config.

You don't need to use buffer configs, but they give you a quick way to pick a
whole set of option settings.

http://www.emacswiki.org/emacs/Icicles_-_Customization_and_General_Tips#toc95

http://www.emacswiki.org/emacs/Icicles_-_Global_Filters

http://www.emacswiki.org/emacs/Icicles_-_Support_for_Projects#toc6




reply via email to

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