unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Mendler <mail@daniel-mendler.de>
To: Eli Zaretskii <eliz@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 60264@debbugs.gnu.org
Subject: bug#60264: 29.0.60; Strange file completion candidates for shadowed file paths
Date: Fri, 23 Dec 2022 09:02:25 +0100	[thread overview]
Message-ID: <a44aa159-fb80-d4b9-6185-cdbb153bd2ec@daniel-mendler.de> (raw)
In-Reply-To: <83h6xm8udx.fsf@gnu.org>



On 12/23/22 08:13, Eli Zaretskii wrote:
>> From: Daniel Mendler <mail@daniel-mendler.de>
>> 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





  reply	other threads:[~2022-12-23  8:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22 20:57 bug#60264: 29.0.60; Strange file completion candidates for shadowed file paths Daniel Mendler
2022-12-23  7:13 ` Eli Zaretskii
2022-12-23  8:02   ` Daniel Mendler [this message]
2022-12-23 14:08   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-23 17:38     ` Gregory Heytings
2022-12-27  0:16       ` Gregory Heytings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a44aa159-fb80-d4b9-6185-cdbb153bd2ec@daniel-mendler.de \
    --to=mail@daniel-mendler.de \
    --cc=60264@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).