From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: scratch/backend-completion 9a62da21c2 1/2: Integrate Stefan suggestions but rename it to "external-completion.el" Date: Sun, 4 Dec 2022 10:02:39 +0000 Message-ID: References: <167007345844.23701.8454474119701440468@vcs2.savannah.gnu.org> <20221203131739.2A601C004BA@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006e896805eefdac36" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17056"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 04 11:03:38 2022 Return-path: Envelope-to: ged-emacs-devel@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 1p1lqU-0004Gm-2W for ged-emacs-devel@m.gmane-mx.org; Sun, 04 Dec 2022 11:03:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1lpn-0005Gi-1Z; Sun, 04 Dec 2022 05:02:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p1lpl-0005En-Cg for emacs-devel@gnu.org; Sun, 04 Dec 2022 05:02:53 -0500 Original-Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p1lpj-0001Sn-RL for emacs-devel@gnu.org; Sun, 04 Dec 2022 05:02:53 -0500 Original-Received: by mail-oi1-x235.google.com with SMTP id s186so9838524oia.5 for ; Sun, 04 Dec 2022 02:02:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=kfbo9PzsCbCkWeHZCv/dGHzb2FCuZZZkpUFsgjPjGzA=; b=fuV0XmR2T2P0g0j2LV4oK53zAoXuVALjK8BK9JwLL8p+42xKRX6m94hwCRcA60WldH hSV6okjLv5e3gQqFcJgVxS7fMkM4Fll8MLg0fCDqSudS7ZNCxDlFDDlg0kxGDHAkyt9i 5olHaW+IsAqoq5BiB+OJy88GQmg/pphSBwaaLC0RPK2a/weo8XK70wtQ/fLq1AecJuFi iHBnpvo5k38Ok4vVSO9J38B6SAoKzQ+dcleTZclb1k2Vg+ylIncjXcRRWwwOxth0bTXu F4nceJ29y02TYWJMp1FnzmcvCUaWQeFkrgUJbHeouzexLtS/QjxRDJ+9c60tyz5EAbjG W3oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kfbo9PzsCbCkWeHZCv/dGHzb2FCuZZZkpUFsgjPjGzA=; b=Z1IEalxP0xqFcEcpZYWQ/L3hk5G65y6PedzdRvkMmNXf9/1SXyEpabchoHwGH5BxIF ZL7zC+DDy1/mPRdmsuni2cYbk5/4fSzUkBYnQDoDX58BQxqA9wH2cLabOeX5/U5YNrwd T1PzRINuAq9BzJeeWczYznEkaw6QPubl1Amn29W+8JLxsV2CHFr1Um+UutdfvhUsqy9H bfYqmvHQpfBgve7UVUYPtY6veyvb5itTc1l3QYtbcccUx+wIrhMRMsof+k2sHIQOVE9n uOkeHpGXfroNsKArdT6M8nXCxmnybrXDRPFZxU24SrsQicNX+RNrjqrh91ipkiiFnMW2 FvMw== X-Gm-Message-State: ANoB5pkM7/MB5JRl8zaEwHK6TAOq8nd0EFP0KT6Qd4VIlrRRPNG1xmwx N4Qnf2nN8mlo7SNDquBOIKRQrhiL5T9pC2nUAc0ZQKRd X-Google-Smtp-Source: AA0mqf6+9GEZt+y/9g69n240ULYd+Nh4yWHr4aZwKW1Vi5dFm/LwWWVDxvneWiuXCVfHom7u6po17EeXJdaeZzqoNvM= X-Received: by 2002:aca:ac44:0:b0:35c:2ddf:59d5 with SMTP id v65-20020acaac44000000b0035c2ddf59d5mr514264oie.215.1670148170613; Sun, 04 Dec 2022 02:02:50 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::235; envelope-from=joaotavora@gmail.com; helo=mail-oi1-x235.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: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300898 Archived-At: --0000000000006e896805eefdac36 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Dec 4, 2022, 00:31 Stefan Monnier wrote:= . > > For prefix completion, it works great. > For completion styles like `flex`, it's rarely able to complete anything. Alright, that helps, thanks. But what use can you imagine try-completion having with an external tool like LSP or my everything.exe client which does regex-style? Or some other external tool you can think of... Is it perhaps that the caller of our new function might look at the tool's results for PATTERN and then, knowing the implicit style the tool is employing, use TRY-COMPLETION-FUNCTION to extend the string being used for PATTERN at the completion locus? This would make some sense, but then again probably only be actually useful if the caller is adept of caching the results of the calls to LOOKUP. Else, I think we end up contacting the external tool one too many times for the same PATTERN. That's at least with the popular completion front-ends such as fido/vertico who probably go for the 'allc' immediately. Maybe 'external-completion-function' could be doing some per-table-per-PATTERN caching, to relieve the caller of this complication. Jo=C3=A3o > > --0000000000006e896805eefdac36 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Dec 4, 2022, 00:31 Stefan Monnier <monnier@ir= o.umontreal.ca> wrote:.

For prefix completion, it works great.
For completion styles like `flex`, it's rarely able to complete anythin= g.

Al= right, that helps, thanks. But what use can you imagine try-completion havi= ng with an external tool like LSP or my everything.exe client which does re= gex-style?=C2=A0 Or some other external tool you can think of...

Is it perhaps that the caller of o= ur new function might look at the tool's results for PATTERN and then, = knowing the implicit style the tool is employing, use TRY-COMPLETION-FUNCTI= ON to extend=C2=A0 the string being used for PATTERN at the completion locu= s?=C2=A0 This would make some sense, but then again probably only be actual= ly useful if the caller is adept of caching the results of the calls to LOO= KUP.

Else, I think we en= d up contacting the external tool one too many times for the same PATTERN. = That's at least with the popular completion front-ends such as fido/ver= tico who probably go for the 'allc' immediately.=C2=A0

Maybe=C2=A0 'external-completion= -function' could be doing some per-table-per-PATTERN caching, to reliev= e the caller of this complication.

Jo=C3=A3o
=C2=A0
--0000000000006e896805eefdac36--