]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor Tramp tweaks
authorMichael Albinus <michael.albinus@gmx.de>
Sat, 17 Sep 2016 08:01:31 +0000 (10:01 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sat, 17 Sep 2016 08:01:31 +0000 (10:01 +0200)
* lisp/net/tramp.el (tramp-get-buffer): Reuse connection
property "process-buffer" if already existing.
(tramp-connectable-p): Suppress debug messages.

lisp/net/tramp.el

index 0dade732c4699f55c403859516a31fdc1c82a36a..2a8a5ef15faafd4131ae077a1eaf89458a4b33ff 100644 (file)
@@ -1314,7 +1314,11 @@ necessary only.  This function will be used in file name completion."
   "Get the connection buffer to be used for VEC."
   (or (get-buffer (tramp-buffer-name vec))
       (with-current-buffer (get-buffer-create (tramp-buffer-name vec))
-       (tramp-set-connection-property vec "process-buffer" nil)
+       ;; We use existence of connection property "process-buffer" as
+       ;; indication, whether a connection is active.
+       (tramp-set-connection-property
+        vec "process-buffer"
+        (tramp-get-connection-property vec "process-buffer" nil))
        (setq buffer-undo-list t)
        (setq default-directory
              (tramp-make-tramp-file-name
@@ -2284,11 +2288,12 @@ should never be set globally, the intention is to let-bind it.")
   "Check, whether it is possible to connect the remote host w/o side-effects.
 This is true, if either the remote host is already connected, or if we are
 not in completion mode."
-  (and (tramp-tramp-file-p filename)
-       (or (not (tramp-completion-mode-p))
-          (tramp-compat-process-live-p
-           (tramp-get-connection-process
-            (tramp-dissect-file-name filename))))))
+  (let (tramp-verbose)
+    (and (tramp-tramp-file-p filename)
+        (or (not (tramp-completion-mode-p))
+            (tramp-compat-process-live-p
+             (tramp-get-connection-process
+              (tramp-dissect-file-name filename)))))))
 
 (defun tramp-completion-handle-expand-file-name (name &optional dir)
   "Like `expand-file-name' for Tramp files."