-
I would love to have the ephemeral buffers sorted in an extra category below the regular buffers when calling consult-buffer. The following definition doesn't work. It does sort them as wanted, but when I choose them, the buffer doesn't switch to Messages or scratch, it just stays as the current buffer. (The regular buffers can be chosen in the upper part of the consult-menu as usual.) What did I do wrong?
I need to filter them, so they are not listed twice, but just in the extra category. And neither :category buffer nor :category 'buffer works. I am grateful for any advice. I am using Emacs 30.0.50 and Consult 1.3. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You missed the (setq consult-buffer-sources
'(consult--source-hidden-buffer
consult--source-modified-buffer
consult--source-buffer
(:name "Ephemeral"
:narrow ?m
:category buffer
:state consult--buffer-state
:items
("*Messages*"
"*scratch*"
"*Async-native-compile-log*"
"*Bookmark List*")))) |
Beta Was this translation helpful? Give feedback.
You missed the
:state
field, which defines preview and the action. Without the:state
(or alternatively:action
) fieldconsult--multi
does not know how to act on the selected candidate. Seeconsult--source-buffer
andconsult--source-recent-file
for comparison.