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

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

[elpa] master 61bb9e0 50/90: Require TRAMP in time


From: Oleh Krehel
Subject: [elpa] master 61bb9e0 50/90: Require TRAMP in time
Date: Tue, 30 Jun 2015 07:28:31 +0000

branch: master
commit 61bb9e09fd2c39c8b2f855b723a8fc9924ab9caf
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Require TRAMP in time
    
    * ivy.el (ivy-alt-done): Require tramp before use. Store `ivy-last'
      before calling `ivy-read', since each `ivy-read' overwrites
      `ivy-last', and this one overwrites `counsel-find-file' action.
    
    Fixes #145
---
 ivy.el |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/ivy.el b/ivy.el
index aaa7e11..b130ec9 100644
--- a/ivy.el
+++ b/ivy.el
@@ -298,6 +298,7 @@ When ARG is t, exit with current text, ignoring the 
candidates."
              (let ((method (match-string 1 ivy-text))
                    (user (match-string 2 ivy-text))
                    res)
+               (require 'tramp)
                (dolist (x (tramp-get-completion-function method))
                  (setq res (append res (funcall (car x) (cadr x)))))
                (setq res (delq nil res))
@@ -305,8 +306,10 @@ When ARG is t, exit with current text, ignoring the 
candidates."
                  (dolist (x res)
                    (setcar x user)))
                (setq res (cl-delete-duplicates res :test #'equal))
-               (let ((host (ivy-read "Find File: "
+               (let ((old-ivy-last ivy-last)
+                     (host (ivy-read "Find File: "
                                      (mapcar #'ivy-build-tramp-name res))))
+                 (setq ivy-last old-ivy-last)
                  (when host
                    (setq ivy--directory "/")
                    (ivy--cd (concat "/" method ":" host ":"))))))



reply via email to

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