Closed grolongo closed 9 months ago
In order to achieve this set the :items
to a new function, see for example consult--source-hidden-buffer
and consult--source-buffer
. The function consult--buffer-query
takes an :exclude
and :include
argument which you can use. The :exclude
argument is set to consult-buffer-filter
by default and you probably want to override this. I hope this helps!
Thank you for putting me in the good direction, :exclude and :include did the trick :)
minad, I've a weird problem witch I think is related to :exclude
(defvar gnus-buffer-source
(list :name "Gnus"
:hidden t
:narrow ?g
:category 'buffer
:state #'consult--buffer-state
:items '(lambda () (consult--buffer-query :sort 'visibility
:as #'buffer-name
:include (mapcar #'buffer-name (gnus-buffers))))))
when I C-b
followed by g + <space>
and if I have the buffers below open, they get shown as expected:
-- Gnus -----------------------------------------
*Group*
*Article nntp+news.gmane.io:gmane.emacs.announce*
*Summary nntp+news.gmane.io:gmane.emacs.announce*
instead, if I have these buffers open, only *Group* is showing (I just show them here so you can see their names, but only *Group* is there):
-- Gnus -----------------------------------------
*Group*
*Article nnimap+icloud:INBOX*
*Summary nnimap+icloud:INBOX*
Do you have any idea why "nnimap+icloud:INBOX" would get filtered out of the results? I have the default consult-buffer-filter
value, and there is nothing inside it that matches this pattern.
Also, when I'm doing C-b
without filtering with "g", both buffers name (nnimap...) are listed.
I am so confused.
Hi minad,
I'm trying to have all non-user buffers with asterisks to fall into a Special group, while keeping some of them into the main source, like this:
Notice how scratch and eshell don't fall into the Special category.
I've created:
but I don't how to integrate that function into a buffer source list with
:items
, as well as removing the Special buffers from the "main" list at the same time.