From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#65137: 29.1; completion-substring-try-completion doesn't return the longest common substring Date: Tue, 05 Sep 2023 17:26:00 -0400 Message-ID: References: <83a5v1okwm.fsf@gnu.org> <875y5pk8rj.fsf@catern.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3026"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: sbaugh@catern.com, Eli Zaretskii , 65137@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 05 23:28:22 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 1qddav-0000Yz-GF for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Sep 2023 23:28:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qddad-0007cI-Ed; Tue, 05 Sep 2023 17:28:03 -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 1qddab-0007aD-MB for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 17:28:01 -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 1qddab-0001am-EP for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 17:28:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qddab-0004gE-Oh for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 17:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Sep 2023 21:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65137 X-GNU-PR-Package: emacs Original-Received: via spool by 65137-submit@debbugs.gnu.org id=B65137.169394923417928 (code B ref 65137); Tue, 05 Sep 2023 21:28:01 +0000 Original-Received: (at 65137) by debbugs.gnu.org; 5 Sep 2023 21:27:14 +0000 Original-Received: from localhost ([127.0.0.1]:59654 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qddZq-0004f4-6W for submit@debbugs.gnu.org; Tue, 05 Sep 2023 17:27:14 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:27599) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qddZk-0004eo-Da for 65137@debbugs.gnu.org; Tue, 05 Sep 2023 17:27:12 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 11FF24446C5; Tue, 5 Sep 2023 17:27:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1693949220; bh=9qBYky+aJI+rnhdKPehXWloUoKXC0BtTfT0JztVFpeI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=kcFx3k4Z7g60XE1AA8iZjuyeNeanNn2oBH00Nwp9ovCuRug+TeUYWB4qh/YeYZcSo Vd/hT6uqT0crXvS9tDb7vLhw8sKMrTLGhKK0GYvOlJMTl2KkwKPmVFz8yscrnmTxQA rlpQ31+Og9Z1cunUBq+J0RF9q0SMGldllZBG3lie96H+T3S0wsoU9U2fHNVAuZRIvo f//jiK7cxurR3ezFEC4GYvaJfpQ+lufsBQR7tPikt90MOyz9WT08lAPOCHiuJtmKBn lnIuYX6JU7KnwqgUNYncKG9vQ1cUN4x4Ca4fZ+isqcR2FxkZh48xjMOW9PN5l8L6We oncEjmPkWrmmw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 6BC9F4446B7; Tue, 5 Sep 2023 17:27:00 -0400 (EDT) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 54597120263; Tue, 5 Sep 2023 17:27:00 -0400 (EDT) In-Reply-To: (Spencer Baugh's message of "Tue, 05 Sep 2023 15:51:14 -0400") 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:269411 Archived-At: > Patch with test: Thanks, pushed. >> Similarly, I see that >> >> (completion-pcm--merge-completions '("abr" "absabr") '(prefix "br")) >> >> returns >> >> ("br" prefix) >> >> whereas it should arguably return >> >> ("br" "a" prefix) >> >> [ Tho this may have the side effect that after this completion, `absabr` >> won't be considered any more, if the `basic` completion comes before >> `substring` :-( ] > I did notice this too. I could try fixing/changing this too, but it > does seem annoying when basic comes before substring - as it does by > default in a number of completion categories. Yup :-( I have often wished for there to be a way to remember the style that was used so as to try and avoid such "style capture". > I wonder if we should move basic to after substring in those > categories in completion-category-defaults? It's a tradeoff: the default is designed to reduce the factor of surprise for people used to the default (i.e. to mostly prefix completion). > Or just remove basic from them. Same difference :-) > It doesn't seem like having both basic and substring in those lists > has much point. If you're used to relying on `substring` indeed it's not helpful. But if you're used to using mostly prefix-based completion (which may have the effect that you choose your names such that prefix completion works well), it can be helpful to have `substring` as a fallback when you can't remember what prefix to use for the thing you're looking for. Stefan