tags:

views:

39

answers:

1

In buff-menu+.el or (respectivly buff-menu.el) there is an function "Buffer-menu-toggle-files-only", which sets the variable "Buffer-menu-files-only" to true/false.

When showing the Buffer list, I can toggle this with the key T. So i can prevent non-file-buffers from being shown in the list.

I would like to have this filter (files-only) set by default.

How could I implement this to my init.el File?

I tried (add-hook 'buffer-menu-mode-hook 'Buffer-menu-toggle-files-only 1)

but when I then show the Buffer List, it says:

run-hooks: Wrong number of arguments: #[(arg) "..." [arg Buffer-menu-files-only prefix-numeric-value 0 t revert-buffer] 2 578818 "P"], 0

Do you have me a hint? With best regards

Hartmut

+1  A: 

Try this:

(add-hook 'buffer-menu-mode-hook
          '(lambda ()
             (Buffer-menu-toggle-files-only 1)))

I don't use buffer-menu, so this is untested. But this is the form all my mode-hooks follow, and they all work.

rjray