-
|
How can I integrate the bufler workspace buffer list into consult-buffer? I saw in persp-mode e.g. it is possible by filtering the buffer list: Could I do something similar with bufler? I want to integrate it into consult-buffer to only show the buffers of the active workspace but still be able to show all buffers by using the narrowing keys like Consult does support custom buffer sources, but I'm not experienced with emacs to create such an integration for bufler. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
This is more of a question for Consult developers and users than for me. I do use Consult, but I don't have its APIs memorized, so I would have to research how to do it. I'd recommend browsing the Consult repo (issues, discussions, wiki), as other users have asked similar questions in the past. It shouldn't be too hard to put it together, and then you could share it for other users to use. |
Beta Was this translation helpful? Give feedback.
-
|
This is what I have found: (defun bufler-disable-workspace ()
"Reset the `frame-parameters' `bufler-workspace-path' and `bufler-workspace-path-formatted' to nil."
(interactive)
(set-frame-parameter nil 'bufler-workspace-path nil)
(set-frame-parameter nil 'bufler-workspace-path-formatted nil))
(defvar consult--bufler-workspace+
`(:name "Workspace"
:narrow ?w
:category buffer
:face consult-buffer
:history buffer-name-history
:state ,#'consult--buffer-state
:enabled ,(lambda () (frame-parameter nil 'bufler-workspace-path))
:items
,(lambda ()
(let ((bufler-vc-state nil))
(mapcar #'buffer-name
(mapcar #'cdr
(bufler-buffer-alist-at
(frame-parameter nil 'bufler-workspace-path)
:filter-fns bufler-filter-buffer-fns))))))
"Bufler workspace buffers source for `consult-buffer'.")
(add-to-list 'consult-buffer-sources 'consult--bufler-workspace+)So far it seems to be working. Credits to: |
Beta Was this translation helpful? Give feedback.
This is what I have found: