jwiegley / emacs-async

Simple library for asynchronous processing in Emacs
GNU General Public License v3.0
829 stars 68 forks source link

Respect `dired-create-destination-dirs` when a file name is specified #178

Closed Stebalien closed 1 year ago

Stebalien commented 1 year ago

When copying dired-create-destination-dirs is set and a file is copied/renamed (dired-do-copy, dired-do-rename) to a non-existent directory:

Error:

Copy: 1 of 1 file failed

Error: Tue May 23 09:15:25 2023 Buffer ‘*scratch*’
file-missing: (Opening output file No such file or directory /tmp/non-existent/foo)

Both work just fine when dired-async-mode is disabled.

thierryvolpiatto commented 1 year ago

Steven Allen @.***> writes:

When copying dired-create-destination-dirs is set and a file is copied/renamed (dired-do-copy, dired-do-rename) to a non-existent directory:

• When only the non-existent directory (/tmp/non-existent/) is specified, everything works. • When a non-existent directory and a filename is specified (/tmp/non-existent/foo), the copy fails.

Error:

Copy: 1 of 1 file failed Error: Tue May 23 09:15:25 2023 Buffer ‘scratch’ file-missing: (Opening output file No such file or directory /tmp/non-existent/foo)

Both work just fine when dired-async-mode is disabled.

Not for me here from emacs -Q so I guess it is an emacs bug.

NOTE: It is working fine from Helm (helm-find-files) with dired-async-mode enabled.

-- Thierry

Stebalien commented 1 year ago

Yeah, you're right. It works with emacs -Q. Now I need to figure out what's conflicting.

Thanks!

Stebalien commented 1 year ago

Nevermind, this is definitely a bug (but it may just be a bug on master):

  1. Install emacs v30.0.50 (6cb963b73c3768958e13e96b2534d1e99239a3ff).
  2. Install async.
  3. Enable dired-async-mode.
  4. Set dired-create-destination-dirs to 'ask.
  5. Open dired and run M-x dired-async-do-copy as described above.
thierryvolpiatto commented 1 year ago

Steven Allen @.***> writes:

Nevermind, this is definitely a bug (but it may just be a bug on master):

  1. Install emacs v30.0.50 (6cb963b73c3768958e13e96b2534d1e99239a3ff).
  2. Install async.
  3. Enable dired-async-mode.
  4. Set dired-create-destination-dirs to 'ask.
  5. Open dired and run M-x dired-async-do-copy as described above.

You don't have to call dired-async-do-copy when dired-async-mode is enabled, just hit "C" from a dired buffer (dired-do-copy).

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.*Message ID: @.***>

-- Thierry

thierryvolpiatto commented 1 year ago

Steven Allen @.***> writes:

Yeah, you're right. It works with emacs -Q.

I think you misundertood, I meant I CAN reproduce the bug from emacs -Q without using dired-async, only vanilla emacs dired command, it's why I suppose it is more an emacs bug than a dired-async bug. Sorry if I was unclear.

Now I need to figure out what's conflicting.

Thanks!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.*Message ID: @.***>

-- Thierry

thierryvolpiatto commented 1 year ago

I could reproduce the bug on emacs vanilla because I forgot setting dired-create-destination-dirs. So no it is not an emacs bug, it is just our version of dired-create-files was not updated to use dired-create-destination-dirs, it is now fixed, let me know if it is working for you. For when copying/renaming etc.. async from Helm I kept the behavior we always had, that is asking and we ignore dired-create-destination-dirs.

Stebalien commented 1 year ago

Everything works now. Thanks for the quick fix!