aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2018-11-26 19:48:37 +0100
committerMichael Albinus2018-11-26 19:48:37 +0100
commitf3328f995ee316cffa1a86117e6da2ba299d2c90 (patch)
tree7afac756de061eac89d7cc0da94340fe444b186d
parent82941e44f3ae58349143db5c57af91dad43c1e5e (diff)
downloademacs-f3328f995ee316cffa1a86117e6da2ba299d2c90.tar.gz
emacs-f3328f995ee316cffa1a86117e6da2ba299d2c90.zip
Rework tramp-rclone-mounted-p
* lisp/net/tramp-rclone.el (tramp-rclone-mounted-p): Rewrite. (tramp-rclone-maybe-open-connection): Set "mounted" file property.
-rw-r--r--lisp/net/tramp-rclone.el14
1 files changed, 5 insertions, 9 deletions
diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el
index 725a6f153ad..a1767ab3a16 100644
--- a/lisp/net/tramp-rclone.el
+++ b/lisp/net/tramp-rclone.el
@@ -435,15 +435,10 @@ file names."
435 435
436(defun tramp-rclone-mounted-p (vec) 436(defun tramp-rclone-mounted-p (vec)
437 "Check, whether storage system determined by VEC is mounted." 437 "Check, whether storage system determined by VEC is mounted."
438 (or 438 (with-tramp-file-property vec "/" "mounted"
439 ;; We set this property at the end of 439 (string-match
440 ;; `tramp-rclone-maybe-open-connection'. Let's use it as 440 (format "^%s:" (regexp-quote (tramp-file-name-host vec)))
441 ;; indicator. 441 (shell-command-to-string "mount"))))
442 (tramp-get-connection-property vec "uid-integer" nil)
443 ;; If it is mounted, "." is not shown. If the endpoint is not
444 ;; connected, `directory-files' returns an error.
445 (ignore-errors
446 (not (member "." (directory-files (tramp-rclone-mount-point vec)))))))
447 442
448(defun tramp-rclone-flush-mount (vec) 443(defun tramp-rclone-flush-mount (vec)
449 "Flush directory cache of VEC mount." 444 "Flush directory cache of VEC mount."
@@ -511,6 +506,7 @@ connection if a previous connection has died for some reason."
511 (tramp-compat-temporary-file-directory))) 506 (tramp-compat-temporary-file-directory)))
512 (apply 'start-process (tramp-get-connection-name vec) buf 507 (apply 'start-process (tramp-get-connection-name vec) buf
513 tramp-rclone-program (delq nil args))))) 508 tramp-rclone-program (delq nil args)))))
509 (tramp-set-file-property vec "/" "mounted" t)
514 (tramp-message 510 (tramp-message
515 vec 6 "%s" (mapconcat 'identity (process-command p) " ")) 511 vec 6 "%s" (mapconcat 'identity (process-command p) " "))
516 (process-put p 'adjust-window-size-function 'ignore) 512 (process-put p 'adjust-window-size-function 'ignore)