From: Daniel Mendler <mail@daniel-mendler.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 48572@debbugs.gnu.org, joaotavora@gmail.com
Subject: bug#48572: 28.0.50; Add `passthrough` completion style to minibuffer.el
Date: Sun, 30 May 2021 05:23:05 +0200 [thread overview]
Message-ID: <2b242520-323b-366d-39b5-cb759f346cfb@daniel-mendler.de> (raw)
In-Reply-To: <jwvlf81mbll.fsf-monnier+emacs@gnu.org>
On 5/26/21 11:28 PM, Stefan Monnier via Bug reports for GNU Emacs, the
Swiss army knife of text editors wrote:
>>> The "passthrough" (elsewhere called "backend") completion-style is
>>> definitely something we need to add, yes. But what it should do is pass
>>> all the args from `completion-all/try-completions` to the table and let
>>> the table do *all* the work, i.e. let the completion table implement the
>>> completion-style methods. But we shouldn't call `all-completions` or
>>> `try-completions` for that. Instead we should call the completion-table
>>> directly, as is done for the `completion-boundaries` method.
>> But `all-completions` and `try-completion` already calls the table
>> directly if the table is indeed a table.
>
> Yes, they do, but if you call them, then *you* don't: they call the table in
> their own way for their own purpose (e.g. for `all-completions` they
> call it to get all the completions matching a given prefix and that's
> it, whereas the whole point of `passthrough` is to be able to fetch
> matches based on other criteria (defined by the completion table)).
Sorry, I don't get it. What is the difference in calling the backend
between the two cases:
(1) passthrough-all-completions -> all-completions -> backend
versus
(2) passthrough-all-completions -> backend?
In case (2) you call the backend directly but then you also have to
handle completion tables which are not functions and you end up
reimplementing parts of `all-completions` in elisp. `all-completions`
convers non-function completion tables to lists.
>> Basically `all-completions/try-completion` themselves are already
>> "passthrough" modulo some calling convention.
>> Am I missing something?
>
> Passthrough is about passing the completion-style API directly to
> the backend. `all-completions` is part of the backend API, not the
> completion-style API.
Yes, I am aware that `all-completions` is the backend API. Is anything
lost when going through `all-completions`? From what I've seen the
arguments are passed on directly to the backend table.
Daniel
next prev parent reply other threads:[~2021-05-30 3:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-21 18:48 bug#48572: 28.0.50; Add `passthrough` completion style to minibuffer.el Daniel Mendler
2021-05-22 23:20 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-23 10:21 ` Daniel Mendler
2021-05-23 10:36 ` Daniel Mendler
2021-05-23 15:50 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-23 17:33 ` João Távora
2021-05-23 19:58 ` Daniel Mendler
2021-05-26 21:28 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-30 3:23 ` Daniel Mendler [this message]
2021-05-30 13:03 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-23 1:07 ` Dmitry Gutov
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=2b242520-323b-366d-39b5-cb759f346cfb@daniel-mendler.de \
--to=mail@daniel-mendler.de \
--cc=48572@debbugs.gnu.org \
--cc=joaotavora@gmail.com \
--cc=monnier@iro.umontreal.ca \
/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.