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

From: Jean Louis <[email-masked]>
Date: Thu, 9 Apr 2020 11:21:53 +0300

* Eli Zaretskii <[email-masked]> [2020-04-09 09:57]:
> > From: Jean Louis <[email-masked]>
> > Date: Thu, 09 Apr 2020 07:00:29 +0200
> > 
> > If I have 2 Dired windows, when doing renaming or copy, I can use TAB
> > for expansion, and directory at other window will expand in the
> > minibuffer. For example, if I wish to move files from ~/MY-DIR to ~/OTHER-DIR
> > and other directory is showing ~/ only, I can start typing ~/O<TAB>
> > and it will expand to ~/OTHER-DIR
> > 
> > If I however, have within ~/MY-DIR another directory like
> > ~/MY-DIR/LOCAL-DIR and I remove ~/ from minibuffer, and start typing
> > LOC<TAB> it will not expand into LOCAL-DIR -- but it should in my
> > opinion.
> 
> I don't think I understand the situation, because you didn't describe
> it in enough detail.  E.g., I don't understand what you mean by "other
> directory is showing ~/ only", and how it relates to the issue at
> hand.  File-name completion doesn't depend on what is displayed in
> other windows, it only depends on what is displayed in the window
> which was the selected one when you invoked the command to copy files.
> So please consider providing a more complete recipe to reproduce the
> situation.

Correct behavior is fine in the case where I have only 1 Dired window,
here is the example:

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.

> directory is showing ~/ only", and how it relates to the issue at
> hand.  File-name completion doesn't depend on what is displayed in
> other windows, it only depends on what is displayed in the window
> which was the selected one when you invoked the command to copy
> files.

I wish it is so, yet not in this case, if there are 2 Dired windows
open, and if I delete minibuffer default prompt, like "~/" or "~/tmp"
or anything there, it is not expanding to local paths, it rather wants
to expand to local files from other Dired window, not the Dired window
from where I am beginning the operation.

Jean