aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2018-01-06 19:36:22 +0100
committerMichael Albinus2018-01-06 19:36:22 +0100
commitfc31788beb924c712451adef47b1005bac2ac48a (patch)
treeef6acb2c9e0ef557fea0190f60f65ac05e989152
parentb74fdf4408c883d02dd5c78af2ec622d632c3b1d (diff)
downloademacs-fc31788beb924c712451adef47b1005bac2ac48a.tar.gz
emacs-fc31788beb924c712451adef47b1005bac2ac48a.zip
Minor tramp-gvfs.el cleanup
* lisp/net/tramp-gvfs.el (tramp-gvfs-enabled): Move up. (top): Delete goa methods only when `tramp-gvfs-enabled' is not nil.
-rw-r--r--lisp/net/tramp-gvfs.el28
1 files changed, 15 insertions, 13 deletions
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 7d63118268d..ffe3bd28bd2 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -114,6 +114,16 @@
114(eval-when-compile 114(eval-when-compile
115 (require 'custom)) 115 (require 'custom))
116 116
117;; We don't call `dbus-ping', because this would load dbus.el.
118(defconst tramp-gvfs-enabled
119 (ignore-errors
120 (and (featurep 'dbusbind)
121 (tramp-compat-funcall 'dbus-get-unique-name :system)
122 (tramp-compat-funcall 'dbus-get-unique-name :session)
123 (or (tramp-compat-process-running-p "gvfs-fuse-daemon")
124 (tramp-compat-process-running-p "gvfsd-fuse"))))
125 "Non-nil when GVFS is available.")
126
117;;;###tramp-autoload 127;;;###tramp-autoload
118(defcustom tramp-gvfs-methods 128(defcustom tramp-gvfs-methods
119 '("afp" "dav" "davs" "gdrive" "obex" "owncloud" "sftp" "synce") 129 '("afp" "dav" "davs" "gdrive" "obex" "owncloud" "sftp" "synce")
@@ -137,8 +147,9 @@
137(defconst tramp-goa-methods '("gdrive" "owncloud") 147(defconst tramp-goa-methods '("gdrive" "owncloud")
138 "List of methods which require registration at GNOME Online Accounts.") 148 "List of methods which require registration at GNOME Online Accounts.")
139 149
140;; Remove GNOME Online Accounts if not supported. 150;; Remove GNOME Online Accounts methods if not supported.
141(unless (member tramp-goa-service (dbus-list-known-names :session)) 151(unless (and tramp-gvfs-enabled
152 (member tramp-goa-service (dbus-list-known-names :session)))
142 (dolist (method tramp-goa-methods) 153 (dolist (method tramp-goa-methods)
143 (setq tramp-gvfs-methods (delete method tramp-gvfs-methods)))) 154 (setq tramp-gvfs-methods (delete method tramp-gvfs-methods))))
144 155
@@ -175,16 +186,6 @@
175(defconst tramp-gvfs-service-daemon "org.gtk.vfs.Daemon" 186(defconst tramp-gvfs-service-daemon "org.gtk.vfs.Daemon"
176 "The well known name of the GVFS daemon.") 187 "The well known name of the GVFS daemon.")
177 188
178;; We don't call `dbus-ping', because this would load dbus.el.
179(defconst tramp-gvfs-enabled
180 (ignore-errors
181 (and (featurep 'dbusbind)
182 (tramp-compat-funcall 'dbus-get-unique-name :system)
183 (tramp-compat-funcall 'dbus-get-unique-name :session)
184 (or (tramp-compat-process-running-p "gvfs-fuse-daemon")
185 (tramp-compat-process-running-p "gvfsd-fuse"))))
186 "Non-nil when GVFS is available.")
187
188(defconst tramp-gvfs-path-mounttracker "/org/gtk/vfs/mounttracker" 189(defconst tramp-gvfs-path-mounttracker "/org/gtk/vfs/mounttracker"
189 "The object path of the GVFS daemon.") 190 "The object path of the GVFS daemon.")
190 191
@@ -1975,7 +1976,8 @@ connection if a previous connection has died for some reason."
1975 tramp-gvfs-interface-mountoperation "AskPassword" 1976 tramp-gvfs-interface-mountoperation "AskPassword"
1976 'tramp-gvfs-handler-askpassword) 1977 'tramp-gvfs-handler-askpassword)
1977 1978
1978 ;; There could be a callback of "askQuestion" when adding fingerprint. 1979 ;; There could be a callback of "askQuestion" when adding
1980 ;; fingerprints or checking certificates.
1979 (dbus-register-method 1981 (dbus-register-method
1980 :session dbus-service-emacs object-path 1982 :session dbus-service-emacs object-path
1981 tramp-gvfs-interface-mountoperation "askQuestion" 1983 tramp-gvfs-interface-mountoperation "askQuestion"