diff options
Diffstat (limited to 'lisp/net/tramp-fuse.el')
-rw-r--r-- | lisp/net/tramp-fuse.el | 62 |
1 files changed, 36 insertions, 26 deletions
diff --git a/lisp/net/tramp-fuse.el b/lisp/net/tramp-fuse.el index c10c715d70e..e4610b069ad 100644 --- a/lisp/net/tramp-fuse.el +++ b/lisp/net/tramp-fuse.el @@ -97,23 +97,29 @@ (with-tramp-file-property v localname "file-executable-p" (file-executable-p (tramp-fuse-local-file-name filename))))) +(defun tramp-fuse-handle-file-exists-p (filename) + "Like `file-exists-p' for Tramp files." + (tramp-skeleton-file-exists-p filename + (file-exists-p (tramp-fuse-local-file-name filename)))) + (defun tramp-fuse-handle-file-name-all-completions (filename directory) "Like `file-name-all-completions' for Tramp files." (tramp-fuse-remove-hidden-files - (all-completions - filename - (delete-dups - (append - (file-name-all-completions - filename (tramp-fuse-local-file-name directory)) - ;; Some storage systems do not return "." and "..". - (let (result) - (dolist (item '(".." ".") result) - (when (string-prefix-p filename item) - (catch 'match - (dolist (elt completion-regexp-list) - (unless (string-match-p elt item) (throw 'match nil))) - (setq result (cons (concat item "/") result))))))))))) + (tramp-compat-ignore-error file-missing + (all-completions + filename + (delete-dups + (append + (file-name-all-completions + filename (tramp-fuse-local-file-name directory)) + ;; Some storage systems do not return "." and "..". + (let (result) + (dolist (item '(".." ".") result) + (when (string-prefix-p filename item) + (catch 'match + (dolist (elt completion-regexp-list) + (unless (string-match-p elt item) (throw 'match nil))) + (setq result (cons (concat item "/") result)))))))))))) ;; This function isn't used. (defun tramp-fuse-handle-insert-directory @@ -146,23 +152,24 @@ (format "%s@%s:/" user host) (format "%s:/" host))) -(defun tramp-fuse-mount-point (vec) - "Return local mount point of VEC." - (or (tramp-get-connection-property vec "mount-point") - (expand-file-name - (concat - tramp-temp-name-prefix - (tramp-file-name-method vec) "." - (when (tramp-file-name-user vec) - (concat (tramp-file-name-user-domain vec) "@")) - (tramp-file-name-host-port vec)) - tramp-compat-temporary-file-directory))) - (defconst tramp-fuse-mount-timeout (eval (car (get 'remote-file-name-inhibit-cache 'standard-value)) t) "Time period to check whether the mount point still exists. It has the same meaning as `remote-file-name-inhibit-cache'.") +(defun tramp-fuse-mount-point (vec) + "Return local mount point of VEC." + (let ((remote-file-name-inhibit-cache tramp-fuse-mount-timeout)) + (or (tramp-get-file-property vec "/" "mount-point") + (expand-file-name + (concat + tramp-temp-name-prefix + (tramp-file-name-method vec) "." + (when (tramp-file-name-user vec) + (concat (tramp-file-name-user-domain vec) "@")) + (tramp-file-name-host-port vec)) + tramp-compat-temporary-file-directory)))) + (defun tramp-fuse-mounted-p (vec) "Check, whether fuse volume determined by VEC is mounted." ;; Remember the mount status by using a file property on "/", @@ -194,6 +201,8 @@ It has the same meaning as `remote-file-name-inhibit-cache'.") bol (group (regexp mount-spec)) " on " (group (+ (not blank))) blank) mount) + (tramp-set-file-property + vec "/" "mount-point" (match-string 2 mount)) (match-string 1 mount))))))) (defun tramp-fuse-get-fusermount () @@ -213,6 +222,7 @@ It has the same meaning as `remote-file-name-inhibit-cache'.") (command (format "%s -u %s" (tramp-fuse-get-fusermount) mount-point))) (tramp-message vec 6 "%s\n%s" command (shell-command-to-string command)) (tramp-flush-file-property vec "/" "mounted") + (tramp-flush-file-property vec "/" "mount-point") (setq tramp-fuse-mount-points (delete (tramp-file-name-unify vec) tramp-fuse-mount-points)) ;; Give the caches a chance to expire. |