summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-rclone.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2019-09-12 16:38:48 +0200
committerMichael Albinus <michael.albinus@gmx.de>2019-09-12 16:38:48 +0200
commit5e8d477d63496ada8eb2c42d23735df0cf05ee2d (patch)
treeb19e6b55d6f371644e24fc3be57ebaaa1b1795f1 /lisp/net/tramp-rclone.el
parent997415504c37b4dc1f486b9d9925c4e16ade015c (diff)
downloademacs-5e8d477d63496ada8eb2c42d23735df0cf05ee2d.tar.gz
Optimize host name completion in Tramp
* lisp/net/tramp-adb.el (tramp-adb-maybe-open-connection): * lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection): * lisp/net/tramp-rclone.el (tramp-rclone-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-maybe-open-connection): * lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-maybe-open-connection): Throw `non-essential' at the beginning of the function. * lisp/net/tramp.el (tramp-handle-file-exists-p): * lisp/net/tramp-sh.el (tramp-sh-handle-file-exists-p): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-exists-p): Run only when host is connectable. This is due to host name completion, which shall be optimized. * lisp/net/tramp-smb.el (tramp-smb-do-file-attributes-with-stat) (tramp-smb-get-file-entries): Access connection buffer only after sending the command. * lisp/net/tramp.el (tramp-get-buffer, tramp-get-connection-buffer): New argument DONT-CREATE. (tramp-message): Use it. (tramp-get-mutex): Check, whether host is connectable. (tramp-file-name-handler): Set thread only when host is connectable. (tramp-connectable-p): Allow also VEC as argument. (tramp-completion-handle-file-name-completion): Do not expand directory.
Diffstat (limited to 'lisp/net/tramp-rclone.el')
-rw-r--r--lisp/net/tramp-rclone.el13
1 files changed, 4 insertions, 9 deletions
diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el
index 866e7791bf8..1f0c7eadbc5 100644
--- a/lisp/net/tramp-rclone.el
+++ b/lisp/net/tramp-rclone.el
@@ -520,19 +520,14 @@ file names."
"Maybe open a connection VEC.
Does not do anything if a connection is already open, but re-opens the
connection if a previous connection has died for some reason."
+ ;; During completion, don't reopen a new connection.
+ (unless (tramp-connectable-p vec)
+ (throw 'non-essential 'non-essential))
+
(let ((host (tramp-file-name-host vec)))
(when (rassoc `(,host) (tramp-rclone-parse-device-names nil))
(if (zerop (length host))
(tramp-error vec 'file-error "Storage %s not connected" host))
-
- ;; During completion, don't reopen a new connection. We check
- ;; this for the process related to `tramp-buffer-name';
- ;; otherwise `start-file-process' wouldn't run ever when
- ;; `non-essential' is non-nil.
- (when (and (tramp-completion-mode-p)
- (null (get-process (tramp-buffer-name vec))))
- (throw 'non-essential 'non-essential))
-
;; We need a process bound to the connection buffer. Therefore,
;; we create a dummy process. Maybe there is a better solution?
(unless (get-buffer-process (tramp-get-connection-buffer vec))