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

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

[elpa] master 3de074a 049/399: counsel.el (counsel-find-file-copy): Add


From: Oleh Krehel
Subject: [elpa] master 3de074a 049/399: counsel.el (counsel-find-file-copy): Add and bind.
Date: Sat, 20 Jul 2019 14:56:46 -0400 (EDT)

branch: master
commit 3de074a612326ea7b9967ac899151392934b9e50
Author: Brian Leung <address@hidden>
Commit: Oleh Krehel <address@hidden>

    counsel.el (counsel-find-file-copy): Add and bind.
    
    Fixes #1955
---
 counsel.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/counsel.el b/counsel.el
index 349762b..9706ade 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1815,6 +1815,16 @@ choose between `yes-or-no-p' and `y-or-n-p'; otherwise 
default to
              #'yes-or-no-p)
            (apply #'format fmt args)))
 
+(defun counsel-find-file-copy (x)
+  "Copy file X."
+  (ivy-read "Copy file to: " #'read-file-name-internal
+            :matcher #'counsel--find-file-matcher
+            :action (lambda (new-name)
+                      (require 'dired-aux)
+                      (dired-copy-file x new-name 1))
+            :keymap counsel-find-file-map
+            :caller 'counsel-find-file-copy))
+
 (defun counsel-find-file-delete (x)
   "Delete file X."
   (when (or delete-by-moving-to-trash
@@ -1846,6 +1856,7 @@ choose between `yes-or-no-p' and `y-or-n-p'; otherwise 
default to
    ("x" counsel-find-file-extern "open externally")
    ("r" counsel-find-file-as-root "open as root")
    ("k" counsel-find-file-delete "delete")
+   ("c" counsel-find-file-copy "copy file")
    ("m" counsel-find-file-move "move or rename")
    ("d" counsel-find-file-mkdir-action "mkdir")))
 



reply via email to

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