[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra 69dbbf6 056/395: ivy.el (ivy--tramp-candidate
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra 69dbbf6 056/395: ivy.el (ivy--tramp-candidates): Extract |
Date: |
Thu, 25 Feb 2021 08:31:30 -0500 (EST) |
branch: externals/ivy-hydra
commit 69dbbf6e92ff23d5276e083128955aa386c97a47
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
ivy.el (ivy--tramp-candidates): Extract
---
ivy.el | 45 ++++++++++++++++++++++++---------------------
1 file changed, 24 insertions(+), 21 deletions(-)
diff --git a/ivy.el b/ivy.el
index 40b0241..37e92a0 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1004,6 +1004,29 @@ contains a single candidate.")
((string= input "/sudo::")
(concat input ivy--directory))))
+(defun ivy--tramp-candidates ()
+ (let ((method (match-string 1 ivy-text))
+ (user (match-string 2 ivy-text))
+ (rest (match-string 3 ivy-text))
+ res)
+ (dolist (x (tramp-get-completion-function method))
+ (setq res (append res (funcall (car x) (cadr x)))))
+ (setq res (delq nil res))
+ (when user
+ (dolist (x res)
+ (setcar x user)))
+ (setq res (delete-dups res))
+ (let* ((old-ivy-last ivy-last)
+ (enable-recursive-minibuffers t)
+ (host (let ((ivy-auto-select-single-candidate nil))
+ (ivy-read "user@host: "
+ (mapcar #'ivy-build-tramp-name res)
+ :initial-input rest))))
+ (setq ivy-last old-ivy-last)
+ (when host
+ (setq ivy--directory "/")
+ (ivy--cd (concat "/" method ":" host ":"))))))
+
(defun ivy--directory-done ()
"Handle exit from the minibuffer when completing file names."
(let ((dir (ivy--handle-directory ivy-text)))
@@ -1028,27 +1051,7 @@ contains a single candidate.")
(string-match-p "\\`/[^/]+:.*:.*\\'" ivy-text))
(ivy-done))
((ivy--tramp-prefix-p)
- (let ((method (match-string 1 ivy-text))
- (user (match-string 2 ivy-text))
- (rest (match-string 3 ivy-text))
- res)
- (dolist (x (tramp-get-completion-function method))
- (setq res (append res (funcall (car x) (cadr x)))))
- (setq res (delq nil res))
- (when user
- (dolist (x res)
- (setcar x user)))
- (setq res (delete-dups res))
- (let* ((old-ivy-last ivy-last)
- (enable-recursive-minibuffers t)
- (host (let ((ivy-auto-select-single-candidate nil))
- (ivy-read "user@host: "
- (mapcar #'ivy-build-tramp-name res)
- :initial-input rest))))
- (setq ivy-last old-ivy-last)
- (when host
- (setq ivy--directory "/")
- (ivy--cd (concat "/" method ":" host ":"))))))
+ (ivy--tramp-candidates))
(t
(ivy-done)))))
- [elpa] externals/ivy-hydra 51430ff 233/395: counsel.el: Fix candidate splitting when eol is CR or CRLF, (continued)
- [elpa] externals/ivy-hydra 51430ff 233/395: counsel.el: Fix candidate splitting when eol is CR or CRLF, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 04ca164 275/395: ivy-resume: resume buffer for counsel-grep, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 7dd6bfc 287/395: ivy.el (ivy-read): Document :extra-props as a plist, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 3e281d0 315/395: ivy-test.el (counsel-find-file-single-match-directories): Add test, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra d3e14db 303/395: ivy.el (ivy--call-marked): Fix :multi-action with alist collection, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 031ed58 331/395: ivy.el (ivy-call): Remove redundant cond branch, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 453f510 306/395: * ivy-test.el (ivy-avy): Fix skip condition., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 1bf7f91 018/395: counsel.el (counsel--preselect-file): Do not pre-select URL., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 256deea 019/395: swiper.el (swiper--isearch-format): Prepend swiper-line-face property, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 249ccc6 041/395: ivy.el (ivy--split): Re-write, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 69dbbf6 056/395: ivy.el (ivy--tramp-candidates): Extract,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra 95d557b 070/395: swiper.el (swiper-query-replace): Add a more straightforward default, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra e3fc84f 104/395: counsel.el (counsel--git-grep-occur-cmd): Simplify, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra a159810 120/395: counsel-recentf: Sort by access time when including XDG list., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8dba6ff 115/395: ivy-test.el (swiper-query-replace): Add test, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra aefd669 114/395: swiper.el (swiper-query-replace): Fix for ivy--regex-ignore-order, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 9fd766d 122/395: counsel.el (counsel-evil-register-face): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 47bd7b1 119/395: Handle case correctly in `counsel-grep-like-occur', Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra e860b11 116/395: ivy.el (ivy--resize-minibuffer-to-fit): Fix "M-o" not showing the list of actions, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 068ed9c 131/395: counsel-kmacro: Clarify Emacs's behavior regarding counter initial values., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 56807a1 134/395: counsel.el (counsel-recentf): Add "d" action, Basil L. Contovounesios, 2021/02/25