+2012-11-23 Juri Linkov <juri@jurta.org>
+
+ * wdired.el: Revert 2012-10-17 change partly and replace it with
+ Patch by Christopher Schmidt <christopher@ch.ristopher.com>.
+ (wdired-finish-edit): Add marks for new file names to
+ `wdired-old-marks'. Restore marks using `dired-mark-remembered'
+ after `revert-buffer'.
+ (wdired-do-renames): Remove calls to `dired-remove-file',
+ `dired-add-file', `dired-add-entry'. (Bug#11795)
+
2012-11-21 Alan Mackenzie <acm@muc.de>
* progmodes/cc-defs.el (c-version): Bump to 5.32.4.
(setq changes t)
(if (not file-new) ;empty filename!
(push file-old files-deleted)
+ (when wdired-keep-marker-rename
+ (let ((mark (cond ((integerp wdired-keep-marker-rename)
+ wdired-keep-marker-rename)
+ (wdired-keep-marker-rename
+ (cdr (assoc file-old wdired-old-marks)))
+ (t nil))))
+ (when mark
+ (push (cons (substitute-in-file-name file-new) mark)
+ wdired-old-marks))))
(push (cons file-old (substitute-in-file-name file-new))
files-renamed))))
(forward-line -1)))
(= (length files-renamed) 1))
(setq dired-directory (cdr (car files-renamed))))
;; Re-sort the buffer.
- (revert-buffer))
+ (revert-buffer)
+ (let ((inhibit-read-only t))
+ (dired-mark-remembered wdired-old-marks)))
(let ((inhibit-read-only t))
(remove-text-properties (point-min) (point-max)
'(old-name nil end-name nil old-link nil
(set-buffer-modified-p nil)
(setq buffer-undo-list nil))
-(declare-function dired-add-entry "dired-aux" (filename &optional marker-char relative))
-
(defun wdired-do-renames (renames)
"Perform RENAMES in parallel."
(let ((residue ())
(push (cons tmp file-new) residue))))
(t
(setq progress t)
- (let* ((file-ori (car rename))
- (old-mark (cdr (assoc file-ori wdired-old-marks))))
+ (let ((file-ori (car rename)))
(if wdired-use-interactive-rename
(wdired-search-and-rename file-ori file-new)
;; If dired-rename-file autoloads dired-aux while
(condition-case err
(let ((dired-backup-overwrite nil))
(dired-rename-file file-ori file-new
- overwrite)
- (dired-remove-file file-ori)
- (dired-add-file
- file-new
- (cond ((integerp wdired-keep-marker-rename)
- wdired-keep-marker-rename)
- (wdired-keep-marker-rename old-mark)
- (t nil))))
+ overwrite))
(error
(setq errors (1+ errors))
(dired-log (concat "Rename `" file-ori "' to `"
file-new "' failed:\n%s\n")
- err)
- (dired-add-entry file-ori old-mark)))))))))
+ err)))))))))
errors))