IBuffer is embarrasingly rich in the ways it can filter buffers. Once mastered, IBuffer filtering offers a way to create different views on your buffer list, enabling you to tailor bespoke views for different workflows. Such capability comes with a price though: you’ll need to understand how IBuffer wants to organize filters.
Key is the concept of a Filter Group which is IBuffer’s analog to a Dired subdirectory ((emacs)Subdirectories in Dired). But whereas a subdirectory only maps to a file system directory, a filter group can be constructed from a diverse set of rules to categorize a buffer.
IBuffer organizes filtering with the following taxonomy:
The smallest unit of filtering. There are many types of filter rules:
Casual IBuffer makes the design decision to not enumerate the above in a menu, delegating the work of filter selection to the command ibuffer-filter-chosen-by-completion
.
A filter is a logical combination of filter rules. Logic operators such as AND (&), OR (|) and NOT (!) are used to compose rules into a filter. A single filter rule can also be construed as a filter.
Properties of filters:
A filter group is set of filters. The set itself is named with an identifier that is user-defined.
Properties of filter groups:
A collection is a set of filter groups that can be named with a user-defined identifier. Only one collection can be applied to a buffer list at a time. However, many different collections can be defined, allowing for different views of the same buffer list.
Creating Filters
The basic procedure for making a filter that applies to the entire buffer list is as follows:
Creating a Collection of Filter Groups
Here is where the taxonomy becomes significant as the IBuffer command set unfortunately does not provide much observability on edit operations to filters.
Out of the box, it is best to think of the IBuffer commands for editing buffer filters as a kit of parts and an arguably incomplete one at that. The Casual IBuffer filter menu (‘casual-ibuffer-filter-tmenu’) is my attempt to build a comprehensible filter editor UI from this kit. Whether it succeeds in being comprehensible is left to user feedback.