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

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

[elpa] externals/async dea9627 31/60: Merge pull request #87 from darkfe


From: Stefan Monnier
Subject: [elpa] externals/async dea9627 31/60: Merge pull request #87 from darkfeline/async
Date: Tue, 8 Oct 2019 10:11:32 -0400 (EDT)

branch: externals/async
commit dea9627e64465678024262d8b92453e2cc0f5d47
Merge: 87853ae afe10c4
Author: John Wiegley <address@hidden>
Commit: GitHub <address@hidden>

    Merge pull request #87 from darkfeline/async
    
    Add one-shot dired-async commands
---
 dired-async.el | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/dired-async.el b/dired-async.el
index 485786c..5428206 100644
--- a/dired-async.el
+++ b/dired-async.el
@@ -362,6 +362,39 @@ ESC or `q' to not overwrite any of the remaining files,
           (ad-deactivate 'dired-create-files)
           (ad-deactivate 'wdired-do-renames))))
 
+(defmacro dired-async--with-async-create-files (&rest body)
+  "Evaluate BODY with ‘dired-create-files’ set to ‘dired-async-create-files’."
+  (declare (indent 0))
+  `(cl-letf (((symbol-function 'dired-create-files) 
#'dired-async-create-files))
+     ,@body))
+
+;;;###autoload
+(defun dired-async-do-copy (&optional arg)
+  "Run ‘dired-do-copy’ asynchronously."
+  (interactive "P")
+  (dired-async--with-async-create-files
+    (dired-do-copy arg)))
+
+;;;###autoload
+(defun dired-async-do-symlink (&optional arg)
+  "Run ‘dired-do-symlink’ asynchronously."
+  (interactive "P")
+  (dired-async--with-async-create-files
+    (dired-do-symlink arg)))
+
+;;;###autoload
+(defun dired-async-do-hardlink (&optional arg)
+  "Run ‘dired-do-hardlink’ asynchronously."
+  (interactive "P")
+  (dired-async--with-async-create-files
+    (dired-do-hardlink arg)))
+
+;;;###autoload
+(defun dired-async-do-rename (&optional arg)
+  "Run ‘dired-do-rename’ asynchronously."
+  (interactive "P")
+  (dired-async--with-async-create-files
+    (dired-do-rename arg)))
 
 (provide 'dired-async)
 



reply via email to

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