1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00

* net/tramp-gvfs.el (tramp-gvfs-enabled): New defconst.

(tramp-gvfs-file-name-handler): Raise a user error when
`tramp-gvfs-enabled' is nil.
(top): Register signals only when `tramp-gvfs-enabled' is non-nil.
Do not raise a user error when loading package.  (Bug#14447)
This commit is contained in:
Michael Albinus 2013-05-24 12:03:45 +02:00
parent e670054b66
commit 91aafa1613
2 changed files with 37 additions and 25 deletions

View File

@ -1,3 +1,11 @@
2013-05-24 Michael Albinus <michael.albinus@gmx.de>
* net/tramp-gvfs.el (tramp-gvfs-enabled): New defconst.
(tramp-gvfs-file-name-handler): Raise a user error when
`tramp-gvfs-enabled' is nil.
(top): Register signals only when `tramp-gvfs-enabled' is non-nil.
Do not raise a user error when loading package. (Bug#14447)
2013-05-24 Glenn Morris <rgm@gnu.org>
* font-lock.el (lisp-font-lock-keywords-2): Add with-coding-priority.

View File

@ -147,14 +147,15 @@
(defconst tramp-gvfs-service-daemon "org.gtk.vfs.Daemon"
"The well known name of the GVFS daemon.")
;; Check that GVFS is available. D-Bus integration is available since
;; Emacs 23 on some system types. We don't call `dbus-ping', because
;; this would load dbus.el.
(unless (ignore-errors
(and (tramp-compat-funcall 'dbus-get-unique-name :session)
(or (tramp-compat-process-running-p "gvfs-fuse-daemon")
(tramp-compat-process-running-p "gvfsd-fuse"))))
(tramp-compat-user-error "Package `tramp-gvfs' not supported"))
;; D-Bus integration is available since Emacs 23 on some system types.
;; We don't call `dbus-ping', because this would load dbus.el.
(defconst tramp-gvfs-enabled
(ignore-errors
(and (featurep 'dbusbind)
(tramp-compat-funcall 'dbus-get-unique-name :session)
(or (tramp-compat-process-running-p "gvfs-fuse-daemon")
(tramp-compat-process-running-p "gvfsd-fuse"))))
"Non-nil when GVFS is available.")
(defconst tramp-gvfs-path-mounttracker "/org/gtk/vfs/mounttracker"
"The object path of the GVFS daemon.")
@ -483,6 +484,8 @@ Operations not mentioned here will be handled by the default Emacs primitives.")
"Invoke the GVFS related OPERATION.
First arg specifies the OPERATION, second arg is a list of arguments to
pass to the OPERATION."
(unless tramp-gvfs-enabled
(tramp-compat-user-error "Package `tramp-gvfs' not supported"))
(let ((fn (assoc operation tramp-gvfs-file-name-handler-alist)))
(if fn
(save-match-data (apply (cdr fn) args))
@ -1308,23 +1311,24 @@ ADDRESS can have the form \"xx:xx:xx:xx:xx:xx\" or \"[xx:xx:xx:xx:xx:xx]\"."
(tramp-set-file-property
v "/" "default-location" default-location)))))))
(dbus-register-signal
:session nil tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker "mounted"
'tramp-gvfs-handler-mounted-unmounted)
(dbus-register-signal
:session nil tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker "Mounted"
'tramp-gvfs-handler-mounted-unmounted)
(when tramp-gvfs-enabled
(dbus-register-signal
:session nil tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker "mounted"
'tramp-gvfs-handler-mounted-unmounted)
(dbus-register-signal
:session nil tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker "Mounted"
'tramp-gvfs-handler-mounted-unmounted)
(dbus-register-signal
:session nil tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker "unmounted"
'tramp-gvfs-handler-mounted-unmounted)
(dbus-register-signal
:session nil tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker "Unmounted"
'tramp-gvfs-handler-mounted-unmounted)
(dbus-register-signal
:session nil tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker "unmounted"
'tramp-gvfs-handler-mounted-unmounted)
(dbus-register-signal
:session nil tramp-gvfs-path-mounttracker
tramp-gvfs-interface-mounttracker "Unmounted"
'tramp-gvfs-handler-mounted-unmounted))
(defun tramp-gvfs-connection-mounted-p (vec)
"Check, whether the location is already mounted."
@ -1452,7 +1456,7 @@ It was \"a(say)\", but has changed to \"a{sv})\"."
`(:struct ,(tramp-gvfs-dbus-string-to-byte-array mount-pref) ,mount-spec)))
;; Connection functions
;; Connection functions.
(defun tramp-gvfs-maybe-open-connection (vec)
"Maybe open a connection VEC.