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

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

[nongnu] elpa/wfnames 2e9f34d939 20/98: Handle directories rename


From: ELPA Syncer
Subject: [nongnu] elpa/wfnames 2e9f34d939 20/98: Handle directories rename
Date: Tue, 8 Aug 2023 04:01:13 -0400 (EDT)

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

    Handle directories rename
---
 helm-edit-marked.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/helm-edit-marked.el b/helm-edit-marked.el
index 589ccdde94..f1408316f4 100644
--- a/helm-edit-marked.el
+++ b/helm-edit-marked.el
@@ -93,6 +93,8 @@ Special commands:
                                               helm-ff--edit-marked-old-files)
                                       (not (assoc new delayed)))
                                  (let ((tmpfile (make-temp-name old)))
+                                   (when (file-directory-p new)
+                                     (setq tmpfile (file-name-as-directory 
tmpfile)))
                                    (push (cons new tmpfile) delayed)
                                    (rename-file old tmpfile)
                                    (add-text-properties
@@ -104,6 +106,8 @@ Special commands:
                                 ((and (file-exists-p new)
                                       (not (assoc new delayed)))
                                  (let ((tmpfile (make-temp-name new)))
+                                   (when (file-directory-p new)
+                                     (setq tmpfile (file-name-as-directory 
tmpfile)))
                                    (push (cons new tmpfile) delayed)
                                    (rename-file new tmpfile)))
                                 ;; Now really rename files.
@@ -113,7 +117,10 @@ Special commands:
                                    (let ((basedir (helm-basedir new 'parent)))
                                      (unless (file-directory-p basedir)
                                        (mkdir basedir 'parents))))
-                                 (rename-file old new)
+                                 (rename-file
+                                  old (if (file-directory-p new)
+                                          (file-name-as-directory new)
+                                        new))
                                  (add-text-properties beg end `(old-name ,new))
                                  (let* ((assoc (assoc new delayed))
                                         (tmp   (cdr assoc)))



reply via email to

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