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

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

[elpa] master 1220781 131/348: counsel.el (counsel-find-file): Speed up


From: Oleh Krehel
Subject: [elpa] master 1220781 131/348: counsel.el (counsel-find-file): Speed up opening remotes
Date: Sat, 8 Apr 2017 11:03:42 -0400 (EDT)

branch: master
commit 1220781cb24fab9bb5918984c3679be64ad1f109
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    counsel.el (counsel-find-file): Speed up opening remotes
---
 counsel.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/counsel.el b/counsel.el
index 9101d03..f767fbf 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1306,6 +1306,9 @@ Skip some dotfiles unless `ivy-text' requires them."
 
 (declare-function ffap-guesser "ffap")
 
+(defvar counsel-find-file-speedup-remote t
+  "Speed up opening remote files by disabling `find-file-hook' for them.")
+
 ;;;###autoload
 (defun counsel-find-file (&optional initial-input)
   "Forward to `find-file'.
@@ -1317,7 +1320,12 @@ When INITIAL-INPUT is non-nil, use it in the minibuffer 
during completion."
             :action
             (lambda (x)
               (with-ivy-window
-                (find-file (expand-file-name x ivy--directory))))
+                (let ((find-file-hook (if (and
+                                           counsel-find-file-speedup-remote
+                                           (file-remote-p ivy--directory))
+                                          nil
+                                        find-file-hook)))
+                  (find-file (expand-file-name x ivy--directory)))))
             :preselect (when counsel-find-file-at-point
                          (require 'ffap)
                          (let ((f (ffap-guesser)))



reply via email to

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