Add circe-buffer-source

This commit is contained in:
Case Duckworth 2021-09-27 18:20:34 -05:00
parent bfd4e02c0c
commit a9534e1a83
2 changed files with 25 additions and 0 deletions

View File

@ -1211,6 +1211,8 @@ specific to most general, they are these:
"M-s e" #'consult-isearch
"M-s l" #'consult-line))
(:option (append consult-buffer-sources) #'circe-buffer-source)
(consult-history-to-modes ((minibuffer-local-map . nil)
(shell-mode-map . shell-mode-hook)
(term-mode-map . term-mode-hook)

View File

@ -67,4 +67,27 @@ if ripgrep is installed, otherwise `consult-grep'."
defuns)))
`(progn ,@ (nreverse defuns))))
;;; Circe buffers source
(require 'cl-lib)
(autoload 'circe-server-buffers "circe")
(autoload 'circe-server-chat-buffers "circe")
(defun circe-all-buffers ()
(cl-loop with servers = (circe-server-buffers)
for server in servers
collect server
nconc
(with-current-buffer server
(cl-loop for buf in (circe-server-chat-buffers)
collect buf))))
(defvar circe-buffer-source
`(:name "circe"
:hidden t
:narrow ?c
:category buffer
:state ,#'consult--buffer-state
:items ,(lambda () (mapcar #'buffer-name (circe-all-buffers)))))
(provide 'acdw-consult)