views:

47

answers:

2

Hello,

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,

+1  A: 

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 Thompson
+5  A: 

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*" ...))
Bozhidar Batsov