From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler Newsgroups: gmane.emacs.bugs Subject: bug#60264: 29.0.60; Strange file completion candidates for shadowed file paths Date: Fri, 23 Dec 2022 09:02:25 +0100 Message-ID: References: <87ili3xikc.fsf@daniel-mendler.de> <83h6xm8udx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32485"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60264@debbugs.gnu.org To: Eli Zaretskii , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 23 09:03:41 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p8d1o-0008Hs-Nr for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Dec 2022 09:03:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p8d1R-0000At-KG; Fri, 23 Dec 2022 03:03:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8d1C-00008o-Ko for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2022 03:03:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p8d1C-0000Cv-6o for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2022 03:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p8d1C-0004RT-29 for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2022 03:03:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Dec 2022 08:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60264 X-GNU-PR-Package: emacs Original-Received: via spool by 60264-submit@debbugs.gnu.org id=B60264.167178255517068 (code B ref 60264); Fri, 23 Dec 2022 08:03:02 +0000 Original-Received: (at 60264) by debbugs.gnu.org; 23 Dec 2022 08:02:35 +0000 Original-Received: from localhost ([127.0.0.1]:36802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8d0k-0004RE-OB for submit@debbugs.gnu.org; Fri, 23 Dec 2022 03:02:35 -0500 Original-Received: from server.qxqx.de ([178.63.65.180]:52105 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p8d0j-0004R4-Dv for 60264@debbugs.gnu.org; Fri, 23 Dec 2022 03:02:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: 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=SdKiXCkf2occm7p5No7EjHVa+IDtDvfiAme/fbTZpFo=; b=FUhCHzuqLQaIe/15xX0RtmHqVD Z96JO1kd0iIUjrnlL8Jf8ga428rqanLdsFHIto7IJvg03+438A+RpGqZZVRn1SAhKfDD6Aa6TsfjH SElmtrtYtAbHKcjgN6vqbCQV0i/2LUuIOAiDRgculLlfOMm0SNZKifuJdbH4FmuE/x58=; Content-Language: en-US In-Reply-To: <83h6xm8udx.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251711 Archived-At: On 12/23/22 08:13, Eli Zaretskii wrote: >> From: Daniel Mendler >> Date: Thu, 22 Dec 2022 21:57:39 +0100 >> >> 1. Start emacs -Q >> 2. C-x C-f >> 3. Delete the entire minibuffer input >> 4. Enter /etc//s >> 5. Press ? >> >> You will see candidates like etc//sbin/. The candidates can get even >> stranger. If you enter /etc//etc//etc/s then you will get candidates >> like etc//etc//etc//sbin/. I can reproduce this bug on 27 and 29. I >> haven't tried 28, but the issue should exist there too. > > I don't think it's a bug (look at what the minibuffer shows in those > cases), perhaps just a minor aesthetic thing, but I'm adding Stefan in > case he has comments. I argue that this is a bug since the etc// and etc//etc//etc strings belong to the base prefix of file path completions. The base string is basically the context of completion but should not be replicated in the candidates itself. This concept of a completion base string (or completion boundaries) is of course especially relevant for file completion where the current directory corresponds to the base. The candidates itself don't carry their path with them. Note that the content of the minibuffer is valid. The prefixes are correctly grayed out. These grayed out paths are called shadowed paths since they allow the user to easily switch directories. I have not mentioned this in my report, but you should see the gray out when you reproduce this. The bug is that file substitution is not applied correctly at some place within the internal file completion tables. This points to a bigger internal correctness issue. See the function `substitute-in-file-name`, which would get rid of the grayed out paths. Daniel