]> git.eshelyaron.com Git - emacs.git/commit
wdired-do-renames: Speed up for long Emacs sessions
authorTino Calancha <tino.calancha@gmail.com>
Fri, 4 Sep 2020 04:09:23 +0000 (06:09 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 4 Sep 2020 04:09:23 +0000 (06:09 +0200)
commit7769cad1e396c1ab68d2e6c35fc1846003b4639d
tree2d446fb8564770c343c841db979fc740a0854a5b
parent70af9a9cb914ffc276eac58b10106f9449f2544c
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.
lisp/dired-aux.el
lisp/dired.el
lisp/wdired.el