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#47711: bug#48841: bug#47711: bug#48841: bug#47711: [PATCH VERSION 2] Add new `completion-filter-completions` API and deferred highlighting Date: Thu, 2 Nov 2023 11:12:15 +0000 Message-ID: References: <56ab18b1-4348-9b2c-85bb-af9b76cd429a@daniel-mendler.de> <328f87eb-6474-1442-e1ca-9ae8deb2a84a@yandex.ru> <83fsvcbio7.fsf@gnu.org> <9f432d18-e70f-54c1-0173-1899fb66d176@gutov.dev> <877cnafv39.fsf@gmail.com> <9447dde3-b8e7-2ec0-9a9c-72c4cf9d12a8@gutov.dev> <7d14bc13-4419-816c-5708-c42988c39c02@gutov.dev> <5d0a78cc-4fa0-ef04-3462-1826f17d7d56@gutov.dev> <877cn8asud.fsf@gmail.com> <8734xtauqj.fsf@gmail.com> <5181f95e-61e7-c8c4-6389-44ee57e0c749@gutov.dev> <31cadbfd-d086-a04f-0ed9-17ce70b4282c@gutov.dev> <835y2k8nyt.fsf@gnu.org> <834ji48lrg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23710"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, 47711@debbugs.gnu.org, monnier@iro.umontreal.ca, mail@daniel-mendler.de To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 02 12:13:51 2023 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 1qyVe1-0005zI-Th for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Nov 2023 12:13:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyVdi-0008Bi-Ru; Thu, 02 Nov 2023 07:13:30 -0400 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 1qyVdf-0008BL-NJ for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 07:13:28 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyVdf-0007Tp-Eq for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 07:13:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qyVeD-0005Nl-Sb for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 07:14: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: Thu, 02 Nov 2023 11:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47711 X-GNU-PR-Package: emacs Original-Received: via spool by 47711-submit@debbugs.gnu.org id=B47711.169892359820632 (code B ref 47711); Thu, 02 Nov 2023 11:14:01 +0000 Original-Received: (at 47711) by debbugs.gnu.org; 2 Nov 2023 11:13:18 +0000 Original-Received: from localhost ([127.0.0.1]:54032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyVdS-0005Me-8y for submit@debbugs.gnu.org; Thu, 02 Nov 2023 07:13:18 -0400 Original-Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]:61785) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyVdL-0005MK-VC for 47711@debbugs.gnu.org; Thu, 02 Nov 2023 07:13:12 -0400 Original-Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-507c5249d55so953202e87.3 for <47711@debbugs.gnu.org>; Thu, 02 Nov 2023 04:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698923547; x=1699528347; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uxxqBMGhl1VrYLzij/h26zZyVwBnfQpBZxB1M1LMwX8=; b=g6rLU21YoeF4c4uLqmaY4YUlpkNgFnAOGM46HPID6VGWOpS5Nw5rjusIWYowqXtuHq bU/WH+XmAjg6HLUweQ0Yzyqszydc5FCJY063pN6khYk5giHAzXq9nlZY42hxgIn6ZrsW db5kQTr0WwdqjixYrysv0zWsHKVaDGoGm47DU/UWKaWUzrZe4dZEWT4heCYiOUvUfpN6 H4NtCeJCmNx8DU4ctkEgenxA/M8r2lHqSPHZ34xsioCuWUmwaDsQOJj1F8KGHL6ZfX0t eYLRtH1pY1E10rzlEGDQusQg84BOPiHCUDyjc46QHx3Dyw/axAE/QBuIG6+QJXZDOF0U oS+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698923547; x=1699528347; h=content-transfer-encoding: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=uxxqBMGhl1VrYLzij/h26zZyVwBnfQpBZxB1M1LMwX8=; b=RsbCg1L9bnbpoKhVz+1ZTqkHgRolOB8vrQiDnl23gajDrqdN4mBM8QjWtzHaokdY9w 8X9BXCuojLvQdK+LeD49YolP1W4lmoVUdo344Z+pzjRcz9eK7Bedidrq3solliW75pN/ KmkIBhxUaMEIKvGBRXrQ3jwXlHIibAMgLGdWRM62Kg8m5hwpuKoccX7EQO3+93tOEWh3 3V6vlGluhM6OWThgIiUXGwYqbF2uT/DleAYwGuTZMpVF75vMbSportXqlGfGqEEulwX/ Rh47oDKQW679ODdrWmfUzHRKPE7GV0zCkvKa2Z+xkuKpI8JN/et0Cpd93l32MpDvUrJE qApQ== X-Gm-Message-State: AOJu0YzZHRQik12KpR8HyqKInCkdVerQoojuEvgN/44wdYabNVxP3hxa lYc4P3pt9YGc2MfBGeq8+6aLRbJ7+m252+SiOc8= X-Google-Smtp-Source: AGHT+IEkeQ89Nt6qsbvkR21wcSTCIl485m5V6Y+z5mDwzxg5QtLqyDB5v3kP0Mr4HBPuKfuf4iE3K+HALdFgFDQInp0= X-Received: by 2002:a19:ca49:0:b0:507:c9d5:39a9 with SMTP id h9-20020a19ca49000000b00507c9d539a9mr12694997lfj.52.1698923546828; Thu, 02 Nov 2023 04:12:26 -0700 (PDT) In-Reply-To: <834ji48lrg.fsf@gnu.org> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273647 Archived-At: On Thu, Nov 2, 2023 at 10:58=E2=80=AFAM Eli Zaretskii wrote: > > After some rounds of benchmarking and discussion, Dmitry and I > > think the latest version of the patch should be installed. > > Are there any problematic aspects of the patch that need to be > discussed or considered before installing the patch? > > IOW, why are you soliciting our opinions, instead of just going ahead > and installing? No particular reason. Dmitry suggested that we do, and you participated in this discussion a while back, and I know you normally have some useful comment or two. > > In a nutshell it solves the performance problem of overly eager > > completion highlighting with minimal changes to the completion API. > > It looks to me like it adds a new feature, not just solves a > performance problem? > > Some minor comments to the patch itself: > > > +(defvar-local completion-lazy-hilit nil > > + "If non-nil, request completion lazy highlighting. > > + > > +Completion-presenting frontends may opt to bind this variable to > > +non-nil value in the context of completion-producing calls (such > > +as `completion-all-completions'). This hints the intervening > > +completion styles that they do not need to > > +fontify (i.e. propertize with the `face' property) completion > > +strings with highlights of the matching parts. > > If this is intended to be bound by frontends, why is it defvar-local? > I thought let-binding buffer-local variables is a tricky business that > could have unexpected results? Good catch! It shouldn't be defvar-local indeed, not with this latest version. See, glad I called you ;-) > Also, I think this doc string should reference > completion-lazy-hilit-fn. > > > +(defvar completion-lazy-hilit-fn nil > > + "Used by completions styles honoring `completion-lazy-hilit'. > > This should mention "function", since just "Used to..." doesn't convey > that, and "-fn" could also mean "file name", not just "function". Makes sense. > > +(defun completion-lazy-hilit (str) > > + "Return a copy of completion STR that is `face'-propertized. > ^^^^^^^^^^^^^^^^^^ > Strange quoting. "face" is not a symbol that we want to have a link > to, is it? It's not a symbol we'll be referencing, but it's a symbol. I'll rewrite it. > > I see a few more places in the doc strings that will "need work", but > that can be done later. > > What did you want to say in NEWS about this? If it's just a > performance improvement, we don't normally mention them in NEWS. But it needs frontends to opt in, and that requires an non-breaking addition to completion API. Jo=C3=A3o