开发者

ignore certain buffers using iswitchb

开发者 https://www.devze.com 2022-12-27 09:59 出处:网络
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 m

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 t开发者_Go百科o 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,


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消