From unknown Wed Jun 18 23:15:58 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#77718 <77718@debbugs.gnu.org> To: bug#77718 <77718@debbugs.gnu.org> Subject: Status: 31.0.50; completion styles substring and flex are broken Reply-To: bug#77718 <77718@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:15:58 +0000 retitle 77718 31.0.50; completion styles substring and flex are broken reassign 77718 emacs submitter 77718 Stephen Berman severity 77718 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 10 18:22:38 2025 Received: (at submit) by debbugs.gnu.org; 10 Apr 2025 22:22:39 +0000 Received: from localhost ([127.0.0.1]:47442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u30IA-0001NA-2a for submit@debbugs.gnu.org; Thu, 10 Apr 2025 18:22:38 -0400 Received: from lists.gnu.org ([2001:470:142::17]:42598) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u30I6-0001M6-AK for submit@debbugs.gnu.org; Thu, 10 Apr 2025 18:22:34 -0400 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 1u30Hm-0001vZ-KI for bug-gnu-emacs@gnu.org; Thu, 10 Apr 2025 18:22:22 -0400 Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u30Hh-0006ay-Ez for bug-gnu-emacs@gnu.org; Thu, 10 Apr 2025 18:22:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1744323724; x=1744928524; i=stephen.berman@gmx.net; bh=l0QdhmYqhcvJBYMX9h2HghfuQ5lyUT2gs6vHtxRUs60=; h=X-UI-Sender-Class:From:To:Subject:Date:Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=XHCr6T3T2Wl0t5wMrWEsf/V1FAt7vcxjphTln8t+XjOylpEdOROyWiwI/fiztRgG J04T7oKpPDADuZSsJUE0L+itj5xE6N+WYnwBGr8A6bGKoIJ8ee7Etl5h/IZo8IXa2 kKsjD/YVtEn24tPWivlBLg6qEP1vJPVeq2n/PH7s0r4HkDrR8cGNaewmIQY33e9kQ tdV4ze44CP0NBNJ2E7UO0nKgWEIs+pKIhv/FughPXvISa9TEPThrOAZEE7Z07bdRE 919sSOClpaDupTLR7XuxRPeXx8M7/rrvVV2GHZcsWlv/9HABENewjiFelXvsJ277Y ioucTAIjtMW0FH34BQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([94.134.94.12]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MowKc-1tGFfu2qX0-00oChA for ; Fri, 11 Apr 2025 00:22:04 +0200 From: Stephen Berman To: bug-gnu-emacs@gnu.org Subject: 31.0.50; completion styles substring and flex are broken Date: Fri, 11 Apr 2025 00:22:01 +0200 Message-ID: <87y0w7ejxy.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:MowRBtdUMBpN1HDiqagIyU9xgd5jhlPvGM8z+vQ8nkFRcVSQ5Ct gTWp5ffQt4iMh4hGetCOvUjfsJhzjecTtkeOFwAm0qBsrNbPY7BzHdH2UIgpPgctTnOAMqd lfuyKpTvg/7ACBB0nH9R6NpReujzI/iHoX6GkPDovxHepTpVOJyYrxuc2vxauyTJuOYoZj2 5eIhvXkbSaT27ZHZfTawA== X-Spam-Flag: NO UI-Outbound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.20; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 0. Start Emacs like this: emacs -Q --eval "(custom-set-variables '(completion-category-overrides = '((file (styles substring)))))" or like this: emacs -Q --eval "(custom-set-variables '(completion-category-overrides = '((file (styles flex)))))" 1. Type `C-x d' and at the prompt enter: `/usr/ TAB'. =3D> Now the text following the prompt is this: "/usr//" and "/usr/" is fontified with face file-name-shadow. 2. Type `TAB' again. =3D> Now the text following the prompt is this: "//" and the first forward slash is fontified with face file-name-shadow. 3. Type `TAB' again. =3D> Now a *Completions* buffer pops up listing all the directories directly under root (dev/, etc/, home/ and so on). This only happens with the substring and flex completion styles; with any of the other completion styles (basic, partial-completion, emacs22, initials), or if Emacs is started just with -Q, then after step 1 as expected a *Completions* buffer pops up listing the directories under /usr (bin/, include/, lib/ and so on). The broken behavior with the substring and flex styles is due to the change in completion-pcm--merge-completions in this commit: commit 0fbba16387513e7692b46885833e4a9c218251f0 Author: Spencer Baugh Commit: Stefan Monnier CommitDate: Tue Apr 8 14:36:30 2025 -0400 Preserve an explicit * in pcm-try-completion [...] * lisp/minibuffer.el (completion-pcm--merge-completions): Don't drop important wildcards. (bug#74420) In GNU Emacs 31.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.49, cairo version 1.18.4) of 2025-04-10 built on strobelfs2 Repository revision: c0ea954d0f650227dc518f02a292daeb27cf0c37 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101016 System Description: Linux From Scratch r12.3-20 Configured using: 'configure -C 'CFLAGS=3D-Og -g3' PKG_CONFIG_PATH=3D/opt/qt6/lib/pkgconfig= ' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINERAMA XINPUT2 XPM XRANDR GTK3 ZLIB From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 11 03:23:03 2025 Received: (at 77718) by debbugs.gnu.org; 11 Apr 2025 07:23:03 +0000 Received: from localhost ([127.0.0.1]:48420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u38j8-0007MP-MU for submit@debbugs.gnu.org; Fri, 11 Apr 2025 03:23:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38292) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u38j5-0007Lp-3V for 77718@debbugs.gnu.org; Fri, 11 Apr 2025 03:23:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u38ix-0006kB-Hn; Fri, 11 Apr 2025 03:22:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=xSksW5hxieoxbyzZsRSfeizWKGzxY3vIWb/J84izhT4=; b=q5btHb0POv49 f2IlaRKOG2bzOGRu0KQT3cnDmP6NnuPmntSSjzfdnRMkUEi1+ahC571rYbbdKiBpv+PfG2X/ADo7p GCu9LaeE/2wUQllv2dChg+e7vrAoitohcPL1dqVZhll46YkA8g1RymUVvKUFxp1why0MlvKLsXYOZ RF1+wcDnSshsixiqc+fh5Fh+ljvX4nVryeWY+NxhVnRKa9bYlu0IQ4gHXpFYCZe/TdO/WNHlt6A0w BIDyF+aBas+WK9Iie7xucjpg7B1YTigBpt21SoTDJVT0JklZqHB/ANHTY/aBSUyLzMRC+d5xMUNdb yG+rSSFRBzEQKNAkN+6/QQ==; Date: Fri, 11 Apr 2025 10:22:46 +0300 Message-Id: <86semfp3g9.fsf@gnu.org> From: Eli Zaretskii To: Stephen Berman , Stefan Monnier , Spencer Baugh In-Reply-To: <87y0w7ejxy.fsf@gmx.net> (bug-gnu-emacs@gnu.org) Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken References: <87y0w7ejxy.fsf@gmx.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 11 Apr 2025 00:22:01 +0200 > From: Stephen Berman via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > 0. Start Emacs like this: > > emacs -Q --eval "(custom-set-variables '(completion-category-overrides '((file (styles substring)))))" > > or like this: > > emacs -Q --eval "(custom-set-variables '(completion-category-overrides '((file (styles flex)))))" > > 1. Type `C-x d' and at the prompt enter: `/usr/ TAB'. > => Now the text following the prompt is this: "/usr//" and "/usr/" is > fontified with face file-name-shadow. > > 2. Type `TAB' again. > => Now the text following the prompt is this: "//" and the first forward > slash is fontified with face file-name-shadow. > > 3. Type `TAB' again. > => Now a *Completions* buffer pops up listing all the directories > directly under root (dev/, etc/, home/ and so on). > > This only happens with the substring and flex completion styles; with > any of the other completion styles (basic, partial-completion, emacs22, > initials), or if Emacs is started just with -Q, then after step 1 as > expected a *Completions* buffer pops up listing the directories under > /usr (bin/, include/, lib/ and so on). > > The broken behavior with the substring and flex styles is due to the > change in completion-pcm--merge-completions in this commit: > > commit 0fbba16387513e7692b46885833e4a9c218251f0 > Author: Spencer Baugh > Commit: Stefan Monnier > CommitDate: Tue Apr 8 14:36:30 2025 -0400 > > Preserve an explicit * in pcm-try-completion > [...] > * lisp/minibuffer.el (completion-pcm--merge-completions): Don't drop > important wildcards. (bug#74420) Thanks, adding the guilty parties to the discussion. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 11 09:03:21 2025 Received: (at 77718) by debbugs.gnu.org; 11 Apr 2025 13:03:21 +0000 Received: from localhost ([127.0.0.1]:49490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3E2S-00044I-Ky for submit@debbugs.gnu.org; Fri, 11 Apr 2025 09:03:21 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:55185) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u3E2P-000443-KL for 77718@debbugs.gnu.org; Fri, 11 Apr 2025 09:03:18 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: <86semfp3g9.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 11 Apr 2025 10:22:46 +0300") References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> Date: Fri, 11 Apr 2025 09:03:12 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1744376592; bh=cUg2T6YtXqy6vhR7N0OeEwM4x63joJL9Lp5RoIC2qw0=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=tx4kXTqnHPONaIn6DTQYq+/rPeTwa85rlb94e9QNVdvem5VFkUaknp+I9Fv7vjgZj 8MwzWlTDU2XZMqOl7g2FWMYqA1ZwTHeN1ekSMDCGJgKGibjCYKV8M8JbgJXXXwMRgv PoR1CihO4GH/PZ/aUmWGSO0ai1Kz5rM7WURcuM3mGuwJl+b14t7w9Vug2xpYp/cHVC g+vEmo4T7SD+rQU6H3e9vZdaRANasC7/z3E/mw7d864qB/YGNf7wbrJNApFAMfKkQm HrImVE0r9bLa1yKZ10GiiiFkklNlDSROhb3pRZaFGlJ9A+h5p+ySAo47uK8e4Z3k6v IGSUUaHXZcEvw== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Stephen Berman , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> Date: Fri, 11 Apr 2025 00:22:01 +0200 >> From: Stephen Berman via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> 0. Start Emacs like this: >> >> emacs -Q --eval "(custom-set-variables '(completion-category-overrides '((file (styles substring)))))" >> >> or like this: >> >> emacs -Q --eval "(custom-set-variables '(completion-category-overrides '((file (styles flex)))))" >> >> 1. Type `C-x d' and at the prompt enter: `/usr/ TAB'. >> => Now the text following the prompt is this: "/usr//" and "/usr/" is >> fontified with face file-name-shadow. >> >> 2. Type `TAB' again. >> => Now the text following the prompt is this: "//" and the first forward >> slash is fontified with face file-name-shadow. >> >> 3. Type `TAB' again. >> => Now a *Completions* buffer pops up listing all the directories >> directly under root (dev/, etc/, home/ and so on). >> >> This only happens with the substring and flex completion styles; with >> any of the other completion styles (basic, partial-completion, emacs22, >> initials), or if Emacs is started just with -Q, then after step 1 as >> expected a *Completions* buffer pops up listing the directories under >> /usr (bin/, include/, lib/ and so on). >> >> The broken behavior with the substring and flex styles is due to the >> change in completion-pcm--merge-completions in this commit: >> >> commit 0fbba16387513e7692b46885833e4a9c218251f0 >> Author: Spencer Baugh >> Commit: Stefan Monnier >> CommitDate: Tue Apr 8 14:36:30 2025 -0400 >> >> Preserve an explicit * in pcm-try-completion >> [...] >> * lisp/minibuffer.el (completion-pcm--merge-completions): Don't drop >> important wildcards. (bug#74420) Thanks for the detailed bug report. Reduced slightly, the issue is that (completion-pcm--merge-completions '("x/" "y/") '(prefix)) now returns ("/" any prefix "" "") when it used to return (any "" "") I think this may be related to the implict "any" added by completion-pcm--merge-completions. I'll look into it and find a fix (and add a test covering this case). From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 11 15:43:27 2025 Received: (at 77718) by debbugs.gnu.org; 11 Apr 2025 19:43:27 +0000 Received: from localhost ([127.0.0.1]:51833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3KHe-0005Uc-SJ for submit@debbugs.gnu.org; Fri, 11 Apr 2025 15:43:27 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:41145) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u3KHc-0005UI-Ce for 77718@debbugs.gnu.org; Fri, 11 Apr 2025 15:43:24 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: (Spencer Baugh's message of "Fri, 11 Apr 2025 09:03:12 -0400") References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> Date: Fri, 11 Apr 2025 15:43:18 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1744400598; bh=GxA76DkoznxhbDcdZQ8VePv5IYzWl0ptkngY09Wq8ys=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=rHoI0GwM3U8JFgClphp30/9YWZBSZu7PrpDnjoAPBVr7yR1EhEEbFKjv4YiWFhMer BOHqQp2VDZwc2HRGgb9aA2MT2RLE8UCIsKLYiV/xIGd5H/bk6scuF23J1Hjc9Y1ZV4 BicfNTYn2Lg+Nw4gfaxBLFHy5/v0k+O2aa6lUTlMQxKWrBFHLafsNti67Hpjp1vZ/m QAIeCzf5vuXrTyXPhEAu5hHVS/p/oZv+pBtXMhAno/GNuxly8BWe056KhO+EieCpiE uj3oOT0VHG88IGftiSM21rwxmKzfzOd6rovzVicwc1YC9Swvou4mK5I997f+wHphaa NiqK9n2GSvVyw== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Stephen Berman , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Spencer Baugh writes: > Reduced slightly, the issue is that > (completion-pcm--merge-completions '("x/" "y/") '(prefix)) > now returns > ("/" any prefix "" "") > when it used to return > (any "" "") > > I think this may be related to the implict "any" added by > completion-pcm--merge-completions. I'll look into it and find a fix > (and add a test covering this case). Update: That's not the issue; this new return value for completion-pcm--merge-completions is actually correct, it's a desirable consequence of my bugfix patch. The issue is actually in completion-table-with-quoting, with filename completion and substitute-in-file-name; it doesn't handle // properly. I'm trying to fix it; it may be a somewhat large change to completion-table-with-quoting. Stefan, a related question: do you think it would be reasonable to split completion-table-with-quoting into two functions, separating the substitute-in-file-name and comint-quote-filename cases? It seems to me that the comint-quote-filename case is way simpler than the substitute-in-file-name case, and it would be a lot easier to understand if the two cases were done separately, without the abstraction of requote and unquote functions. I can do that if that seems reasonable. It would make fixing this issue a lot easier. (I don't think we need to maintain the same interface for completion-table-with-quoting - I see no usage in the 200 packages used at my site - I strongly suspect, given the complexity, that the only users are in Emacs core) From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 11 17:38:03 2025 Received: (at 77718) by debbugs.gnu.org; 11 Apr 2025 21:38:03 +0000 Received: from localhost ([127.0.0.1]:52037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3M4Y-0002f8-MK for submit@debbugs.gnu.org; Fri, 11 Apr 2025 17:38:03 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:4081) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u3M4W-0002eJ-Cw for 77718@debbugs.gnu.org; Fri, 11 Apr 2025 17:38:00 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B1CA68075E; Fri, 11 Apr 2025 17:37:54 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1744407473; bh=r9i1LWPK5N1G6jVJYfib4X6wJtYt716XZmv0dGQDMkg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=pQLGH9GgDJE2TqCYe0NbkZ8OHCQiuVutem7Bw96NEG+qeBVA+V3ipZU/rFFIUyC8J jlpx6uhvxEvzmrAXo5YwiPU20RGjcdTwpMKndpuS6Ecf1011CpCLcclhS8nW2VZ5v9 otMFQcIBz/L80myoWgHdDzIlupW6ZPjS3nmYfTDhmZ3kXYPQxtMI5vX1G/iR9ENiWj F+AXvNaZmhJAgB0uO1a1Hu4koUaBPM3YcxgWrEkKo1pLFm0aN7Ewf8s9ee7opxpxXA JBCNJxllsOWmz4IX8V3+ZmJnOQINrlfxe6Sa/cPRL7DaoIa056JLYxLpaxtThm3uJU V//jhSngLDG/Q== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E8662804C9; Fri, 11 Apr 2025 17:37:53 -0400 (EDT) Received: from pastel (unknown [104.247.242.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B9CCF120491; Fri, 11 Apr 2025 17:37:53 -0400 (EDT) From: Stefan Monnier To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: Message-ID: References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> Date: Fri, 11 Apr 2025 17:37:52 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.363 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stephen Berman X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Stefan, a related question: do you think it would be reasonable to split > completion-table-with-quoting into two functions, separating the > substitute-in-file-name and comint-quote-filename cases? It seems to me > that the comint-quote-filename case is way simpler than the > substitute-in-file-name case, and it would be a lot easier to understand > if the two cases were done separately, without the abstraction of > requote and unquote functions. I can do that if that seems reasonable. > It would make fixing this issue a lot easier. It's worth a try. The system we have is the best I could come up with back then but is hideous, so I'm interested in a simpler solution. > (I don't think we need to maintain the same interface for > completion-table-with-quoting - I see no usage in the 200 packages used > at my site - I strongly suspect, given the complexity, that the only > users are in Emacs core) It's definitely not worth worrying about that while designing a replacement. Maybe we'll want to preserve backward compatibility, but let's first get a good replacement. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 14 16:30:18 2025 Received: (at 77718) by debbugs.gnu.org; 14 Apr 2025 20:30:18 +0000 Received: from localhost ([127.0.0.1]:49214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u4QRd-0000Ce-UZ for submit@debbugs.gnu.org; Mon, 14 Apr 2025 16:30:18 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:48551) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u4QRa-0000B1-Vf for 77718@debbugs.gnu.org; Mon, 14 Apr 2025 16:30:15 -0400 From: Spencer Baugh To: Stefan Monnier Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: (Stefan Monnier's message of "Fri, 11 Apr 2025 17:37:52 -0400") References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> Date: Mon, 14 Apr 2025 16:30:09 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1744662609; bh=fTifyt80EbSPRduNoqRshB/oGomZMswTa9QmFWbqIIk=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=SXwCLNtfiMvDBJFOSucm/7wcw2FUYCJ2OpbPJlnsoXVVLC9JpajDQv1cwQdI1icCj 1WqzmTKQCu+7dwua42LP4wdC0gA2hwW+PWlqpwNR6BpwK7+7UOM8TVb5t92pUDUvc2 7u1t4fbwOqW2JFE4QhimF6pVYdW9Z6XXU5XYH28Xn0usSfa7RpSHoNLMkf3MytTkMB 92MVeZ0LnyoNrCUzv8OSmG+Na+FsuKGJgXq3U0APSy5VFGkr39fKS9fOIRS/A34DLP gT3vELZlHKqWG6An0tRNdvR+s+ODFQEMD8LTsxTsADbD+Suh/Z0L6U7UoTWy1oGier rDOCtRnkwKdUg== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stephen Berman X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Stefan Monnier writes: >> Stefan, a related question: do you think it would be reasonable to split >> completion-table-with-quoting into two functions, separating the >> substitute-in-file-name and comint-quote-filename cases? It seems to me >> that the comint-quote-filename case is way simpler than the >> substitute-in-file-name case, and it would be a lot easier to understand >> if the two cases were done separately, without the abstraction of >> requote and unquote functions. I can do that if that seems reasonable. >> It would make fixing this issue a lot easier. > > It's worth a try. The system we have is the best I could come up with > back then but is hideous, so I'm interested in a simpler solution. OK, here is a rework of just the substitute-in-file-name side. This fixes this bug (by making completion continue to work when point is at /usr/|/), and fixes another FIXME in a test (partial completion now preserves environment variables!). And I don't think it loses anything important, but I may be missing something. (completion--sifn-requote can now be deleted and there are probably other cleanups possible after this patch, but I didn't do them here to keep the patch smaller. Also, rfn-eshadow needs to be updated, but that's just a visual issue.) --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Improve-env-var-handling-in-read-file-name.patch >From 48653fd0b22739f6d836bbe121989f5051502d81 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Mon, 14 Apr 2025 16:01:38 -0400 Subject: [PATCH] Improve env var handling in read-file-name Fix various bugs, including bug#77718, by rewriting the way file name completion handles environment variable expansion. Instead of using completion-table-with-quoting to manipulate the string being completed on, simply make the completion table itself understand substitute-in-file-name. The completion table first tries to complete without substituting environment variables; this allows completion to work on file names which contain things which look like environment variables. If that fails, we call substitute-in-file-name and then complete again. Tests are updated: we no longer duplicate $s in file names, since that's not necessary. And partial-completion now preserves unexpanded environment variables. However, partial-completion no longer works across environment variables containing delimiters; that's an acceptable sacrifice. * lisp/minibuffer.el (completion--replace-prefix): Add. (completion--file-name-table): Rewrite to use substitute-in-file-name explicitly. (bug#77718) * test/lisp/minibuffer-tests.el (completion-table-test-quoting) (minibuffer-next-completion): Update. --- lisp/minibuffer.el | 43 +++++++++++++++++++++++++++++++---- test/lisp/minibuffer-tests.el | 16 ++++++------- 2 files changed, 45 insertions(+), 14 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index c0ccfc00ce5..4ccf3a1d2f9 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3596,13 +3596,46 @@ completion--sifn-requote (setq qpos (1- qpos))) (cons qpos #'minibuffer-maybe-quote-filename))))) -(defalias 'completion--file-name-table - (completion-table-with-quoting #'completion-file-name-table - #'substitute-in-file-name - #'completion--sifn-requote) +(defun completion--replace-prefix (s old new) + "Replace prefix OLD of string S with prefix NEW." + (concat new (substring s (length old)))) + +(defun completion--file-name-table (orig pred action) "Internal subroutine for `read-file-name'. Do not call this. This is a completion table for file names, like `completion-file-name-table' -except that it passes the file name through `substitute-in-file-name'.") +except that it passes the file name through `substitute-in-file-name'." + (let ((table #'completion-file-name-table)) + (cond + ((eq (car-safe action) 'boundaries) + ;; Boundaries are always computed on the original string. + (complete-with-action action table orig pred)) + (;; Ensure we discard text before // by always using sifn in that case. + (unless (string-search "//" orig) + (complete-with-action action table orig pred))) + (t ;; On a nil result, complete again after sifn and adjust the result. + (let* ((expansion (substitute-in-file-name orig)) + (result (complete-with-action action table expansion pred))) + (cond + ((null action) + (if (stringp result) + (completion--replace-prefix result expansion orig) + result)) + ((eq action t) + ;; Find the part of EXPANSION which is inside the boundaries, and + ;; replace it with the part of ORIG which is inside the boundaires. + (let* ((expansion-bounds (completion-boundaries expansion table pred "")) + (expansion-in-bounds (substring expansion (car expansion-bounds))) + (orig-bounds (completion-boundaries orig table pred "")) + (orig-in-bounds (substring orig (car orig-bounds)))) + (if (and (string-empty-p expansion-in-bounds) + (string-empty-p orig-in-bounds)) + ;; Nothing to replace, so avoid doing unnecessary work. + result + (mapcar + (lambda (s) + (completion--replace-prefix s expansion-in-bounds orig-in-bounds)) + result)))) + (t result))))))) (defalias 'read-file-name-internal (completion-table-in-turn #'completion--embedded-envvar-table diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index 59ac5ab9578..38c005bd1b5 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -91,20 +91,18 @@ completion-table-subvert-test (ert-deftest completion-table-test-quoting () (let ((process-environment - `("CTTQ1=ed" "CTTQ2=et/" ,@process-environment)) + `("CTTQ1=ed" ,@process-environment)) (default-directory (ert-resource-directory))) (pcase-dolist (`(,input ,output) '( - ;; Test that $ in files is properly $$ quoted. - ("data/m-cttq" "data/minibuffer-test-cttq$$tion") - ;; Test that $$ in input is properly unquoted. - ("data/m-cttq$$t" "data/minibuffer-test-cttq$$tion") + ;; Test that files containing $ can be completed + ("data/m-cttq" "data/minibuffer-test-cttq$tion") + ;; Test that $ can be completed + ("data/m-cttq$" "data/minibuffer-test-cttq$tion") ;; Test that env-vars are preserved. ("lisp/c${CTTQ1}et/se-u" "lisp/c${CTTQ1}et/semantic-utest") - ("lisp/ced${CTTQ2}se-u" "lisp/ced${CTTQ2}semantic-utest") ;; Test that env-vars don't prevent partial-completion. - ;; FIXME: Ideally we'd like to keep the ${CTTQ}! - ("lis/c${CTTQ1}/se-u" "lisp/cedet/semantic-utest") + ("lis/c${CTTQ1}/se-u" "lisp/c${CTTQ1}et/semantic-utest") )) (should (equal (completion-try-completion input #'completion--file-name-table @@ -690,7 +688,7 @@ minibuffer-next-completion (completing-read-with-minibuffer-setup #'read-file-name-internal (insert "d/") (execute-kbd-macro (kbd "M- M- M-")) - (should (equal "data/minibuffer-test-cttq$$tion" (minibuffer-contents)))))) + (should (equal "data/minibuffer-test-cttq$tion" (minibuffer-contents)))))) (provide 'minibuffer-tests) ;;; minibuffer-tests.el ends here -- 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 15 02:25:52 2025 Received: (at 77718) by debbugs.gnu.org; 15 Apr 2025 06:25:52 +0000 Received: from localhost ([127.0.0.1]:50210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u4Zjz-0006qp-OF for submit@debbugs.gnu.org; Tue, 15 Apr 2025 02:25:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60386) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u4Zjx-0006qd-VM for 77718@debbugs.gnu.org; Tue, 15 Apr 2025 02:25:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u4Zjr-00046R-AQ; Tue, 15 Apr 2025 02:25:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=JxWHBPSUROWuyT5AtBA6sddYMc7CNqXNAy2ycosiE40=; b=BKKHKrIX0GOW HMRBc0e2lmegXcw8ZG7DTIp0Esp7pQXVtnOY0I7YHccQAWYwonHlIo7nsnB9d4zcJ66f4QqsrU5Y6 UM+1lYZ5tLKedCIY2M9aXwjWaKd1PWxgrEl/IAv3xxpQK1D/dlC8EPbVf5gVvqPAssBZaQMDaRGVB B+ozqPB+/PPhEq/GJKtEuIUffO0ecJHE6P4yMNWkQACEfHizhNBUmh0eyCui47PMEFjHTKUMBJm8l ZkwpPjDQLwVXsXHit6PFaZyQrls7y+hMWyn7xRtHNSwrOR7PzZGEKWjlAmXgz9InzvWEud3x0yBnn tH1fB6aaxm7UCluSALbgNg==; Date: Tue, 15 Apr 2025 09:25:39 +0300 Message-Id: <86a58ihrfg.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Mon, 14 Apr 2025 16:30:09 -0400) Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, stephen.berman@gmx.net, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Spencer Baugh > Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stephen Berman > > Date: Mon, 14 Apr 2025 16:30:09 -0400 > > + (;; Ensure we discard text before // by always using sifn in that case. > + (unless (string-search "//" orig) > + (complete-with-action action table orig pred))) AFAIU, this ignores the case of UNC file names, which begin with "//", and other complications with file names on Windows. Emacs on Windows reacts differently to "//" than it does on Posix systems, and it does so for very good reasons. Please don't break file-name completion on Windows. It took us many iterations to get it right, and the result is fragile. Be sure to test each change on Windows as well before installing. For the same reasons, please test thoroughly with remote file names of different formats. Given the fragility of this, I'd tend to suggest to define a new style with these changes, and leave alone the existing styles, even if you consider them "broken". From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 15 04:22:28 2025 Received: (at 77718) by debbugs.gnu.org; 15 Apr 2025 08:22:28 +0000 Received: from localhost ([127.0.0.1]:50467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u4bYq-00076V-5G for submit@debbugs.gnu.org; Tue, 15 Apr 2025 04:22:28 -0400 Received: from mout.gmx.net ([212.227.17.20]:40819) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u4bYm-00076D-Fr for 77718@debbugs.gnu.org; Tue, 15 Apr 2025 04:22:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1744705337; x=1745310137; i=stephen.berman@gmx.net; bh=AIg4QSqgHd86vPxGLPUi3gjkx90vQK559n603F+O2Eg=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=c7tNQZ2GINn7zoPsk4lpbRV1ut7BfqM6GpFqrgOjQIqJjDmuR1015Uxjo6YLXwM8 X79TSevtJ1L5F6b6/jAEDAxwPI7h8HI6jhv9eGryyHCU17vSEJj3KwmFsRV+lhLZM Ub9eQyGs+sRpOT7ey+T6MBE70DtoZM2KD4uQF9RpJtH+aQ7RN2k4IUrJr5GFBEzBr p3uJ3rt5v/FIT2FjfSuCf7IRjNXUuq4YIHNDdaRl18VqOv6bIywaL1Mhjshq8Dr49 2yidmKSlYp/9qjAG/DTJmW9aT6nM5K6DVYTvqRO2ouquXx7s6eySE104uhVe0TyHC /yykP2wJx14+E5DbrA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([94.134.95.70]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N8obG-1szB1D2etK-016HTW; Tue, 15 Apr 2025 10:22:17 +0200 From: Stephen Berman To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> Date: Tue, 15 Apr 2025 10:22:15 +0200 Message-ID: <87a58hal6w.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:21YslgaZfUCYz0FtfqJkVKBWYYCDA9O0SFmYPPyRR3BpGpD0My3 IbCw3mXykaSjgWsm6noy6mz1sUxlkomyVHp8Zd8ab+YunPVkLtE1CnTJKXdc7BCZT70k1t4 Yfe0H0htGVSxCVm9U2cGypkGsSq7M52f0mYBoxr1+5WCwa+rq2sHp8NdlCTmpTnNgRgRy0w LzTKLf/4ZwIg8o/HgZ0fw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:TAJrj4/+fCU=;OeyqPfdw/esiTJP5koFtFLe5dT1 LHNlAS0Z0Xa5BBE7r7vhw5w8+cMRKw8+M1p5WY89Ebsc9FiBAGtlmtxi4Ybj3zAlJtXjJpCQX lY2AYZbd2ZYPX/CsN/DSZFkHG8pQ1ghcOLqIvz1FJpDgseL/B7N7b5kBHK9fOFH/WxJJZ68D3 LScyADwajKvCz+0MlWJYtci8+Lnra8/3gBWbZYgS2ZnwwBgBCbPy+jtlI+2F6KhNylSYweSr+ ByAJV4IvXzIFaQ2uHCpZyVwdSvM+wTpSJ99jQv6xnz/q7bAU69T2agBRf4JNHmh3FTO/tc2ic Tfuz2Rt90cFq6Qkzw3/bBqCG/mhrZHI6QHXoPBFPP8auUgikpMtdj+l4czL3jQVG9fi4iXv2Z YBet36cSD99z93aJ9w6OHIF8KIEyE8qoS2Iz+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uTYz REq6ccbD1aHaftIOhSiq+eHL5D/c= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Mon, 14 Apr 2025 16:30:09 -0400 Spencer Baugh wrote: > Stefan Monnier writes: > >>> Stefan, a related question: do you think it would be reasonable to split >>> completion-table-with-quoting into two functions, separating the >>> substitute-in-file-name and comint-quote-filename cases? It seems to me >>> that the comint-quote-filename case is way simpler than the >>> substitute-in-file-name case, and it would be a lot easier to understand >>> if the two cases were done separately, without the abstraction of >>> requote and unquote functions. I can do that if that seems reasonable. >>> It would make fixing this issue a lot easier. >> >> It's worth a try. The system we have is the best I could come up with >> back then but is hideous, so I'm interested in a simpler solution. > > OK, here is a rework of just the substitute-in-file-name side. This > fixes this bug (by making completion continue to work when point is at > /usr/|/), and fixes another FIXME in a test (partial completion now > preserves environment variables!). And I don't think it loses anything > important, but I may be missing something. > > (completion--sifn-requote can now be deleted and there are probably > other cleanups possible after this patch, but I didn't do them here to > keep the patch smaller. Also, rfn-eshadow needs to be updated, but > that's just a visual issue.) Thanks, I applied your patch and rebuilt emacs, and now completion with the substring style works, but it's still different from the behavior before you previous change, as your comments above seem to acknowledge: now when I enter "/us" and hit TAB, it completes to "/usr/" and when I hit TAB again it becomes "/usr//" with point on (i.e. just before) the last slash and "/usr/" displayed with the file-name-shadow face. Hitting TAB again pops up a *Completions* buffer with the correct completions (immediate subdirectories of /usr) and typing part of a candidate in the minibuffer correctly expands the file name. This behavior obtains with any directory whose immediate children are all directories; if at least one child is a non-directory file, the *Completions* buffer up on hitting the TAB the second time (and the part of the file name up to the final slash has the default face); so here the completion works also visually as before. So your patch only partially fixes the regression. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 15 07:17:20 2025 Received: (at 77718) by debbugs.gnu.org; 15 Apr 2025 11:17:20 +0000 Received: from localhost ([127.0.0.1]:50918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u4eI3-0001ul-LJ for submit@debbugs.gnu.org; Tue, 15 Apr 2025 07:17:20 -0400 Received: from mail-vk1-xa2c.google.com ([2607:f8b0:4864:20::a2c]:46235) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u4eI0-0001uU-1a for 77718@debbugs.gnu.org; Tue, 15 Apr 2025 07:17:17 -0400 Received: by mail-vk1-xa2c.google.com with SMTP id 71dfb90a1353d-523ffbe0dbcso5419767e0c.0 for <77718@debbugs.gnu.org>; Tue, 15 Apr 2025 04:17:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744715830; x=1745320630; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QktqLxyydQitrCFKMWc0EeoLzzYxHzWvIsgmxnjpVm0=; b=MELblFVThWQCUm1mmTjK9UYo25RXUwmA64KPl6S98l4rtGRRqZs4kuymBE5sQXnyC4 NTc8Q/YHwS4Udtk2ePiGQJMszl6EFqViOZL/jDNhzQEokZck/Y1J73nidh3E0jQ0Lm7R kCiLTghZwxUssaYdpBmfD+HpIlMRwctktTlmsXKBTf50ZHYnZqD0E9QTsWN8W3MjpR2t IctPF7ZDLNTTz3MMVGfre51sQCwBh/ZLp7QQAtTEMt+XVypPWbP8GKvUZXzC+yTLKvMR FB/A3W4AgTCWrBpC2dd1XXkTMDcR1cyT1s0MHY1+sy/0NQ8j9suZJvcCoI2k7id+34D/ 7lsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744715830; x=1745320630; 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=QktqLxyydQitrCFKMWc0EeoLzzYxHzWvIsgmxnjpVm0=; b=p726uarFWjLv5NCutKAE5piKhC8ihvJcHbzOqDB2nU3QNxCw9skowlggQ3z430bAPK GHvRAokHdpA2u6ZBZu7WJSnW2zJSBfpYVnyfXjTiWsjYgWOD7//PaLk4pv4KrOtx4Ezy hda2x6uxqsBL6NA/Zk5kjXdrRDuh4L3keKWqwzOrymc7JE0gASEzGIhNtU0sae27lkfJ R39LGjjLOpOUiyE7q93BM5F/aCSlBQA8mj34DKqbe0r52gp+BNlvHKfyKs4uYMJQPz9G vYXKME4qJzRSJDVUykI7Gr7KHveIFHFo8qv16LhCkOQSRd5dmp9+RS0a/lI2/gyo7PLH l1WQ== X-Forwarded-Encrypted: i=1; AJvYcCXzq1Jtg1xAF5jzfyDvzQfDGUbab8XMqBErqVpJOnVBuAB/G7Aq/bnsUQb0+L3nYhB8cLV2Vg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzXBZDu65+PHnaXlw+c1cQH0Lqqh4jFQ+7wIbg3SNuowQ10UgWJ MGRyJ3AkPzL6q6iCg0F48/LOtiYr69aaKRRwWNJpZ4vIMXv1oUs2+AgC/tKInmmtY/KF1Vm/WQK CWh0sUy9xKW/YLC9E1EdC/AUnQak= X-Gm-Gg: ASbGnctRV4LAIN8w7gLCsQu3GmmT/8uXUoyOCG3eV0s6Cff/ofQ1Uz4z4CY1NkiTfME 7DNY5tk7a+I/Df7rre+r93GuzVusk3iTanxCjacCMQ6uj4incR+xifHgPzt8atIDXsWfq0gJ+vW GJOpPcYiF+Q4wknkw6G8V12A== X-Google-Smtp-Source: AGHT+IEvDhpvfKNCtB59T86/RauzjJqWghjBHXvwjmJPNltAF4JR0DpCOMbH/ry3kq97+IWhzbqs2vVS90rwSPY75PU= X-Received: by 2002:a05:6122:d95:b0:520:61ee:c7f9 with SMTP id 71dfb90a1353d-527c35b020amr9368100e0c.7.1744715830253; Tue, 15 Apr 2025 04:17:10 -0700 (PDT) MIME-Version: 1.0 References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> In-Reply-To: <86a58ihrfg.fsf@gnu.org> From: Ship Mints Date: Tue, 15 Apr 2025 07:16:58 -0400 X-Gm-Features: ATxdqUE62sVXKdUeAK2k1cqVTdxRdvt8G6C4wGOeAaEhl09PokgSlalywbN8Oro Message-ID: Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken To: Eli Zaretskii Content-Type: multipart/alternative; boundary="0000000000004be0220632cf4f2d" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77718 Cc: Spencer Baugh , stephen.berman@gmx.net, monnier@iro.umontreal.ca, 77718@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000004be0220632cf4f2d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 15, 2025 at 2:26=E2=80=AFAM Eli Zaretskii wrote: > > From: Spencer Baugh > > Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stephen > Berman > > > > Date: Mon, 14 Apr 2025 16:30:09 -0400 > > > > + (;; Ensure we discard text before // by always using sifn in that > case. > > + (unless (string-search "//" orig) > > + (complete-with-action action table orig pred))) > > AFAIU, this ignores the case of UNC file names, which begin with "//", > and other complications with file names on Windows. Emacs on Windows > reacts differently to "//" than it does on Posix systems, and it does > so for very good reasons. > > Please don't break file-name completion on Windows. It took us many > iterations to get it right, and the result is fragile. Be sure to > test each change on Windows as well before installing. > > For the same reasons, please test thoroughly with remote file names of > different formats. > > Given the fragility of this, I'd tend to suggest to define a new style > with these changes, and leave alone the existing styles, even if you > consider them "broken". > The POSIX standard allows "pathnames" that start with "//" and Emacs, for sure, should respect file names that begin with //. "A pathname that begins with two successive slashes may be interpreted in an implementation-defined manner, although more than two leading slashes shall be treated as a single slash." "A pathname may optionally contain one or more trailing slashes." "Multiple successive slashes are considered to be the same as one slash." For mailing list posterity: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#ta= g_03_271:~:text=3Din%20Filename.-,3.273,-Path%20Prefix https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#ta= g_03_271:~:text=3Din%20their%20execution.-,3.40,-Basename https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#:~= :text=3DIf%20a%20pathname%20begins%20with%20two%20successive%20%3Cslash%3E%= 20characters%2C%20the%20first%20component%20following%20the%20leading%20%3C= slash%3E%20characters%20may%20be%20interpreted%20in%20an%20implementation%2= Ddefined%20manner%2C%20although%20more%20than%20two%20leading%20%3Cslash%3E= %20characters%20shall%20be%20treated%20as%20a%20single%20%3Cslash%3E%20char= acter. https://pubs.opengroup.org/onlinepubs/007904875/basedefs/xbd_chap03.html#ta= g_03_266:~:text=3DA%20pathname%20may%20optionally%20contain%20one%20or%20mo= re%20trailing%20slashes.%20Multiple%20successive%20slashes%20are%20consider= ed%20to%20be%20the%20same%20as%20one%20slash. -Stephane --0000000000004be0220632cf4f2d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
= On Tue, Apr 15, 2025 at 2:26=E2=80=AFAM Eli Zaretskii <eliz@gnu.org> wrote:
> From: Spencer Baugh <sbaugh@janestreet.com>
> Cc: 77718@d= ebbugs.gnu.org,=C2=A0 Eli Zaretskii <eliz@gnu.org>,=C2=A0 Stephen Berman
>=C2=A0 =C2=A0<stephen.berman@gmx.net>
> Date: Mon, 14 Apr 2025 16:30:09 -0400
>
> +=C2=A0 =C2=A0 =C2=A0(;; Ensure we discard text before // by always us= ing sifn in that case.
> +=C2=A0 =C2=A0 =C2=A0 (unless (string-search "//" orig)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (complete-with-action action table orig p= red)))

AFAIU, this ignores the case of UNC file names, which begin with "//&q= uot;,
and other complications with file names on Windows.=C2=A0 Emacs on Windows<= br> reacts differently to "//" than it does on Posix systems, and it = does
so for very good reasons.

Please don't break file-name completion on Windows.=C2=A0 It took us ma= ny
iterations to get it right, and the result is fragile.=C2=A0 Be sure to
test each change on Windows as well before installing.

For the same reasons, please test thoroughly with remote file names of
different formats.

Given the fragility of this, I'd tend to suggest to define a new style<= br> with these changes, and leave alone the existing styles, even if you
consider them "broken".

The POSIX standard allow= s "pathnames" that start with "//" and Emacs, for sure,= should respect file names that begin with //.

"A pathname that begins with two succes= sive slashes may be interpreted in an implementation-defined manner, althou= gh more than two leading slashes shall be treated as a single slash."<= /div>
"A= pathname may optionally contain one or more trailing slashes."
<= div class=3D"gmail_default" style=3D"font-family:monospace">
"Multiple succ= essive slashes are considered to be the same as one slash."

For mailing list posterity:
<= /div> --0000000000004be0220632cf4f2d-- From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 15 15:24:55 2025 Received: (at 77718) by debbugs.gnu.org; 15 Apr 2025 19:24:55 +0000 Received: from localhost ([127.0.0.1]:55706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u4ltu-0005My-Hk for submit@debbugs.gnu.org; Tue, 15 Apr 2025 15:24:55 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:58309) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u4ltq-0005Mb-UG for 77718@debbugs.gnu.org; Tue, 15 Apr 2025 15:24:52 -0400 From: Spencer Baugh To: Eli Zaretskii Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: <86a58ihrfg.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 15 Apr 2025 09:25:39 +0300") References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> Date: Tue, 15 Apr 2025 15:24:45 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1744745085; bh=jjwNR9O0+q+/+Zz1h45Vi0nweIsN9uqlz88uWmPkZIg=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=Jpzq30K3/jAfUbjCa+ZVPTepy3Ls4Ew+LuQhhciCueqRj9g1zsHyPxixY7OE/PA0r yvzUrqIpvhJjAexoUnwiuaHGuHyKzODYPM0WIGgzCtJHIbHfobUXLhskSedSTGjY29 FqKSml9moQknmQcDZxUTf9xtRD0tiM56Tl6JHMj58nSPdn2W4QzGaIYao/tX/UTmdl 9J9A45FDZdQeRrxWz9saUVxCBjA7K8EXgk7PkKXSC1EU6huN3J1RiGGyaDT2aKc1LM AKfmApEH7u6M84U67UaAQes/igH2IuYG5zOR9cjcSwXK9HaKDEeStbjB4ucyQHlyEo UHTGE++TDAMhA== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, stephen.berman@gmx.net, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stephen Berman >> >> Date: Mon, 14 Apr 2025 16:30:09 -0400 >> >> + (;; Ensure we discard text before // by always using sifn in that case. >> + (unless (string-search "//" orig) >> + (complete-with-action action table orig pred))) > > AFAIU, this ignores the case of UNC file names, which begin with "//", > and other complications with file names on Windows. Emacs on Windows > reacts differently to "//" than it does on Posix systems, and it does > so for very good reasons. Ah, thanks, good point. I updated it to remove this hardcoded handling of //, and instead defer to substitute-in-file-name, which will behave right on Windows. Updated patch attached. > Please don't break file-name completion on Windows. It took us many > iterations to get it right, and the result is fragile. Be sure to > test each change on Windows as well before installing. Can do, I'm working on setting up a test Windows system right now. Is there any way to approximately test the behavior of Windows file name completion while still on GNU/Linux? It might be useful to have tests which can run on GNU/Linux but test the Windows behavior. > For the same reasons, please test thoroughly with remote file names of > different formats. Will do - I'll make some additions to tramp-tests as well. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Improve-env-var-handling-in-read-file-name.patch >From d35a5068cb9d9a75a19914fb624da5b0bd461937 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Mon, 14 Apr 2025 16:01:38 -0400 Subject: [PATCH] Improve env var handling in read-file-name Fix various bugs, including bug#77718, by rewriting the way file name completion handles environment variable expansion. Instead of using completion-table-with-quoting to manipulate the string being completed on, simply make the completion table itself understand substitute-in-file-name. The completion table first tries to complete without substituting environment variables; this allows completion to work on file names which contain things which look like environment variables. If that fails, we call substitute-in-file-name and then complete again. Tests are updated: we no longer duplicate $s in file names, since that's not necessary. And partial-completion now preserves unexpanded environment variables. However, partial-completion no longer works across environment variables containing delimiters; that's an acceptable sacrifice. * lisp/minibuffer.el (completion--replace-prefix) (completion--complete-on-expansion): Add. (completion--file-name-table): Rewrite to use substitute-in-file-name explicitly. (bug#77718) * test/lisp/minibuffer-tests.el (completion-table-test-quoting) (minibuffer-next-completion): Update. --- lisp/minibuffer.el | 57 ++++++++++++++++++++++++++++++++--- test/lisp/minibuffer-tests.el | 16 +++++----- 2 files changed, 59 insertions(+), 14 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index ab00395a850..e53bd673df9 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3565,13 +3565,60 @@ completion--sifn-requote (setq qpos (1- qpos))) (cons qpos #'minibuffer-maybe-quote-filename))))) -(defalias 'completion--file-name-table - (completion-table-with-quoting #'completion-file-name-table - #'substitute-in-file-name - #'completion--sifn-requote) +(defun completion--replace-prefix (s old new) + "Replace prefix OLD of string S with prefix NEW." + (concat new (substring s (length old)))) + +(defun completion--file-name-table (orig pred action) "Internal subroutine for `read-file-name'. Do not call this. This is a completion table for file names, like `completion-file-name-table' -except that it passes the file name through `substitute-in-file-name'.") +except that it passes the file name through `substitute-in-file-name'." + (let ((table #'completion-file-name-table)) + (or + ;; First try completing without expanding environment variables; we still + ;; call `substitute-in-file-name' to handle // and other constructs. + (let ((sifned (let ((process-environment nil)) (substitute-in-file-name orig)))) + ;; Fall through to the second case if `substitute-in-file-name' expanded + ;; something anyway. + (when (string-suffix-p sifned orig) + (let ((discarded (string-remove-suffix sifned orig)) + (result (complete-with-action action table sifned pred))) + (cond + ((eq (car-safe action) 'boundaries) + (cons 'boundaries (cons (+ (length discarded) (cadr result)) (cddr result)))) + ((null action) + (if (stringp result) (concat discarded result) result)) + (t result))))) + ;; Try again, this time expanding environment variables. + (cond + ((eq (car-safe action) 'boundaries) + ;; Compute the boundaries on ORIG; boundaries created by expanding + ;; environment variables can't be used. + (complete-with-action action table orig pred)) + ((let* ((sifned (substitute-in-file-name orig)) + (result (complete-with-action action table sifned pred))) + (cond + ((null action) + (if (stringp result) + (completion--replace-prefix result sifned orig) + result)) + ((eq action t) + (when result + ;; Find the part of SIFNED which is inside the boundaries, and + ;; replace it with the part of ORIG which is inside the boundaries. + (let* ((expansion-bounds (completion-boundaries sifned table pred "")) + (expansion-in-bounds (substring sifned (car expansion-bounds))) + (orig-bounds (completion-boundaries orig table pred "")) + (orig-in-bounds (substring orig (car orig-bounds)))) + (if (and (string-empty-p expansion-in-bounds) + (string-empty-p orig-in-bounds)) + ;; Nothing to replace, so avoid doing unnecessary work. + result + (mapcar + (lambda (s) + (completion--replace-prefix s expansion-in-bounds orig-in-bounds)) + result))))) + (t result)))))))) (defalias 'read-file-name-internal (completion-table-in-turn #'completion--embedded-envvar-table diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index 59ac5ab9578..38c005bd1b5 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -91,20 +91,18 @@ completion-table-subvert-test (ert-deftest completion-table-test-quoting () (let ((process-environment - `("CTTQ1=ed" "CTTQ2=et/" ,@process-environment)) + `("CTTQ1=ed" ,@process-environment)) (default-directory (ert-resource-directory))) (pcase-dolist (`(,input ,output) '( - ;; Test that $ in files is properly $$ quoted. - ("data/m-cttq" "data/minibuffer-test-cttq$$tion") - ;; Test that $$ in input is properly unquoted. - ("data/m-cttq$$t" "data/minibuffer-test-cttq$$tion") + ;; Test that files containing $ can be completed + ("data/m-cttq" "data/minibuffer-test-cttq$tion") + ;; Test that $ can be completed + ("data/m-cttq$" "data/minibuffer-test-cttq$tion") ;; Test that env-vars are preserved. ("lisp/c${CTTQ1}et/se-u" "lisp/c${CTTQ1}et/semantic-utest") - ("lisp/ced${CTTQ2}se-u" "lisp/ced${CTTQ2}semantic-utest") ;; Test that env-vars don't prevent partial-completion. - ;; FIXME: Ideally we'd like to keep the ${CTTQ}! - ("lis/c${CTTQ1}/se-u" "lisp/cedet/semantic-utest") + ("lis/c${CTTQ1}/se-u" "lisp/c${CTTQ1}et/semantic-utest") )) (should (equal (completion-try-completion input #'completion--file-name-table @@ -690,7 +688,7 @@ minibuffer-next-completion (completing-read-with-minibuffer-setup #'read-file-name-internal (insert "d/") (execute-kbd-macro (kbd "M- M- M-")) - (should (equal "data/minibuffer-test-cttq$$tion" (minibuffer-contents)))))) + (should (equal "data/minibuffer-test-cttq$tion" (minibuffer-contents)))))) (provide 'minibuffer-tests) ;;; minibuffer-tests.el ends here -- 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 15 17:04:57 2025 Received: (at 77718) by debbugs.gnu.org; 15 Apr 2025 21:04:57 +0000 Received: from localhost ([127.0.0.1]:56642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u4nSj-00027a-6U for submit@debbugs.gnu.org; Tue, 15 Apr 2025 17:04:57 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:43992) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u4nSg-00027H-L9 for 77718@debbugs.gnu.org; Tue, 15 Apr 2025 17:04:55 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 54E7C1002EC; Tue, 15 Apr 2025 17:04:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1744751084; bh=sM28nVOhI4rawcAA8ah7o/vUeQqx0KSBWzdM84UGqCo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=PMdPfJDWR2oxnW1WzzbzhScRt95fY/QdtokIOoO/fSHUtxpgT9+7y1vuEqc68omUX IG0q3Z9bkO9S/lds/kPBzZJV5F7yB+EwZo1wekDE8EkIcrWpVpoJQO1199KO9NQEh3 h34ZZnMG1MQVFlMCuducGJyztFeB3xlPDDobPfLLAXT7tCYOofGTJgwXIMdTYI6qaO BrT8ZMpN9bfIPNQf8A7TM2idg/287HY+WSdJhphHZ/yODjTsnEFT7c6HOJbTxG6TnT IC/DA63TdW3TXkL+Sk4atEh+A9/jkficenE/v1Mzy+ovkJMWmVu/LxKOLdjRBY3l0U YdVNzkTsJvQMA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 82ABA100034; Tue, 15 Apr 2025 17:04:44 -0400 (EDT) Received: from pastel (unknown [104.247.242.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 527D61201DD; Tue, 15 Apr 2025 17:04:44 -0400 (EDT) From: Stefan Monnier To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: Message-ID: References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> Date: Tue, 15 Apr 2025 17:04:43 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.372 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Fix various bugs, including bug#77718, by rewriting the way file > name completion handles environment variable expansion. Instead > of using completion-table-with-quoting to manipulate the string > being completed on, simply make the completion table itself > understand substitute-in-file-name. OK. > The completion table first tries to complete without > substituting environment variables; this allows completion to > work on file names which contain things which look like > environment variables. If that fails, we call > substitute-in-file-name and then complete again. Why? `substitute-in-file-name` presumably already takes care of that: (substitute-in-file-name "/foo/$NOTAVAR/bar") => "/foo/$NOTAVAR/bar" > Tests are updated: we no longer duplicate $s in file names, > since that's not necessary. AFAIK it is still needed for the (null action) case. > And partial-completion now > preserves unexpanded environment variables. However, > partial-completion no longer works across environment variables > containing delimiters; that's an acceptable sacrifice. Agreed. > * lisp/minibuffer.el (completion--replace-prefix) > (completion--complete-on-expansion): Add. > (completion--file-name-table): Rewrite to use > substitute-in-file-name explicitly. (bug#77718) I think you can also delete `completion--sifn-requote` while at it. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 15 17:21:23 2025 Received: (at 77718) by debbugs.gnu.org; 15 Apr 2025 21:21:23 +0000 Received: from localhost ([127.0.0.1]:56762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u4nia-0004ZH-Oa for submit@debbugs.gnu.org; Tue, 15 Apr 2025 17:21:22 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:46077) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u4niW-0004Xg-Ts for 77718@debbugs.gnu.org; Tue, 15 Apr 2025 17:21:18 -0400 From: Spencer Baugh To: Stefan Monnier Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: (Stefan Monnier's message of "Tue, 15 Apr 2025 17:04:43 -0400") References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> Date: Tue, 15 Apr 2025 17:21:11 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1744752071; bh=XX5oq4MANuuNQzdcxG1hKhW0Nuz4pGYbXDBshuAVvyw=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=gFFnFhbpMGh7PEdkRkF0y4h6igGWTdZLiY+9eRhwY6Km8pzn7x07uI2eL/uPj5OTK gIojjldytE2qKoZ7DDI3p17lffYwZ9iROXPChJFWPoBntA3LTgmgPgo860NWBSpbpX 9Uc1paDzBt+NvsmxhgKh+YYYybe+uEikDr5pnpH5EJW6usqZEQ1xvQQi/cOutsxIkD eWO1elaZUIG1LrFn9H9tlCaHtFGCXnNA9p68ptrzfO1ipzPCBDInynBqhPOs2yusJO PJXIALxMzCsDX54n3+PFQNAVUGZFINmhZH2CsvRw9CkU7q2mo31JTmyYv+N+vsNm0B /+bqHJm1hlgPA== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: >> The completion table first tries to complete without >> substituting environment variables; this allows completion to >> work on file names which contain things which look like >> environment variables. If that fails, we call >> substitute-in-file-name and then complete again. > > Why? `substitute-in-file-name` presumably already takes care of that: > > (substitute-in-file-name "/foo/$NOTAVAR/bar") > => "/foo/$NOTAVAR/bar" To support completing file names that look like environment variables, without the need to quote $ by duplicating it. >> Tests are updated: we no longer duplicate $s in file names, >> since that's not necessary. > > AFAIK it is still needed for the (null action) case. Why would that be? I believe quoting $ should no longer be necessary. >> * lisp/minibuffer.el (completion--replace-prefix) >> (completion--complete-on-expansion): Add. >> (completion--file-name-table): Rewrite to use >> substitute-in-file-name explicitly. (bug#77718) > > I think you can also delete `completion--sifn-requote` while at it. Indeed, I will, just avoiding that for now while iterating on the patch. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 15 17:50:58 2025 Received: (at 77718) by debbugs.gnu.org; 15 Apr 2025 21:50:59 +0000 Received: from localhost ([127.0.0.1]:57048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u4oBF-0008Hc-HX for submit@debbugs.gnu.org; Tue, 15 Apr 2025 17:50:58 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:19165) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u4oBB-0008G4-8n for 77718@debbugs.gnu.org; Tue, 15 Apr 2025 17:50:55 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 32F721002EC; Tue, 15 Apr 2025 17:50:47 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1744753845; bh=KRj4T068n8siW85JqOVTvY3k98exu8oeJ/CDJiarxmI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=iN7qWm9M9LexculLCUAX0pPDPjby5RVWEZ43vYLhvLd0lfiy/ejgnOSqxnl1yZKeu hmue7+RcjxYw6smYYfBoTigkAMHBxMy6G9stTqS62XHYrN/P2HFrFNkP75ZMXlj50J 7LgbnP31LaVJwpQEauSiQXrPA96ff0CamcezePE9TeKFDu1xfpkG8hD28VINGcwENJ aCVoaDYot0qwnqeVyMoBnxX+O/rhp0muJF6PnX7sp3w1mF7KUOwutEb97BmOTeYRDT ThMhbG92kkStIHpCp+2lmNeCJN2HIll/q2Xult+yDsJzuNZcmGXO/XcZN9ZqH5OyPY 9HHACelfT8oCQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id BFA66100034; Tue, 15 Apr 2025 17:50:45 -0400 (EDT) Received: from pastel (unknown [104.247.242.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 891A31201DD; Tue, 15 Apr 2025 17:50:45 -0400 (EDT) From: Stefan Monnier To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: Message-ID: References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> Date: Tue, 15 Apr 2025 17:50:44 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.369 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> Why? `substitute-in-file-name` presumably already takes care of that: >> >> (substitute-in-file-name "/foo/$NOTAVAR/bar") >> => "/foo/$NOTAVAR/bar" > > To support completing file names that look like environment variables, > without the need to quote $ by duplicating it. I don't understand: the example I show above suggests you can do that without doing anything special. [ Also, I'm not sure it's worth the trouble anyway: dollars in file names are fairly rare, so having to double them in those rare cases where they occur is not a big deal. In any case, it seems orthogonal to the problem at hand. ] >>> Tests are updated: we no longer duplicate $s in file names, >>> since that's not necessary. >> AFAIK it is still needed for the (null action) case. > Why would that be? I believe quoting $ should no longer be necessary. Say I have a file ~/tmp/foo$HOME.txt and I do C-x C-f ~/tmp/foo TAB AFAIK it needs to complete to ~/tmp/foo$$HOME.txt otherwise the file name returned by `read-file-name` will be ~/tmp/foo/home/monnier.txt > Indeed, I will, just avoiding that for now while iterating on the patch. +1 Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 16 03:31:44 2025 Received: (at 77718) by debbugs.gnu.org; 16 Apr 2025 07:31:44 +0000 Received: from localhost ([127.0.0.1]:34173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u4xFF-0002u3-0e for submit@debbugs.gnu.org; Wed, 16 Apr 2025 03:31:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36852) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u4xFA-0002sU-Uz for 77718@debbugs.gnu.org; Wed, 16 Apr 2025 03:31:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u4xF4-0004xs-L8; Wed, 16 Apr 2025 03:31:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Tyc4eJ9e/gHPFAwTNrKTFeLUmUv/tCJel6R6uel2+os=; b=LKDhesOS4QR9 Ca54XWGNbyUkP9tXYV0YC/Jb6Fi63k1rYRGlOGZzEAaNfISoMIBfeQJWsSUcCaU8dy/c0Zwurfzef kBu+E1OIAhXGPepHuRRr1oH0/UdY7eoaSwwVw522l/rVXSlvLB3ZjKCRgDC88Z5T1cTDP+D1EOvcp k5jFYxmdiB2de4S5pIzGSNowCt1FSvqEPAE8t3lVMzdN8CwWrgthsyNCZakt4FAyXZ7dTzOvF+FhE 9fYwFsUViTU8n69Xl2CCnfA7fVRtBS3pq3c8v6dIy0QiU5vubmwyL/QXJ6KlKi3h4TM8qp2570S1s 5AI0aW0+3/NyBnX+FsLB5Q==; Date: Wed, 16 Apr 2025 10:31:25 +0300 Message-Id: <86sem8ftpu.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Tue, 15 Apr 2025 15:24:45 -0400) Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, stephen.berman@gmx.net, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Spencer Baugh > Cc: 77718@debbugs.gnu.org, stephen.berman@gmx.net, monnier@iro.umontreal.ca > Date: Tue, 15 Apr 2025 15:24:45 -0400 > > Eli Zaretskii writes: > > >> From: Spencer Baugh > >> Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stephen Berman > >> > >> Date: Mon, 14 Apr 2025 16:30:09 -0400 > >> > >> + (;; Ensure we discard text before // by always using sifn in that case. > >> + (unless (string-search "//" orig) > >> + (complete-with-action action table orig pred))) > > > > AFAIU, this ignores the case of UNC file names, which begin with "//", > > and other complications with file names on Windows. Emacs on Windows > > reacts differently to "//" than it does on Posix systems, and it does > > so for very good reasons. > > Ah, thanks, good point. I updated it to remove this hardcoded handling > of //, and instead defer to substitute-in-file-name, which will behave > right on Windows. Updated patch attached. > > > Please don't break file-name completion on Windows. It took us many > > iterations to get it right, and the result is fragile. Be sure to > > test each change on Windows as well before installing. > > Can do, I'm working on setting up a test Windows system right now. Thanks. > Is there any way to approximately test the behavior of Windows file name > completion while still on GNU/Linux? It might be useful to have tests > which can run on GNU/Linux but test the Windows behavior. Unfortunately, this is not possible, because portions of the relevant code in C are only compiled into the Windows build of Emacs. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 16 13:10:59 2025 Received: (at 77718) by debbugs.gnu.org; 16 Apr 2025 17:11:00 +0000 Received: from localhost ([127.0.0.1]:41240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u56Hn-0007lR-4w for submit@debbugs.gnu.org; Wed, 16 Apr 2025 13:10:58 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:50879) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u56Hg-0007jQ-Ok for 77718@debbugs.gnu.org; Wed, 16 Apr 2025 13:10:52 -0400 From: Spencer Baugh To: Stefan Monnier Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: (Stefan Monnier's message of "Tue, 15 Apr 2025 17:50:44 -0400") References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> Date: Wed, 16 Apr 2025 13:10:42 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1744823442; bh=kGyoe+6z0eQxk2NaNiWfs/T9/iHuz65oHpJ4nrCh4As=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=nO7on/pRpL4UEMKbJp5JNhuic/KC3YLDqCHHGzO/azgclQsHrkKi8vC19fn19fD6M w4150l6ZpQkPP9NDc78QlpZq2GfFPIlH4+Tev5ZE6URJYtAVzUx4f9T2oDOcT1qBhh z1Owo9nYUD0jQVs4vuhUfQU48PSi4NWHklKQ+oLrbIAy3de2poxg1c8ns1D8fyAWlT 3Uk+eNmfssKBQioaANRLR9d9RwV35B21YISpV461Fe9fA8W37rhaLpx/zmZtMtwscT NhYubWE9OKCk5V6YmYNyWSzIJtlaktU3pRmGY9Ut/oFqXc2E7EfoZo3NHqjjolTydb c6G508lPj4Nfw== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: >>> Why? `substitute-in-file-name` presumably already takes care of that: >>> >>> (substitute-in-file-name "/foo/$NOTAVAR/bar") >>> => "/foo/$NOTAVAR/bar" >> >> To support completing file names that look like environment variables, >> without the need to quote $ by duplicating it. > > I don't understand: the example I show above suggests you can do that > without doing anything special. That only works for completing file names that contain $ and which *aren't* currently environment variables. My code supports completing on ~/$HOME/foo where "$HOME" is the literal name of a directory. > [ Also, I'm not sure it's worth the trouble anyway: dollars in file names > are fairly rare, so having to double them in those rare cases where they > occur is not a big deal. In any case, it seems orthogonal to the > problem at hand. ] That's fair - so you think it might be OK to, basically, not support completion on file names containing substrings like "$HOME"? That could make things simpler, if we think that's acceptable. >>>> Tests are updated: we no longer duplicate $s in file names, >>>> since that's not necessary. >>> AFAIK it is still needed for the (null action) case. >> Why would that be? I believe quoting $ should no longer be necessary. > > Say I have a file > > ~/tmp/foo$HOME.txt > > and I do > > C-x C-f ~/tmp/foo TAB > > AFAIK it needs to complete to > > ~/tmp/foo$$HOME.txt > > otherwise the file name returned by `read-file-name` will be > > ~/tmp/foo/home/monnier.txt Ah, I see. I didn't realize that read-file-name calls substitute-in-file-name on the result; so a file name containing literally "$HOME" would be erroneously expanded by my code, right now. I'll add some tests for this case in the next version of my patch. This TAB behavior doesn't help if I manually type $HOME though, right? The $ is only automatically duplicated if you tab-complete. So, if the user manually types foo$HOME.txt then $HOME would be incorrectly expanded. So here's one idea: Since this only works if I tab-complete, that means it only works for files which actually exist. So, instead, I could have read-file-name check if the file (e.g. "~/tmp/foo$HOME.txt") exists before expanding environment variables; if the file exists, don't expand environment variables. This avoids the need to duplicate $s. Do you think that might suffice? From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 16 14:30:08 2025 Received: (at 77718) by debbugs.gnu.org; 16 Apr 2025 18:30:08 +0000 Received: from localhost ([127.0.0.1]:41873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u57WR-0007c7-Cd for submit@debbugs.gnu.org; Wed, 16 Apr 2025 14:30:08 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:15252) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u57WO-0007aP-3V for 77718@debbugs.gnu.org; Wed, 16 Apr 2025 14:30:05 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id E5ABB10033A; Wed, 16 Apr 2025 14:29:57 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1744828197; bh=baKTdLHrhA0GkFHSW8/Qd8Put6bzPq1Gx8nv8vGRGsg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Qntbvlyn2DAkuNnlKdsyU2TYGHzpxhjS5Qz0KWaOfDdLyVpFMxljcFvQO05PVHot6 OfQMsc4cspVPvgGyjD019Q9vwlVlq6mwJQY6/XCkV+n+Zg1cu+EqNLhwc4TLCK3sto 0yNT3H4jToAMR40X6BdfpGczLoCdCzNPR/gh9D58/nJUSYuxHT4jaBUY2ZcYyDHH8a mY/A9XQrwV0KZ73hxIZTU9D8Y55nl38OSAnjwn+uee1/yWaiLNXww/WXN/cw6MmeFe xjCnt4UZOrqiWltlEUi47cRs/G4vCTy06UJWcu2GRRl/CMU/IP9LUu6HG6gGDealZQ 0FYJVm+YP4oKw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 1196410007A; Wed, 16 Apr 2025 14:29:57 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0306B120691; Wed, 16 Apr 2025 14:29:57 -0400 (EDT) From: Stefan Monnier To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: Message-ID: References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> Date: Wed, 16 Apr 2025 14:29:56 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.097 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> [ Also, I'm not sure it's worth the trouble anyway: dollars in file names >> are fairly rare, so having to double them in those rare cases where they >> occur is not a big deal. In any case, it seems orthogonal to the >> problem at hand. ] > That's fair - so you think it might be OK to, basically, not support > completion on file names containing substrings like "$HOME"? Of course we support it, but we require the use of `$$HOME` to state clearly which interpretation you want. > This TAB behavior doesn't help if I manually type $HOME though, right? Presumably if you type `$HOME` it means you want the value of the HOME envvar. If you want the file named `$HOME` you need to type `$$HOME`. When the typing is done by the completion code, it's up to the completion code to apply that same rule. > So here's one idea: Since this only works if I tab-complete, that means > it only works for files which actually exist. So, instead, I could have > read-file-name check if the file (e.g. "~/tmp/foo$HOME.txt") exists > before expanding environment variables; if the file exists, don't expand > environment variables. This avoids the need to duplicate $s. But then we'd need to add some way for the user to say "I really want this $HOME to be expanded even though there is also a file by that funny name". [ In any case, this is not a question of completion but of `read-file-name`. ] Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 16 15:15:55 2025 Received: (at 77718) by debbugs.gnu.org; 16 Apr 2025 19:15:55 +0000 Received: from localhost ([127.0.0.1]:42269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u58Ek-0004nt-8j for submit@debbugs.gnu.org; Wed, 16 Apr 2025 15:15:54 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:58493) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u58Eg-0004n1-Ct for 77718@debbugs.gnu.org; Wed, 16 Apr 2025 15:15:51 -0400 From: Spencer Baugh To: Stefan Monnier Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: (Stefan Monnier's message of "Wed, 16 Apr 2025 14:29:56 -0400") References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> Date: Wed, 16 Apr 2025 15:15:44 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1744830945; bh=Yd0awvQBoax71P8CngRNgcYhsGOtL/c1NrK/yzlsxME=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=FfrHAO5MPGuaTNqj4WQ+8zipp/vsqwMnmTHjBXRjW3Hysnn1rer7y0TmtSCXkd8yv 88fz7KjrU+1xWgkuqfCkwA4H7u/NzKfU7mv6gDs0KlHi5KeDEfF9gZtTefr9vL7IH/ DftyalTdZ+TRJk/UzD7185c6RsWCyGL9SZ7Np+WFNCefrNYvICm6sAtso+0h/aHFZs jZpzmURsRbLQv0PfAYvfZ7kq61y1Bx2anP2nMIxZQzlTUytAPvOgqWVgP3f7IcJ7aa zkNPFDs0Tzq1hn4MB2GLST3uWzO1xXritL0jEEGQ6D2UC6pLDdZeaimaWolD7e/OU/ J1uPS4JnpdhTg== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: >>> [ Also, I'm not sure it's worth the trouble anyway: dollars in file names >>> are fairly rare, so having to double them in those rare cases where they >>> occur is not a big deal. In any case, it seems orthogonal to the >>> problem at hand. ] >> That's fair - so you think it might be OK to, basically, not support >> completion on file names containing substrings like "$HOME"? > > Of course we support it, but we require the use of `$$HOME` to state > clearly which interpretation you want. Ah, sure. But my code supports completion on file names containing "$HOME" without the user of "$$HOME", which seems even nicer. >> This TAB behavior doesn't help if I manually type $HOME though, right? > > Presumably if you type `$HOME` it means you want the value of the HOME > envvar. If you want the file named `$HOME` you need to type `$$HOME`. > > When the typing is done by the completion code, it's up to the > completion code to apply that same rule. Sure, that's fair. Though, a user might not know that they can type $$HOME to get the file named '$HOME'; it's not that obvious. It seems like it would be nice to automatically DTRT, where possible, without requiring them to know that. >> So here's one idea: Since this only works if I tab-complete, that means >> it only works for files which actually exist. So, instead, I could have >> read-file-name check if the file (e.g. "~/tmp/foo$HOME.txt") exists >> before expanding environment variables; if the file exists, don't expand >> environment variables. This avoids the need to duplicate $s. > > But then we'd need to add some way for the user to say "I really want > this $HOME to be expanded even though there is also a file by that funny > name". True. Although, this situation seems likely to be quite rare. Perhaps we could support it by adding some new command minibuffer-substitute-in-file-name or something, which explicitly expands environment variables found in the current minibuffer. Then read-file-name does the right thing automatically in every case except this one, without the user needing to insert $$; and in this case, the user can just use minibuffer-substitute-in-file-name explicitly. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 16 16:00:18 2025 Received: (at 77718) by debbugs.gnu.org; 16 Apr 2025 20:00:18 +0000 Received: from localhost ([127.0.0.1]:42582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u58vi-0001rC-7i for submit@debbugs.gnu.org; Wed, 16 Apr 2025 16:00:18 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:36793) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u58vg-0001o9-EW for 77718@debbugs.gnu.org; Wed, 16 Apr 2025 16:00:17 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0A53A1000BC; Wed, 16 Apr 2025 16:00:11 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1744833609; bh=a4AaIHte6/d1mX+O5OlnZlKuMnvoAMSe+OewyyoUm84=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Nus87hk/1CQorY+py/I+tCqT63/ZXLUVkIi4n6xZDH9qouGwqGO6aWWgRZyzBu8wI dEdhp3WOn7oi0prUAh+bXnRBFb6KyBNLl+4ZaV6CdVi7P6u5fX+oRNJPZHucf7ZieH 9DI4m9dR3YkyFvx327SU8Yceu6I0KcQqbjeuFY8l8LR5g2fUlNN9e2pmAp2gxBcQaQ OMYExY8C5hUtySQN+lQErl0100/4UFowe1kVTllGjuHgO6YKA4Le7/7SRZ0h01k7vs kNxsw/Trv9Z8TIObN6MwpEp+NAAB77G2MvmPz/QV+E2HhzEFnyylDm6+LGtKVRRVzG nx6Xw4Zwj98Eg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D0093100027; Wed, 16 Apr 2025 16:00:09 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BD1B9120748; Wed, 16 Apr 2025 16:00:09 -0400 (EDT) From: Stefan Monnier To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: Message-ID: References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> Date: Wed, 16 Apr 2025 16:00:09 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.095 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) I suggest we focus on the immediate completion issue. If you want to refine the treatment of $$, let's do that in a separate bug report. Stefan Spencer Baugh [2025-04-16 15:15:44] wrote: > Stefan Monnier writes: > >>>> [ Also, I'm not sure it's worth the trouble anyway: dollars in file names >>>> are fairly rare, so having to double them in those rare cases where they >>>> occur is not a big deal. In any case, it seems orthogonal to the >>>> problem at hand. ] >>> That's fair - so you think it might be OK to, basically, not support >>> completion on file names containing substrings like "$HOME"? >> >> Of course we support it, but we require the use of `$$HOME` to state >> clearly which interpretation you want. > > Ah, sure. But my code supports completion on file names containing > "$HOME" without the user of "$$HOME", which seems even nicer. > >>> This TAB behavior doesn't help if I manually type $HOME though, right? >> >> Presumably if you type `$HOME` it means you want the value of the HOME >> envvar. If you want the file named `$HOME` you need to type `$$HOME`. >> >> When the typing is done by the completion code, it's up to the >> completion code to apply that same rule. > > Sure, that's fair. Though, a user might not know that they can type > $$HOME to get the file named '$HOME'; it's not that obvious. It seems > like it would be nice to automatically DTRT, where possible, without > requiring them to know that. > >>> So here's one idea: Since this only works if I tab-complete, that means >>> it only works for files which actually exist. So, instead, I could have >>> read-file-name check if the file (e.g. "~/tmp/foo$HOME.txt") exists >>> before expanding environment variables; if the file exists, don't expand >>> environment variables. This avoids the need to duplicate $s. >> >> But then we'd need to add some way for the user to say "I really want >> this $HOME to be expanded even though there is also a file by that funny >> name". > > True. Although, this situation seems likely to be quite rare. Perhaps > we could support it by adding some new command > minibuffer-substitute-in-file-name or something, which explicitly > expands environment variables found in the current minibuffer. > > Then read-file-name does the right thing automatically in every case > except this one, without the user needing to insert $$; and in this > case, the user can just use minibuffer-substitute-in-file-name > explicitly. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 16 16:20:28 2025 Received: (at 77718) by debbugs.gnu.org; 16 Apr 2025 20:20:28 +0000 Received: from localhost ([127.0.0.1]:42809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u59FE-00040S-94 for submit@debbugs.gnu.org; Wed, 16 Apr 2025 16:20:28 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:47027) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u59FB-000408-Ug for 77718@debbugs.gnu.org; Wed, 16 Apr 2025 16:20:26 -0400 From: Spencer Baugh To: Stefan Monnier Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: (Stefan Monnier's message of "Wed, 16 Apr 2025 16:00:09 -0400") References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> Date: Wed, 16 Apr 2025 16:20:20 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1744834820; bh=25LHA2rKhLlZEofrq6INU2Ky4BHMak8cLXRldYXHN20=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=rOcQsNZ6Zrl9R2c6Z1Um4mJmoJ+NE3KfdOu4ziW0Ymtcvfxa0bUXwnNti5G9ZYPev /ANp2qHLYx4GLsePpncGV6w3WsgEeaYknIg9MsIwhhgn0kBTtEGRMdIHWEhD5ShdrX NKv0prfh6m2q0fPnVnzzMtakbvXguyC670sV9Vq8bnMLwIMk5JSmGMqtG3v9ZSvl5F F4Vt7OUq/9Mj3SVrzD1eghI3hkSv2QqeqOmV7rXgFCB5fdmvHj/zrREhpKqoCd+nMS E5OfXsXa3mRlv7UJaXWCbsJAkP3Zmd0EIViaEk5XBGMeYAepledd0CJbpCkNYFqE+b eI2HzHmpW3HzA== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: > I suggest we focus on the immediate completion issue. > If you want to refine the treatment of $$, let's do that in a separate > bug report. OK, that's fair. But to be clear, the issue is in completion-table-with-quoting, so it's quite tied together with the treatment of $$. My new version of completion--file-name-table fixes the bug by taking a much simpler approach than completion-table-with-quoting, but that approach depends on avoiding the need for $$. I will try to think of another approach which is more similar to how completion-table-with-quoting does things, but it will be more complicated. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 16 16:38:06 2025 Received: (at 77718) by debbugs.gnu.org; 16 Apr 2025 20:38:06 +0000 Received: from localhost ([127.0.0.1]:43016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u59WH-000601-RU for submit@debbugs.gnu.org; Wed, 16 Apr 2025 16:38:06 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:42240) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u59WF-0005zL-9j for 77718@debbugs.gnu.org; Wed, 16 Apr 2025 16:38:04 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CB0871000BC; Wed, 16 Apr 2025 16:37:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1744835876; bh=0bxrBQ3IBZO0E49PstB2vh85yMbBVMbaVLouJ7+bDMw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=VPv9+wCFMIlWnYJCRL1e9sCDtmC1E6w3nEghgrjh3knnVdebSwhAa+O+KqMXYcbOu Pj98T+o/2Eb3z/NBsXhSeO5Zls2pA09Ytm8IpBfSWKTM+npTk2G4i4BRSdplGOBu5z 8wAFzDYHkBVQYNcQiZmNZQm6+3lhP4O/+Fs7TcgdqNxpvs+XeCy6uFX7R0tgWXwsKf tNfnDAXyMSLtYvN7jPnf4GBQ4FruAdSnuvEwp05MmPstEFWSc3EcRmvOO44YaFsJol G9XHoB0m8De7QYXCi2AQGPovtRtU89upMy+0YB2AWulFFHeqM1L7ANMIulfiqRAv9h o3bW8mEaE3OPA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 2DF28100027; Wed, 16 Apr 2025 16:37:56 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1D036120588; Wed, 16 Apr 2025 16:37:56 -0400 (EDT) From: Stefan Monnier To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: Message-ID: References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> Date: Wed, 16 Apr 2025 16:37:55 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.094 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> I suggest we focus on the immediate completion issue. >> If you want to refine the treatment of $$, let's do that in a separate >> bug report. > > OK, that's fair. > > But to be clear, the issue is in completion-table-with-quoting, so it's > quite tied together with the treatment of $$. Yes, I know. > My new version of completion--file-name-table fixes the bug by taking > a much simpler approach than completion-table-with-quoting, but that > approach depends on avoiding the need for $$. I think I missed some of that, then. Can you clarify how they interact? > I will try to think of another approach which is more similar to how > completion-table-with-quoting does things, but it will be more > complicated. I thought all that's missing is to double the $$ in the text we append during completion. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 17 02:00:18 2025 Received: (at 77718) by debbugs.gnu.org; 17 Apr 2025 06:00:18 +0000 Received: from localhost ([127.0.0.1]:45469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5IIL-0005HB-J0 for submit@debbugs.gnu.org; Thu, 17 Apr 2025 02:00:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60572) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u5IIJ-0005BC-HX for 77718@debbugs.gnu.org; Thu, 17 Apr 2025 02:00:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u5IID-0002Hg-5b; Thu, 17 Apr 2025 02:00:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=mX7fjN0DNA8krtsr2wcGItZUvTpxJw9BLXk2+DJJx5o=; b=cBtjVc8G+KeU fUGv029l+vzn7wXLJqQCmzLKBvt1VU/nl8SDA8YItY1Sz2PxvMUMUWAD5o69mMUtOPDiW8z4Sqe97 oNBpkcUgNZMg3tEXKUuU/iBzg4FTBeMOJfRDvsVdUOgHFWJe2NfYw8KfDoLGuS66CdMRQ8RjPnM57 FIxn1NpXg6Lf5wUUY/PwDxb1qsuOxzkVgKd730C5ka1CEPOrqA/acVxXSzk5kvZyf7rL97IqBjgyJ l+FHv/2inaBvDp3QHrqqH1FEBMHtIXt8HEFD2Y7etoItagjmPKj7Fpo9x74MYkjs4f+EyUIPDFUSL Eyk0JLAtbqEiF+4LSLC8Uw==; Date: Thu, 17 Apr 2025 09:00:04 +0300 Message-Id: <86zfgfe3a3.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh In-Reply-To: (message from Spencer Baugh on Wed, 16 Apr 2025 15:15:44 -0400) Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, stephen.berman@gmx.net, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Spencer Baugh > Cc: 77718@debbugs.gnu.org, Eli Zaretskii , > stephen.berman@gmx.net > Date: Wed, 16 Apr 2025 15:15:44 -0400 > > Stefan Monnier writes: > > >>> [ Also, I'm not sure it's worth the trouble anyway: dollars in file names > >>> are fairly rare, so having to double them in those rare cases where they > >>> occur is not a big deal. In any case, it seems orthogonal to the > >>> problem at hand. ] > >> That's fair - so you think it might be OK to, basically, not support > >> completion on file names containing substrings like "$HOME"? > > > > Of course we support it, but we require the use of `$$HOME` to state > > clearly which interpretation you want. > > Ah, sure. But my code supports completion on file names containing > "$HOME" without the user of "$$HOME", which seems even nicer. IMO, it's confusing, because it's inconsistent with the rest of Emacs's behavior regarding file names with embedded "$". > >> This TAB behavior doesn't help if I manually type $HOME though, right? > > > > Presumably if you type `$HOME` it means you want the value of the HOME > > envvar. If you want the file named `$HOME` you need to type `$$HOME`. > > > > When the typing is done by the completion code, it's up to the > > completion code to apply that same rule. > > Sure, that's fair. Though, a user might not know that they can type > $$HOME to get the file named '$HOME'; it's not that obvious. It seems > like it would be nice to automatically DTRT, where possible, without > requiring them to know that. What do you mean by "where possible"? The behavior should be consistent across all Emacs interfaces that accept file names, so "where possible" should be common to all of them. It would be wrong for some UIs to use rules and exhibit behaviors that are different from other UIs in this regard, since then the users will have much harder time knowing what is right and what to expect. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 17 12:39:58 2025 Received: (at 77718) by debbugs.gnu.org; 17 Apr 2025 16:39:59 +0000 Received: from localhost ([127.0.0.1]:48235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5SHO-0003t8-32 for submit@debbugs.gnu.org; Thu, 17 Apr 2025 12:39:58 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:37901) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u5SHJ-0003s8-Mv for 77718@debbugs.gnu.org; Thu, 17 Apr 2025 12:39:55 -0400 From: Spencer Baugh To: Stefan Monnier Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: (Stefan Monnier's message of "Wed, 16 Apr 2025 16:37:55 -0400") References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> Date: Thu, 17 Apr 2025 12:39:48 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1744907988; bh=hqqxNq6O5hXe4zSlQdJSb72TR167XIyLxUOYvr3n/vA=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=kmw4824bQiUhPwwuar2tNayfSHBZkb80P+3aMwIbyJbBWliwKGTat5YhK+aD7lrr7 JOBNor2hDKQB7eMnb19orw3ODjEfuIXp/dCGpoVCFoTmN1dP9prGoQ5roUKd49yp3Q Nj7yaMiU1o5K+Q5GJDpQZTVpZeQtsF9GmZqnlrT6+HMLVM1+lUBmb1/dbiSJwg/+6D V+frDku1w5gZvVeuyQ+Yrj1IgdoiDPOrmRy+YGL5pkRpy5MRhmFm3cAQa46uGEIA4n 0TsIFKVJAsiIGNuZD7SZqHoafygNYz07HV6K8WXU8XrelYOmOt7UkGTTBeqNoKvlUm ZNb7IyLwo+Zgw== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Stefan Monnier writes: >> I will try to think of another approach which is more similar to how >> completion-table-with-quoting does things, but it will be more >> complicated. > > I thought all that's missing is to double the $$ in the text we append > during completion. Yes, actually you're right, that turns out to be relatively simple. And now the quoting behavior doesn't change at all. Updated patch attached. The $ doubling also needs to happen in all-completions, not just try-completion. But, with sufficiently robust logic for figuring out the completion boundaries, that's straightforward: just double the $ in the newly added text. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Improve-env-var-handling-in-read-file-name.patch >From 6a8685edc22cba617ddced1f2b2e1b6c4e1c9de2 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Mon, 14 Apr 2025 16:01:38 -0400 Subject: [PATCH] Improve env var handling in read-file-name Fix various bugs, including bug#77718, by rewriting the way file name completion handles environment variable expansion. Instead of using completion-table-with-quoting to manipulate the string being completed on, simply make the completion table itself understand substitute-in-file-name. Tests are updated: partial-completion now preserves unexpanded environment variables. However, partial-completion no longer works across environment variables containing delimiters; that's an acceptable sacrifice. * lisp/minibuffer.el (completion--sifn-boundaries): Add. (completion--file-name-table): Rewrite to use substitute-in-file-name explicitly. (bug#77718) * test/lisp/minibuffer-tests.el (completion-table-test-quoting): Update. --- lisp/minibuffer.el | 59 ++++++++++++++++++++++++++++++++--- test/lisp/minibuffer-tests.el | 6 ++-- 2 files changed, 56 insertions(+), 9 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index c0ccfc00ce5..8edeba1fba9 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3596,13 +3596,62 @@ completion--sifn-requote (setq qpos (1- qpos))) (cons qpos #'minibuffer-maybe-quote-filename))))) -(defalias 'completion--file-name-table - (completion-table-with-quoting #'completion-file-name-table - #'substitute-in-file-name - #'completion--sifn-requote) +(defun completion--sifn-boundaries (string table pred suffix) + "Return completion boundaries on file name STRING. + +Runs `substitute-in-file-name' on STRING first, but returns completion +boundaries for the original string." + (let* (;; Calculate the completion boundaries without expanding env vars. + (unquoted + (let ((process-environment nil)) (substitute-in-file-name string))) + (bounds (completion-boundaries unquoted table pred suffix)) + ;; This is the part of UNQUOTED inside the completion boundaries. + (unquoted-suffix (substring unquoted (car bounds))) + ;; Each $ in UNQUOTED-SUFFIX is either $ or $$ in STRING. + (regex + (concat (replace-regexp-in-string "\\$" "\\$\\$?" unquoted-suffix t t) "$"))) + (cl-assert (string-match regex string) t) + (cons (match-beginning 0) (cdr bounds)))) + +(defun completion--file-name-table (orig pred action) "Internal subroutine for `read-file-name'. Do not call this. This is a completion table for file names, like `completion-file-name-table' -except that it passes the file name through `substitute-in-file-name'.") +except that it passes the file name through `substitute-in-file-name'." + (let ((table #'completion-file-name-table)) + (if (eq (car-safe action) 'boundaries) + (cons 'boundaries (completion--sifn-boundaries orig table pred (cdr action))) + (let* ((sifned (substitute-in-file-name orig)) + (result + (let ((completion-regexp-list + ;; Regexps are matched against the real file names after + ;; expansion, so regexps containing $ won't work. Drop + ;; them; we'll return more completions, but callers need to + ;; handle that anyway. + (cl-remove-if (lambda (regexp) (string-search "$" regexp)) + completion-regexp-list))) + (complete-with-action action table sifned pred)))) + (cond + ((null action) ; try-completion + (if (stringp result) + ;; Extract the newly added text, quote any dollar signs, and + ;; append it to ORIG. + (let ((new-text (substring result (length sifned)))) + (concat orig (minibuffer--double-dollars new-text))) + result)) + ((eq action t) ; all-completions + (mapcar + (let ((orig-prefix + (substring orig (car (completion--sifn-boundaries orig table pred "")))) + (sifned-prefix-length + (- (length sifned) + (car (completion-boundaries sifned table pred ""))))) + ;; Extract the newly added text, quote any dollar signs, and append + ;; it to the part of ORIG inside the completion boundaries. + (lambda (compl) + (let ((new-text (substring compl sifned-prefix-length))) + (concat orig-prefix (minibuffer--double-dollars new-text))))) + result)) + (t result)))))) (defalias 'read-file-name-internal (completion-table-in-turn #'completion--embedded-envvar-table diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index 59ac5ab9578..9e28077026c 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -91,7 +91,7 @@ completion-table-subvert-test (ert-deftest completion-table-test-quoting () (let ((process-environment - `("CTTQ1=ed" "CTTQ2=et/" ,@process-environment)) + `("CTTQ1=ed" ,@process-environment)) (default-directory (ert-resource-directory))) (pcase-dolist (`(,input ,output) '( @@ -101,10 +101,8 @@ completion-table-test-quoting ("data/m-cttq$$t" "data/minibuffer-test-cttq$$tion") ;; Test that env-vars are preserved. ("lisp/c${CTTQ1}et/se-u" "lisp/c${CTTQ1}et/semantic-utest") - ("lisp/ced${CTTQ2}se-u" "lisp/ced${CTTQ2}semantic-utest") ;; Test that env-vars don't prevent partial-completion. - ;; FIXME: Ideally we'd like to keep the ${CTTQ}! - ("lis/c${CTTQ1}/se-u" "lisp/cedet/semantic-utest") + ("lis/c${CTTQ1}/se-u" "lisp/c${CTTQ1}et/semantic-utest") )) (should (equal (completion-try-completion input #'completion--file-name-table -- 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 18 11:59:40 2025 Received: (at 77718) by debbugs.gnu.org; 18 Apr 2025 15:59:40 +0000 Received: from localhost ([127.0.0.1]:52583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5o7w-0004ql-4L for submit@debbugs.gnu.org; Fri, 18 Apr 2025 11:59:40 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13469) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u5o7u-0004pf-8E for 77718@debbugs.gnu.org; Fri, 18 Apr 2025 11:59:38 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 75CC1442370; Fri, 18 Apr 2025 11:59:32 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1744991971; bh=RLqAqlvbgTnaH7bJOFsVCMWfcvtlTw1SmtxGmR73y/o=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=XiKu5O2tBJVIjwSWEjPPQoLKcZMR4nrAYLMjglc8d0kmZ63hwhmYEk0FuHCj92Kkq MX5rOZj3Hilly+8dz0zC0hWaghepPuda6FpKT9HzOPWBRdM+fru+xO//OT1g1OZAlO WHjBjrmY9tL/SjRJsOIOs4+WggydqvDJrtZYLZgeqpap6GGE874yGBFDOaH4fQjynt RO42Muw7YNd18gh6PpQkkAy06zSvquh/NX9kDUmhmGgpechTNURjBVN4qMlv2I3xoF SDKvsWtN42wKFYqre5oXSthNdlSBaou6KppLf+p7oUPaf/2TrGHiCAv2K/HimGZMTk Iv59Zqr36jrXA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 53DB1441625; Fri, 18 Apr 2025 11:59:31 -0400 (EDT) Received: from alfajor (unknown [23.233.149.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2F2961201DE; Fri, 18 Apr 2025 11:59:31 -0400 (EDT) From: Stefan Monnier To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: Message-ID: References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> Date: Fri, 18 Apr 2025 11:59:30 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.228 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el > index c0ccfc00ce5..8edeba1fba9 100644 > --- a/lisp/minibuffer.el > +++ b/lisp/minibuffer.el > @@ -3596,13 +3596,62 @@ completion--sifn-requote > (setq qpos (1- qpos))) > (cons qpos #'minibuffer-maybe-quote-filename))))) > > -(defalias 'completion--file-name-table > - (completion-table-with-quoting #'completion-file-name-table > - #'substitute-in-file-name > - #'completion--sifn-requote) > +(defun completion--sifn-boundaries (string table pred suffix) > + "Return completion boundaries on file name STRING. > + > +Runs `substitute-in-file-name' on STRING first, but returns completion > +boundaries for the original string." > + (let* (;; Calculate the completion boundaries without expanding env vars. > + (unquoted > + (let ((process-environment nil)) (substitute-in-file-name string))) > + (bounds (completion-boundaries unquoted table pred suffix)) > + ;; This is the part of UNQUOTED inside the completion boundaries. > + (unquoted-suffix (substring unquoted (car bounds))) > + ;; Each $ in UNQUOTED-SUFFIX is either $ or $$ in STRING. > + (regex > + (concat (replace-regexp-in-string "\\$" "\\$\\$?" unquoted-suffix t t) "$"))) > + (cl-assert (string-match regex string) t) > + (cons (match-beginning 0) (cdr bounds)))) What makes us think that the `cl-assert` will always be satisfied? Won't it fail in `/blabla/foo-$BAR.c` when `BAR=bash` ? > @@ -101,10 +101,8 @@ completion-table-test-quoting > ("data/m-cttq$$t" "data/minibuffer-test-cttq$$tion") > ;; Test that env-vars are preserved. > ("lisp/c${CTTQ1}et/se-u" "lisp/c${CTTQ1}et/semantic-utest") > - ("lisp/ced${CTTQ2}se-u" "lisp/ced${CTTQ2}semantic-utest") Why do we remove this test? Maybe it's OK that it doesn't return the same value (e.g. that it behaves less well), but if so, we should probably keep this commented out with an explanation of what's going on. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 22 14:52:27 2025 Received: (at 77718) by debbugs.gnu.org; 22 Apr 2025 18:52:27 +0000 Received: from localhost ([127.0.0.1]:49883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u7IjK-0002LU-Br for submit@debbugs.gnu.org; Tue, 22 Apr 2025 14:52:27 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:39209) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u7IjG-0002LA-AL for 77718@debbugs.gnu.org; Tue, 22 Apr 2025 14:52:24 -0400 From: Spencer Baugh To: Stefan Monnier Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: (Stefan Monnier's message of "Fri, 18 Apr 2025 11:59:30 -0400") References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> Date: Tue, 22 Apr 2025 14:52:16 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1745347936; bh=Vb9tcModWG14s/YoZsViJC4okNcyIpR2trkby2rCLGo=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=RTiSGCCEVCui83lNx5T5yrN2CJDJhXTS7UQt/g8WoiEozYYXbz73KA3VZwFegPxIQ Av34/NA4aDgk6RNW9blo53Zq2i7cJG/J0Qyn330XVeeADbXoD1DpCGb64eb/YPauIJ wW5h2fFWxeHufPRVm3imCkXdHac7h6u4T53IOnCwatMRn0ggHDL4Br3pJTUD3ZGBMo ZZXQhZKoemCcn7V6nvpv90WWifKY1jlt+4mTxrYdwjYAdLwcjqpg1cK1WiSmJS2ZAa D/1uOKgkNVmawVz1s+vsGyl+/uGFAaJjVS5PfmMCwWRcN75xtb5BDMLiYjIejOSNjG TKrVAQpfeyjDg== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Stefan Monnier writes: >> diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el >> index c0ccfc00ce5..8edeba1fba9 100644 >> --- a/lisp/minibuffer.el >> +++ b/lisp/minibuffer.el >> @@ -3596,13 +3596,62 @@ completion--sifn-requote >> (setq qpos (1- qpos))) >> (cons qpos #'minibuffer-maybe-quote-filename))))) >> >> -(defalias 'completion--file-name-table >> - (completion-table-with-quoting #'completion-file-name-table >> - #'substitute-in-file-name >> - #'completion--sifn-requote) >> +(defun completion--sifn-boundaries (string table pred suffix) >> + "Return completion boundaries on file name STRING. >> + >> +Runs `substitute-in-file-name' on STRING first, but returns completion >> +boundaries for the original string." >> + (let* (;; Calculate the completion boundaries without expanding env vars. >> + (unquoted >> + (let ((process-environment nil)) (substitute-in-file-name string))) >> + (bounds (completion-boundaries unquoted table pred suffix)) >> + ;; This is the part of UNQUOTED inside the completion boundaries. >> + (unquoted-suffix (substring unquoted (car bounds))) >> + ;; Each $ in UNQUOTED-SUFFIX is either $ or $$ in STRING. >> + (regex >> + (concat (replace-regexp-in-string "\\$" "\\$\\$?" unquoted-suffix t t) "$"))) >> + (cl-assert (string-match regex string) t) >> + (cons (match-beginning 0) (cdr bounds)))) > > What makes us think that the `cl-assert` will always be satisfied? > Won't it fail in `/blabla/foo-$BAR.c` when `BAR=bash` ? Because I bound process-environment to nil around the substitute-in-file-name call, with the goal of preventing environment variable expansion. But actually there's a simpler and better way to do that: just duplicate all the $s to $$, then substitute-in-file-name turns all the $$ back to $ without expanding environment variables. So I did that in the attached updated patch. >> @@ -101,10 +101,8 @@ completion-table-test-quoting >> ("data/m-cttq$$t" "data/minibuffer-test-cttq$$tion") >> ;; Test that env-vars are preserved. >> ("lisp/c${CTTQ1}et/se-u" "lisp/c${CTTQ1}et/semantic-utest") >> - ("lisp/ced${CTTQ2}se-u" "lisp/ced${CTTQ2}semantic-utest") > > Why do we remove this test? Maybe it's OK that it doesn't return the > same value (e.g. that it behaves less well), but if so, we should > probably keep this commented out with an explanation of what's going on. Fixed - actually, this test doesn't need to change at all, it still works, just an oversight on my part. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Improve-env-var-handling-in-read-file-name.patch >From c2773fbc301ef0b6eb34b84da181e916d563c490 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Mon, 14 Apr 2025 16:01:38 -0400 Subject: [PATCH] Improve env var handling in read-file-name Fix various bugs, including bug#77718, by rewriting the way file name completion handles environment variable expansion. Instead of using completion-table-with-quoting to manipulate the string being completed on, simply make the completion table itself understand substitute-in-file-name. Tests are updated: partial-completion now preserves unexpanded environment variables. However, partial-completion no longer works across environment variables containing delimiters; that's an acceptable sacrifice. * lisp/minibuffer.el (completion--sifn-boundaries): Add. (completion--file-name-table): Rewrite to use substitute-in-file-name explicitly. (bug#77718) * test/lisp/minibuffer-tests.el (completion-table-test-quoting): Update. --- lisp/minibuffer.el | 63 ++++++++++++++++++++++++++++++++--- test/lisp/minibuffer-tests.el | 3 +- 2 files changed, 59 insertions(+), 7 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index c0ccfc00ce5..efe2eba9539 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3596,13 +3596,66 @@ completion--sifn-requote (setq qpos (1- qpos))) (cons qpos #'minibuffer-maybe-quote-filename))))) -(defalias 'completion--file-name-table - (completion-table-with-quoting #'completion-file-name-table - #'substitute-in-file-name - #'completion--sifn-requote) +(defun completion--sifn-boundaries (string table pred suffix) + "Return completion boundaries on file name STRING. + +Runs `substitute-in-file-name' on STRING first, but returns completion +boundaries for the original string." + ;; We want to compute the start boundary on the result of + ;; `substitute-in-file-name' (since that's what we use for actual completion), + ;; and then transform that into an offset in STRING instead. We can't do this + ;; if we expand environment variables, so double the $s to prevent that. + (let* ((doubled-string (replace-regexp-in-string "\\$" "$$" string t t)) + ;; sifn will change $$ back into $, so the result is a suffix of STRING + ;; (in fact, it's the last absolute file name in STRING). + (last-file-name (substitute-in-file-name doubled-string)) + (bounds (completion-boundaries last-file-name table pred suffix))) + (cl-assert (string-suffix-p last-file-name string) t) + ;; BOUNDS contains the start boundary in LAST-FILE-NAME; adjust it to be an + ;; offset in STRING instead. + (cons (+ (- (length string) (length last-file-name)) (car bounds)) + ;; No special processing happens on SUFFIX and the end boundary. + (cdr bounds)))) + +(defun completion--file-name-table (orig pred action) "Internal subroutine for `read-file-name'. Do not call this. This is a completion table for file names, like `completion-file-name-table' -except that it passes the file name through `substitute-in-file-name'.") +except that it passes the file name through `substitute-in-file-name'." + (let ((table #'completion-file-name-table)) + (if (eq (car-safe action) 'boundaries) + (cons 'boundaries (completion--sifn-boundaries orig table pred (cdr action))) + (let* ((sifned (substitute-in-file-name orig)) + (result + (let ((completion-regexp-list + ;; Regexps are matched against the real file names after + ;; expansion, so regexps containing $ won't work. Drop + ;; them; we'll return more completions, but callers need to + ;; handle that anyway. + (cl-remove-if (lambda (regexp) (string-search "$" regexp)) + completion-regexp-list))) + (complete-with-action action table sifned pred)))) + (cond + ((null action) ; try-completion + (if (stringp result) + ;; Extract the newly added text, quote any dollar signs, and + ;; append it to ORIG. + (let ((new-text (substring result (length sifned)))) + (concat orig (minibuffer--double-dollars new-text))) + result)) + ((eq action t) ; all-completions + (mapcar + (let ((orig-prefix + (substring orig (car (completion--sifn-boundaries orig table pred "")))) + (sifned-prefix-length + (- (length sifned) + (car (completion-boundaries sifned table pred ""))))) + ;; Extract the newly added text, quote any dollar signs, and append + ;; it to the part of ORIG inside the completion boundaries. + (lambda (compl) + (let ((new-text (substring compl sifned-prefix-length))) + (concat orig-prefix (minibuffer--double-dollars new-text))))) + result)) + (t result)))))) (defalias 'read-file-name-internal (completion-table-in-turn #'completion--embedded-envvar-table diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index 57c7cc2ae1a..00a2055e602 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -103,8 +103,7 @@ completion-table-test-quoting ("lisp/c${CTTQ1}et/se-u" "lisp/c${CTTQ1}et/semantic-utest") ("lisp/ced${CTTQ2}se-u" "lisp/ced${CTTQ2}semantic-utest") ;; Test that env-vars don't prevent partial-completion. - ;; FIXME: Ideally we'd like to keep the ${CTTQ}! - ("lis/c${CTTQ1}/se-u" "lisp/cedet/semantic-utest") + ("lis/c${CTTQ1}/se-u" "lisp/c${CTTQ1}et/semantic-utest") )) (should (equal (completion-try-completion input #'completion--file-name-table -- 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 28 14:01:36 2025 Received: (at 77718-done) by debbugs.gnu.org; 28 Apr 2025 18:01:36 +0000 Received: from localhost ([127.0.0.1]:34513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u9SnQ-0005x4-2M for submit@debbugs.gnu.org; Mon, 28 Apr 2025 14:01:36 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:32460) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u9SnF-0005vA-Su for 77718-done@debbugs.gnu.org; Mon, 28 Apr 2025 14:01:28 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 061C84425D2; Mon, 28 Apr 2025 14:01:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1745863279; bh=Ime6tkHKmTLQydv13wY4vhxxPbfG2HdKy2FOUwVuXJc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=VawYYxQpHsI6uQHL5kwuuNQhwvsUR+w6DE2zD7MtizU58U/YpJ9gUpXyqmkqTc8QZ qoQiIC697/xnxqGqee2ZlDXBID1wskBDvvcqfoqYaq/fZnKZAGJ+DUx/icSZHy8For 9ZXBht3X/Pf/ZbQRN45QXA4ebL9PG0Rgt8EeuIyHZ5ZBOVBEAnWpWFJ3Z/PL9BdO37 lTEYFHo97vFCkXwxwcs5T2Iq/++Um1gBik7nJiJsUsB1ri1D8zlcmxISIhg0PnhVXy PUZIJckTH7DrR0d+9YT5GK4wzhXEiwwTZPCHOoLznlULeZTyt5a3pH9ySpGLHN7X+f G4p0beTOMacaQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0C0094425C6; Mon, 28 Apr 2025 14:01:19 -0400 (EDT) Received: from pastel (104-195-232-56.cpe.teksavvy.com [104.195.232.56]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CE45E1201DD; Mon, 28 Apr 2025 14:01:18 -0400 (EDT) From: Stefan Monnier To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: Message-ID: References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> Date: Mon, 28 Apr 2025 14:01:18 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.019 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718-done Cc: Eli Zaretskii , 77718-done@debbugs.gnu.org, stephen.berman@gmx.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > But actually there's a simpler and better way to do that: just duplicate > all the $s to $$, then substitute-in-file-name turns all the $$ back to > $ without expanding environment variables. So I did that in the > attached updated patch. LGTM, pushed to `master`. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 29 06:19:23 2025 Received: (at 77718-done) by debbugs.gnu.org; 29 Apr 2025 10:19:23 +0000 Received: from localhost ([127.0.0.1]:50239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u9i3e-000638-Nf for submit@debbugs.gnu.org; Tue, 29 Apr 2025 06:19:23 -0400 Received: from mout.gmx.net ([212.227.17.20]:51935) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u9i3b-00062r-Ao for 77718-done@debbugs.gnu.org; Tue, 29 Apr 2025 06:19:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1745921953; x=1746526753; i=stephen.berman@gmx.net; bh=j4zOBevuaMcSP5zihvdxpW4aSuieVxpFKFT/Zg+8Aac=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=RylpZM4ZdH59h/gbiJ64wS1GyDSrrz9uqLGpvfNZC+ya+lw05IT5jDc99/lM0GHW 8zTvqEtnWkftKhErL7tHacmx9/HfhAjkNJG1BPiCx44zPkBfqu4kD+8ED3I1dGbYV M88msrX02iuhBHCo8z5Ruyhjlw4VRuyvOWZeKOlOdUH4VZuDO5qVivSBJQmxBogrI xsL+GW3jhXSUAFbOcE0LemkLpVTfNQHg/SjAibFFFkM5eLlyRRSTx5+ddTj9QqV5h 0POHCkl2lVWXHV7cEPDgnszh0A1X/9pSC+b35iqiGOh3QnH28VXTeWwWur991V3na 7LZqLzNRkP5GMschUA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([94.134.95.126]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MTRQq-1udRkL0b7c-00Iqbm; Tue, 29 Apr 2025 12:19:13 +0200 From: Stephen Berman To: Stefan Monnier Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: References: <87y0w7ejxy.fsf@gmx.net> <86semfp3g9.fsf@gnu.org> <86a58ihrfg.fsf@gnu.org> Date: Tue, 29 Apr 2025 12:19:11 +0200 Message-ID: <87v7qnp8ww.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:NeD8HzxyMnQGtlklgVSOK59Riaj05U/+XFYBbfqoJKidLeFZ9JL JthEnzbxxsAtkjeDOXEjP6sDwaNd7PVqKcS1d2NKU9QXr7dkM+KI4Ct/Jz99AOY/rrmMjq2 ioo3q1H16e3JpQK/RWYAIWfLODa9wEcP8fqtYk6toO/IGkzLp1VobDBoo0dmsKcBa+sdpVJ SYRtIb1xoAMb5oQh9LH4Q== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:GYqtlGX2euE=;YFBfxhN+84NVYowwCneBK61GMoA OvDNq3PixOxPCcGGEonV65zRRGxhdu84ZJzOvcjzr5v+phLMm82GlGVlIbQo9j6IscKuHByLw b/EaacZouSa6Fnj4lHTKMgQfQIROZn2zhvq4jxycbTr1kc21N0rDRbXi37rMF+sygiw+GwtjI D1xPwDiGAW3uaspcmZ1t50wuGUe/UeUws/KbaBc2yVlDGFd1Sw45+qnPujsIvB7rc/GpPWV8e SP72Y9OI5/YeJhUBmUdNKACKXyLUKkkV9BZefCntU3dpqD9g42UQHyqKTfdO8e15WE+0KHhLO 1wUZ4CGb6zH6gC6tv6cq3S81AsHhs/ctqkDz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NZH/8omRylvqeq0GGrIpWwtilrhuX9smrjixDE22EsmOry3yZuUzyPW9l0uq9JcNzEbkW50sA VOjzLLTIr/I5Q59O/8817fuexdRa29Pn1feetn0RIbwWSojmkgYcksrlNdWD7XSUifjZVB6t8 ZXW2KhftDJw3BPe/Aus6L5BWaKe/2N99ydrL8f3PSLiPLc3zitZusKOfqQpskpQY34x13YQax pmt13T4YHgeEektKQ98sGCygPGPPTNjsvNE4OuJpd5GvbpbrZdmnAfD8c80YnOBaiN6+4mEIC oLuYjvMEgoXsK4xHsTIY0CZR4aCNPKoppOLn2m5Dof8SxbeDNBlrCaqLjnZXDRcLsrkmUXPdx Lcmj6UYrosT7sxlEaSkkjeJl6yumTURSV6vBz70Vdf/e8aeN9xApqQVJHctq+k2kWt9aIfd09 eSzvq+xcwUERB/jI7d5eO0XkoRVZJf96iWjufL+4KmbfjKhkzD+kJfaWSnlg2fmmjSuYrouxn C6fGLcTtu5QmbQbtDbHIrpI3xr45rkYImC7gtaKiA503mRWuOGbbvFX/A6j+raik6FS9o6dG9 rrVoRnZ8B2a9SArey8cMaYJ+aUj8JCLpCYJreUkei5HQElH2/L6z2RNWH5c9+MLLunmcKswsi 5q1XvInW11avTHCNaBinwSfTx69fQifL7U3i2oy0pJdXSvAwgQLvZR3qRc7wHV7NOrlqCQVAl 1T92Bd7w2lVA7iKe5zKQxmqi35KQPhd54EIMP2elNx+voOjXWgtPCrLrBh1Txh9+Gg0o= X-Spam-Score: 2.9 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Mon, 28 Apr 2025 14:01:18 -0400 Stefan Monnier wrote: >> But actually there's a simpler and better way to do that: just duplicate >> all the $s to $$, then substitute-in-file-name turns all the $$ back to >> $ without expanding environment variables. So [...] Content analysis details: (2.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.20 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stephen.berman[at]gmx.net) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [212.227.17.20 listed in sa-accredit.habeas.com] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [212.227.17.20 listed in bl.score.senderscore.com] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [94.134.95.126 listed in zen.spamhaus.org] X-Debbugs-Envelope-To: 77718-done Cc: Spencer Baugh , Eli Zaretskii , 77718-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.9 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Mon, 28 Apr 2025 14:01:18 -0400 Stefan Monnier wrote: >> But actually there's a simpler and better way to do that: just duplicate >> all the $s to $$, then substitute-in-file-name turns all the $$ back to >> $ without expanding environment variables. So [...] Content analysis details: (1.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [212.227.17.20 listed in sa-accredit.habeas.com] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [94.134.95.126 listed in zen.spamhaus.org] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.20 listed in list.dnswl.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [212.227.17.20 listed in bl.score.senderscore.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stephen.berman[at]gmx.net) -0.0 SPF_PASS SPF: sender matches SPF record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager --=-=-= Content-Type: text/plain On Mon, 28 Apr 2025 14:01:18 -0400 Stefan Monnier wrote: >> But actually there's a simpler and better way to do that: just duplicate >> all the $s to $$, then substitute-in-file-name turns all the $$ back to >> $ without expanding environment variables. So I did that in the >> attached updated patch. > > LGTM, pushed to `master`. This patch causes two regressions wrt emacs-30. One I pointed out upthread (<87a58hal6w.fsf@gmx.net>, ). For this, the following patch fixes the regression according to my testing: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: completion-pcm--merge-completions patch diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index f8593fde0f7..cf5ab39bfb2 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -4609,7 +4609,7 @@ completion-pcm--merge-completions (mapcar (lambda (str) (substring str skip)) comps)))))) (cl-assert (stringp suffix)) - (unless (equal suffix "") + (unless (member suffix '("" "/")) (push suffix res)))) ;; We pushed these wildcards on RES, so we're done with them. (setq wildcards nil)) --=-=-= Content-Type: text/plain For the other regression, here is a reproducer: 0. mkdir /tmp/{Test,retest} 1. emacs -Q --eval "(custom-set-variables \ '(completion-category-overrides '((file (styles substring)))) \ '(read-file-name-completion-ignore-case t))" 2. Type `C-x d /tmp/tes TAB': this completes to /tmp/test/ 3. Type TAB again: Emacs dings and shows "[no match]" If you repeat this recipe in emacs-30, then after the TAB in step 3, this completion is shown: /tmp/Test/. and typing TAB again pops up the *Completions* buffer displaying the two completions ../ and ./ While the result in emacs-30 seems suboptimal, since it omits the possible completion /tmp/retest/, still it's better than "[no match]". A workaround for both emacs-30 and master is to enter at step 2 `C-x d /tmp/*tes TAB'. This shows the completion /tmp/*test/, then hitting TAB again shows /tmp/*test/., and hitting TAB a third time pops up the *Completions* buffer showing the four completions Test/../, Test/./, retest/../, and retest/./ Steve Berman --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu May 01 13:59:58 2025 Received: (at 77718) by debbugs.gnu.org; 1 May 2025 17:59:58 +0000 Received: from localhost ([127.0.0.1]:53039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uAYCT-0001nG-UI for submit@debbugs.gnu.org; Thu, 01 May 2025 13:59:58 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:38891) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uAYCP-0001mk-Mh for 77718@debbugs.gnu.org; Thu, 01 May 2025 13:59:55 -0400 From: Spencer Baugh To: Stephen Berman Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: <87v7qnp8ww.fsf@gmx.net> (Stephen Berman's message of "Tue, 29 Apr 2025 12:19:11 +0200") References: <87y0w7ejxy.fsf@gmx.net> <86a58ihrfg.fsf@gnu.org> <87v7qnp8ww.fsf@gmx.net> Date: Thu, 01 May 2025 13:59:48 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1746122388; bh=azTYLfh7LTG8HmdFkUViu33mzxPoIXG4noQXwPcBW54=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=tnQEaFAZ15NbElMOtW4n506TS3QheluOijRJ9nG9Z7gwLwAkzHLFtZVG3bRZ8Rznu crWMVf8aGg0c3g40S96M9ctiZAxMKvMQFkjo9l+Ig00QO+ok9mhhrRy13wKrs2B87U brX3/l+tEpg0VBkff6FKMD5bEj8WcAvkLQZiqMSPJfSMHd/ImZF4m8Eqy+gxit+tz6 umzNvN2eaZ7bxQa7ZTZuLGfJ1etQWvD5FDy6s+mBuoqjn3H6Pku7e609Cyf3dAsncr zdjb+dOTPlSZRGBLu9EyQcbc05lbeZR+gDGSSXPE2oLWo6jPNMjPaV2welm4DrofML QzIF127XPLvBg== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , 77718-done@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Stephen Berman writes: > For the other regression, here is a reproducer: > > 0. mkdir /tmp/{Test,retest} > 1. emacs -Q --eval "(custom-set-variables \ > '(completion-category-overrides '((file (styles substring)))) \ > '(read-file-name-completion-ignore-case t))" > 2. Type `C-x d /tmp/tes TAB': this completes to /tmp/test/ > 3. Type TAB again: Emacs dings and shows "[no match]" > > If you repeat this recipe in emacs-30, then after the TAB in step 3, this > completion is shown: /tmp/Test/. and typing TAB again pops up the > *Completions* buffer displaying the two completions ../ and ./ > > While the result in emacs-30 seems suboptimal, since it omits the > possible completion /tmp/retest/, still it's better than "[no match]". > > A workaround for both emacs-30 and master is to enter at step 2 `C-x d > /tmp/*tes TAB'. This shows the completion /tmp/*test/, then hitting TAB > again shows /tmp/*test/., and hitting TAB a third time pops up the > *Completions* buffer showing the four completions Test/../, Test/./, > retest/../, and retest/./ > > Steve Berman Thanks for the prompt and detailed report. Does the attached patch fix this issue for you? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Fix-completion-ignore-case-with-completion-file-name.patch >From 2619db58b2f3bdaeed0ea077b3292d93621e15d8 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Thu, 1 May 2025 13:56:37 -0400 Subject: [PATCH] Fix completion-ignore-case with completion--file-name-table 509cbe1c35b3d "Improve env var handling in read-file-name" caused try-completion and all-completion operations with completion--file-name-table to no longer update the case of text which was already present in the input string. That is, completions would be returned ignoring case, but the completions would have letter-casing which matched the input string rather than matching the actual file names. Fix this by always using text from the file name completions whenever it might have changed case. Also, fix a related bug where mixing completion-ignore-case and expanding environment variables would cause `read-file-name' to return the wrong result; do this by suppressing completion-ignore-case in the problematic case. * lisp/minibuffer.el (completion--file-name-table): Use text from the completions, not the input string. (bug#77718) * test/lisp/minibuffer-tests.el (completion-table-test-quoting): Test with completion-ignore-case as well. --- lisp/minibuffer.el | 42 +++++++++++++++++++++++------------ test/lisp/minibuffer-tests.el | 18 ++++++++++++++- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 7b2b986aa1d..e35db9dad64 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3597,8 +3597,18 @@ completion--file-name-table (if (eq (car-safe action) 'boundaries) (cons 'boundaries (completion--sifn-boundaries orig table pred (cdr action))) (let* ((sifned (substitute-in-file-name orig)) + (orig-start (car (completion--sifn-boundaries orig table pred ""))) + (sifned-start (car (completion-boundaries sifned table pred ""))) + (orig-in-bounds (substring orig orig-start)) + (sifned-in-bounds (substring sifned sifned-start)) + (did-expansion-in-bounds (not (string-equal orig-in-bounds sifned-in-bounds))) (result - (let ((completion-regexp-list + (let ((completion-ignore-case + ;; If we expanded an environment variable in the completion + ;; bounds, don't ignore-case, otherwise `read-file-name' + ;; can return the wrong filename. + (and (not did-expansion-in-bounds) completion-ignore-case)) + (completion-regexp-list ;; Regexps are matched against the real file names after ;; expansion, so regexps containing $ won't work. Drop ;; them; we'll return more completions, but callers need to @@ -3606,26 +3616,30 @@ completion--file-name-table (seq-remove (lambda (regexp) (string-search "$" regexp)) completion-regexp-list))) (complete-with-action action table sifned pred)))) + ;; For each completion, quote dollar signs in newly added text. If sifn + ;; changed text within the completion boundaries, replace that with text + ;; from ORIG; otherwise, use text from the completion (it may differ if + ;; `completion-ignore-case' is non-nil) (cond ((null action) ; try-completion (if (stringp result) - ;; Extract the newly added text, quote any dollar signs, and - ;; append it to ORIG. (let ((new-text (substring result (length sifned)))) - (concat orig (minibuffer--double-dollars new-text))) + ;; Unconditionally replace the text outside the + ;; completion boundaries with text from ORIG. + (concat (substring orig nil orig-start) + (if did-expansion-in-bounds + orig-in-bounds + (substring result sifned-start (length sifned))) + (minibuffer--double-dollars new-text))) result)) ((eq action t) ; all-completions (mapcar - (let ((orig-prefix - (substring orig (car (completion--sifn-boundaries orig table pred "")))) - (sifned-prefix-length - (- (length sifned) - (car (completion-boundaries sifned table pred ""))))) - ;; Extract the newly added text, quote any dollar signs, and append - ;; it to the part of ORIG inside the completion boundaries. - (lambda (compl) - (let ((new-text (substring compl sifned-prefix-length))) - (concat orig-prefix (minibuffer--double-dollars new-text))))) + (lambda (compl) + (let ((new-text (substring compl (length sifned-in-bounds)))) + (concat (if did-expansion-in-bounds + orig-in-bounds + (substring compl nil (length sifned-in-bounds))) + (minibuffer--double-dollars new-text)))) result)) (t result)))))) diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index bed797bdb14..5e013668a2e 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -108,7 +108,23 @@ completion-table-test-quoting (should (equal (completion-try-completion input #'completion--file-name-table nil (length input)) - (cons output (length output))))))) + (cons output (length output))))) + ;; Everything also works with `completion-ignore-case'. + (let ((completion-ignore-case t)) + (pcase-dolist (`(,input ,output) + '( + ("data/M-CTTQ" "data/minibuffer-test-cttq$$tion") + ("data/M-CTTQ$$t" "data/minibuffer-test-cttq$$tion") + ("lisp/c${CTTQ1}et/SE-U" "lisp/c${CTTQ1}et/semantic-utest") + ;; `completion-ignore-case' is suppressed when an + ;; environment variable is in the completion bounds. + ("lisp/ced${CTTQ2}SE-U" nil) + ("lis/c${CTTQ1}/SE-U" "lisp/c${CTTQ1}et/semantic-utest") + )) + (should (equal (car (completion-try-completion input + #'completion--file-name-table + nil (length input))) + output)))))) (ert-deftest completion--insert-strings-faces () (with-temp-buffer -- 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 02 04:30:27 2025 Received: (at 77718) by debbugs.gnu.org; 2 May 2025 08:30:28 +0000 Received: from localhost ([127.0.0.1]:56259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uAlmt-0000dK-I0 for submit@debbugs.gnu.org; Fri, 02 May 2025 04:30:27 -0400 Received: from mout.gmx.net ([212.227.17.21]:39815) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uAlmq-0000cy-AT; Fri, 02 May 2025 04:30:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1746174617; x=1746779417; i=stephen.berman@gmx.net; bh=w98HOSKCbPCkibJxibl47yNCQbf45iT8o+80vFzx0vE=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=XpeIAeNSqeFDWwCbGzApu1NQl9oZiYyodbzJi/jnpa2d8j4IHobAKKx94kP887fG jMjadSUk7H4NA/fJP6oDQlzFRQmOoS66i1yGbrKwrbJzMbmIorFpP9NMgAw3CsimX Ne+DDJg1rrWN2SGjGgBvNMYfyaUcU3sfqe2LTFAqCwufiZ/xBAVhDZpUxBgoy+BZk +HkEGidm+UCYx5kKxElqLWAiuoMxQR5qGZsXHAAPkOYQYiJQK8boajwAMVdkHqQeh F669ukqzg/QHye1VM1+b/KB5JUmnO7TfYV3KeZ1N+yLtNNpwYeCLR0uSlc7pY/EuO 9rYiBjwbizrcS5PinA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([94.134.95.219]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MRTRN-1uNEey2D0n-00Woue; Fri, 02 May 2025 10:30:17 +0200 From: Stephen Berman To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: References: <87y0w7ejxy.fsf@gmx.net> <86a58ihrfg.fsf@gnu.org> <87v7qnp8ww.fsf@gmx.net> Date: Fri, 02 May 2025 10:30:15 +0200 Message-ID: <87bjsbquso.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:faSer93x4I42gAdv/ubwDNoT2OrU3BAcd/SOV4o4hU3vVfuk8Hg g2rN9hA7bsITe0zI2qtNbI72HFizk6+xUkVMsyoXPfp/31olLTFU2nF7uTeMv6SIsLKWMkq so8/PL9jPSTuXgipwzGk9UyWUHm/ZfXirYG8XuzyRns01uxCFGKDwEAqkzsqIysIS80l4pr RmjLBDglud2BF+TGR4FHw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:9gVJxcdjuAM=;5ZiGGspxd4sABycqv8FjoHM7GCc KgAQM/yhnYEmyX8cjeg5mZVnchx0jXgF7fkFdFywNH+S1qgJskKOMCOWtfCzXNoEyMh8v3fkO GHK9PGnSPd91rrdq9H0T7wplU/4kZzxNz53rVdoR3CQMUXcyig8c4OnzhcpLjFX4hVJgKciL9 tZmtypi70N3bZCq7V43EoP47bmk8ZVBOyoNWt2FKYKvLUD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P43+w Ww1p5tp6BOGptIqf6GhpUdPnLeHVaZ4lp2qg7nO+pMbT7JUJ59fMg6OmWx3WrWqiJQZqM38Er kbmkVSB1nD6Sd6Ddcr7ZP/QkSLBOhdlYKXXr0nABRrhWwOwrX6bp1cVgv258ivOGNizFumXk4 /WC1NRBEdgWY8F2DeK2X3P76pjrfRJTtHHeYo/WJnRtVWL6cPFszRjIbhs3dOfQ93kS4lOg23 CQ7tibqyxNiVBtF+bLvo3bKihprGveqLL3bgkl+lgiO9xEPHV8Dmq3VQTO9TILBdnuCcqELdZ oECuUFgQEQhcDml/EBILXXdgW8yrIgCBpre7TmXBJ2Sbj9vyAsYzYkpAEhuU9VeyETXni0QD3 YNS+GWTD2VKa4LobNCsHfdsOEoIJPxNK7eiPrNsN9yXEgSWjKFdjjC+ZGueIRJukOitlkTi72 YUUxSp0I+Zfjz1zpVhURjg1vlNiieHLSaH6tJlIgNn4Jift6sAUf7AI5TFXq2K28LKXWuYLm2 8PLAOnPkhHvzjNYDLGQBNsjVdeIUtaRmL+YfkYcHqcdiV6MFoR+DBCGASXHurw3AWpt3WUap+ N0iOxaYA4PtlXQ/ORAXMcJFdvhwGszReAuP0SCU0wm4KuX/zl1V9r0vWnKOwm9SDKaI5nVPSS iEOD0N0ceokNbE22xrWBCL/7GuULb2CnS4iUm1OogWZgifqJhf76h2XhCCXJpdEzFTltjypwd 44Zk9AiD4GpXBPigO3ibIoYmbl0ZkTdMFY9cnzrkgJmF4sH8KV5pWvpVKoZYx4gA7G/VKn8b+ 22miSrX+FvVRU= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , 77718-done@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Thu, 01 May 2025 13:59:48 -0400 Spencer Baugh wrote: > Stephen Berman writes: >> For the other regression, here is a reproducer: >> >> 0. mkdir /tmp/{Test,retest} >> 1. emacs -Q --eval "(custom-set-variables \ >> '(completion-category-overrides '((file (styles substring)))) \ >> '(read-file-name-completion-ignore-case t))" >> 2. Type `C-x d /tmp/tes TAB': this completes to /tmp/test/ >> 3. Type TAB again: Emacs dings and shows "[no match]" >> >> If you repeat this recipe in emacs-30, then after the TAB in step 3, this >> completion is shown: /tmp/Test/. and typing TAB again pops up the >> *Completions* buffer displaying the two completions ../ and ./ >> >> While the result in emacs-30 seems suboptimal, since it omits the >> possible completion /tmp/retest/, still it's better than "[no match]". >> >> A workaround for both emacs-30 and master is to enter at step 2 `C-x d >> /tmp/*tes TAB'. This shows the completion /tmp/*test/, then hitting TAB >> again shows /tmp/*test/., and hitting TAB a third time pops up the >> *Completions* buffer showing the four completions Test/../, Test/./, >> retest/../, and retest/./ >> >> Steve Berman > > Thanks for the prompt and detailed report. Does the attached patch fix > this issue for you? Yes, with that patch my reproducer now gives the same results on master as on emacs-30, i.e., the patch fixes the regression; thanks! What about the other regression I mentioned? Have you looked at that and tried the fix for it I included? If there are no objections to that patch, I'd like to install it on master. Or if there are problems with it, I'd welcome a better fix. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Fri May 02 08:27:07 2025 Received: (at 77718) by debbugs.gnu.org; 2 May 2025 12:27:07 +0000 Received: from localhost ([127.0.0.1]:57202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uApTu-0007hD-HD for submit@debbugs.gnu.org; Fri, 02 May 2025 08:27:07 -0400 Received: from mxout1.mail.janestreet.com ([38.105.200.78]:59389) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uApTq-0007gN-CP for 77718@debbugs.gnu.org; Fri, 02 May 2025 08:27:03 -0400 Received: from mail-ej1-f69.google.com ([209.85.218.69]) by mxgoog2.mail.janestreet.com with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) (Exim 4.98.2) id 1uApTk-00000001aWR-2yEm for 77718@debbugs.gnu.org; Fri, 02 May 2025 08:26:56 -0400 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-ac3db5469fbso156062866b.0 for <77718@debbugs.gnu.org>; Fri, 02 May 2025 05:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; t=1746188816; x=1746793616; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=pr8vLHCYo6oKy1YWuHt5rRIVQGVwN7v21APZ31sVpTc=; b=HpHDwq0ChKHz09nSa3IFsjRYPWddZoFkBB1LlrJUChjzwxD/0ASvuJovcIqvzN9gBf BRR40Oz4JzCQVX+aXX60rDWetHYRX5fZSTL9KcKuydtzeAXiuGqss4Yhc3iybO9detWV JUzZGgYDaAYbCOeaoLyL3/PITGulfZhgmzseI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1746188817; bh=pr8vLHCYo6oKy1YWuHt5rRIVQGVwN7v21APZ31sVpTc=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=L9FlGJZkZauDE6RzFwmiBCQjrkYIpraRe4JWDE6d91DQVVQyhUHAqr+H2S9DxEUON 6L2pjk7NqBSrClL786R1UI2vDG6uHFSGb7tH9SPqkn++fU92qrW4B2jQi68i7cC15g RabKP1vco0k4xLJLO65zD41CX/c78drRsp2y+DX4HLXs89N0mbrYvnoeeq5fqlYfoZ PFgX3btkGAHTtlKUupxnPxDayo/gs/g9ezv/nea/KpLd4UA0OA0NXO8n3adh7Yfzm/ FYtwUHxAwDY2sCXfgrpFsl7eKAWYX8v2z6Isgfrd6uutNQo7qWdbbfiqMZDYZ0HBrK NISsJy+69wnVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746188816; x=1746793616; 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=pr8vLHCYo6oKy1YWuHt5rRIVQGVwN7v21APZ31sVpTc=; b=dOw7nOJhya69TutTpJORHHTWW+jolG+nVNqeKfBfgYSgSTAD2gsShysoD5kc0TeGEU nMHYEzuknHduOzU8Oxrn9sAESHivlmBqsBiHEArdazQ/gdxxlTsQ3/VKYvXgTQrIKUXc joOlNhqRlMAPi3lw//TFzTujtr5GagEyp6+wrAFs3wjnUtg9NVcTcejR1s0EjDLSwgJW c9Kl1PUEAlUjfaK0/VFTsQWTR6pC4CmQMqmjjBfgcz/++RuhMrMKRp1eNeJCzdGgZZen osM51SaXxmfH1bihqWLNM9ktKXmnLkVURDbPxkNb68Ljx+eJTYm+uJStlIkU9gDGN/rw G1dw== X-Forwarded-Encrypted: i=1; AJvYcCXxvcxHxL5ujOobK+oo9s1s3zh2naUbkGBRmo9RZyq2HexMj/Grss2vfni3bCJ3vixv9uH4fg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxiCJ1r66WNWYYBXsnjP75g+wB8iIjC8txfiys18GyO1xAlwoHR 5tBqSKyz8M0J/RSPVVO/cm27VWJj8CtScQBlnMIBxSwSo2XHzxkQ1bGLzFa64Q55kS1LcjAeTLS MyAOAnqSOnRi+3ucWg4sLqaS9ATS9lqUIctaQsCjZ4EJzbNLAZi8Qy6p5ESCDEyhNy1f8DPNyVz fU+dTLCxPt56AeuiyBxG5k/bU4uQ== X-Gm-Gg: ASbGncuCryLSTPOePk0An1VeXAD0mtteLkwpp4KDAqZQhTKf2Yh9qQQiaNJfBImXDCF fVdRin4D2EWJD8aKtLAKWVTpm7o0oCHqg8wSgt45afiQ/A86FhTxVz3T71s9y2f/wcWWc X-Received: by 2002:a17:907:1999:b0:acb:b966:3a8f with SMTP id a640c23a62f3a-ad17af47f9fmr251265966b.39.1746188816045; Fri, 02 May 2025 05:26:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9oIQIcAwBKrN8ghyf3VMhO5bn30U805oGghLb+NJPzy+cyd2mPT82EF4JCWIX7cGTiZ1WPs/H94EkYVCpflE= X-Received: by 2002:a17:907:1999:b0:acb:b966:3a8f with SMTP id a640c23a62f3a-ad17af47f9fmr251263566b.39.1746188815745; Fri, 02 May 2025 05:26:55 -0700 (PDT) MIME-Version: 1.0 References: <87y0w7ejxy.fsf@gmx.net> <86a58ihrfg.fsf@gnu.org> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> In-Reply-To: <87bjsbquso.fsf@gmx.net> From: Spencer Baugh Date: Fri, 2 May 2025 08:26:44 -0400 X-Gm-Features: ATxdqUEZ96M3RXIpU8w2JvYJ5ceCOyiShwtb8BbJpghs4oYClnpEx6BIu5bKwuw Message-ID: Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken To: Stephen Berman Content-Type: multipart/alternative; boundary="00000000000012d7ec06342644c1" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , 77718-done@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --00000000000012d7ec06342644c1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, May 2, 2025, 4:30=E2=80=AFAM Stephen Berman wrote: > On Thu, 01 May 2025 13:59:48 -0400 Spencer Baugh > wrote: > > > Stephen Berman writes: > >> For the other regression, here is a reproducer: > >> > >> 0. mkdir /tmp/{Test,retest} > >> 1. emacs -Q --eval "(custom-set-variables \ > >> '(completion-category-overrides '((file (styles substring)))) \ > >> '(read-file-name-completion-ignore-case t))" > >> 2. Type `C-x d /tmp/tes TAB': this completes to /tmp/test/ > >> 3. Type TAB again: Emacs dings and shows "[no match]" > >> > >> If you repeat this recipe in emacs-30, then after the TAB in step 3, > this > >> completion is shown: /tmp/Test/. and typing TAB again pops up the > >> *Completions* buffer displaying the two completions ../ and ./ > >> > >> While the result in emacs-30 seems suboptimal, since it omits the > >> possible completion /tmp/retest/, still it's better than "[no match]". > >> > >> A workaround for both emacs-30 and master is to enter at step 2 `C-x d > >> /tmp/*tes TAB'. This shows the completion /tmp/*test/, then hitting TA= B > >> again shows /tmp/*test/., and hitting TAB a third time pops up the > >> *Completions* buffer showing the four completions Test/../, Test/./, > >> retest/../, and retest/./ > >> > >> Steve Berman > > > > Thanks for the prompt and detailed report. Does the attached patch fix > > this issue for you? > > Yes, with that patch my reproducer now gives the same results on master > as on emacs-30, i.e., the patch fixes the regression; thanks! > Great! It should be good to install if no one has any objections > What about the other regression I mentioned? Have you looked at that > and tried the fix for it I included? If there are no objections to that > patch, I'd like to install it on master. Or if there are problems with > it, I'd welcome a better fix. > That fix is not right and would cause other issues. I will look at it soon; it's lower priority since completion still works fine. Part of what is needed is just to update rfn-eshadow. > --00000000000012d7ec06342644c1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, May 2, 2025, 4:30=E2=80= =AFAM Stephen Berman <stephen.= berman@gmx.net> wrote:
On Th= u, 01 May 2025 13:59:48 -0400 Spencer Baugh <sbaugh@janestreet.com> wrote:

