emacs-devel
[Top][All Lists]
Advanced

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

Re: Completion


From: Stefan Monnier
Subject: Re: Completion
Date: Mon, 03 Sep 2018 13:19:12 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> +if there is one match, but it's not an exact match, the function
> +should return the match;

Actualy, when there is one match, "the common substring of all matches"
is that match, so I think we can make it simpler, e.g.:

    This specifies a @code{try-completion} operation.  The function should
    return @code{t} if the specified string is a unique and exact match;
    It should return @code{nil} if there are no matches; and it should
    return the longest common prefix of all matches otherwise.

>>> `minibuffer-allow-text-properties' exists.  Would it make sense to add a
>>> new variable, like `completion-allow-text-properties', to handle this
>>> case as well?
>>
>> We could, I guess.  What's your use case?
>
> I'm completing over people and films from the IMDB database, and they're
> uniquely identified by IDs.  I'd like to complete over the names (or
> perhaps also adorn the names with more...  stuff, like years for the
> films (but not complete over that bit))), but get the IMDB IDs back
> after choosing a name.

What if the user writes the whole name by hand: how do you get the ID in
this case?  In my experience, the need to handle that "manual case" most
of the time ends up covering just as well the case where the user
selected an entry from the *Completions*.


        Stefan




reply via email to

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