emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 ac0a82ea987: Fix Tramp mount-spec (don't merge)


From: Michael Albinus
Subject: emacs-29 ac0a82ea987: Fix Tramp mount-spec (don't merge)
Date: Mon, 26 Jun 2023 06:41:17 -0400 (EDT)

branch: emacs-29
commit ac0a82ea987cf6831216b1b9202f221ddd350553
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>

    Fix Tramp mount-spec (don't merge)
    
    * lisp/net/tramp-fuse.el (tramp-fuse-mounted-p): The mount-spec
    could contain an optional trailing slash.  (Bug#64278)
---
 lisp/net/tramp-fuse.el | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/lisp/net/tramp-fuse.el b/lisp/net/tramp-fuse.el
index e1ad0c2e5d2..c10c715d70e 100644
--- a/lisp/net/tramp-fuse.el
+++ b/lisp/net/tramp-fuse.el
@@ -175,13 +175,24 @@ It has the same meaning as 
`remote-file-name-inhibit-cache'.")
     (or (tramp-get-file-property vec "/" "mounted")
         (let* ((default-directory tramp-compat-temporary-file-directory)
                (command (format "mount -t fuse.%s" (tramp-file-name-method 
vec)))
-              (mount (shell-command-to-string command)))
+              (mount (shell-command-to-string command))
+              (mount-spec (split-string (tramp-fuse-mount-spec vec) ":" 
'omit)))
           (tramp-message vec 6 "%s\n%s" command mount)
+         ;; The mount-spec contains a trailing local file name part,
+         ;; which might not be visible, for example with rclone
+         ;; mounts of type "memory" or "gdrive".  Make it optional.
+         (setq mount-spec
+               (if (cdr mount-spec)
+                   (tramp-compat-rx
+                    (literal (car mount-spec))
+                    ":" (? (literal (cadr mount-spec))))
+                 (car mount-spec)))
           (tramp-set-file-property
           vec "/" "mounted"
            (when (string-match
                  (tramp-compat-rx
-                  bol (group (literal (tramp-fuse-mount-spec vec))) blank)
+                  bol (group (regexp mount-spec))
+                  " on " (group (+ (not blank))) blank)
                  mount)
              (match-string 1 mount)))))))
 



reply via email to

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