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

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

[elpa] master 84b5ece 050/399: counsel.el (counsel-find-file-copy): Use


From: Oleh Krehel
Subject: [elpa] master 84b5ece 050/399: counsel.el (counsel-find-file-copy): Use ivy-inhibit-action
Date: Sat, 20 Jul 2019 14:56:47 -0400 (EDT)

branch: master
commit 84b5ece78451f1c40cff30ea25df1ceb3cb48a43
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    counsel.el (counsel-find-file-copy): Use ivy-inhibit-action
    
    Lets us re-use `counsel-find-file' without copying its code.
    
    Re #1955
---
 counsel.el | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/counsel.el b/counsel.el
index 9706ade..4f471a6 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1817,13 +1817,11 @@ choose between `yes-or-no-p' and `y-or-n-p'; otherwise 
default to
 
 (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))
+  (let ((ivy-inhibit-action
+         (lambda (new-name)
+           (require 'dired-aux)
+           (dired-copy-file x new-name 1))))
+    (counsel-find-file)))
 
 (defun counsel-find-file-delete (x)
   "Delete file X."



reply via email to

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