From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#48572: 28.0.50; Add `passthrough` completion style to minibuffer.el Date: Sun, 23 May 2021 18:33:42 +0100 Message-ID: References: <2ebf9ed0-bd5d-8107-9d22-61e56f29c02a@daniel-mendler.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000af9f1b05c303bd6c" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5796"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mail@daniel-mendler.de, 48572@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 23 20:49:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lktA0-0001Ir-Ha for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 23 May 2021 20:49:12 +0200 Original-Received: from localhost ([::1]:40732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkt9z-0000os-JR for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 23 May 2021 14:49:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkt9r-0000o0-73 for bug-gnu-emacs@gnu.org; Sun, 23 May 2021 14:49:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58445) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lkt9p-0004sn-P0 for bug-gnu-emacs@gnu.org; Sun, 23 May 2021 14:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lkt9p-00028U-NV for bug-gnu-emacs@gnu.org; Sun, 23 May 2021 14:49:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 May 2021 18:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48572 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: Daniel Mendler , bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16217957288191 (code B ref -1); Sun, 23 May 2021 18:49:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 May 2021 18:48:48 +0000 Original-Received: from localhost ([127.0.0.1]:41758 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkt9c-000283-7r for submit@debbugs.gnu.org; Sun, 23 May 2021 14:48:48 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:56454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lkt9Z-00027u-6h for submit@debbugs.gnu.org; Sun, 23 May 2021 14:48:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkt9X-0000nR-BO for bug-gnu-emacs@gnu.org; Sun, 23 May 2021 14:48:43 -0400 Original-Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]:40456) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lkt9T-0004jy-Pw for bug-gnu-emacs@gnu.org; Sun, 23 May 2021 14:48:43 -0400 Original-Received: by mail-io1-xd2f.google.com with SMTP id e17so13026094iol.7 for ; Sun, 23 May 2021 11:48:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AIB7b1aUA/O1tdD/bvckj13+Wk+w8z+ptcuG3OawzCc=; b=GGvRZbi2dtYJNRFMzf9ESXkRqWpqO6AD/IROc4pgx8JRA/UVOqN7dBMfuO6VhNqqLw xnpK6az4uK681D9d+A4wod1Peh/EhlK7bI4h6sEoSWy+GFTDh2n6erAfnAT84sV+JMGX PWQuWpT64BQ19iIW+jgJq7SR0WCPGOiX7yZtB5uy0q/U7qd/1YZ96pvbc9xQn2Z2guvk yWvW4Ym09zkx7w31Hq0zXC0cluw7DGW2xGIC70ZGsjT0+yX1sAm5S6cQ/kfL9htneg6w /15D9w+j2wWwsvisf0HfxrESuACvEpuK0vmSGvr1G6zB+blkPnEayg1TIaZA//bzJm7Z TiIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AIB7b1aUA/O1tdD/bvckj13+Wk+w8z+ptcuG3OawzCc=; b=NZmT4LQEigUi/HirA8b6ZCIYzx3xoVsQIe+z/QPbErBODZljreIpvnXaUdzFGqkHZj N4220n7OkBKrtrudnju3P29sh5JkEhkH0Oh2UJ+KAXOoZaGalOeH8fHVWFnOVuC4FjPt XPYWo5PdTMOicvHdKA2gjyN5C2lmQ/wYv75Huvw6AVw09PQdHMw7N1gYl1nAGL6bRZPP PEMuLy7bt7z3B3T+bBlL+56Qt1R96/aDKPNv2Vj5AopObyaZfxUaW8ICaDDT4kEK1l2B fGs1T4LK3qzNHzb9VJTMpL8K+YDMl52n8K9LcF1TSQ9KLjl+vXz1KHtfyhwo4LUiaUKh 524Q== X-Gm-Message-State: AOAM532XT+6RloF5K1iJU/dUNO49Ydo2VI7A7aBQBQlhXkIrGygv+37B niZXBep3CwPtQmNbS9HeE/qM/j+XypK9qVDwOts= X-Google-Smtp-Source: ABdhPJwJNPD0NhyCqSd4YhvEgoZx96kEUzzuVVDEeE2MWjrhgxOUXB+9zMnvoEIyCPR8+V7mNb5ck6d9Lb4eog5MT7Q= X-Received: by 2002:a02:a312:: with SMTP id q18mr20328282jai.24.1621795718273; Sun, 23 May 2021 11:48:38 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::d2f; envelope-from=joaotavora@gmail.com; helo=mail-io1-xd2f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:207099 Archived-At: --000000000000af9f1b05c303bd6c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable If it helps, I've a working copy of Stefan's idea over at github.com/joaotavora/sly. Indeed it's called backend there, and it's been working fine for some years to let Sly's completion providing backend do the flex or prefix heavy lifting, while still appearing as a normal completion table to Emacs frontends, such as icomplete, vanilla, company-capf and even Helm. A first approach could be just to copy that over to Emacs minubuffer.el. Jo=C3=A3o On Sun, May 23, 2021, 16:51 Stefan Monnier wrote= : > >> Clearly, this is not right: passthrough completion should pass the `st= r` > >> and `point` info to the completion table. The completion table may op= t > >> to ignore that information, but we shouldn't prevent them from using i= t. > >> I expect most passthrough uses will want to use `str`. > > > > I see what you mean. In my use case I didn't use an improperly > > implemented completion table which does not ignore . However the > > question is then if this "passthrough" style is really needed since if > > you don't ignore the input, it is mostly equivalent to the emacs21 styl= e. > > 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. > > > Stefan > > --000000000000af9f1b05c303bd6c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
If it helps, I've a working copy of Stefan's idea= over at github.com/joaotavora= /sly.

Indeed it's call= ed backend there, and it's been working fine for some years to let Sly&= #39;s completion providing backend do the flex or prefix heavy lifting, whi= le still appearing as a normal completion table to Emacs frontends, such as= icomplete, vanilla, company-capf and even Helm.
A first approach could be just to copy that over t= o Emacs minubuffer.el.

J= o=C3=A3o

On Sun, May 23, 2021, 16:51 Stefan Monnier <monnier@iro.umontreal.ca> wrote:
=
>> Clearly, this is not right: p= assthrough completion should pass the `str`
>> and `point` info to the completion table.=C2=A0 The completion tab= le may opt
>> to ignore that information, but we shouldn't prevent them from= using it.
>> I expect most passthrough uses will want to use `str`.
>
> I see what you mean. In my use case I didn't use an improperly
> implemented completion table which does not ignore . However the
> question is then if this "passthrough" style is really neede= d since if
> you don't ignore the input, it is mostly equivalent to the emacs21= style.

The "passthrough" (elsewhere called "backend") completi= on-style is
definitely something we need to add, yes.=C2=A0 But what it should do is pa= ss
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.=C2=A0 But we shouldn't call `all-completions`= or
`try-completions` for that.=C2=A0 Instead we should call the completion-tab= le
directly, as is done for the `completion-boundaries` method.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan

--000000000000af9f1b05c303bd6c--