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#42149: Substring and flex completion ignore implicit trailing =?UTF-8?Q?=E2=80=98any=E2=80=99?= Date: Mon, 28 Dec 2020 17:04:42 +0000 Message-ID: <87bledkgk5.fsf@gmail.com> References: <874kk7107v.fsf@gmail.com> <875z4ml1l2.fsf@gmail.com> 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="21331"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 42149@debbugs.gnu.org, Dario Gjorgjevski To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 28 18:06:38 2020 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 1ktvyg-0005Rf-IZ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Dec 2020 18:06:38 +0100 Original-Received: from localhost ([::1]:33372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ktvyf-0005IG-EJ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Dec 2020 12:06:37 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ktvx9-0003cQ-Ku for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2020 12:05:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53384) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ktvx9-0004qf-9e for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2020 12:05:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ktvx9-0004lm-4S for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2020 12:05:03 -0500 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: Mon, 28 Dec 2020 17:05:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42149 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 42149-submit@debbugs.gnu.org id=B42149.160917509218287 (code B ref 42149); Mon, 28 Dec 2020 17:05:03 +0000 Original-Received: (at 42149) by debbugs.gnu.org; 28 Dec 2020 17:04:52 +0000 Original-Received: from localhost ([127.0.0.1]:36694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktvwy-0004kt-24 for submit@debbugs.gnu.org; Mon, 28 Dec 2020 12:04:52 -0500 Original-Received: from mail-wm1-f45.google.com ([209.85.128.45]:39278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktvww-0004kh-Cs for 42149@debbugs.gnu.org; Mon, 28 Dec 2020 12:04:50 -0500 Original-Received: by mail-wm1-f45.google.com with SMTP id 3so10293565wmg.4 for <42149@debbugs.gnu.org>; Mon, 28 Dec 2020 09:04:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=dlD9yM9vMqHE2bR+FKnVl+WJeSNf3BoPaew6uUV4qjE=; b=oxkf9FOv6N1CpJQKBR1Vm5DwFkiq11NWjxKObzEkx+gZTz+2XsZhMeDtSZBN//9R9N KL0oZEDueWt/GyoK9Xx4VQ1T78zij5RN81jzjnuYEo8xvZ8QiXsQZ4fUDjEmIEcmxRoY SDZw3N4X1FsGyp9AGm+iDu7H7oGUlf0XZIE7G1ZPCzTdJMwQxaN4U+WF06k+gRt1HKFN qawYIQQbFbGYx022m4q/luLtBY1KPMSGA0DkzenYLeTZ3GqWDl2x7mDYtcE9ARmc3vmC npM92DeCM4sDBUKSQILL5jQxcB84Xa+rS9gltWsvm2y1WrcpZsWw9WTTwnP5CJAca0aD gpRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=dlD9yM9vMqHE2bR+FKnVl+WJeSNf3BoPaew6uUV4qjE=; b=R6oq+KBmW3V/8jD/JoBpCAwpS/BgGA0MG0dWAvcST8df5MroWij7MAU+W86HOoMIFh KLDC8aVXOXvgV6Ln638oZWmz4u6mabYtDJ1ujgKFxQC7ArOuYeUV/WqLN9NyM5voT0CO 21evUMiDAFPrZe1Tt4TB1k8PdEtRFxQbskjA5rWr5g6RbyZHq8myv2V2L1JmMl98WWHr r2Zfu3xkK+7bIsqf8A09bJB8cemVRu3RYKvQRlbnAVOYqt6VvLkmOO/ufrRkAs3VP11v aKl5uygMUZwKqbx3UdE/rAUuEn63FrGiHmmZXeTmuuieGYfZR8mM/dSe4N5ZOVSPDXdt uVDA== X-Gm-Message-State: AOAM530clxo9yaP45DapUS93rTMmTDY5S/hYXBpwH+jS6so2fUWSnWAm fR7C4nLrwUhfGAzEVXyQwzRuP73hu1k= X-Google-Smtp-Source: ABdhPJxEyhjxk885oZHeh/gcuaIFoG6dmPnIKfqr96jIzpVNi+QDyZS4aDPN7oI58GyWH3aCsgvwvQ== X-Received: by 2002:a1c:208f:: with SMTP id g137mr20760707wmg.67.1609175084101; Mon, 28 Dec 2020 09:04:44 -0800 (PST) Original-Received: from krug (6.213.115.89.rev.vodafone.pt. [89.115.213.6]) by smtp.gmail.com with ESMTPSA id 125sm19581292wmc.27.2020.12.28.09.04.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 09:04:43 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Mon, 28 Dec 2020 11:07:56 -0500") 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:196875 Archived-At: Stefan Monnier writes: >> Regardless, if you don't want to touch that funciton, I understand, it >> is used in more places than just completion-pcm--hilit-commonality, >> which really should be called >> >> completion--given-that-we-know-this-matches-tell-me-where-and-how-well > > Hmm... until someone=E2=84=A2 added scoring to it, this function did noth= ing > more than add faces to highlight the common parts and the "first > difference". So I'd suggest you take it up with that someone ;-) :-) Grumblebgrumpbl. I kinda did, and so I added a docstring to it (have a read). Anyway, what's suprising about this function is that this re-matches PATTERN to each of COMPLETIONS which is very odd to the reader, becasue it also asserts that PATTERN already matches COMPLETIONS. Why are we regexp-matching twice?! -- asks the poor soul reading this. This comes down to completion-regexp-list being used by Fall_completions() directly. If that C function recorded the match data in all the lisp strings it was passed, then completion--given-that... would be easier follow. And likely faster. Though I haven't measured the impact, sparing a regexp match against each completion might be worth it in terms of responsiveness, especially in flex and similar methods. Jo=C3=A3o