Subject: Re: bug#40517: 28.0.50; Dired, expansion missing with local directory

From: Eli Zaretskii <[email-masked]>
Date: Thu, 09 Apr 2020 16:58:44 +0300

> Date: Thu, 9 Apr 2020 11:21:53 +0300
> From: Jean Louis <[email-masked]>
> Cc: [email-masked]
> 
> 1. I am having only 1 window, like this email being written.
> 
> 2. I do: C-x C-f to open ~/tmp
> 
> 3. There is directory ~/tmp/attachments
> 
> 4. I move cursor to the file: tmp-string-ZKE7jOO9Un located in ~/tmp
> 
> 5. I press "C" in Dired
> 
> 6. Minibuffer appears with: Copy tmp-string-ZKE7jOO9Un to: ~/tmp/
> 
> 7. If I start typing "att" from wanted "attachments" and after "at" or
>    "att" I press TAB then the minibuffer prompt will expand to:
>    ~/tmp/attachments
> 
> 8. If I delete the "~/tmp/" from minibuffer prompt, and start typing
>    "att" and press TAB, it will also expand to "attachments/" -- this
>    is desired behavior, and it does exist in Dired, I can expand file
>    names, and if I do not use full path, it will expand to local
>    default directory paths.
> 
> If I however, open 2 dired windows, one is for "~/tmp" and other for
> "~/" or any other directory, as directory does not matter here, and if
> I then delete whatever is written in the minibuffer prompt, I cannot
> expand it to local directory or file.
> 
> In my particular example, if I wish to "C" or copy file "PHOTO.jpg"
> from "~/" to "~/Media", I cannot just deleete "~/" from minibuffer
> prompt and write "Med"<TAB> to expand it to Media, in fact I can
> expand it to "attachments" which is located in "~/tmp/" or as
> "~/tmp/attachments" because other Dired window is open with "~/tmp"
> being there.

This works for me (with names of directories changed to fit my system)
as you expect.  Did you try this in "emacs -Q"?  Maybe some of your
customizations gets in the way?