> Stephen Berman <
stephen.berman@gmx.net> writes:
>> For the other regression, here is a reproducer:
>>
>> 0. mkdir /tmp/{Test,retest}
>> 1. emacs -Q --eval "(custom-set-variables=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 \
>>=C2=A0 =C2=A0 '(completion-category-overrides '((file (styl= es substring)))) \
>>=C2=A0 =C2=A0 '(read-file-name-completion-ignore-case t))"=
>> 2. Type `C-x d /tmp/tes TAB': this completes to /tmp/test/
>> 3. Type TAB again: Emacs dings and shows "[no match]" >>
>> If you repeat this recipe in emacs-30, then after the TAB in step = 3, this
>> completion is shown: /tmp/Test/. and typing TAB again pops up the<= br> >> *Completions* buffer displaying the two completions ../ and ./
>>
>> While the result in emacs-30 seems suboptimal, since it omits the<= br> >> possible completion /tmp/retest/, still it's better than "= ;[no match]".
>>
>> A workaround for both emacs-30 and master is to enter at step 2 `C= -x d
>> /tmp/*tes TAB'. This shows the completion /tmp/*test/, then hi= tting TAB
>> again shows /tmp/*test/., and hitting TAB a third time pops up the=
>> *Completions* buffer showing the four completions Test/../, Test/.= /,
>> retest/../, and retest/./
>>
>> Steve Berman
>
> Thanks for the prompt and detailed report.=C2=A0 Does the attached pat= ch fix
> this issue for you?

Yes, with that patch my reproducer now gives the same results on master
as on emacs-30, i.e., the patch fixes the regression; thanks!

Great! It shou= ld be good to install if no one has any objections=C2=A0


What about the other regression I mentioned?=C2=A0 Have you looked at that<= br> and tried the fix for it I included?=C2=A0 If there are no objections to th= at
patch, I'd like to install it on master.=C2=A0 Or if there are problems= with
it, I'd welcome a better fix.

That fix is not right and would cause othe= r issues.=C2=A0 I will look at it soon; it's lower priority since compl= etion still works fine.=C2=A0 Part of what is needed is just to update rfn-= eshadow.
--00000000000012d7ec06342644c1-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 02 08:44:19 2025 Received: (at 77718) by debbugs.gnu.org; 2 May 2025 12:44:19 +0000 Received: from localhost ([127.0.0.1]:57278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uApkY-00007I-Un for submit@debbugs.gnu.org; Fri, 02 May 2025 08:44:19 -0400 Received: from mout.gmx.net ([212.227.17.21]:33291) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uApkS-00006o-OI; Fri, 02 May 2025 08:44:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1746189846; x=1746794646; i=stephen.berman@gmx.net; bh=4VFUsFyqvSOt/sLNkoEbOXu7PhLMV4wQl2/l+7C2ZKU=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=aiQwLaozYNfL2z9zxrqsG+GBT0IoBiNx9yScWE6V2PPv11+9S1GFhfYhJPRSxLx9 EUs89MPFQuPqf9aHYJelRKKafSULNPTLy5L634Mq22MsEBjWi9glWlTVzMIrgm7FC 15BStbevEmSga83y1oiXCgHoIay2ChmgFbz9gNwx4RF45b8DPdQ6RMpGhWCWaxUb6 yILO6tsr2zFf8L+A7meuMOE5zGC4n9cAIeC/CaAzUme7NdxLfOaPXJKtkM2QZruYc 1wDULUh4FQY/8yLjwZawemjSgomDEIs6Oz3PmyyDAIb4sZkT2iMvfJpiFwdNCSIE/ w/g1UfXFPk3pBXLthw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([94.134.95.219]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MjS9C-1uvOma0nvO-00Zp3v; Fri, 02 May 2025 14:44:06 +0200 From: Stephen Berman To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: References: <87y0w7ejxy.fsf@gmx.net> <86a58ihrfg.fsf@gnu.org> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> Date: Fri, 02 May 2025 14:44:04 +0200 Message-ID: <87o6wbp4h7.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags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5IMM8ryIn/uXCah6j9d 94SD5C4McGuMb6zDVoj+vW+kjIal2wYDMLl6w9OJFRUVhvce6XWxZYKJ2mtn5aUffETD087yr fc0dmyazs9O0LsxXko4NnY1k8sZQ4vYQQ+TsinrSLt37cuOaiJHsA0kq3Xx/khwQnasF6v+hd uTkXmFwp1weLEtt8Az+rB3/2BhWDpNubcItvArmZ3WfvQm89Hqw+vigRrRVcZXqbQ== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , 77718-done@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Fri, 2 May 2025 08:26:44 -0400 Spencer Baugh wro= te: > On Fri, May 2, 2025, 4:30=E2=80=AFAM Stephen Berman wrote: >> What about the other regression I mentioned? Have you looked at that >> and tried the fix for it I included? If there are no objections to that >> patch, I'd like to install it on master. Or if there are problems with >> it, I'd welcome a better fix. >> > > That fix is not right and would cause other issues. When you have the opportunity, please say what those issues are; I have been using my patch since the first version of your changes that introduced this regression and don't recall any issues with it with my setup, but admittedly I haven't extensive testing with -Q or other configurations. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Fri May 02 12:05:13 2025 Received: (at 77718) by debbugs.gnu.org; 2 May 2025 16:05:13 +0000 Received: from localhost ([127.0.0.1]:60777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uAssy-0003sE-8S for submit@debbugs.gnu.org; Fri, 02 May 2025 12:05:12 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:54721) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uAssq-0003ms-Ll; Fri, 02 May 2025 12:05:05 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E71E68089D; Fri, 2 May 2025 12:04:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1746201898; bh=X8cmfO0mipnHpAeqx8ZG1NBirHQgcb4xltgzG1W21dA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Mv3RiI/LIS336I935oYXU0wemMLtAEiq87gCN0sOFN21v0VnuLIdVMcMrTdv4Bhfb mtT3fWK1aqguheRvwHrgMDgRabUkHh4Kca6bnGiqCjpZ3JQ/vqpsJjIjhBgdVWMHaN lJ0/IULAJbibU9Cg+TGpHcubWYBpvQViQ5/CIOmkk6sTPgYtagN4R2znYUOaHhDJce gkNKVv9LdH6bdc2Mjd6SGxHJfr/1MWCayu5lraRrLECXARPkWm233LlFnqC8s9IvPV m4t9vn2dHln2FmzJbvYmUrMBNLia32+fJrLOQFxW8vKr9EuLO1abRTvdo6ZGW+/v3O CceJVD49n5THw== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 07E1E806F8; Fri, 2 May 2025 12:04:58 -0400 (EDT) Received: from alfajor (unknown [23.233.149.155]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C5EA512023C; Fri, 2 May 2025 12:04:57 -0400 (EDT) From: Stefan Monnier To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: Message-ID: References: <87y0w7ejxy.fsf@gmx.net> <86a58ihrfg.fsf@gnu.org> <87v7qnp8ww.fsf@gmx.net> Date: Fri, 02 May 2025 12:04:57 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.164 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stephen Berman , 77718-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el > index 7b2b986aa1d..e35db9dad64 100644 > --- a/lisp/minibuffer.el > +++ b/lisp/minibuffer.el > @@ -3597,8 +3597,18 @@ completion--file-name-table > (if (eq (car-safe action) 'boundaries) > (cons 'boundaries (completion--sifn-boundaries orig table pred (cdr action))) > (let* ((sifned (substitute-in-file-name orig)) > + (orig-start (car (completion--sifn-boundaries orig table pred ""))) > + (sifned-start (car (completion-boundaries sifned table pred ""))) > + (orig-in-bounds (substring orig orig-start)) > + (sifned-in-bounds (substring sifned sifned-start)) > + (did-expansion-in-bounds (not (string-equal orig-in-bounds sifned-in-bounds))) Doesn't this set `did-expansion-in-bounds` to non-nil if there was a $$ in `orig`? > (result > - (let ((completion-regexp-list > + (let ((completion-ignore-case > + ;; If we expanded an environment variable in the completion > + ;; bounds, don't ignore-case, otherwise `read-file-name' > + ;; can return the wrong filename. > + (and (not did-expansion-in-bounds) completion-ignore-case)) AFAICT we're not "doing The Right Thing" here but falling back to a suboptimal behavior that favors not returning bogus completions at the cost of missing some completions. And we do this because doing TRT is a lot more complicated. I'm not opposed to this trade-off, but the comment should make it more clear. And it should come with a good example of the wrong thing we're trying to avoid. > + ;; For each completion, quote dollar signs in newly added text. If sifn > + ;; changed text within the completion boundaries, replace that with text > + ;; from ORIG; otherwise, use text from the completion (it may differ if > + ;; `completion-ignore-case' is non-nil) Here also, clarify that we choose between those two because just don't want to write the code that correctly merges the capitalization changes back into the non-env-var part of the original string. An example is probably the easier way to illustrate the difficulty. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue May 06 11:39:09 2025 Received: (at 77718) by debbugs.gnu.org; 6 May 2025 15:39:09 +0000 Received: from localhost ([127.0.0.1]:59817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uCKNw-0007YW-RP for submit@debbugs.gnu.org; Tue, 06 May 2025 11:39:09 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:47233) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uCKNu-0007Xd-C2 for 77718@debbugs.gnu.org; Tue, 06 May 2025 11:39:07 -0400 From: Spencer Baugh To: Stefan Monnier Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: (Stefan Monnier's message of "Fri, 02 May 2025 12:04:57 -0400") References: <87y0w7ejxy.fsf@gmx.net> <86a58ihrfg.fsf@gnu.org> <87v7qnp8ww.fsf@gmx.net> Date: Tue, 06 May 2025 11:39:00 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1746545940; bh=QeHRzLXjQDOZfKSeXBahYN8idE+7yZ5npeP805cpxjU=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=UH50K+vDl/1jqvNLp471lqj0JKgGeH80dAR1ADAxgpuae3X+UBjZgiCqvh91Ay31u RN0bjpWMY+0P/eSqnvnInCMemxnHQQRUsZ612Sys7k3G4mZywQ3RQf13OxfD/7es8O HQYZYB1hcQ9hM9zPbDNd+TQrTHMbi+cX1dzhxMTsRrBUvlqC5H8NUW+sXcQB15FEpE znNsmHrsK/ZTQZIyhoCPEBnUYxBS1WLTMA7Faa+v1nUlws826EWqWvytQfEUgwgwYp jMuQK03jvRUGJBNxKCRt2ZfD6MnASP1uT+ub2tYF1bqQr8aT/xVk6JDHXEDh69evHP ap8yn6ZhdGLaw== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stephen Berman , 77718-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: >> diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el >> index 7b2b986aa1d..e35db9dad64 100644 >> --- a/lisp/minibuffer.el >> +++ b/lisp/minibuffer.el >> @@ -3597,8 +3597,18 @@ completion--file-name-table >> (if (eq (car-safe action) 'boundaries) >> (cons 'boundaries (completion--sifn-boundaries orig table pred (cdr action))) >> (let* ((sifned (substitute-in-file-name orig)) >> + (orig-start (car (completion--sifn-boundaries orig table pred ""))) >> + (sifned-start (car (completion-boundaries sifned table pred ""))) >> + (orig-in-bounds (substring orig orig-start)) >> + (sifned-in-bounds (substring sifned sifned-start)) >> + (did-expansion-in-bounds (not (string-equal orig-in-bounds sifned-in-bounds))) > > Doesn't this set `did-expansion-in-bounds` to non-nil if there was a $$ > in `orig`? Good point, I didn't think about that. That's probably not acceptable... fixed in the latest version at the end. >> (result >> - (let ((completion-regexp-list >> + (let ((completion-ignore-case >> + ;; If we expanded an environment variable in the completion >> + ;; bounds, don't ignore-case, otherwise `read-file-name' >> + ;; can return the wrong filename. >> + (and (not did-expansion-in-bounds) completion-ignore-case)) > > AFAICT we're not "doing The Right Thing" here but falling back to > a suboptimal behavior that favors not returning bogus completions at the > cost of missing some completions. And we do this because doing TRT is > a lot more complicated. > > I'm not opposed to this trade-off, but the comment should make it more > clear. And it should come with a good example of the wrong thing we're > trying to avoid. Yes, that's true. I'll try to include a nice example in later versions. >> + ;; For each completion, quote dollar signs in newly added text. If sifn >> + ;; changed text within the completion boundaries, replace that with text >> + ;; from ORIG; otherwise, use text from the completion (it may differ if >> + ;; `completion-ignore-case' is non-nil) > > Here also, clarify that we choose between those two because just don't > want to write the code that correctly merges the capitalization changes > back into the non-env-var part of the original string. An example is > probably the easier way to illustrate the difficulty. That's fair. Though to be clear, at this point the issue isn't really the capitalization changes. I have what I think is a pretty much correct approach for that, where we just give up on preserving the environment variables if the capitalization changes can't be merged into the original string. That approach works great if the text inside the completion boundaries in ORIG (the original string) "matches up" with the text inside the completion boundaries in SIFNED (the string after s-i-f-n). But, when the last component of ORIG contains an environment variable which contains a slash, then the completion boundaries on ORIG and SIFNED don't "match up". The completions returned from the underlying table will be for the boundaries on SIFNED, and need to be adjusted for the boundaries on ORIG (by adding additional text in front), since those are the boundaries our table returns. e.g., supposing SLASH_B=/b orig: /foo/bar${SLASH_B}az orig split on the completion boundaries we returned: /foo/ bar${SLASH_B}az sifned: /foo/bar/baz sifned split on the underlying table's completion boundaries: /foo/bar/ baz underlying table returns completions like: baz1 baz2 we need to return completions like: bar${SLASH_B}az1 bar${SLASH_B}az2 This is easy if we ignore case completely, and that's what we do in the version currently in the master branch: Simply replace "baz" (the text in the underlying table's completion boundaries) with "bar${SLASH_B}az" (the text in our completion in each completion, and we're good. But if we want to preserve case, then even if we don't care about preserving environment variables at all, this becomes difficult. e.g. if the underlying table returns completions like: baz1 Baz2 Suppose we're okay with returning completions like: bar/baz1 bar/Baz2 It's still unclear how to compute that "bar/" is the text which we should prefer in front of each completion. It's hard to even figure out that this ${SLASH_B} scenario is happening; I haven't yet thought of a robust way to figure out that there's a / inside the completion boundaries in ORIG. So instead I'm trying to side-step this problem by identifying the simple common scenario where the text inside the completion boundaries doesn't contain any environment variables, and then behaving right in that scenario, and just blindly preserving environment variables heedless of case when not in that scenario. Here's an attempt at that, do you think it might be fine? diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 7b2b986aa1d..6f9e6c67541 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3597,6 +3597,16 @@ completion--file-name-table (if (eq (car-safe action) 'boundaries) (cons 'boundaries (completion--sifn-boundaries orig table pred (cdr action))) (let* ((sifned (substitute-in-file-name orig)) + (orig-start (car (completion--sifn-boundaries orig table pred ""))) + (sifned-start (car (completion-boundaries sifned table pred ""))) + (orig-in-bounds (substring orig orig-start)) + (sifned-in-bounds (substring sifned sifned-start)) + (only-need-double-dollars + ;; If true, sifn only un-doubled $s in ORIG, so we can fix a + ;; completion to match ORIG by just doubling $s again. This + ;; preserves more text from the completion, behaving better with + ;; non-nil `completion-ignore-case'. + (string-equal orig-in-bounds (minibuffer--double-dollars sifned-in-bounds))) (result (let ((completion-regexp-list ;; Regexps are matched against the real file names after @@ -3611,21 +3621,21 @@ completion--file-name-table (if (stringp result) ;; Extract the newly added text, quote any dollar signs, and ;; append it to ORIG. - (let ((new-text (substring result (length sifned)))) - (concat orig (minibuffer--double-dollars new-text))) + (if only-need-double-dollars + (concat (substring orig nil orig-start) + (minibuffer--double-dollars (substring result sifned-start))) + (let ((new-text (substring result (length sifned)))) + (concat orig (minibuffer--double-dollars new-text)))) result)) ((eq action t) ; all-completions (mapcar - (let ((orig-prefix - (substring orig (car (completion--sifn-boundaries orig table pred "")))) - (sifned-prefix-length - (- (length sifned) - (car (completion-boundaries sifned table pred ""))))) + (if only-need-double-dollars + #'minibuffer--double-dollars ;; Extract the newly added text, quote any dollar signs, and append ;; it to the part of ORIG inside the completion boundaries. (lambda (compl) - (let ((new-text (substring compl sifned-prefix-length))) - (concat orig-prefix (minibuffer--double-dollars new-text))))) + (let ((new-text (substring compl (length sifned-in-bounds)))) + (concat orig-in-bounds (minibuffer--double-dollars new-text))))) result)) (t result)))))) From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 02 06:38:38 2025 Received: (at 77718) by debbugs.gnu.org; 2 Jun 2025 10:38:38 +0000 Received: from localhost ([127.0.0.1]:48982 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uM2Yw-0001BN-8G for submit@debbugs.gnu.org; Mon, 02 Jun 2025 06:38:38 -0400 Received: from mout.gmx.net ([212.227.17.21]:47309) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uM2Yu-0001B9-KC for 77718@debbugs.gnu.org; Mon, 02 Jun 2025 06:38:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1748860689; x=1749465489; i=stephen.berman@gmx.net; bh=1XjFd/4ej38YvSvJKI6RizbxEXki87YQD7c3Sj8YpCg=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=KKzUpYQ/jWsGMsqSYrfrFfntN73IITLG5/2knypJer9xxm3Cxpf8cphRelfZnGRr p6P02QJABzBnVewBzTMeYsMfNyzVl+5i+zRnzXyv3Nsq0hamHabG2FWFcrqHan1tf zINX7cNQnG03uoIy+IEHXlMAgldvBXTxlh2aSZOSx8z+ZlS6C7VqQ8lgyXZa+yDCB +JXsWk30utZOI9RkkOiOp/iDbANAYAgWl2qFJPLxdeMReyrfV4j6ktqDXdv7Vx+ZZ QQJtEHm+Pm0JxclmCBj4JoR95LZ/5DjlAkyLA5fsf42zLrSz0KmhUYso6vVgBBWGG n8XP7j9qLNRj/SBYcw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([94.134.95.182]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M8QS8-1uHchd1Xpw-002X3P; Mon, 02 Jun 2025 12:38:09 +0200 From: Stephen Berman To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: <87o6wbp4h7.fsf@gmx.net> References: <87y0w7ejxy.fsf@gmx.net> <86a58ihrfg.fsf@gnu.org> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> <87o6wbp4h7.fsf@gmx.net> Date: Mon, 02 Jun 2025 12:38:06 +0200 Message-ID: <87cybm2zu9.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:IrtU0s8pMHekMuxe+XlqqpEgcXvF+m+Kf9cAZvSaaVJH76Tpgjv ZQgeTwjdM6TAMsDEf6SfjQGnmBTOEMQ7gcDKU3LrqvXRLKLt5F3NvnfkcxgbrNiDaHlXJFe 8TEEQQLN/2+GjBlpEbUcub/sLyxfjvT+UBiuqFp/gcKN5Y7Sb71YmBEwLl9dnZPwFhp/rvf 6ialoAQyMTV+KtvHNoeYg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:pysWxhx3/Gg=;DJIrQkwKIpCbjy6e/jpGl3hoXw3 bFnvIIuFfiGEiVdZ8VO8/4sge3jPRmVW5SbOY8Q6vU0iBAMlAC5Mjr7k0dkMDem1uM63qNdHA CYCtpMc5cekUEBEl+qc+6ATmyTvB91mj4xF0+14BvcmfNviEiAUjNDNGn8o5eBk2+LPgEAYOw 8f8adjfCaBzuVUu4pij+h6VNQEqgg/aw8EeIUmzQwZcuJCgXX9zBM/JySyfQZKQUaBv916Tz9 x9pi1RVWMkFk/qdCsgR2w2oKa2DoBBkrd93+aoyQVRzBilwHvUP8zbJOI77/2WWyPWoF0Dns7 iRvG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yJFNRmmvvbrLGsi7JoUWJXkmkbfvTzTkcYR00y2BNveF/pAHJQncmusVxs Vh2keJnuFX1IFauEYGaK3fnoQMayEzvleBqX2H8Q4xIGWHtg5a8ZsDmxjNQhJiWnBXl8u4fwR WSOU05Wv3i9asdjjvSjUVMVy9pQQJZ22PGJA7v9AV7Q1JtSHHOXyb9kGRq4NPCUwwGX6jSTUR TE1+Xld+a3gjCX6zpMLUaEoq6CYE0JKi2Z1bkuELzBL2YFonC1NQxhHE73dv6FEwz9TplwTFG lqkp2tK5aujmtfK3V1VqRWZdEcKXtybFOkFk0QThZA55qFjs/DE8D9Mp/ffVCTJtXcpWsmDqf 6CzQwFOhDmHy1aoei1kAjc/zNSonhe01U9T2m1p2w+ApJz8HEi64DCMfCzwObByLQfslkc+KP lUv6o2rtdqLQVI5CDVr058+n8rZcS7/YSQu/m4EgzbKlWTXSOV96E2JG8BQ/wnoZE1/oMQlee NUdWO7x0pVlmJW1CzYEAsC4U0kWX/J6f0LEq6zngyu1jA9kiTse/nSYSqSH56hm5YWaSedXAd zWxlMYS1mWsf5oSDI1QQ7b3UX/hobKfe/Lrvw0jg3+C6vbNWfGUXLaVRYlik3pHplLXOFSKdH TXOk/4JKbfO9IZl2Z1oT0pFGOwBfY0KgynSiMAS58ZAk3nhvQoarrVLzzNE67Pr0hColrJmwF Wzk6mSb/sZa3B3E6an8eyXgUCuXK2Uwnwk0lK7AWJ97A0xlHCMrHb8CmL58zVoFQM+J1q3qo0 Pu48TWSJ3sqZyANsxEgFSZJpuj6iGUzobHSe4pUL9DipuvzkLCmxdFaOp4rs1JmTPOKYo5W5Q dfUNte+1/+1XiH33 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Fri, 02 May 2025 14:44:04 +0200 Stephen Berman = wrote: > On Fri, 2 May 2025 08:26:44 -0400 Spencer Baugh w= rote: > >> On Fri, May 2, 2025, 4:30=E2=80=AFAM Stephen Berman wrote: > >>> What about the other regression I mentioned? Have you looked at that >>> and tried the fix for it I included? If there are no objections to that >>> patch, I'd like to install it on master. Or if there are problems with >>> it, I'd welcome a better fix. >>> >> >> That fix is not right and would cause other issues. > > When you have the opportunity, please say what those issues are; I have > been using my patch since the first version of your changes that > introduced this regression and don't recall any issues with it with my > setup, but admittedly I haven't extensive testing with -Q or other > configurations. Do you have a rough ETA for fixing this regression? And again, can you please explain what's wrong with my fix? Thanks. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 17 03:50:39 2025 Received: (at 77718) by debbugs.gnu.org; 17 Jun 2025 07:50:39 +0000 Received: from localhost ([127.0.0.1]:52838 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uRR5b-0000iJ-5p for submit@debbugs.gnu.org; Tue, 17 Jun 2025 03:50:39 -0400 Received: from mout.gmx.net ([212.227.17.20]:53955) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uRR5W-0000hQ-CV for 77718@debbugs.gnu.org; Tue, 17 Jun 2025 03:50:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1750146617; x=1750751417; i=stephen.berman@gmx.net; bh=wnSbYjR4bvpG7pwP52u1eYaYGOtp4+zVlqV1VGFg36k=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=T1VhQRUbUTd70FhHaX+1GVsK3v0ZlJz5Hoq93fUYXifV7EtIzuOA4Cx2b2wMt065 hnUOBTyiFuFDSNnwVfqPLK9NTTtKEpBPALUKWXUffev/UoUnYzj+oHqRf8Tr0kxE9 egkkKAGgnf67jJ3OgdIUBXRSM8gx1WvQCLWSpxFlp5TxVkhPNs9Xy91h08PeP5RYq USX2TlZpFfcHtNR47QGoZ+zBsqPXQzptFkbGIlj0b2LZvvYw5anGNHANit9wAIEGY VvbZ6cH0SJQKJfyeosjmT9EiYlyfvRqEUWcMGhmmYAT8prClSWHgAcHNOIRNlY7Tw CdpfZA7nyxBuNQIdlg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([94.134.94.38]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N6KYb-1upZlA0xKr-00ys0r; Tue, 17 Jun 2025 09:50:17 +0200 From: Stephen Berman To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: <87cybm2zu9.fsf@gmx.net> References: <87y0w7ejxy.fsf@gmx.net> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> <87o6wbp4h7.fsf@gmx.net> <87cybm2zu9.fsf@gmx.net> Date: Tue, 17 Jun 2025 09:50:15 +0200 Message-ID: <87ecviolhk.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:aGZytq2JBjMIkebLZvM1saFg/J2YbNgDSOlyXqsoMJuLP6RvB0b tVzW34kwcXwvPG+/RguOI4rifyjSoaGvzAJKVHvZmhVVbWHxI3wgZP6kScZzJX7r8q7+v4d EZ70nvOEpf7CbxumgRQI07tbKA3byGas12rAo6z8CKlToluHaRpTvtOtCMcDSSatj1p40L+ Eritttjus4y1hVzav/GfQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:/pMo1HWDNSk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CvLP8k82p2yEYsB7nEG0S1jJrrCVWZIUmpbhOfx CtGKKqiQrjaOw6gLdvar07C+bpRbKw6bgUfTBgxhCoulbKHGfx5msftu3O+v6WQE+FGI= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Mon, 02 Jun 2025 12:38:06 +0200 Stephen Berman = wrote: > On Fri, 02 May 2025 14:44:04 +0200 Stephen Berman wrote: > >> On Fri, 2 May 2025 08:26:44 -0400 Spencer Baugh = wrote: >> >>> On Fri, May 2, 2025, 4:30=E2=80=AFAM Stephen Berman wrote: >> >>>> What about the other regression I mentioned? Have you looked at that >>>> and tried the fix for it I included? If there are no objections to th= at >>>> patch, I'd like to install it on master. Or if there are problems with >>>> it, I'd welcome a better fix. >>>> >>> >>> That fix is not right and would cause other issues. >> >> When you have the opportunity, please say what those issues are; I have >> been using my patch since the first version of your changes that >> introduced this regression and don't recall any issues with it with my >> setup, but admittedly I haven't extensive testing with -Q or other >> configurations. > > Do you have a rough ETA for fixing this regression? And again, can you > please explain what's wrong with my fix? Progress on this issue seems to be stalled. I have no reason to doubt my fix may be problematic for use cases I haven't encountered, but I don't know what these are, so I cannot reasonably investigate further. If my patch is installed, those who encounter any problems due to it can report them, which hopefully will facilitate finding a better fix. Therefore, I request permission to install my patch. If it causes serious problems for which there is no quick fix, it can be reverted. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 17 11:00:09 2025 Received: (at 77718) by debbugs.gnu.org; 17 Jun 2025 15:00:10 +0000 Received: from localhost ([127.0.0.1]:60037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uRXnB-000456-T5 for submit@debbugs.gnu.org; Tue, 17 Jun 2025 11:00:09 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:40379) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uRXn8-00042k-6m for 77718@debbugs.gnu.org; Tue, 17 Jun 2025 11:00:03 -0400 From: Spencer Baugh To: Stephen Berman Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: <87ecviolhk.fsf@gmx.net> (Stephen Berman's message of "Tue, 17 Jun 2025 09:50:15 +0200") References: <87y0w7ejxy.fsf@gmx.net> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> <87o6wbp4h7.fsf@gmx.net> <87cybm2zu9.fsf@gmx.net> <87ecviolhk.fsf@gmx.net> Date: Tue, 17 Jun 2025 10:59:56 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1750172396; bh=wkFWWblm4Ju116K14H2hCsYvnd5PaoKR7UsqV641Kr8=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=PQoqWQPw3xPHi8zz+WVExaVF0wi0F+zmArTne65ryJnQvBz47OcnvXcbogg/XN/uW QpQnNuofkKelVcPd392hVfYQp2TGYjK1A0gP3j71uKyh2glvA6g3tsLedGoEnpwGZ9 Fe+hbMR1bnBOwthaRaGF8Jabtw7RoEIDeAgnovW6EhaON/G38DWthGU5jq0/ONE7XE KaDlXD+zxynF3mOqPlW2GqPZ8UwbSi8t6ZMf3kWMF+Yjn6r5TgUfXcWl8ScO3XddaA 9QzYdq83+/BzVQYpOcETwjmZu4PhY7Dx7HxH+/L2RuO1tLL/FPQ/rOu59XhetqB783 OUfjvTt5ibkgA== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stephen Berman writes: > On Mon, 02 Jun 2025 12:38:06 +0200 Stephen Berman wrote: > >> On Fri, 02 May 2025 14:44:04 +0200 Stephen Berman wrote: >> >>> On Fri, 2 May 2025 08:26:44 -0400 Spencer Baugh = wrote: >>> >>>> On Fri, May 2, 2025, 4:30=E2=80=AFAM Stephen Berman wrote: >>> >>>>> What about the other regression I mentioned? Have you looked at that >>>>> and tried the fix for it I included? If there are no objections to t= hat >>>>> patch, I'd like to install it on master. Or if there are problems wi= th >>>>> it, I'd welcome a better fix. >>>>> >>>> >>>> That fix is not right and would cause other issues. >>> >>> When you have the opportunity, please say what those issues are; I have >>> been using my patch since the first version of your changes that >>> introduced this regression and don't recall any issues with it with my >>> setup, but admittedly I haven't extensive testing with -Q or other >>> configurations. >> >> Do you have a rough ETA for fixing this regression? And again, can you >> please explain what's wrong with my fix? > > Progress on this issue seems to be stalled. I have no reason to doubt > my fix may be problematic for use cases I haven't encountered, but I > don't know what these are, so I cannot reasonably investigate further. > If my patch is installed, those who encounter any problems due to it can > report them, which hopefully will facilitate finding a better fix. > Therefore, I request permission to install my patch. If it causes > serious problems for which there is no quick fix, it can be reverted. There is no other regression. rfn-eshadow works correctly, graying out the section of the minibuffer text which will be removed by substitute-in-file-name when read-file-name returns, even if point is in that section of the text. This has always been the case. Likewise, the pcm-based completion styles sometimes move point into that text on try-completion. This has also always been the case. So there is no other regression. From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 17 11:43:13 2025 Received: (at 77718) by debbugs.gnu.org; 17 Jun 2025 15:43:14 +0000 Received: from localhost ([127.0.0.1]:60737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uRYSv-0000BZ-EK for submit@debbugs.gnu.org; Tue, 17 Jun 2025 11:43:13 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:60425) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uRYSs-0000An-EV for 77718@debbugs.gnu.org; Tue, 17 Jun 2025 11:43:11 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B0CCE10013E; Tue, 17 Jun 2025 11:43:04 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1750174984; bh=eBnymM5tVkoK7w0JU2/jR5QuUm8y9V4vr7UBnnjR2Io=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ehGtwbvx8DT9xEjP5G681IAeaX8+JT8VYehkgztPRi9x8+PftJGvt1zfvVJ4yY+A9 eGUVW4F8gWioAhbI3I94lfQHuE2YSdwpTwgPSKC/SuGie0nVwHslci4D3XAcsib8bM 9H2gNVe5pJ21fE1I52L4GurGwLqDIfOtWwop0zHVm64d7zPxhzv5jltXIBI6R413AX 5p4txlBlN02hm+IT4bKh0KLms5G7Ki7L51xWtaMag/N6ziOf0yxpZtmPqjheSW4p50 2tXBwDyjUmOFPrqHY0FFMj4YGEAY4TKsz98VCDE3j4tGC6KS0dqeAwP2cO7VZy7TUw Ds1hdoNF/Z+vQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 00A7010002E; Tue, 17 Jun 2025 11:43:04 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E20391200CC; Tue, 17 Jun 2025 11:43:03 -0400 (EDT) From: Stefan Monnier To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: Message-ID: References: <87y0w7ejxy.fsf@gmx.net> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> <87o6wbp4h7.fsf@gmx.net> <87cybm2zu9.fsf@gmx.net> <87ecviolhk.fsf@gmx.net> Date: Tue, 17 Jun 2025 11:43:03 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.084 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stephen Berman X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > There is no other regression. rfn-eshadow works correctly, graying out > the section of the minibuffer text which will be removed by > substitute-in-file-name when read-file-name returns, even if point is in > that section of the text. This has always been the case. Likewise, the > pcm-based completion styles sometimes move point into that text on > try-completion. This has also always been the case. So there is no > other regression. So, can we close this? Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 17 11:49:22 2025 Received: (at 77718) by debbugs.gnu.org; 17 Jun 2025 15:49:22 +0000 Received: from localhost ([127.0.0.1]:60833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uRYYr-0000mU-OY for submit@debbugs.gnu.org; Tue, 17 Jun 2025 11:49:22 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:58351) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uRYYn-0000lc-L8 for 77718@debbugs.gnu.org; Tue, 17 Jun 2025 11:49:19 -0400 From: Spencer Baugh To: Stefan Monnier Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: (Stefan Monnier's message of "Tue, 17 Jun 2025 11:43:03 -0400") References: <87y0w7ejxy.fsf@gmx.net> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> <87o6wbp4h7.fsf@gmx.net> <87cybm2zu9.fsf@gmx.net> <87ecviolhk.fsf@gmx.net> Date: Tue, 17 Jun 2025 11:49:12 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1750175352; bh=y7nMxaF2kAQ/khsQFOCGRJFJReBRZyAW0cYVDLGFF5k=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=UuQt1+vsJVu7GBn3fSv4qhlXp9r1nXDQGYqVl9qS9uUqPOwnL1inyhB8ITY2Tetku 5GHOnJ6d59TFr4tLCHiCgDVqqPepjvmfE1RmHxbns1FmIib6YPxJ5ngpp1bhoFn9ib Dn+6MmQdP3SBk6CWkqKzYEyLqOFg4siFkncjCwxESG2J8iCdv5ehX2OMghm3f4k7Xo hNv0S72MIsJ+0Vz2rCVXf08osNEBx0RSz+LLOnM8dByXt+X+eH1/aD3MYDwqGNV/X/ jeESoXWEU04iRN6Vwnl37ZuADpc2HehPujP6cpyStFCOF28hHp0yXOmG7CtE3MxO5+ QGya9lLdj6K0A== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stephen Berman X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: >> There is no other regression. rfn-eshadow works correctly, graying out >> the section of the minibuffer text which will be removed by >> substitute-in-file-name when read-file-name returns, even if point is in >> that section of the text. This has always been the case. Likewise, the >> pcm-based completion styles sometimes move point into that text on >> try-completion. This has also always been the case. So there is no >> other regression. > > So, can we close this? I believe it is already closed :) From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 17 11:52:37 2025 Received: (at 77718) by debbugs.gnu.org; 17 Jun 2025 15:52:37 +0000 Received: from localhost ([127.0.0.1]:60874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uRYc0-0001Di-HS for submit@debbugs.gnu.org; Tue, 17 Jun 2025 11:52:37 -0400 Received: from mout.gmx.net ([212.227.15.18]:35643) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uRYbx-0001D2-VX for 77718@debbugs.gnu.org; Tue, 17 Jun 2025 11:52:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1750175540; x=1750780340; i=stephen.berman@gmx.net; bh=sg8HwSlRB201bTDPhskJQ7r6iIziVPtN7ZXwcwAKOW4=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=Ls/DTLnj9bzRzjSnVAqmTj4t32yKYAIv+D+ButdXQQq/GxT4Wd+y2oY2glmgG/A7 jqOlXow8d2R9lYEbF5JmAsfYKepQqE6peRhq270JXxo59PJbQ0cYozZPP1liufSh9 R7fCEBYOSMxj8tJa6XrPcKED9IlBgjfofJ2cQD/KyAUiEUpy7qMcjR/Py1DEXOIDE e8SQJ2N+gMZBPVlgKFuOs7WP44W12RzJXtLMD6kRWIC+8O6ecG3vJtooK/kJ8dUZX nh/PlpY7rrhRym2lo3PeKTwawfvM1Qnd8oII2vdSVQ4HjD993HfrdX4+Rzer1v7ck qJLSheu10fDhFjRKXA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([94.134.94.38]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MxDkw-1ugtfH2mbo-00wDMF; Tue, 17 Jun 2025 17:52:19 +0200 From: Stephen Berman To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: References: <87y0w7ejxy.fsf@gmx.net> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> <87o6wbp4h7.fsf@gmx.net> <87cybm2zu9.fsf@gmx.net> <87ecviolhk.fsf@gmx.net> Date: Tue, 17 Jun 2025 17:52:16 +0200 Message-ID: <87zfe6mklr.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:PbJoxg2Hsr9xYwocX3AkiLYMRuB+Ips6NNx2XXko1G1a8XJP3qP ug7CA9x1RkYlkWbmgKIPjvIkGQ9F3meiVleLrrZhRo+46iP8JzzXfhIsOnZZA67sL52wbr4 MiY3rUOcWX6w68xWT7EJr6rGUdwLZ901mcuzo31CW2Wn1UIRfwbZ/E7D+Bh3A3iXmkVL7mt vTnz2F+8iKs2TSlaIrwEA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:gCndo1RqW/s=;XhPJVL2mE7UBBM6CRrvR6wzYH8C 0f8JGPthbsWJnmyBVbXS7lgdskjIk599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j2GNNq4/zVFq5QeCYMXDfoI2wWfE5n4mcTsB7C2KllMt pmDVBhjh/Q0BFir2EeHTXSXd8r1crYJyD6LeRLP/9jnHGzZ/0rUE2feTYFDfqfcjMwWDy6aJR fdnht3+ln/lHYXq2jHwofja42Gy1yJNtjPkcbCkq7p2P4l3VHS/Roq5rEi1Mt/RrjBY9SQT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Tue, 17 Jun 2025 10:59:56 -0400 Spencer Baugh wr= ote: > Stephen Berman writes: >> On Mon, 02 Jun 2025 12:38:06 +0200 Stephen Berman wrote: >> >>> On Fri, 02 May 2025 14:44:04 +0200 Stephen Berman wrote: >>> >>>> On Fri, 2 May 2025 08:26:44 -0400 Spencer Baugh wrote: >>>> >>>>> On Fri, May 2, 2025, 4:30=E2=80=AFAM Stephen Berman wrote: >>>> >>>>>> What about the other regression I mentioned? Have you looked at that >>>>>> and tried the fix for it I included? If there are no objections to = that >>>>>> patch, I'd like to install it on master. Or if there are problems w= ith >>>>>> it, I'd welcome a better fix. >>>>>> >>>>> >>>>> That fix is not right and would cause other issues. >>>> >>>> When you have the opportunity, please say what those issues are; I have >>>> been using my patch since the first version of your changes that >>>> introduced this regression and don't recall any issues with it with my >>>> setup, but admittedly I haven't extensive testing with -Q or other >>>> configurations. >>> >>> Do you have a rough ETA for fixing this regression? And again, can you >>> please explain what's wrong with my fix? >> >> Progress on this issue seems to be stalled. I have no reason to doubt >> my fix may be problematic for use cases I haven't encountered, but I >> don't know what these are, so I cannot reasonably investigate further. >> If my patch is installed, those who encounter any problems due to it can >> report them, which hopefully will facilitate finding a better fix. >> Therefore, I request permission to install my patch. If it causes >> serious problems for which there is no quick fix, it can be reverted. > > There is no other regression. rfn-eshadow works correctly, graying out > the section of the minibuffer text which will be removed by > substitute-in-file-name when read-file-name returns, even if point is in > that section of the text. This has always been the case. Likewise, the > pcm-based completion styles sometimes move point into that text on > try-completion. This has also always been the case. So there is no > other regression. I'm not sure what you mean by "no other regression", but what I reported upstream still holds in current master. That is, start Emacs like this: emacs -Q --eval "(custom-set-variables '(completion-category-overrides '((f= ile (styles substring)))))" After typing `C-x d / TAB', I see this on master: --=-=-= Content-Type: image/png Content-Disposition: attachment; filename=master-1.png Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAOAAAAAlCAIAAADUanKxAAAAA3NCSVQICAjb4U/gAAAOcUlEQVR4 nO2cfVBTV/rHn5CE8B4IEkQKKIJgcUSrK76NaJy6i4BF3e3qogtbtdbFXae+zLq+FQdRHEQ7ZZaZ ioq7WK1Mi3bVWnwbxRBlLcjILyAvSkNCiHkjIbmXhNzk7B/XjSFAuLwJ/iafv8j3nPOcb26ee+65 954DDcf0egwXCoXgxMn4wwUACIIYaxtOnPSNi+Nik8lUXFysVCrJj83NzaWlpaPvauhcvXq1srLy LXeKYZhMJuvq6qJS+bPPPtu0aVN/pWPifwiUlJTcunXLVlmzZs1HH32UkJCAYRgVnSIDJKjRaDx3 7pxcLic/NjQ0XLp0aQjdjDYIoR9++MFoNAqFQrFYrFar7Q7fqFJaWrp+/foHDx5QqSyXy1+9emUn jq3/wSISic6ePXvq1Knu7m6rWFpaeubMGYPBgBCyrdyfThHGcM2OD3Acr6mpuXDhgru7u0QiKS4u TkhIsJZiGPbLL78AQHBwsK+vr21DpVIpFos5HE5YWBipmM1mtVrNYrE8PDyeP3/u4eERHh5OFsnl cplMRqPRpkyZ4uXlBQDd3d1arRbHcQDQ6XQKhYLJZNp20Tu+tZf6+noul8vlcgf0P96oqKhYsGBB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MxKIgBAK9eEeTcSyYjfHwGHtFDQ11NJqRUEhMmMIYTh7pPAAgJ Yb582ffWKxcXsLuqBAQwGAyaTEaEh7MAQCYzBQX1WO3QO9WYTFpaGufcOZXFAn/8I4fB6DEMSKUm Ly8XDmeI+3OmT59O/uHv70/uJrCFz+fPmjXLupVqQP348ePp6enkZtS3wMA/JIZZGhuNWVnt33+v +dvfAofQh68vfeVK9v790u5uBAB6veXmzU4ACAxkfvCBB/mQr6Wl++ZNLZVo4eGs4GDmf/7z5rns 0OJQ9wkAGzZwSko0lZUYACAEDx7ora2Cg5lyOfHixZv0pdNpK1b4FBQoEIKuLsvZsyq7EbFPNm+e cOWK5upVjd31HQAqK7FFi7x6X7tiYurWrWuxVweDVqsVCoULFy6kqIvF4pKSkl27dg2n00Ex8Ek5 d+5zb2/6nDkeN29GLFr0etrxq189F4tNOp0ZIbh+vZPNdmlosD81bSksDP3Tn0Rc7jMulyGVmlJT OQkJPgBw+nRocvKLCxfULi6wdCnVV/8bNnCuXNGuXPnmOWh/cUbK57Jl3idOBK9Y0ezvT+/oMP/h D5z4+NeHIirKLSMjIC6ugSDQX/4SkJU1CQC++uq91atfTppUazBY5s3z3Lu3751PtkRGsubO9SAI mDbNfgJQWqr561/7GLG0WrNeT2ky0x+PHj2Kjo728/OjqOfl5aWkpFj/UcDbwMFd/IjfkWm1REOD AcPMtqLZjJqaDDhu7q9Vb8Ti7sDAZ2o1YSsOIc6gfCKECMLS3GxQKEzUfVKvbLGg6GjhuXNKO726 GgsLqzUY7G/hhw+GYdnZ2e3t7RR1pVLp6en59OnTEXfigHd1NVN+vuK995irV9s/fn9HefwYu3JF U1ysbm6O8fDoMe86dUoeEcFKTu77tdlwMBgMGo2m977T/nSNRiMSiWJjY0fciQPe1QT9f0ZGhri7 G+3cyR29V7LvKM4EdTKuoeGYfuBaTpyMEc71oE7GNc4EdTKucSaok3HNfwEwm/auD9j7YQAAAABJ RU5ErkJggg== --=-=-= Content-Type: text/plain and after continuing typing `us TAB TAB', I see this: --=-=-= Content-Type: image/png Content-Disposition: attachment; filename=master-2.png Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAOgAAAAjCAIAAAAR5NFYAAAAA3NCSVQICAjb4U/gAAAPpklEQVR4 nO2ce1ATWfbHT0hCeIcEAYEBFEFgsERHV0StQWKNuwg4oK6riy7siOO4uGuNj1rX12ApioXo1FBL 1YgILj4GykFn1VFUHMUQZRmQkuWNOiEkxDwgIUmTRyf9+6P9xZCQBw9H2Mrnr+5z7/2eQ+f07du3 74XA4/E6OjrAjp0phYOFMo1GU1ZWJhKJ8NPu7u7KyspfJaoxcv369bq6ul/ZqUKh4PP5Q0NDtlT+ 4osvtmzZYq70vcQ/BioqKu7evWtoWbNmzaeffpqQkKBQKGyxjx9LiatSqc6fPy8QCPDTjo6OK1eu TKz7CQHDsB9++EGlUrW0tHA4nP7+fqPL+k6prKzcuHHjo0ePbKksEAhev35tZHy/8Y8WNptdXFx8 5swZtVqtN1ZWVp47d06pVGIYZljZnH38kCZW7r2AIEhTU9PFixednZ17e3vLysoSEhL0pQqF4pdf fgGAgIAAT09Pw4YikYjD4dDp9ODgYNyi1Wr7+/spFIqLi0t7e7uLi0tISAheJBAI+Hw+gUCYOXOm m5sbAKjVaqlUiiAIAMhkMqFQSCaTDV2Y6uu9tLW1+fj4+Pj4WI1/slFbWxsbG9vV1dXY2Lh48eL3 Fca4Ejc7OzsgIGDr1q0TFc3YcHV1PXDgwNdff33r1i0A2LFjx9q1a/Gimpqa3Nxc/XM8Ly9v4cKF AICiaF5enr5jYzAYhw4dAgAul5uenh4VFSWXy9lsNgDk5OQsWbLk5MmTd+7cwSuTyeR9+/YxGIyG hob9+/fjxsLCwsLCwlmzZp07d86CPgBgGLZz586WlhYikZiTkxMTE2Mh/kkIi8VKSEig0Wi1tbVT NXFbWlpUKtVEhTJm5HL51q1bQ0NDo6Ojvb2979+/z2Kx8vPzAaC0tJRIJBYXF1MolOfPn1OpVLxJ eXn53bt3o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3d3VEuLsMGb2fOCEJDKcnJI38mHA9KpVIi kZjuQzZnf9d+JRIJm82Ojo62UWdKJu7/GFlZHLUa27XL5919mv7fw564dqYkBEQht17Ljp1Jhn09 rp0piT1x7UxJ/g9GlrG7/yG6dQAAAABJRU5ErkJggg== --=-=-= Content-Type: text/plain In contrast, starting emacs-30 as above and making the same input, I see the following: --=-=-= Content-Type: image/png Content-Disposition: attachment; filename=emacs-30-1.png Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAOQAAAAkCAIAAAAW3QFuAAAAA3NCSVQICAjb4U/gAAAOMElEQVR4 nO2ce1BTVx7HfyEJUd4EQ4oUUOTlplugsCCKonHqLqIWdaeji13YqrUu7jrjY5b1VRxEcZDqyCwz FQV3sLVlpmirrcVHVzGJshbMgiG8Kg2BEEMSEvIgITc5+8d1YwgQAkQNO/n8xf2dc76/X05+99xz T86BIJFIeDweuHDh9LhhGPa6Y3Dhwi7cbJQZDIaqqiqpVIpfdnZ21tTUvJKoHMzVq1fr6+tfsVON RiMWi4eGhuyp/PHHH2/dunW80tcS/xSorq6+efOmpWXDhg3vvfdeenq6RqOxx24bW8mq1+srKiok Egl+2dbWdvnyZfulXzsIoW+++Uav1/N4PKFQKJfLrbrypVJTU7N58+Z79+7ZU1kikTx79szK+Hrj nywCgeDChQunT58eHh42G2tqas6fP6/T6RBClpXHs9uG5LBgnQ+tVsvlci9dujR79uyenp6qqqr0 9HRzqUaj+eWXXwAgODjYz8/PsqFUKhUKhVQqNSwsDLcYjUa5XE6hUDw8PFpbWz08PMLDw/EiiUQi FosJBML8+fO9vLwAYHh4WKlUarVaAFCpVP39/WQy2dLFaH2zFz6fHxgYGBgYOGH8zgabzU5JSeno 6GhsbFy0aNHLcDGtZM3Pzw8ODt6+fbujonEsnp6eBw8ePHPmzHfffQcAu3bt2rhxI15UV1dXVFRk fkYXFxcnJiYCAIZhxcXF5gGMyWQePnwYAHp7e7OzsxkMhlqtFggEAFBYWLh48eKTJ0/+8M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eTInJwc/ZOs8TPC9ajSm9nZ9QUHf118r/vY3 +hQc+PkRV6/2PXhQNDyMAECtNt24MQgAdDr5nXc88EXErq7hGzeU9qiFh1OCg8n//veLdd+p6dgf JwBs2UKtrlbU12sAACG4d09tbhUcTJZIsJ9/fpHKRCJh1SqfsrJ+hGBoyHThgsxqpByTbdvmXLmi uHpVYTUHAID6es2SJV6jn2kMRsumTV3W1smgVCp5PN7ixYut7EKhsLq6eu/evdMRfxlMcL8mJrZ6 exMTEjxu3IhYsuT59OU3v2kVCg0qlREhuH590NfXra3N+pa1pLw89E9/EgQGNgUGkkQiQ1YWNT3d BwDOnQtdu/bnS5fkbm6wfLm9WxG2bKFeuaJcvfrFOut4Oo6Kc8UK71Onglet6gwIIA4MGP/wB2pa 2vOuiI6elZtLS05uwzD0l7/QCgrmAsDZs2+uX/907txmnc6UlOSZlzf2iS5LIiMpiYkeGAZRUdaT hJoaxV//OsYIp1Qa1Wq7Jjzj8eDBg5iYGH9/fyt7SUlJZmam+R8jOBHjrQY4/FVOqcTa2nQajdHS aDSijg6dVmscr9VohMJhOr1JLscsjVPQmVScCCEMM3V26vr7DWO2GjNO+yubTCgmhldRIbWyNzZq wsKadTrrpYDpo9FoCgsL+/r6rOxSqdTT0/Px48cO9zh9ZuSuq9LS/jffJK9fb73UP0N5+FBz5Yqi qkre2cnw8BgxMTt9WhIRQVm7duyf66aDTqdTKBSjz9kqFAqBQBAbG+twj9NnRibr/xm5ucLhYbRn T+DL+1n4/wNXsrqYMRC0GvXEtVy4cAJc+1ldzBhcyepixvBfbpZskqJWHuYAAAAASUVORK5CYII= --=-=-= Content-Type: image/png Content-Disposition: attachment; filename=emacs-30-2.png Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAO8AAAAkCAIAAADuPfqZAAAAA3NCSVQICAjb4U/gAAAPi0lEQVR4 nO2ce1RTV/bHd0gg8iYgUKSAIC9/dIoWFFEUxeoMohZ1VpcMdmSq1jo4uoq6xrdURHEh1SV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UXTg5kZcscL1wAFufz8CALlcd/NmLwB4e9t+8IEDvpja 1tZ/86bUHLWgILKvr+2TJy/Xv0enY76fALBhg3tZmaSqSgEACMGDB3J9K19fWz4f++23l7FOJBKW L3cpKBAgBH19uqIikdFYOySbN0+tqJBcuSIxmmYAQFWVYsECp8F3xYiIhvXr24ytr4JUKmUymfPn zzeyczicsrIyw4jECQwMxP8eRCgUXrlyRW9/8uSJXC4HAB8fHycnpxETlIbTHzsjXPHR0Y3OzsSo KIebN4MXLHgxxZkzp5HD0chkWoTg+vVeV1ebpibji96QwkL/v/2N7eVV5+VF4nI1qanuiYkuAHDu nP+qVb9dvCi2sYHFi83dFrJhg3tFhXTFipfrzcPpWMrPJUucT53yXb681cOD2NOj/ctf3OPjX5yK sLAp6emeMTFNGIb+8Q/PrKxpAHD27Ltr1jyfNq1epdLNneu4d+/QWYaGhISQo6MdMAxCQ43nIeXl kh07hhjDpFKtXG7WnGo4Hj16FB4eTqFQjOx5eXnJycn6PwzRs2PHjiVLlvj6+rq4uMTFxenT9Ssq KpYuXern5ycQCKKjo9PS0kz3O5y+BRhuTcOCT5o4UinW1KRSKLSGRq0WtbSolErtcK0Gw+H0e3vX icWYoXEUOq/kJ0IIw3StrSqBQDNkqyH9NL+yTofCw5nFxUIje22tIiCgXqUyXtAYOwqFIjs7u6ur y8guFAodHR2fPn06ZCulUtnY2Njf329kl8lkLBbLcMliOEzrj5FJuYcuP1/w7ru2a9YYvxOZpDx+ rKiokJSWiltbIxwcBsz9Tp/mBweTV60a+sXnWFCpVBKJZHD2uEQiYbPZ+CrEeDCu+pMymt8y0tM5 /f0oI8Nr/N7A/z/BGs1W3h4ISoV85FpWrEwGrPubrbw9WKPZytvD/wFTHiBWEEBEUAAAAABJRU5E rkJggg== --=-=-= Content-Type: text/plain And these last two results are also what I see when I repeat the test on master with my patch applied. Steve --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 17 11:57:01 2025 Received: (at 77718) by debbugs.gnu.org; 17 Jun 2025 15:57:01 +0000 Received: from localhost ([127.0.0.1]:60949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uRYgG-0001eG-W8 for submit@debbugs.gnu.org; Tue, 17 Jun 2025 11:57:01 -0400 Received: from mout.gmx.net ([212.227.15.19]:38391) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uRYgC-0001db-O9 for 77718@debbugs.gnu.org; Tue, 17 Jun 2025 11:56:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1750175799; x=1750780599; i=stephen.berman@gmx.net; bh=vrHxR9qZnj4ZmrpkBERC/TgHwAXrUbO3P+Y/jSQUdI0=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=lJW8VOgfnhSS9j0X2gluWxUywDHwVX8e+wNh5dD66Fb2LyJUpxERJK5ThPHgxK2g jhrKdXbnaILVexg02TA/W6N5uJTOjlgfR9/btqHsuMfr8ee9pM6//TAuY+T9Zd8FW VMMHIgw8sx95ZfFaD/1pxTZ3y5Nw7+Vmvj461tJf+TNnMaoG0L0SyrQ3dpqx9aiUh i6pnM9t7SRBDBW4eyuttplnPB+9tyQaPbAhj0Elvu1WtTc773efv1gbwx0q62MNAh 2F5vnlBcV5pQHNk3JVPy3lLvgf5iD5JA6ulaFycNhGRYXBgTkWBe3cZ/TlWOB/wNO xuLphItsMt1030OP7Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([94.134.94.38]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N63Vi-1upiM302au-014gRr; Tue, 17 Jun 2025 17:56:39 +0200 From: Stephen Berman To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: References: <87y0w7ejxy.fsf@gmx.net> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> <87o6wbp4h7.fsf@gmx.net> <87cybm2zu9.fsf@gmx.net> <87ecviolhk.fsf@gmx.net> Date: Tue, 17 Jun 2025 17:56:38 +0200 Message-ID: <87v7oumkeh.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:ms4CvJtOAJexkn2X3rH4+f73UO7quGhUTRCIZEnpDvrL7kS4Cek QY7sHC1gBkPm0g4ojFdYD2MViQBBra2OWsIIJuvTPcBo6pe0bTtB5RpsYiThIm1bwhHNlem UOoTpIbY5bP9mjUc+wtsG3wBzCllY56vF+nJ88dF+FWjJ4yR8+A87LI35mJYPe50acJebFM 3TJJzOm+UDdWRPYN/s88g== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:xifpVtJO97E=;99BaZ/ot6avc9fJRAEgUmaueM0M 9gsbfpfz7zyCRE3PGlZGE7s+VxjtR2yXsVgbJSXYhJAjkhgMrjmphjHr/0xqf9EhwYX52Y41r EoZzYaQJQMMDK6VoWAkrRqpP8F38qQDjo13nZwr6/p3vy3VQ4Km+ir7FEn9OnO8oKMZf6M1Ou L2/YHUjr5WfLpAATsfAoBlDNepNK4DhWExPtEO+XlPUbg9UN92vtrL5cR7Jwc/dgDONcdqwwZ PHFO/Ttc46DSkv38F81E5r47zXvFNKH8NHyZzPLg6H3mVP+xfgtqO/k4HkW1GsfBtMi25ThfM d8QmdU3NWQQkgQkwjNm70dAWXHRAcAsxdExstynszswjf7hq1kXgtPaojmJL/T7MQB+6mRgE/ VXmHbLk2yt2W1sokioNdABPAykrF3L0Z/I4ILeTUx/nbaDYfwRJwvms2CuMFfDdrqH3yBqp6s /IItdeVREK4BiKEDij0BIaARn61FMwVsEZuVtCOhpUIctTeDE0xwm7SEJ3Dk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xpYof9NHRynFqzdyh9Z8qrU2ukVEX+F/y526qLvvWv3CQRFpYrzAk/t/uvAsfIlmRe kq9/dTEQSzlPk41MzNaJ3WD7/o0wk/baHSOJ/EEZymnYyV/NwVk4BW0kyuvJ780Bn4hofBJUa 3sYN+UXh0n1WNzvCkkCk/7BaoY0jbthUluY8QCIa7VchPxGoFrDbsfWe7rHPQ9UmJ+1qK4y2u Lnn9kKrlPKCuyz6pXyWfcOboDorZXbL4SV/+RdxFOCXI8bNIEihAbqmRLZzh99RKSnDOOt68M Kxfz0vC3UO1CunyLjArn8kG8ws077pvD96RBOofgPSNdxcHtaVTn0EPpML9QPP/RHyEWeN25D fJYHBZhswuRDvuFMOpk8YHeDJhQeXGhxcQjbVZfspEJsUXmTw8DfTuvsIULgnQr+Mcm8L2XrL i1vQ190NeYipJkXptsGwksxsPD9TaGIwlkEyqKey4ohHoJHGfhcq9hAMZj+kttlL3sQkV0i9Y J4xWuhLeYhpR9JQD/kP7X+gvM5EYCVjRUGk1PfbhNsBxXMK+882XFQOhG5wL/GHamLTde+ulF kVyeDbm9+4s2+SNM5tGKpEL8KMcGS3bYYMc9+ro7+CYU0cDVoo3b4B2xSm+rd0/RvBXw= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Tue, 17 Jun 2025 11:49:12 -0400 Spencer Baugh wrote: > Stefan Monnier writes: >>> There is no other regression. rfn-eshadow works correctly, graying out >>> the section of the minibuffer text which will be removed by >>> substitute-in-file-name when read-file-name returns, even if point is in >>> that section of the text. This has always been the case. Likewise, the >>> pcm-based completion styles sometimes move point into that text on >>> try-completion. This has also always been the case. So there is no >>> other regression. >> >> So, can we close this? > > I believe it is already closed :) Nevertheless, I hope the followup I just posted convinces you both that the regression still obtains. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 17 15:26:45 2025 Received: (at 77718) by debbugs.gnu.org; 17 Jun 2025 19:26:45 +0000 Received: from localhost ([127.0.0.1]:35314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uRbxE-0006CL-R3 for submit@debbugs.gnu.org; Tue, 17 Jun 2025 15:26:45 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:60275) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uRbxC-0006Bk-0J for 77718@debbugs.gnu.org; Tue, 17 Jun 2025 15:26:42 -0400 From: Spencer Baugh To: Stephen Berman Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: <87zfe6mklr.fsf@gmx.net> (Stephen Berman's message of "Tue, 17 Jun 2025 17:52:16 +0200") References: <87y0w7ejxy.fsf@gmx.net> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> <87o6wbp4h7.fsf@gmx.net> <87cybm2zu9.fsf@gmx.net> <87ecviolhk.fsf@gmx.net> <87zfe6mklr.fsf@gmx.net> Date: Tue, 17 Jun 2025 15:26:36 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1750188396; bh=GFFS4A4/GLBS4twcnaTvKUKpIzRMptLl8FGXCui/2AY=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=qUIekXZIqAyjv4VNGHfSGPrOfjmSEsu9jOz4TlmHxk9VPElP8ZzBS7nR7+THUOBYi yKWrTrHIzidBaiN/xnfChlujnCOfYKvUNKUDgP/OoeetGPezrhIRcMQ77L+xX9c6It 6d3ENVBg+64qtElQ4S/ZY7vdAtnjSdFfeWWBVX8ueLixJf6ma72bA/seXwRp4m/wSW gVvWtFPoJwTMWHNMiJJJmUtjHZbpvFytPYi9Ukkc5gRsHWUokkIY0yz3k7ijzKzMrn gMLzerAhovna8dFWVqUKSG/B4np8Vpp/nc8o9IYsABJdJlOGv/68nEI5UUjdgYBjku uvtqigmwqVqqQ== X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stephen Berman writes: > On Tue, 17 Jun 2025 10:59:56 -0400 Spencer Baugh = wrote: > >> Stephen Berman writes: >>> On Mon, 02 Jun 2025 12:38:06 +0200 Stephen Berman wrote: >>> >>>> On Fri, 02 May 2025 14:44:04 +0200 Stephen Berman wrote: >>>> >>>>> On Fri, 2 May 2025 08:26:44 -0400 Spencer Baugh wrote: >>>>> >>>>>> On Fri, May 2, 2025, 4:30=E2=80=AFAM Stephen Berman wrote: >>>>> >>>>>>> What about the other regression I mentioned? Have you looked at th= at >>>>>>> and tried the fix for it I included? If there are no objections to= that >>>>>>> patch, I'd like to install it on master. Or if there are problems = with >>>>>>> it, I'd welcome a better fix. >>>>>>> >>>>>> >>>>>> That fix is not right and would cause other issues. >>>>> >>>>> When you have the opportunity, please say what those issues are; I ha= ve >>>>> been using my patch since the first version of your changes that >>>>> introduced this regression and don't recall any issues with it with my >>>>> setup, but admittedly I haven't extensive testing with -Q or other >>>>> configurations. >>>> >>>> Do you have a rough ETA for fixing this regression? And again, can you >>>> please explain what's wrong with my fix? >>> >>> Progress on this issue seems to be stalled. I have no reason to doubt >>> my fix may be problematic for use cases I haven't encountered, but I >>> don't know what these are, so I cannot reasonably investigate further. >>> If my patch is installed, those who encounter any problems due to it can >>> report them, which hopefully will facilitate finding a better fix. >>> Therefore, I request permission to install my patch. If it causes >>> serious problems for which there is no quick fix, it can be reverted. >> >> There is no other regression. rfn-eshadow works correctly, graying out >> the section of the minibuffer text which will be removed by >> substitute-in-file-name when read-file-name returns, even if point is in >> that section of the text. This has always been the case. Likewise, the >> pcm-based completion styles sometimes move point into that text on >> try-completion. This has also always been the case. So there is no >> other regression. > > I'm not sure what you mean by "no other regression", but what I reported > upstream still holds in current master. That is, start Emacs like this: > > emacs -Q --eval "(custom-set-variables '(completion-category-overrides '(= (file (styles substring)))))" > > After typing `C-x d / TAB', I see this on master: > > x More simply, even with -Q,=20 (let ((file-name-handler-alist nil) (completion-styles '(substring)) (default-directory "/")) (read-file-name ":")) gives you a minibuffer containing "/" Hitting ? will show all the possible completions, all of which (on your system) contain a "/" as a suffix since they are directories. Hitting TAB will make the minibuffer contain "//", with point in between the two slashes. You can then continue to type more characters contained in the directory names to further narrow down the completions. This is the behavior of the substring completion style. When there's a common substring between all the completions, completion-substring-try-completion inserts that substring. Since the substring is a common suffix, it positions point before that common suffix. If there are any other completion styles before substring, this doesn't happen. e.g. with: (let ((file-name-handler-alist nil) (completion-styles '(basic substring)) (default-directory "/")) (read-file-name ":")) Hitting TAB will do nothing. To have only "substring" configured as a completion style implies you want the behavior of the "substring" completion style, and only that behavior. You are indeed getting that behavior. What's the problem? substring has always behaved like this, so improved consistency in edge cases like this one should not be a surprise. Is there some problem with this behavior, some reason it doesn't work right for you? A more concrete complaint about what doesn't work would be helpful. From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 17 15:55:36 2025 Received: (at 77718) by debbugs.gnu.org; 17 Jun 2025 19:55:36 +0000 Received: from localhost ([127.0.0.1]:35614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uRcP9-0000lK-NO for submit@debbugs.gnu.org; Tue, 17 Jun 2025 15:55:36 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:2472) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uRcP6-0000kh-KF for 77718@debbugs.gnu.org; Tue, 17 Jun 2025 15:55:34 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9E3ED10013E; Tue, 17 Jun 2025 15:55:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1750190125; bh=pQU1p2CcaR3nPR2BEyjI3hLS5SgyBS/2sd79AmcJTHM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Uf6fFROPqTUfFvXBhFA4SWiMbXVhl/ZPvxmQR6AyhC+JhOZVBYZ4tZdT5fBIxYpQ4 rhci7slqcHs0i2Qca4NJvwxAPXAxBZzC+Uj/zziDRMNxdaNTmZWyN8c8Dscy1NeOfe h+Y/TbYb+Z9GlyhMaBYMlVcrlaB5oBtblovI4udaTwKS4+6vCkfMhjE/g0KnUYkeS8 yzUF6Q0c46K+nHyjWkqPH1oJCjvK9QwuY93B/CFvE90XDOUt/xbL9w6Q5n1Wg9BlyH ldBd1uQHmg8PCIln66E9Joi0itTKP8Rs3VAGUZOeUVDUeaXqO6BUZVKbmFJPEr15+v zoPkJ5a/Z3gcg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C200410002E; Tue, 17 Jun 2025 15:55:25 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AE83F120524; Tue, 17 Jun 2025 15:55:25 -0400 (EDT) From: Stefan Monnier To: Stephen Berman Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: <87zfe6mklr.fsf@gmx.net> Message-ID: References: <87y0w7ejxy.fsf@gmx.net> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> <87o6wbp4h7.fsf@gmx.net> <87cybm2zu9.fsf@gmx.net> <87ecviolhk.fsf@gmx.net> <87zfe6mklr.fsf@gmx.net> Date: Tue, 17 Jun 2025 15:55:25 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.084 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: Spencer Baugh , Eli Zaretskii , 77718@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I'm not sure what you mean by "no other regression", but what I reported > upstream still holds in current master. That is, start Emacs like this: > > emacs -Q --eval "(custom-set-variables '(completion-category-overrides > '((file (styles substring)))))" > > After typing `C-x d / TAB', I see this on master: > > Dired (directory): ~/// > > and after continuing typing `us TAB TAB', I see this: > > Dired (directory): ~//usr// When I try your recipe I see something very similar, but my cursor is positioned right *before* the last `/`, so in terms of completion, it seems like an acceptable behavior (I'm not sure it's very useful, but it's the result of the generic attempt to insert the longest common substring, which happens to be just "/"). I do see one problem which is that the whole `~//usr/` prefix is greyed out by the rfn-shadow. It's not strictly incorrect since "/" is indeed the filename that would be returned if I were to hit RET to exit the minibuffer, but given that point is *before* it, we could argue that the `rfn-shadow` could/should presume that I'm about to type something in there, which will immediately bring the `/usr` back to life. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 17 19:01:04 2025 Received: (at 77718) by debbugs.gnu.org; 17 Jun 2025 23:01:04 +0000 Received: from localhost ([127.0.0.1]:37441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uRfIc-0002EB-H3 for submit@debbugs.gnu.org; Tue, 17 Jun 2025 19:01:03 -0400 Received: from mout.gmx.net ([212.227.15.15]:47553) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uRfIW-0002CH-Rt for 77718@debbugs.gnu.org; Tue, 17 Jun 2025 19:00:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1750201248; x=1750806048; i=stephen.berman@gmx.net; bh=ll3keq2Quf9QqV8dkKMVqh39yTzDps/CR4osB00OyLk=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=VFAyZRgCMqoy0eC7A1t6WDGpDpYUoflkYAek1Y9FXOCmnJp/V30M2old0qDCHo4K +5FlYv83CKhmyeA2oW66YMo8SbKznbMtEe1rJ3togjawxtPV+BTey2ncskAdqzaRv Wl/YxZyUF+ProkfhiQdZtiKdflwSdt7uGtS9cQKU8px5bFaV50BTDFc9jacRIKajL 7pX3BPkK4v8NPkUBS3R9MaOmfEudEftU+LC2pXef6YdH7+YSL5I3+eKryrQ5SzbAj 2Jei24+lobpbGj0VnCHonYs+Ditie1thO7FkjD0pgaj9i5hnUG7q3MJ+lDEidlehg pkngzBiO3PtTiwtuzQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([94.134.94.38]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MLiCo-1u9zv61pZ2-00KP9m; Wed, 18 Jun 2025 01:00:48 +0200 From: Stephen Berman To: Stefan Monnier Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: References: <87y0w7ejxy.fsf@gmx.net> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> <87o6wbp4h7.fsf@gmx.net> <87cybm2zu9.fsf@gmx.net> <87ecviolhk.fsf@gmx.net> <87zfe6mklr.fsf@gmx.net> Date: Wed, 18 Jun 2025 01:00:48 +0200 Message-ID: <87jz5am0rj.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:YK0Ft0lxxq0iZlhlc7gHwl3L0YknIm8QsSOG+x68ICuNcUnW9tq it6eh1VfNlWGx9cG1GFajawf/O41FW/m5yduTYkWf5Js7QNFMnTSCHKKvsPQssfm1oCbEsz eLA0TW/31v8mJpLGFH7Xq71lzq5EdR1UuxFPTs3P9z2/AgbxMbE92MzR0hkva5PYPnEwF0B X+ffAR39UTIt8+USgVSCQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:uwLCtrXZ+ng=;kF5p9M2fxSYQXwc2bTn4YpjMN5S vwCFsPe+FFWUeworVf9XqaT9X4iApKHtygqt+NEOOvuqoFE5/SilK2zPNwcI65YZlPPvOsJGY mf+twHNpEWU4aG26p/aSPVpgx1hNb5OfM7905P0H7pWdswlJLGyb5GBcNVqV9OUD7nvS2G2lj uEstC6s/AzEvj7UEJbEfxwWd2s0rGWD3jRHyZhVoqKljI9QPbD5dCN/opWgf0iRk1h2+bv1H5 xvJhBNCbrn7LW490jRKqLCfYWn6c3K9Jqay7ALA7UaC67PHXFNscHXZz3nVCfEPNOeUfJmncl FxHvGza2G7Vt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5YKURctn83rZWH0175xmVy0FPVEF2BXMFL8sX6p5mVk wGPkYBy6moG1izRxuCEVxPRgAA9jx+DQ616eLjopxvfj3dRStAvLw5Y/Xdtp/f0ct3OWHbOib G47NwIznd5Y6HFPGf2gXy3a+qz5KBCjQ1rpK3aJIy/QyQf1aMNt1mt08gdg7Hg4gHU3AAAvOp Bs/22WWW3k4W1wwu3je9hi0jBXmISosZxlK+n8WgfCpG+i89dEwkkq7uHJVeoW3AN6ZYPlRoN RZAtj3bLS3giTcpEmzJA2iDT2WrckEWnl/ufA75bS4gQOtb0pz90Z1GayVei0g431aS9cc0Gu s6N5idP7KoIl2PJF5GapwFqK3AP9Erw3E6B8A4IhxYasyaPRr8pMH+q6paekNBHXlBnDZbWrG mOynYlDL8hQD3qg6Nyqaamvn4JHISMTynpzii87vuYP/JtEpWl/6W+Srlx5kqoB+owZdUAFOP fswcCX4HbwCmyNhVe3HEIPWkBtbrXJXNUcFWedJOUSf6PeYb4iMLcEKOC9XgCIoSvtLXwGWRJ waVyo9zECikjlnEwoT++p5nrHNZ1Hb0t/v6C9QLBpvr9nsEOlQj/xJ+OESE4qx3E+M8049h9m ZdjZ2kNpL8hQSuiAODBSVEAK8UJZsFLidR0tAOfuIUsd910aEnt0wfw/xdRJewJ6W1kJJKSts pf4TdolJPKpl+QpRqqbHQ7t0kBq1QwFx+TeMNYhKAPCNUfNh7yXr9ayCizVUhPR/nDURyl500 Nu392NlJj1+1q3drHQe0fuvcYqqGiF6kW6HYqk76r5RsI8/OAIFwYjNaVmXBzc/2TEPHkL8Ae OKXXVaIbLGc4LpeB X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77718 Cc: Spencer Baugh , Eli Zaretskii , 77718@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Tue, 17 Jun 2025 15:55:25 -0400 Stefan Monnier wrote: >> I'm not sure what you mean by "no other regression", but what I reported >> upstream still holds in current master. That is, start Emacs like this: >> >> emacs -Q --eval "(custom-set-variables '(completion-category-overrides >> '((file (styles substring)))))" >> >> After typing `C-x d / TAB', I see this on master: >> >> Dired (directory): ~/// >> >> and after continuing typing `us TAB TAB', I see this: >> >> Dired (directory): ~//usr// > > When I try your recipe I see something very similar, but my cursor is > positioned right *before* the last `/`, Yes, that's what I see, too; the screen shots failed to capture the cursor and I failed to mention that. > so in terms of completion, it > seems like an acceptable behavior (I'm not sure it's very useful, but > it's the result of the generic attempt to insert the longest common > substring, which happens to be just "/"). Yes, Spencer pointed this out too, and I can appreciate the desire to strive for more consistency (whether this is an edge case or not), as long as the resulting behavior is no worse than before; however... > I do see one problem which is that the whole `~//usr/` prefix is greyed > out by the rfn-shadow. > It's not strictly incorrect since "/" is indeed the filename that would be > returned if I were to hit RET to exit the minibuffer, but given that > point is *before* it, we could argue that the `rfn-shadow` could/should > presume that I'm about to type something in there, which will > immediately bring the `/usr` back to life. That, and also the points I mentioned in my reply to Spencer (extra TAB, failure of `M-DEL'). Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 17 19:01:40 2025 Received: (at 77718) by debbugs.gnu.org; 17 Jun 2025 23:01:40 +0000 Received: from localhost ([127.0.0.1]:37457 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uRfJD-0002Gn-7n for submit@debbugs.gnu.org; Tue, 17 Jun 2025 19:01:40 -0400 Received: from mout.gmx.net ([212.227.15.15]:46833) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uRfJ9-0002Fw-8U for 77718@debbugs.gnu.org; Tue, 17 Jun 2025 19:01:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1750201234; x=1750806034; i=stephen.berman@gmx.net; bh=mZ/WQ5ZhG4i5hQEZIpUtHF6kBURakSOkwacls4FVxZI=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=ddKdmhQjcxjCKE5EQGi1Q9FjE98RQmLeRu+bL5Wcotde1N3pifrjabpCyzDlKNhl yEqPFkpuBp6keB8abTrFMls/rWtbIkK1YXp172SpV2OPxQpQYf22gbjUprJVFu1pQ BOK7qtpzOIASmYJUr+QvZlh6EampuODrV+yLT2mMo6QzWDLwE1eD6jdpPEagh6KHq Tf6UrCZCsGP9P4Dee1okGwquHqCTKX0kG9VabpTJuaABA0FK1BkouZPneKjYIC0JH pKIrRw5pkj45Kz+ZDIDK7DISEkKkMROjht5h1iynZPKjQDfxh6KH51La2oDhxNQie eZnUIOPbQ5JZ5C8Y6g== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([94.134.94.38]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M6UZv-1uPBFY2QmX-005KR2; Wed, 18 Jun 2025 01:00:33 +0200 From: Stephen Berman To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: References: <87y0w7ejxy.fsf@gmx.net> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> <87o6wbp4h7.fsf@gmx.net> <87cybm2zu9.fsf@gmx.net> <87ecviolhk.fsf@gmx.net> <87zfe6mklr.fsf@gmx.net> Date: Wed, 18 Jun 2025 01:00:31 +0200 Message-ID: <87ldpqm0s0.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:g2QQXZBSS2jEDIANvfZ6XJfNCjPaoZ/9khV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ux5o6xpwx8k KZhDHjYIynyYgLYSrIPS3N1cncI9soogHOevadbzL9Rz7CCKpmYDcwY7jp3XPucTIWd2pLpk5 K0jMu2Nx63WZtbih1Ly4HgPUSlQntsT2rQ8T5zuvE+KaPQd8ZkOKMBjnSC6T9odbdAs8oam7J aBDUCnL8pO3eCwNkm5wqBpSfa42X6r4LF5cH2+fIjQyzNpqCfaS5+35YD1CtxPrP1y56qxYx2 f4E5mlcokpvMCU0YY1A87dXIfzZ+EYyoIp8eellEqGScfEe3Tn2c2mFp2nXBEm6uNIZ2evuSP prKwyI7c0az7fqPY Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Tue, 17 Jun 2025 15:26:36 -0400 Spencer Baugh w= rote: > Stephen Berman writes: > >> On Tue, 17 Jun 2025 10:59:56 -0400 Spencer Baugh wrote: [...] >>> There is no other regression. rfn-eshadow works correctly, graying ou= t >>> the section of the minibuffer text which will be removed by >>> substitute-in-file-name when read-file-name returns, even if point is = in >>> that section of the text. This has always been the case. Likewise, t= he >>> pcm-based completion styles sometimes move point into that text on >>> try-completion. This has also always been the case. So there is no >>> other regression. >> >> I'm not sure what you mean by "no other regression", but what I reporte= d >> upstream still holds in current master. That is, start Emacs like this= : >> >> emacs -Q --eval "(custom-set-variables '(completion-category-overrides >> '((file (styles substring)))))" >> >> After typing `C-x d / TAB', I see this on master: >> >> x > > More simply, even with -Q,=20 > (let ((file-name-handler-alist nil) > (completion-styles '(substring)) > (default-directory "/")) > (read-file-name ":")) > > gives you a minibuffer containing "/" > > Hitting ? will show all the possible completions, all of which (on your > system) contain a "/" as a suffix since they are directories. > > Hitting TAB will make the minibuffer contain "//", with point in between > the two slashes. You can then continue to type more characters > contained in the directory names to further narrow down the completions. Yes, I noted this upthread, where I pointed out that this differs from the previous behavior, which is why I called it a regression (https://lists.gnu.org/archive/html/bug-gnu-emacs/2025-04/msg00884.html). > This is the behavior of the substring completion style. When there's a > common substring between all the completions, > completion-substring-try-completion inserts that substring. Since the > substring is a common suffix, it positions point before that common > suffix. > > If there are any other completion styles before substring, this doesn't > happen. e.g. with: > > (let ((file-name-handler-alist nil) > (completion-styles '(basic substring)) > (default-directory "/")) > (read-file-name ":")) > > Hitting TAB will do nothing. > > To have only "substring" configured as a completion style implies you > want the behavior of the "substring" completion style, and only that > behavior. You are indeed getting that behavior. What's the problem? > substring has always behaved like this, so improved consistency in edge > cases like this one should not be a surprise. You may consider this an edge case, but it is proof that the substring style has not "always behaved like this". I don't recall that the goal of "improved consistency in edge cases" was previously cited in this thread; if it had been, I might have viewed the issue in a different light, though I still find the current behavior problematic... > Is there some problem with this behavior, some reason it doesn't work > right for you? A more concrete complaint about what doesn't work would > be helpful. ...to wit: Before your change, when using substring style, typing `C-x d /us TAB TAB' completes to "/usr/" and pops up the *Completions* buffer. If I want to change the input, e.g. to "/var/", I can type `M-DEL va TAB'. After your change, when using substring style, typing `C-x d /us TAB TAB' completes to "/usr//" and only after typing TAB a third time does the *Completions* buffer pop up. If I want to change the input, typing `M-DEL' has no effect, though e.g. `C-f / va TAB' works (the minibuffer then displays "~//usr//var/" with "~//usr/" in file-name-shadow face). It works, but it's a bit more cumbersome than previously (an extra TAB to get the *Completions* buffer) and visually confusing (at least given familiarity with the previous behavior). And again, with my patch (posted in https://lists.gnu.org/archive/html/bug-gnu-emacs/2025-04/msg01860.html) I get the behavior and appearance I'm used to, and for my usage have encountered no problems with it. I ask you once again: please tell me specifically what problems that patch causes. Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 18 08:02:33 2025 Received: (at 77718) by debbugs.gnu.org; 18 Jun 2025 12:02:34 +0000 Received: from localhost ([127.0.0.1]:48252 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uRrUu-0007HV-MY for submit@debbugs.gnu.org; Wed, 18 Jun 2025 08:02:33 -0400 Received: from mout.gmx.net ([212.227.17.22]:58739) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uRrUr-0007GP-S7 for 77718@debbugs.gnu.org; Wed, 18 Jun 2025 08:02:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1750248116; x=1750852916; i=stephen.berman@gmx.net; bh=Kd/T6QKTykXnTHE59i/hQqKGvzIEiagYJlfWsNfqFPk=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=CsoPvyeJMLQyMLexy9Nv1zubmZGl7QO+JmmRzdbubIfWKKXVO0fSbdQLBCvH4riG K4uf0RHYMxF6b49klwE09G36dEIGKgAi527QGp0i30RgQvilSpt0CIbQPIYrrvR/E 3W9K0w3lwTLKsugrGe5YXY50g3kE3vFTu+2ye5NMHqH6DiMrnsg3M+2Mu9ZGgthM7 OR3dCLoXUKHPsU/Z1Ix6fwrKrh6INTQSkfGciJM5uF5tvpPNQhyZFCL3ppobuyvPZ 8UGm2T0iKRjWWzRLmKTyi+17y2MUnXS3jyWupolw8Q/S0ayelW6XLtpsfrwHt8CHv 87hjRwbmnNBbKcSBXQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([88.130.50.166]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MF3DM-1uYR3M0D8K-007rto; Wed, 18 Jun 2025 14:01:56 +0200 From: Stephen Berman To: Spencer Baugh Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: <87ldpqm0s0.fsf@gmx.net> References: <87y0w7ejxy.fsf@gmx.net> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> <87o6wbp4h7.fsf@gmx.net> <87cybm2zu9.fsf@gmx.net> <87ecviolhk.fsf@gmx.net> <87zfe6mklr.fsf@gmx.net> <87ldpqm0s0.fsf@gmx.net> Date: Wed, 18 Jun 2025 14:01:54 +0200 Message-ID: <875xgtdzrh.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:rA1tb3g4sH2EFbNuQYdVZnCVd1BRdbUq+iPKyNMDOxZQMOUFekl H6yMm8ZO5qIdUoUpJYdTZeDsY07kMULmXFm7bxbx9fvpoRCru1uEaMdSrMlUyfpoRc3Ul0+ jRXCRaZlB5Fbzrh+DvsstfCI0MEntavaMMKt9lt7OMdJ2a3N3X9GxgaWT26ADvbR51q9NNH NmBWvO8Qf3CdGmJ+04l8A== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:ZXHh2YKM3d8=;W0jMeQBiprsz+pdH9ECAB9CMCoW /WbDRWJTRgfsJOR/EpOjSQQ5JaSBj+LYoOIC7tupz44v444ZX+5wYuP9BKHZ8kc7ssm2Es6KN yakCqHS2kuZrxI0S6yhaE4v9e3BCaTbtLnUcAKSABacC5OzKd5jFfVFenLq/ZuHrQqERfMpVO 67FiWLzD6rdcNUJvvFVfDY19KqSub66HgJeLBMbkmGeMncGGUeQx8XnEv6sLvHz5zX3eSmjIn updi3F9xlkrUB62W3YhU0VZ2Ry84ZfZZHPOqF7c72JfGaLQKPH1wBmInAjPrzYtPgcufucc/j U3VpavSLafh4TW+KoU7i6CZiXDJPIXlQt3heqKLECEzX5xPjMTL4eCmJWC6N4rTFa+9cN5YID he3nOh5Iq4/BHOJa+CalMqdWXLo+FJHHGc9XQz1U3NF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cDZ1tyQ2WYOqJOupz0+V3LCAC JWxDszm6BZNXuIVxWaczyZcXYpWSb2hzXc5IElwqG2CmL0/gZnfpKZAzW4EYHytTVgycOLI4r um2lG38VYw1/INdRZ7wgSsNNPNOx6nMnZNWK/7/4xi5HSeL47KRKt5t3icNIlZJmDxle9ACgE kqa39LzthEIWIX0+emUQsjPKd5F7rlxKEXJY2KBNVcV6P1ICGgl6agCsdc7sVWJkPihQ/huba YVcG2yK6+41Dv8N6kz9a5gOOyRJTLBozOHU9EtSdWuFbbF3RnC+noiqEmhuknT0U0BWoD0lps ItLmlLxiZDrklFdUU43Yj/eAAnv7B2JKNDIkAT9EguG/OXJQyGBDEFDLb70eLVB0w7oYUVhp2 tDz6XOQXYx7Y1DA2YNksMlPQAfnAYpwlBdapiYvvigH2pp9xCzqjrYnrW95AKLz2kKSSLd8sD gt+hqXW4jFO3eKrKQgfV+NpI7AhC0NJ2qbfOCVjT2OV2DMvtk0Ytx8Ze166rDx6JGrRm11A18 AT+cuQJnpfqNpEJVSXsAiU1R/PzpPox/mG2qMemNX/Ef+6Os8D7H6YvouVGFj51Kpo6siXZ8m Nf/UzdZWyhugkvTwWgW1HK3FkB52Q7Mw43DRJRp9Z88mPQiX0KSyS3Q/zpO5djlmubkG5UGCs q3CATZGOQeo20PWgabR7L0UkflSaFlbhhDLwykjvYcon54QCYXhfhs74plQ2npYi/JkoVDRnd J3u16dVSh/jqkQ67oszI+9bMB2MnzkeFmPGK4wPh0wIScXdqEbTG3ky3XcfooWL/rhW7whTSw arCJqVg X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77718 Cc: 77718@debbugs.gnu.org, Eli Zaretskii , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain On Wed, 18 Jun 2025 01:00:31 +0200 Stephen Berman wrote: > On Tue, 17 Jun 2025 15:26:36 -0400 Spencer Baugh wrote: > >> Stephen Berman writes: >> >>> On Tue, 17 Jun 2025 10:59:56 -0400 Spencer Baugh wrote: > [...] >> This is the behavior of the substring completion style. When there's a >> common substring between all the completions, >> completion-substring-try-completion inserts that substring. Since the >> substring is a common suffix, it positions point before that common >> suffix. > [...] >> To have only "substring" configured as a completion style implies you >> want the behavior of the "substring" completion style, and only that >> behavior. You are indeed getting that behavior. What's the problem? >> substring has always behaved like this, so improved consistency in edge >> cases like this one should not be a surprise. > > You may consider this an edge case, but it is proof that the substring > style has not "always behaved like this". I don't recall that the goal > of "improved consistency in edge cases" was previously cited in this > thread; if it had been, I might have viewed the issue in a different > light, though I still find the current behavior problematic... > >> Is there some problem with this behavior, some reason it doesn't work >> right for you? A more concrete complaint about what doesn't work would >> be helpful. > > ...to wit: > > Before your change, when using substring style, typing `C-x d /us TAB > TAB' completes to "/usr/" and pops up the *Completions* buffer. If I > want to change the input, e.g. to "/var/", I can type `M-DEL va TAB'. > > After your change, when using substring style, typing `C-x d /us TAB > TAB' completes to "/usr//" and only after typing TAB a third time does > the *Completions* buffer pop up. If I want to change the input, typing > `M-DEL' has no effect, though e.g. `C-f / va TAB' works (the minibuffer > then displays "~//usr//var/" with "~//usr/" in file-name-shadow face). > It works, but it's a bit more cumbersome than previously (an extra TAB > to get the *Completions* buffer) and visually confusing (at least given > familiarity with the previous behavior). > > And again, with my patch (posted in > https://lists.gnu.org/archive/html/bug-gnu-emacs/2025-04/msg01860.html) > I get the behavior and appearance I'm used to, and for my usage have > encountered no problems with it. I ask you once again: please tell me > specifically what problems that patch causes. Assuming the current behavior of substring completion in master is not a bug/regression but the intended "improved consistency", I would like to propose a different patch (attached) to make the completion behavior conditional on a user option, defaulting to the current behavior in master. Steve Berman --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: substring completion patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 122459be062..598383e7b51 100644 =2D-- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -4516,6 +4516,14 @@ completion--common-suffix "Return the common suffix of the strings STRS." (nreverse (try-completion "" (mapcar #'reverse strs)))) =20 +(defcustom completion-/-not-common-suffix nil + "If non-nil, ignore \"/\" as common suffix. +With the substring completion style enabled, this prevents displaying +\"/\" as the common substring suffix when all completion candidate end +in \"/\" (that was the only dispay prior to Emacs 31)." + :version "31.1" + :type 'boolean) + (defun completion-pcm--merge-completions (strs pattern) "Extract the commonality in STRS, with the help of PATTERN. PATTERN can contain strings and symbols chosen among `star', `any', `poin= t', @@ -4622,7 +4630,9 @@ completion-pcm--merge-completions (mapcar (lambda (str) (substring str skip= )) comps)))))) (cl-assert (stringp suffix)) - (unless (equal suffix "") + (unless (if completion-/-not-common-suffix + (member suffix '("" "/")) + (equal suffix "")) (push suffix res)))) ;; We pushed these wildcards on RES, so we're done with= them. (setq wildcards nil)) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 18 08:17:57 2025 Received: (at 77718) by debbugs.gnu.org; 18 Jun 2025 12:17:57 +0000 Received: from localhost ([127.0.0.1]:48455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uRrjn-0000Vd-HW for submit@debbugs.gnu.org; Wed, 18 Jun 2025 08:17:57 -0400 Received: from server.qxqx.de ([2a01:4f8:c012:9177::1]:40513 helo=mail.qxqx.de) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uRrjk-0000UF-Jn for 77718@debbugs.gnu.org; Wed, 18 Jun 2025 08:17:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uYSmxkryTuv+C3jdTMqlDoUjqRcgtKJmj9L3e20v9h0=; b=eV8eRM/3tUqnkQt1xmug1n/vcp KfeSVkI6PVkJ3lYierrC+MWUNzy1eBpE9jYLrFKxBXsDhvfbnb98bkiM9xjf0axhL3iJDveXc5IG1 D6Ow+uyWDcUGAz4ZqsRGcQ2vmI4PnyZqdcjjSK4kM7Tuuxxsqd+mPY0QpFJNa3WrqmOk=; From: Daniel Mendler To: Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: <875xgtdzrh.fsf@gmx.net> References: <87y0w7ejxy.fsf@gmx.net> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> <87o6wbp4h7.fsf@gmx.net> <87cybm2zu9.fsf@gmx.net> <87ecviolhk.fsf@gmx.net> <87zfe6mklr.fsf@gmx.net> <87ldpqm0s0.fsf@gmx.net> <875xgtdzrh.fsf@gmx.net> Date: Wed, 18 Jun 2025 14:17:43 +0200 Message-ID: <87ldppdz14.fsf@daniel-mendler.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77718 Cc: Spencer Baugh , Eli Zaretskii , Stephen Berman , Stefan Monnier , 77718@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > On Wed, 18 Jun 2025 01:00:31 +0200 Stephen Berman wrote: > >> On Tue, 17 Jun 2025 15:26:36 -0400 Spencer Baugh wrote: >> >>> Stephen Berman writes: >>> >>>> On Tue, 17 Jun 2025 10:59:56 -0400 Spencer Baugh wrote: >> [...] >>> This is the behavior of the substring completion style. When there's a >>> common substring between all the completions, >>> completion-substring-try-completion inserts that substring. Since the >>> substring is a common suffix, it positions point before that common >>> suffix. >> [...] >>> To have only "substring" configured as a completion style implies you >>> want the behavior of the "substring" completion style, and only that >>> behavior. You are indeed getting that behavior. What's the problem? >>> substring has always behaved like this, so improved consistency in edge >>> cases like this one should not be a surprise. >> >> You may consider this an edge case, but it is proof that the substring >> style has not "always behaved like this". I don't recall that the goal >> of "improved consistency in edge cases" was previously cited in this >> thread; if it had been, I might have viewed the issue in a different >> light, though I still find the current behavior problematic... >> >>> Is there some problem with this behavior, some reason it doesn't work >>> right for you? A more concrete complaint about what doesn't work would >>> be helpful. >> >> ...to wit: >> >> Before your change, when using substring style, typing `C-x d /us TAB >> TAB' completes to "/usr/" and pops up the *Completions* buffer. If I >> want to change the input, e.g. to "/var/", I can type `M-DEL va TAB'. >> >> After your change, when using substring style, typing `C-x d /us TAB >> TAB' completes to "/usr//" and only after typing TAB a third time does >> the *Completions* buffer pop up. If I want to change the input, typing >> `M-DEL' has no effect, though e.g. `C-f / va TAB' works (the minibuffer >> then displays "~//usr//var/" with "~//usr/" in file-name-shadow face). >> It works, but it's a bit more cumbersome than previously (an extra TAB >> to get the *Completions* buffer) and visually confusing (at least given >> familiarity with the previous behavior). >> >> And again, with my patch (posted in >> https://lists.gnu.org/archive/html/bug-gnu-emacs/2025-04/msg01860.html) >> I get the behavior and appearance I'm used to, and for my usage have >> encountered no problems with it. I ask you once again: please tell me >> specifically what problems that patch causes. > > Assuming the current behavior of substring completion in master is not a > bug/regression but the intended "improved consistency", I would like to > propose a different patch (attached) to make the completion behavior > conditional on a user option, defaulting to the current behavior in > master. Can we please avoid adding absurd user options like `completion-/-not-common-suffix'? The completion machinery is already complex with many options. Adding options for minor details does not seem like a good direction. Daniel From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 18 16:10:23 2025 Received: (at 77718) by debbugs.gnu.org; 18 Jun 2025 20:10:23 +0000 Received: from localhost ([127.0.0.1]:56176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uRz70-0004d0-I2 for submit@debbugs.gnu.org; Wed, 18 Jun 2025 16:10:22 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:25433) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uRz6x-0004c6-Id for 77718@debbugs.gnu.org; Wed, 18 Jun 2025 16:10:20 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 0C05780962; Wed, 18 Jun 2025 16:10:14 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1750277412; bh=TAMBcr2hzEOGt2UPhldHlWXI7TB2JBONqAcqZtVf2Lw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=BuQ/q1ZuoHxpzp3bVmy3OFp7ZGrFROG5AENHhm1EPmO9B7DAnBd6geTO2tp1Umz0E BEcEnFxVguyrZ8Yc98IxLde6MF9tPNYuwWyTAAj6PkHzfDPyxOOS5ilrDnafeIyIbJ C6F59N1xz3YkfG7mpZPRv0jd19yeVXTM4Ed+Qs/eWNs49NHVtejEunoUuqPenfMDIz X/+1euqXDkpElesjuYgADv2bPE2LTVXe+yE0n2ziehrCEE3rvbryvaoJxrqy2ZJXC0 dkKGbEPOhoDX7wBcztAJ/Eu7ZaySxAE1YvCGl/LPpBUpnxVRt4mHxvnnYqfg5o6/lt s3sdSIpAMo97A== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 8C01C80925; Wed, 18 Jun 2025 16:10:12 -0400 (EDT) Received: from alfajor (modemcable005.21-80-70.mc.videotron.ca [70.80.21.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 65392120642; Wed, 18 Jun 2025 16:10:12 -0400 (EDT) From: Stefan Monnier To: Stephen Berman Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: <875xgtdzrh.fsf@gmx.net> Message-ID: References: <87y0w7ejxy.fsf@gmx.net> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> <87o6wbp4h7.fsf@gmx.net> <87cybm2zu9.fsf@gmx.net> <87ecviolhk.fsf@gmx.net> <87zfe6mklr.fsf@gmx.net> <87ldpqm0s0.fsf@gmx.net> <875xgtdzrh.fsf@gmx.net> Date: Wed, 18 Jun 2025 16:10:11 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.192 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77718 Cc: Spencer Baugh , Eli Zaretskii , 77718@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el > index 122459be062..598383e7b51 100644 > --- a/lisp/minibuffer.el > +++ b/lisp/minibuffer.el > @@ -4516,6 +4516,14 @@ completion--common-suffix > "Return the common suffix of the strings STRS." > (nreverse (try-completion "" (mapcar #'reverse strs)))) > > +(defcustom completion-/-not-common-suffix nil > + "If non-nil, ignore \"/\" as common suffix. > +With the substring completion style enabled, this prevents displaying > +\"/\" as the common substring suffix when all completion candidate end > +in \"/\" (that was the only dispay prior to Emacs 31)." > + :version "31.1" > + :type 'boolean) Like Daniel, I'd much rather find a solution that doesn't involve a user config. > (defun completion-pcm--merge-completions (strs pattern) > "Extract the commonality in STRS, with the help of PATTERN. > PATTERN can contain strings and symbols chosen among `star', `any', `point', > @@ -4622,7 +4630,9 @@ completion-pcm--merge-completions > (mapcar (lambda (str) (substring str skip)) > comps)))))) > (cl-assert (stringp suffix)) > - (unless (equal suffix "") > + (unless (if completion-/-not-common-suffix > + (member suffix '("" "/")) > + (equal suffix "")) > (push suffix res)))) > ;; We pushed these wildcards on RES, so we're done with them. > (setq wildcards nil)) Comments: - We shouldn't hardcode "/" here, since this code is not specific to file names. IOW we should use the `completion-boundaries` functionality instead to detect if the suffix is equal to the boundary separator. - Maybe we can/should limit this "/" special case to the situation where `prefix` is empty (or where the string before "suffix" also ends in a boundary-separator). Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 18 18:40:52 2025 Received: (at 77718) by debbugs.gnu.org; 18 Jun 2025 22:40:52 +0000 Received: from localhost ([127.0.0.1]:57889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uS1Sd-0003sH-T9 for submit@debbugs.gnu.org; Wed, 18 Jun 2025 18:40:52 -0400 Received: from mout.gmx.net ([212.227.17.22]:59191) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uS1Sa-0003rA-70 for 77718@debbugs.gnu.org; Wed, 18 Jun 2025 18:40:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1750286439; x=1750891239; i=stephen.berman@gmx.net; bh=oOTDAA971rIsyj/nmQVsQxbrG5KJKoKcYDuiP2QYZs8=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=pCVPO3AJOggfQoHWogCIE+cVI/5KpiiXKyuHG4wk7T7nHAPS1BNBVZjBKPEnFSYB d5TmPTZ0uSsVfjNt+v9eXeaeucUjU/NXn2+eqVPZ7ATqyivYEpC1rv6Vok0EJeMnd Vlla8Zv+lVxlvWahQmOje3dmxl9hGiwEJydJwIgTJ14JVsvyFJUBY1YJ38MF6tNrs ptcXVZHKYLGh6/cEZT57xORVWExxRPn6x5EaHkE48nlmV32iC0SNLJ3DEP19Kno+9 g1yYk9zk2F8ici6nho0V3S/coDYhhqhnYgiiCSlrCfB1NNTITezYJGgZkqFJRfouB JqHCa0CkulcdK3pepQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([88.130.50.166]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MdefJ-1v15IE2IDZ-00jPbz; Thu, 19 Jun 2025 00:40:39 +0200 From: Stephen Berman To: Stefan Monnier Subject: Re: bug#77718: 31.0.50; completion styles substring and flex are broken In-Reply-To: References: <87y0w7ejxy.fsf@gmx.net> <87v7qnp8ww.fsf@gmx.net> <87bjsbquso.fsf@gmx.net> <87o6wbp4h7.fsf@gmx.net> <87cybm2zu9.fsf@gmx.net> <87ecviolhk.fsf@gmx.net> <87zfe6mklr.fsf@gmx.net> <87ldpqm0s0.fsf@gmx.net> <875xgtdzrh.fsf@gmx.net> Date: Thu, 19 Jun 2025 00:40:37 +0200 Message-ID: <87plf0d66y.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:AREerZxbBV5MHLy/bZllsd7VS2xJVxRgJ3OSuNpn8UXWRlYwK4W Lb5t9mdkQ3rufISC4qYbJQDUAkFkIHsceaF4CY2k6k47U+GF2sBD0UpuDtK5k99hqU3SHvl /Us7cMqaG3lFPvforcBbIRq9My4pLAs62VTam4BD79dfNtAOxCJJ/eSJHAbP7Pq1a/SOQrU imsNPRAHqzRq5OL1HKCTQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:gTZJ3vYEac8=;Aa11tWxePSPA+opsiuRXsQYzl7e m5fYCn08mgfYU04Ys/fHQM50q/Xupgo0BteprDWgcmd7r0PRXtDj3198utjQHf/Da7seFeXDX Y9U2AFh8XPlNroSafTItLSRnX4z5rfTEbP+c5WnDWXY8neGj2AdGU+eDc1JNtDTVUctBIksCo b39uzOGflZrDJ7N5dEUOwoo7Iq9M5vES0eD6qtix392OVgaPBc0GqAhKUV6MklMKP/JjUtN82 Iefj+Dq2Lrea9pW/ISVgsH7oeO6LTxTZwVQCoWf8+oZi8AAQuh60IRExNJbehNQO32V6vi2WF nefYL8nNWEgu8vei/Vd1BF/0ojCULlUnruPXVShQOeOO0Kw+g6uxpMYUy14P7Hy5fGOFPb563 dXUzb5V+5zyvqOLX1naLBQUL2GM4IIf6BpcC4gl0cSm+1TfOh6av7kuzQFK2LT1CgLap4uXLT 95IUK6ylFmItk5qECosbbT9KfAKD5I3kImLYvWQsk4xO2Uj8ldricmlFN+Z6WGiAh5ExjgkRW eb8hjGpOVaz2xU4pSa/dXO59yI+0oOtyOP/bYyxdslTeHWQA4TW5KpMdACf8PH5tVMwNsB3wy EQ2sHq5Iej5vv4hk2w+elwrRrQAyT7TxZZAra7yAgrn8nVABEagk69lnk1Xw+iQx6m63MHfyO BasgjBft02AhhmXyBfLz/IE07H2c5SlZtq6YP0+GaR8qT7Q9D/tUIpCG7Zou9CbHPukO9YS6I mdaPkSmiqTpK9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0tCweEgddFD/5qPU8Cz0wh1cJzm725wAx5seHJdyfL7 I+awI+hsY34TFGrM01kZ5utKnpMtDTEdngEbv1v3/UaCT05mSfigPNwfbzznDx04asK6wc0VQ IlXxCIKVb+C8ANf3uU9nMpVf7oJElenZiic3NFUZgfdwBUr6xi6P02Kxds1RcmCl64pT1K572 iYpbvqr5fy5oKnECNHDbkJr6tSjGmlG2yUmXLgupXSCMPpvdWV84Rl2IPyHeo5BoC/yH+suGR WRnU1QH1p6cy8rdonIpnjb9yzCVNd610QMaYPfX+4MoqZKODhfxrOvHz5IquO5UdyMnH391fI 89GVNiF+a8B/fsymJ4BwFAw4f/iqHoFXkxmFevMMwaBHao6Xi4BPjdBS4xf8mhQzufiFFjsQ5 5Hytk7bnLQpOjoCv/GErc9/fXIcRyKIw6/AdBA== Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77718 Cc: Spencer Baugh , Eli Zaretskii , 77718@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Wed, 18 Jun 2025 16:10:11 -0400 Stefan Monnier wrote: >> diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el >> index 122459be062..598383e7b51 100644 >> --- a/lisp/minibuffer.el >> +++ b/lisp/minibuffer.el >> @@ -4516,6 +4516,14 @@ completion--common-suffix >> "Return the common suffix of the strings STRS." >> (nreverse (try-completion "" (mapcar #'reverse strs)))) >> =20 >> +(defcustom completion-/-not-common-suffix nil >> + "If non-nil, ignore \"/\" as common suffix. >> +With the substring completion style enabled, this prevents displaying >> +\"/\" as the common substring suffix when all completion candidate end >> +in \"/\" (that was the only dispay prior to Emacs 31)." >> + :version "31.1" >> + :type 'boolean) > > Like Daniel, I'd much rather find a solution that doesn't involve > a user config. > >> (defun completion-pcm--merge-completions (strs pattern) >> "Extract the commonality in STRS, with the help of PATTERN. >> PATTERN can contain strings and symbols chosen among `star', `any', `p= oint', >> @@ -4622,7 +4630,9 @@ completion-pcm--merge-completions >> (mapcar (lambda (str) (substring str s= kip)) >> comps)))))) >> (cl-assert (stringp suffix)) >> - (unless (equal suffix "") >> + (unless (if completion-/-not-common-suffix >> + (member suffix '("" "/")) >> + (equal suffix "")) >> (push suffix res)))) >> ;; We pushed these wildcards on RES, so we're done w= ith them. >> (setq wildcards nil)) > > Comments: > > - We shouldn't hardcode "/" here, since this code is not specific to > file names. IOW we should use the `completion-boundaries` > functionality instead to detect if the suffix is equal to the > boundary separator. > - Maybe we can/should limit this "/" special case to the situation where > `prefix` is empty (or where the string before "suffix" also ends in > a boundary-separator). Thanks for the constructive feedback. I can try and see if I can implement your suggestions, but it would probably take me some time, if I succeed at all, since I have little familiarity with the completion code, so I hope you or someone else who knows the code well is interested enough to do this. Steve Berman