0

GNU Emacs 23.1

I am using iswitchb. However, when I press C-x b I get a list of buffers. However, I don't want to display one like scratch, Messages, GNU Emacs, etc. Just the buffers I have opened myself.

So I am looking for a way to ignore these buffers. This is what I have in my configuration. However, it doesn't ignore the buffers I don't want. Have I done anything wrong?

;; Setup iswitchb to select different buffers, ignore buffers to reduce list
(iswitchb-mode 1)
(setq iswitchb-buffer-ignore '("*scratch*"))
(setq iswitchb-buffer-ignore '("*Messages*"))
(setq iswitchb-buffer-ignore '("*GNU Emacs*"))
(setq iswitchb-buffer-ignore '("*compilation*"))

Many thanks for any suggestions,

viam0Zah
  • 25,949
  • 8
  • 77
  • 100
ant2009
  • 27,094
  • 154
  • 411
  • 609

2 Answers2

7

iswitch-buffer-ignore should be set to a list of buffers to ignore, but you're setting a new list of one buffer at each step. I should change your code to something like this or pass all the buffers at once.

(add-to-list 'iswitchb-buffer-ignore "^ ")
(add-to-list 'iswitchb-buffer-ignore "*Messages*")
(add-to-list 'iswitchb-buffer-ignore "*ECB")
(add-to-list 'iswitchb-buffer-ignore "*Buffer")
(add-to-list 'iswitchb-buffer-ignore "*Completions")
(add-to-list 'iswitchb-buffer-ignore "*ftp ")
(add-to-list 'iswitchb-buffer-ignore "*bsh")
(add-to-list 'iswitchb-buffer-ignore "*jde-log")
(add-to-list 'iswitchb-buffer-ignore "^[tT][aA][gG][sS]$")

Alternatively:

(setq iswitchb-buffer-ignore '("*scratch*" "*Messages*" ...))
viam0Zah
  • 25,949
  • 8
  • 77
  • 100
Bozhidar Batsov
  • 55,802
  • 13
  • 100
  • 117
1

You are not appending to the list of ignored buffer, but rather overwriting it. You want the function add-to-list:

(add-to-list 'iswitchb-buffer-ignore "ignored buffer")

Repeat that for each item you want to ignore.

Ryan C. Thompson
  • 40,856
  • 28
  • 97
  • 159