emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/wfnames 6f13e86c85 48/98: Fix renaming directories behavio


From: ELPA Syncer
Subject: [nongnu] elpa/wfnames 6f13e86c85 48/98: Fix renaming directories behavior
Date: Tue, 8 Aug 2023 04:01:24 -0400 (EDT)

branch: elpa/wfnames
commit 6f13e86c85c6de64bf5ad5d72f5ddaa8fc5c78c2
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Fix renaming directories behavior
---
 wfnames.el | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/wfnames.el b/wfnames.el
index 370ce104b0..d7d704e20c 100644
--- a/wfnames.el
+++ b/wfnames.el
@@ -167,22 +167,19 @@ Special commands:
                                                    (directory-file-name  
new))))
                                      (unless (file-directory-p basedir)
                                        (mkdir basedir 'parents))))
-                                 (let ((target (if (file-directory-p new)
-                                                   (file-name-as-directory new)
-                                                 new)))
-                                   (if (and ow (wfnames-ask-for-overwrite new))
-                                       (rename-file
-                                        ;; Use old temp file if it
-                                        ;; exists [1].
-                                        (or (assoc-default old delayed) old)
-                                        target ow)
-                                     (and ow (cl-incf skipped))
-                                     (and (null ow) (rename-file old target))))
+                                 (if (and ow (wfnames-ask-for-overwrite new))
+                                     (rename-file
+                                      ;; Use old temp file if it
+                                      ;; exists [1].
+                                      (or (assoc-default old delayed) old)
+                                      new ow)
+                                   (and ow (cl-incf skipped))
+                                   (and (null ow) (rename-file old new)))
                                  (add-text-properties beg end `(old-name ,new))
                                  (let* ((assoc (assoc new delayed))
                                         (tmp   (cdr assoc)))
                                    ;; The temp file was created in
-                                   ;; clause 2, delete it.
+                                   ;; clause 1, delete it.
                                    (when (and tmp (file-exists-p tmp))
                                      (if (file-directory-p tmp)
                                          (delete-directory tmp t)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]