Skip to content

Add consult-ghostel-sources and ghostel-annotation-function - #800

Merged
dakra merged 1 commit into
mainfrom
consult-ghostel-sources
Nov 10, 2026
Merged

dakra merged 1 commit into
mainfrom
consult-ghostel-sources

Conversation

@dakra

@dakra dakra commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Two hooks for packages that show their own content in ghostel buffers, such as a multiplexer client whose panes are processless ghostel buffers.

consult-ghostel-sources

A defcustom holding the sources consult-ghostel picks from, like consult-buffer-sources. The default is the former fixed list, (consult-ghostel-source consult-ghostel-source-new). A package can append a hidden source with its own narrow key and :new function.

consult-ghostel-project and consult-ghostel-status keep their fixed lists.

ghostel-annotation-function

A buffer-local function, nil by default, called in the buffer without arguments. ghostel-annotate-buffer shows the string it returns between the program status and the title, so it reaches ghostel-list-buffers, the consult sources and marginalia.

An error in the function adds nothing to the annotation instead of propagating: with consult-ghostel-mode the annotation runs for every candidate of every buffer prompt. Under debug-on-error it still reaches the debugger.

With both variables untouched, the pickers and annotations are unchanged.

Testing

make -j8 all passes. New tests: consult-ghostel-test-sources and ghostel-test-annotate-buffer-function.

Packages that show their own content in ghostel buffers could not add a
source to the `consult-ghostel' pickers or text to a buffer's picker
annotation.

`consult-ghostel-sources' and `consult-ghostel-project-sources' hold the
sources `consult-ghostel' and `consult-ghostel-project' pick from, like
`consult-buffer-sources'.

`ghostel-annotation-function' is a buffer-local function called in the
buffer without arguments.  `ghostel-annotate-buffer' shows its string
between the program status and the title, so it reaches
`ghostel-list-buffers', the consult sources and marginalia.  An error in
it is ignored, as the annotation runs for every candidate of every
buffer prompt.

Document how to make `project-kill-buffers' kill ghostel buffers.
@dakra
dakra force-pushed the consult-ghostel-sources branch from ec360c0 to 6dfe798 Compare November 10, 2026 13:52
@dakra
dakra merged commit 6dfe798 into main Nov 10, 2026
33 checks passed
@dakra
dakra deleted the consult-ghostel-sources branch November 10, 2026 14:05

This branch was previously deployed

1 inactive deployment
github-pages — 6dfe7984 Deployed Nov 10, 2026 by dakra via deploy #260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant