wdired-do-renames: Speed up for long Emacs sessions
`dired-rename-file' calls unconditionally `dired-rename-subdir'.
The second function performs performs a loop on all the Emacs
buffers; this step is only needed if FILE is a directory (bug#32899).
In a long lived Emacs session, this can make a difference
when renaming a bunch of files with `wdired'.
For instance, in my 40 days old Emacs session, with ~ 700 buffers,
this patch increases the speed to rename 2000 files a factor ~ 15.
* lisp/dired-aux.el (dired-rename-file): Call `dired-rename-subdir'
iif FILE is a directory. Add docstring.
(dired-rename-subdir, dired-remove-entry)
(dired-remove-file): Add docstring.
(dired-remove-entry): Move definition into `dired.el'.
* lisp/wdired.el (wdired-do-renames): Use a progress-reporter.
* lisp/dired.el (dired-delete-entry):
Use `dired-remove-entry'. Add docstring.
(dired-buffers-for-dir, dired-fun-in-all-buffers):
Change comment into docstring.
(dired-fun-in-all-buffers): Prefer `when' and `push' here.