summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-gvfs.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/net/tramp-gvfs.el')
-rw-r--r--lisp/net/tramp-gvfs.el138
1 files changed, 96 insertions, 42 deletions
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 7323374c607..d44fd55b225 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -119,8 +119,6 @@
(defconst tramp-gvfs-enabled
(ignore-errors
(and (featurep 'dbusbind)
- (autoload 'zeroconf-init "zeroconf")
- (tramp-compat-funcall 'dbus-get-unique-name :system)
(tramp-compat-funcall 'dbus-get-unique-name :session)
(or (tramp-process-running-p "gvfs-fuse-daemon")
(tramp-process-running-p "gvfsd-fuse"))))
@@ -210,6 +208,27 @@ They are checked during start up via
tramp-gvfs-interface-mounttracker))
"The list of supported methods of the mount tracking interface.")
+(defconst tramp-gvfs-listmountableinfo
+ (if (member "ListMountableInfo" tramp-gvfs-methods-mounttracker)
+ "ListMountableInfo"
+ "listMountableInfo")
+ "The name of the \"listMountableInfo\" method.
+It has been changed in GVFS 1.14.")
+
+(defconst tramp-gvfs-listmounttypes
+ (if (member "ListMountTypes" tramp-gvfs-methods-mounttracker)
+ "ListMountTypes"
+ "listMountTypes")
+ "The name of the \"listMountTypes\" method.
+It has been changed in GVFS 1.14.")
+
+(defconst tramp-gvfs-mounttypes
+ (and tramp-gvfs-enabled
+ (dbus-call-method
+ :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
+ tramp-gvfs-interface-mounttracker tramp-gvfs-listmounttypes))
+ "The list of supported mount types of the mount tracking interface.")
+
(defconst tramp-gvfs-listmounts
(if (member "ListMounts" tramp-gvfs-methods-mounttracker)
"ListMounts"
@@ -233,6 +252,12 @@ It has been changed in GVFS 1.14.")
It has been changed in GVFS 1.14.")
;; <interface name='org.gtk.vfs.MountTracker'>
+;; <method name='listMountableInfo'>
+;; <arg name='mountables' type='a(ssasib)' direction='out'/>
+;; </method>
+;; <method name='listMountTypes'>
+;; <arg name='mount_types' type='as' direction='out'/>
+;; </method>
;; <method name='listMounts'>
;; <arg name='mount_info_list'
;; type='a{sosssssbay{aya{say}}ay}'
@@ -253,6 +278,13 @@ It has been changed in GVFS 1.14.")
;; </signal>
;; </interface>
;;
+;; STRUCT mountable
+;; STRING type
+;; STRING scheme
+;; ARRAY STRING scheme_aliases
+;; INT32 default_port
+;; BOOLEAN host_is_inet
+;;
;; STRUCT mount_info
;; STRING dbus_id
;; OBJECT_PATH object_path
@@ -872,6 +904,14 @@ arguments to pass to the OPERATION."
(tramp-register-foreign-file-name-handler
#'tramp-gvfs-file-name-p #'tramp-gvfs-file-name-handler)))
+;; Event type `dbus-event' is added to `while-no-input-ignore-events'
+;; in Emacs 29.1. If it is missing, some packages like Helm report
+;; problems. So we add it here.
+(when (and (featurep 'dbusbind)
+ (not (memq 'dbus-event while-no-input-ignore-events)))
+ (setq while-no-input-ignore-events
+ (cons 'dbus-event while-no-input-ignore-events)))
+
;; D-Bus helper function.
@@ -1080,7 +1120,7 @@ file names."
(goto-char (point-min))
(tramp-error-with-buffer
nil v 'file-error
- "%s failed, see buffer `%s' for details."
+ "%s failed, see buffer `%s' for details"
msg-operation (buffer-name)))
;; Some WebDAV server, like the one from QNAP, do
@@ -2144,6 +2184,18 @@ connection if a previous connection has died for some reason."
(unless (tramp-connectable-p vec)
(throw 'non-essential 'non-essential))
+ ;; Sanity check.
+ (let ((method (tramp-file-name-method vec)))
+ (unless (member
+ (or (rassoc method '(("smb" . "smb-share")
+ ("davs" . "dav")
+ ("nextcloud" . "dav")
+ ("afp". "afp-volume")
+ ("gdrive" . "google-drive")))
+ method)
+ tramp-gvfs-mounttypes)
+ (tramp-error vec 'file-error "Method `%s' not supported by GVFS" method)))
+
;; For password handling, we need a process bound to the connection
;; buffer. Therefore, we create a dummy process. Maybe there is a
;; better solution?
@@ -2487,43 +2539,45 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi."
;; Suppress D-Bus error messages and Tramp traces.
(let ((tramp-verbose 0)
tramp-gvfs-dbus-event-vector fun)
- ;; Add completion functions for services announced by DNS-SD.
- ;; See <http://www.dns-sd.org/ServiceTypes.html> for valid service types.
- (zeroconf-init tramp-gvfs-zeroconf-domain)
- (when (setq fun (or (and (zeroconf-list-service-types)
- #'tramp-zeroconf-parse-device-names)
- (and (executable-find "avahi-browse")
- #'tramp-gvfs-parse-device-names)))
- (when (member "afp" tramp-gvfs-methods)
- (tramp-set-completion-function
- "afp" `((,fun "_afpovertcp._tcp"))))
- (when (member "dav" tramp-gvfs-methods)
- (tramp-set-completion-function
- "dav" `((,fun "_webdav._tcp")
- (,fun "_webdavs._tcp"))))
- (when (member "davs" tramp-gvfs-methods)
- (tramp-set-completion-function
- "davs" `((,fun "_webdav._tcp")
- (,fun "_webdavs._tcp"))))
- (when (member "ftp" tramp-gvfs-methods)
- (tramp-set-completion-function
- "ftp" `((,fun "_ftp._tcp"))))
- (when (member "http" tramp-gvfs-methods)
- (tramp-set-completion-function
- "http" `((,fun "_http._tcp")
- (,fun "_https._tcp"))))
- (when (member "https" tramp-gvfs-methods)
- (tramp-set-completion-function
- "https" `((,fun "_http._tcp")
- (,fun "_https._tcp"))))
- (when (member "sftp" tramp-gvfs-methods)
- (tramp-set-completion-function
- "sftp" `((,fun "_sftp-ssh._tcp")
- (,fun "_ssh._tcp")
- (,fun "_workstation._tcp"))))
- (when (member "smb" tramp-gvfs-methods)
- (tramp-set-completion-function
- "smb" `((,fun "_smb._tcp")))))
+ (when (and (autoload 'zeroconf-init "zeroconf")
+ (tramp-compat-funcall 'dbus-get-unique-name :system))
+ ;; Add completion functions for services announced by DNS-SD.
+ ;; See <http://www.dns-sd.org/ServiceTypes.html> for valid service types.
+ (zeroconf-init tramp-gvfs-zeroconf-domain)
+ (when (setq fun (or (and (zeroconf-list-service-types)
+ #'tramp-zeroconf-parse-device-names)
+ (and (executable-find "avahi-browse")
+ #'tramp-gvfs-parse-device-names)))
+ (when (member "afp" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "afp" `((,fun "_afpovertcp._tcp"))))
+ (when (member "dav" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "dav" `((,fun "_webdav._tcp")
+ (,fun "_webdavs._tcp"))))
+ (when (member "davs" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "davs" `((,fun "_webdav._tcp")
+ (,fun "_webdavs._tcp"))))
+ (when (member "ftp" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "ftp" `((,fun "_ftp._tcp"))))
+ (when (member "http" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "http" `((,fun "_http._tcp")
+ (,fun "_https._tcp"))))
+ (when (member "https" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "https" `((,fun "_http._tcp")
+ (,fun "_https._tcp"))))
+ (when (member "sftp" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "sftp" `((,fun "_sftp-ssh._tcp")
+ (,fun "_ssh._tcp")
+ (,fun "_workstation._tcp"))))
+ (when (member "smb" tramp-gvfs-methods)
+ (tramp-set-completion-function
+ "smb" `((,fun "_smb._tcp"))))))
;; Add completion functions for GNOME Online Accounts.
(tramp-get-goa-accounts nil)
@@ -2553,9 +2607,9 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi."
;; * Host name completion for existing mount points (afp-server,
;; smb-server) or via smb-network or network.
;;
+;; * What's up with the other types in `tramp-gvfs-mounttypes'?
+;;
;; * Check, how two shares of the same SMB server can be mounted in
;; parallel.
-;;
-;; * What's up with ftps dns-sd afc admin computer?
;;; tramp-gvfs.el ends here