[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 62a2c7e 195/399: counsel.el (counsel-find-file): Improve c
From: |
Oleh Krehel |
Subject: |
[elpa] master 62a2c7e 195/399: counsel.el (counsel-find-file): Improve copy and move actions |
Date: |
Sat, 20 Jul 2019 14:57:22 -0400 (EDT) |
branch: master
commit 62a2c7ed34df2d7f0f63d1d44fdad926c10bc4bc
Author: Eric Danan <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-find-file): Improve copy and move actions
Start the new filename completion from the directory of the file to
copy or move instead of the initial directory from which
counsel-find-file was called. Also adapt the prompt to the action (was
not the case for the copy action).
Fixes #2053
---
counsel.el | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/counsel.el b/counsel.el
index a7b5343..fc44e31 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1747,11 +1747,12 @@ choose between `yes-or-no-p' and `y-or-n-p'; otherwise
default to
(defun counsel-find-file-copy (x)
"Copy file X."
- (let ((ivy-inhibit-action
- (lambda (new-name)
- (require 'dired-aux)
- (dired-copy-file x new-name 1))))
- (counsel-find-file)))
+ (require 'dired-aux)
+ (counsel--find-file-1 "Copy file to: "
+ ivy--directory
+ (lambda (new-name)
+ (dired-copy-file x new-name 1))
+ 'counsel-find-file-copy))
(defun counsel-find-file-delete (x)
"Delete file X."
@@ -1767,13 +1768,12 @@ choose between `yes-or-no-p' and `y-or-n-p'; otherwise
default to
(defun counsel-find-file-move (x)
"Move or rename file X."
- (ivy-read "Rename file to: " #'read-file-name-internal
- :matcher #'counsel--find-file-matcher
- :action (lambda (new-name)
- (require 'dired-aux)
- (dired-rename-file x new-name 1))
- :keymap counsel-find-file-map
- :caller 'counsel-find-file-move))
+ (require 'dired-aux)
+ (counsel--find-file-1 "Rename file to: "
+ ivy--directory
+ (lambda (new-name)
+ (dired-rename-file x new-name 1))
+ 'counsel-find-file-move))
(defun counsel-find-file-mkdir-action (_x)
"Create a directory from `ivy-text'."
- [elpa] master 80d9c17 188/399: Makefile: Clone tests/ if needed, (continued)
- [elpa] master 80d9c17 188/399: Makefile: Clone tests/ if needed, Oleh Krehel, 2019/07/20
- [elpa] master 6516265 192/399: ivy-overlay.el: Do not assume in-buffer completion, Oleh Krehel, 2019/07/20
- [elpa] master 6263d04 193/399: counsel.el (counsel-find-file): Improve mkdir action with ivy-call, Oleh Krehel, 2019/07/20
- [elpa] master 31e57e7 181/399: ivy-test.el (counsel-find-file-with-dotfiles): Disable for older Emacs, Oleh Krehel, 2019/07/20
- [elpa] master f52b0ac 175/399: ivy.el (ivy--filter): Don't cache if ivy--old-cands is empty, Oleh Krehel, 2019/07/20
- [elpa] master 2221a5c 177/399: ivy-test.el (counsel-find-file-with-dotfiles): Add test, Oleh Krehel, 2019/07/20
- [elpa] master 0467f5b 191/399: doc/ivy.org: Correct typo, Oleh Krehel, 2019/07/20
- [elpa] master e3f8908 186/399: ivy-test.el: Make friendlier, Oleh Krehel, 2019/07/20
- [elpa] master 891be1d 199/399: counsel.el (counsel-org-file): Handle ATTACH_DIR property, Oleh Krehel, 2019/07/20
- [elpa] master 4f12a59 196/399: counsel.el (counsel-find-file-mkdir-action): Add trailing "/", Oleh Krehel, 2019/07/20
- [elpa] master 62a2c7e 195/399: counsel.el (counsel-find-file): Improve copy and move actions,
Oleh Krehel <=
- [elpa] master d8136a2 200/399: doc/ivy.org: Remove outdated magit customization, Oleh Krehel, 2019/07/20
- [elpa] master ca8d5ba 197/399: ivy.el (ivy-partial): Adjust ivy-tab-space when one candidate, Oleh Krehel, 2019/07/20
- [elpa] master f28e00c 194/399: counsel.el (counsel-find-file): Improve delete action with ivy-call, Oleh Krehel, 2019/07/20
- [elpa] master afeda97 198/399: counsel.el (counsel-company): Add :caller, Oleh Krehel, 2019/07/20
- [elpa] master 3b25d30 206/399: counsel.el (counsel-compile): Add predicate to counsel-compile-env, Oleh Krehel, 2019/07/20
- [elpa] master 3d0887f 204/399: counsel.el (counsel-compile): Add counsel-compile-env, Oleh Krehel, 2019/07/20
- [elpa] master 605cee0 202/399: counsel.el (counsel-compile): Fix saving of blddir, Oleh Krehel, 2019/07/20
- [elpa] master c9f2318 203/399: counsel.el (counsel-compile): Add helper for formatting text, Oleh Krehel, 2019/07/20
- [elpa] master 276599c 201/399: doc/ivy.texi: Generate from doc/ivy.org, Oleh Krehel, 2019/07/20
- [elpa] master 3f27e25 207/399: counsel.el (counsel-compile): Don't squash default-directory, Oleh Krehel, 2019/07/20