emacs-devel
[Top][All Lists]
Advanced

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

Re: Possible minibuffer completion enhancements


From: Eshel Yaron
Subject: Re: Possible minibuffer completion enhancements
Date: Mon, 22 Jan 2024 13:35:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Eshel Yaron <me@eshelyaron.com> writes:

> Daniel Mendler <mail@daniel-mendler.de> writes:
>
>> ...the implementation of completion-table-with-metadata I've seen in
>> Eshel's branch did not seem correct. The function should be simpler:
>
> Hmm, define "correct" and "should" :)
> My implementation is indeed more sophisticated, since it does more.  In
> particular, it lets you override some metadata while preserving other
> metadata that come from the original table.  Could you elaborate about
> how this simplified version is preferable in your opinion?
>
>> (defun completion-table-with-metadata (table metadata)
>>   (lambda (str pred action)
>>     (if (eq action 'metadata)
>>         `(metadata ,@metadata
>>                    ,@(and (functionp table)
>>                           (cdr (funcall table str pred action))))
>>       (complete-with-action action table str pred))))

On second thought, your version should indeed work just as well as mine,
expect that my implementation also allows the extra metadata to be
computed just in time.  In the common case where the metadata is
computed ahead of time, both versions basically behave the same, right?



reply via email to

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