all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org
Subject: Re: Completion
Date: Mon, 03 Sep 2018 13:19:12 -0400	[thread overview]
Message-ID: <jwvk1o2cxna.fsf-monnier+Inbox@gnu.org> (raw)
In-Reply-To: <m3h8j61qeh.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 03 Sep 2018 18:45:10 +0200")

> +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	other threads:[~2018-09-03 17:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-01  9:51 Completion Lars Ingebrigtsen
2018-09-01 14:49 ` Completion Drew Adams
2018-09-03 16:48   ` Completion Lars Ingebrigtsen
2018-09-01 15:14 ` Completion Stefan Monnier
2018-09-03 16:45   ` Completion Lars Ingebrigtsen
2018-09-03 17:19     ` Stefan Monnier [this message]
2018-09-03 17:40       ` Completion Lars Ingebrigtsen
2018-09-05 23:03         ` Completion Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
2021-05-03 13:25 Completion wael-zwaiter
2021-05-03 13:34 ` Completion Gregory Heytings
2021-05-03 13:48   ` Completion wael-zwaiter
2021-05-03 13:35 ` Completion Jean Louis
2007-08-21 22:30 completion Hadron
2007-08-22 21:26 ` completion Nikolaj Schumacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvk1o2cxna.fsf-monnier+Inbox@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.