]> git.eshelyaron.com Git - emacs.git/commit
Fix bugs in wdired.el involving dired-filename property
authorStephen Berman <stephen.berman@gmx.net>
Sat, 28 Jul 2018 23:14:41 +0000 (01:14 +0200)
committerStephen Berman <stephen.berman@gmx.net>
Sat, 28 Jul 2018 23:14:41 +0000 (01:14 +0200)
commit8a563d9762670e9eec9420ba2dc12075c1dd0a8c
treeca1153beee6fbec6c33fb24d02c600bb4d77d9d1
parentdb80851a1f10d73f0b2c12299c3d77716bb8425a
Fix bugs in wdired.el involving dired-filename property

After every change in wdired-mode, put the dired-filename text
property on the file name.  This ensures that changing some but not
all characters in the name succeeds with non-nil
wdired-use-interactive-rename (bug#32173) and it also ensures that
changed names can be found (e.g. by dired-isearch-filenames) while
still in wdired-mode.

* lisp/wdired.el (wdired--restore-dired-filename-prop): New function.
(wdired-change-to-wdired-mode): Add it to after-change-functions.
(wdired-change-to-dired-mode): Remove it from after-change-functions.
(wdired-finish-edit): Move invocation of
wdired-change-to-dired-mode below invocation of wdired-do-renames,
so that the latter runs wdired--restore-dired-filename-prop, but
above the invocation of revert-buffer to avoid using
wdired-revert, which changes back to wdired-mode.
(wdired-search-and-rename): Wrap renaming in unwind-protect and if
user types C-g when prompted to change the file name, make sure we
return to dired-mode.
lisp/wdired.el