[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: My read-buffer-function doesn't work when called by switch-to-buffer

From: Tassilo Horn
Subject: Re: My read-buffer-function doesn't work when called by switch-to-buffer
Date: Wed, 15 Mar 2023 10:06:23 +0100
User-agent: mu4e 1.9.22; emacs 30.0.50

Michael Heerdegen <> writes:

Hi Michael,

>> > Maybe an advice of a higher level function would better fit your
>> > wished-for behavior.
>> Do you have one in mind?
> `read-buffer-to-switch'.

Hm, but then it would be pretty specific to `switch-to-buffer' instead
of a general `read-buffer-function'.  E.g., I just found out it's quite
convienient to be able to use `append-to-buffer' to append to a buffer
whose file I haven't found already but is in recentf-list.

>> I haven't checked their implementation but completion-extra-properties
>> is nil and the metadata completion requests also don't return an
>> annotation-function or affixation-function.  Nevertheless, all standard
>> completions are annotated.  I'll have a look how marginalia does it.
> They do this:
> (advice-add #'completion-metadata-get
>             :before-until #'marginalia--completion-metadata-get)
> Looks like this is how they install their annotation-function.

Yes, thanks for the pointer.

>> Anyway, I've played a bit with responding to metadata requests and it
>> looks like it's not really suited for my goal because it seems to
>> assume that the metadata won't change (e.g., category from buffer to
>> file) during a single completion which is obviously a reasonable
>> assumption.
> Hmm, yes, that's a problem.  Seems a completion table can only provide
> one kind of metadata for all completions and what you want doesn't fit
> at all into that approach.  See the comment in
> `completion-table-in-turn'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]