diff options
| author | Eli Zaretskii | 2023-07-16 12:15:24 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2023-07-16 12:15:24 +0300 |
| commit | a65ece8b2011bd69922262a6fbcf68c2e2c2a717 (patch) | |
| tree | a4c5465c55605c7c7982c10239b5a806aa80920b | |
| parent | c5fa58cbc4a33a0a65494b9ab2e35d4f30ab849b (diff) | |
| download | emacs-a65ece8b2011bd69922262a6fbcf68c2e2c2a717.tar.gz emacs-a65ece8b2011bd69922262a6fbcf68c2e2c2a717.zip | |
Fix Wdired with relative and abbreviated file names
* lisp/wdired.el (wdired-finish-edit): Support Dired buffers where
'dired-directory' is a list made of relative or abbreviated file
names. (Bug#64606)
| -rw-r--r-- | lisp/wdired.el | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lisp/wdired.el b/lisp/wdired.el index 5c745cc9aab..7b9c75d36b1 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el | |||
| @@ -556,8 +556,24 @@ non-nil means return old filename." | |||
| 556 | ;; been modified with their new name keeping | 556 | ;; been modified with their new name keeping |
| 557 | ;; the ones that are unmodified at the same place. | 557 | ;; the ones that are unmodified at the same place. |
| 558 | (cl-loop for f in (cdr dired-directory) | 558 | (cl-loop for f in (cdr dired-directory) |
| 559 | collect (or (assoc-default f files-renamed) | 559 | collect |
| 560 | f)))))) | 560 | (or (assoc-default f files-renamed) |
| 561 | ;; F could be relative or | ||
| 562 | ;; abbreviated, whereas | ||
| 563 | ;; files-renamed always consists | ||
| 564 | ;; of absolute file names. | ||
| 565 | (let ((relative | ||
| 566 | (not (file-name-absolute-p f))) | ||
| 567 | (match | ||
| 568 | (assoc-default (expand-file-name f) | ||
| 569 | files-renamed))) | ||
| 570 | (cond | ||
| 571 | ;; If it was relative, convert | ||
| 572 | ;; the new name back to relative. | ||
| 573 | ((and match relative) | ||
| 574 | (file-relative-name match)) | ||
| 575 | (t match))) | ||
| 576 | f)))))) | ||
| 561 | ;; Re-sort the buffer. | 577 | ;; Re-sort the buffer. |
| 562 | (revert-buffer) | 578 | (revert-buffer) |
| 563 | (let ((inhibit-read-only t)) | 579 | (let ((inhibit-read-only t)) |