Ruslan Bekenev has a post on filtering the results of buffer listings that reminded me of something I’ve known since I started using Emacs but keep forgetting. Bekenev writes that he often lists the open buffers with Ctrl+x Ctrl+b mostly so that he clean up his Emacs environment by deleting no longer needed buffers. I used to do the same thing so I can sympathize with the urge.
One day, though, he wanted to filter the listing so that only buffers from his current project were listed. Sadly, list-buffers
is pretty bare bones and doesn’t support filtering. Ibuffer
does, though, and produces essentially the same output as list-buffers
. My first thought was, “that’s neat” but I also felt that it seemed familiar.
It was, of course. Long ago when I first started using Emacs, I learned that I should use ibuffer
instead of list-buffers
. I last wrote about this only a year and a half ago but I’d already mostly forgotten how powerful ibuffer
is. Every time I rediscover the filtering capability, I promise myself I’ll internalize and make regular use of it but the truth is I just don’t need filtering often enough for the habit to set.
In any event, ibuffer
is a better version of list-buffers
and well worth trying. As Mickey says in the above link, “You should switch to it right now.”