Subject: Re: bug#71401: dired-async-mode breaks dired-vc-rename-file

From: Thierry Volpiatto <[email-masked]>
Date: Mon, 17 Jun 2024 05:49:30 +0000

Juri Linkov <[email-masked]> writes:

> tags 71401 wontfix
> close 71401 30.0.50
> thanks
>
>>> **** Title
>>> dired-async-mode breaks dired-vc-rename-file
>>>
>>> **** Description
>>> If dired-vc-rename-file is t and dired-async-mode is enabled, then
>>> renaming a version controlled file such that the version control
>>> software is aware of it will fail.
>>>
>>> **** Environment
>>> Emacs 29.3
>>>
>>> **** Steps to Reproduce
>>> 1. Set dired-vc-rename-file to t
>>> 2. Enable dired-async-mode.
>>> 3. With a git repo, rename a file via Dired.
>>>
>>> **** Expected Result
>>> The renamed file should be reflected in git.
>>>
>>> **** Actual Result
>>> The file is renamed and considered deleted by git.
>>
>> Juri, could you please look into this?
>
> It took me a while to find that dired-async-mode is implemented
> in the package emacs-async.  Then tried to rename with Wdired,
> and it works.  Then tried to rename with R, and it fails with:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   make-process(:name "emacs" :buffer #<buffer *emacs*> :stderr #<buffer *emacs:err*> ...
>   async-start-process("emacs" ...
>   apply(async-start-process "emacs" ...
>   async-start((lambda nil (require 'cl-lib) (require 'dired-aux) ...
>   dired-async-create-files(dired-rename-file "Move" ...
>   dired-async--smart-create-files(...
>   dired-create-files(dired-rename-file "Move" ...
>   dired-do-create-files(move dired-rename-file "Move" nil t "Rename")
>   dired-do-rename(nil)
>   funcall-interactively(dired-do-rename nil)
>   command-execute(dired-do-rename)
>
> Then noticed that this backtrace doesn't include the function
> that uses dired-vc-rename-file.  So I disabled dired-vc-rename-file,
> and got the same error.
>
> This means that the bug is not in Emacs and should be reported to the
> maintainers of the emacs-async package.

The error is coming from emacs --batch -l nil ....
which result in (wrong-type-argument stringp nil).
My guess is that you installed async and dired-async by manually loading
the files without adding the directory to load-path, so (locate-library
"async") returns nil.
If you install properly the async package you will have no error
either with dired-vc-rename-file enabled or not.

-- 
Thierry