]> code.delx.au - gnu-emacs-elpa/commitdiff
Only rename buffers on rename operation (#56).
authorThierry Volpiatto <thierry.volpiatto@gmail.com>
Fri, 20 Nov 2015 07:55:12 +0000 (08:55 +0100)
committerThierry Volpiatto <thierry.volpiatto@gmail.com>
Fri, 20 Nov 2015 07:55:12 +0000 (08:55 +0100)
dired-async.el

index 6827b0f8a9f235a893fc34cce2b11ccfa26bb2da..01d1a8fa8addbc5be6160566565c123b930080d0 100644 (file)
@@ -219,10 +219,11 @@ ESC or `q' to not overwrite any of the remaining files,
       (setq callback
             `(lambda (&optional ignore)
                (dired-async-after-file-create ,(length fn-list))
-               (cl-loop for (file . to) in ',async-fn-list
-                 do (and (get-file-buffer file)
-                         (with-current-buffer (get-file-buffer file)
-                           (set-visited-file-name to nil t)))))))
+               (when (string= ,operation "rename")
+                 (cl-loop for (file . to) in ',async-fn-list
+                          do (and (get-file-buffer file)
+                                  (with-current-buffer (get-file-buffer file)
+                                    (set-visited-file-name to nil t))))))))
     ;; Handle error happening in host emacs.
     (cond
       (dired-create-files-failures