diff options
| author | Michael Albinus | 2013-05-24 12:03:45 +0200 |
|---|---|---|
| committer | Michael Albinus | 2013-05-24 12:03:45 +0200 |
| commit | 91aafa1613928197eb778ef22c241af5dd06e07e (patch) | |
| tree | 3d0d8eac5ac5943a6e8c2b41626017b9dccbe08b | |
| parent | e670054b6647eb3bb96be4037174484582817f09 (diff) | |
| download | emacs-91aafa1613928197eb778ef22c241af5dd06e07e.tar.gz emacs-91aafa1613928197eb778ef22c241af5dd06e07e.zip | |
* 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)
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 56 |
2 files changed, 38 insertions, 26 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4565f5f9eb0..a033ee6d982 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2013-05-24 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp-gvfs.el (tramp-gvfs-enabled): New defconst. | ||
| 4 | (tramp-gvfs-file-name-handler): Raise a user error when | ||
| 5 | `tramp-gvfs-enabled' is nil. | ||
| 6 | (top): Register signals only when `tramp-gvfs-enabled' is non-nil. | ||
| 7 | Do not raise a user error when loading package. (Bug#14447) | ||
| 8 | |||
| 1 | 2013-05-24 Glenn Morris <rgm@gnu.org> | 9 | 2013-05-24 Glenn Morris <rgm@gnu.org> |
| 2 | 10 | ||
| 3 | * font-lock.el (lisp-font-lock-keywords-2): Add with-coding-priority. | 11 | * font-lock.el (lisp-font-lock-keywords-2): Add with-coding-priority. |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 16cf0c00bb0..6ba055b8bb8 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -147,14 +147,15 @@ | |||
| 147 | (defconst tramp-gvfs-service-daemon "org.gtk.vfs.Daemon" | 147 | (defconst tramp-gvfs-service-daemon "org.gtk.vfs.Daemon" |
| 148 | "The well known name of the GVFS daemon.") | 148 | "The well known name of the GVFS daemon.") |
| 149 | 149 | ||
| 150 | ;; Check that GVFS is available. D-Bus integration is available since | 150 | ;; D-Bus integration is available since Emacs 23 on some system types. |
| 151 | ;; Emacs 23 on some system types. We don't call `dbus-ping', because | 151 | ;; We don't call `dbus-ping', because this would load dbus.el. |
| 152 | ;; this would load dbus.el. | 152 | (defconst tramp-gvfs-enabled |
| 153 | (unless (ignore-errors | 153 | (ignore-errors |
| 154 | (and (tramp-compat-funcall 'dbus-get-unique-name :session) | 154 | (and (featurep 'dbusbind) |
| 155 | (or (tramp-compat-process-running-p "gvfs-fuse-daemon") | 155 | (tramp-compat-funcall 'dbus-get-unique-name :session) |
| 156 | (tramp-compat-process-running-p "gvfsd-fuse")))) | 156 | (or (tramp-compat-process-running-p "gvfs-fuse-daemon") |
| 157 | (tramp-compat-user-error "Package `tramp-gvfs' not supported")) | 157 | (tramp-compat-process-running-p "gvfsd-fuse")))) |
| 158 | "Non-nil when GVFS is available.") | ||
| 158 | 159 | ||
| 159 | (defconst tramp-gvfs-path-mounttracker "/org/gtk/vfs/mounttracker" | 160 | (defconst tramp-gvfs-path-mounttracker "/org/gtk/vfs/mounttracker" |
| 160 | "The object path of the GVFS daemon.") | 161 | "The object path of the GVFS daemon.") |
| @@ -483,6 +484,8 @@ Operations not mentioned here will be handled by the default Emacs primitives.") | |||
| 483 | "Invoke the GVFS related OPERATION. | 484 | "Invoke the GVFS related OPERATION. |
| 484 | First arg specifies the OPERATION, second arg is a list of arguments to | 485 | First arg specifies the OPERATION, second arg is a list of arguments to |
| 485 | pass to the OPERATION." | 486 | pass to the OPERATION." |
| 487 | (unless tramp-gvfs-enabled | ||
| 488 | (tramp-compat-user-error "Package `tramp-gvfs' not supported")) | ||
| 486 | (let ((fn (assoc operation tramp-gvfs-file-name-handler-alist))) | 489 | (let ((fn (assoc operation tramp-gvfs-file-name-handler-alist))) |
| 487 | (if fn | 490 | (if fn |
| 488 | (save-match-data (apply (cdr fn) args)) | 491 | (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]\"." | |||
| 1308 | (tramp-set-file-property | 1311 | (tramp-set-file-property |
| 1309 | v "/" "default-location" default-location))))))) | 1312 | v "/" "default-location" default-location))))))) |
| 1310 | 1313 | ||
| 1311 | (dbus-register-signal | 1314 | (when tramp-gvfs-enabled |
| 1312 | :session nil tramp-gvfs-path-mounttracker | 1315 | (dbus-register-signal |
| 1313 | tramp-gvfs-interface-mounttracker "mounted" | 1316 | :session nil tramp-gvfs-path-mounttracker |
| 1314 | 'tramp-gvfs-handler-mounted-unmounted) | 1317 | tramp-gvfs-interface-mounttracker "mounted" |
| 1315 | (dbus-register-signal | 1318 | 'tramp-gvfs-handler-mounted-unmounted) |
| 1316 | :session nil tramp-gvfs-path-mounttracker | 1319 | (dbus-register-signal |
| 1317 | tramp-gvfs-interface-mounttracker "Mounted" | 1320 | :session nil tramp-gvfs-path-mounttracker |
| 1318 | 'tramp-gvfs-handler-mounted-unmounted) | 1321 | tramp-gvfs-interface-mounttracker "Mounted" |
| 1319 | 1322 | 'tramp-gvfs-handler-mounted-unmounted) | |
| 1320 | (dbus-register-signal | 1323 | |
| 1321 | :session nil tramp-gvfs-path-mounttracker | 1324 | (dbus-register-signal |
| 1322 | tramp-gvfs-interface-mounttracker "unmounted" | 1325 | :session nil tramp-gvfs-path-mounttracker |
| 1323 | 'tramp-gvfs-handler-mounted-unmounted) | 1326 | tramp-gvfs-interface-mounttracker "unmounted" |
| 1324 | (dbus-register-signal | 1327 | 'tramp-gvfs-handler-mounted-unmounted) |
| 1325 | :session nil tramp-gvfs-path-mounttracker | 1328 | (dbus-register-signal |
| 1326 | tramp-gvfs-interface-mounttracker "Unmounted" | 1329 | :session nil tramp-gvfs-path-mounttracker |
| 1327 | 'tramp-gvfs-handler-mounted-unmounted) | 1330 | tramp-gvfs-interface-mounttracker "Unmounted" |
| 1331 | 'tramp-gvfs-handler-mounted-unmounted)) | ||
| 1328 | 1332 | ||
| 1329 | (defun tramp-gvfs-connection-mounted-p (vec) | 1333 | (defun tramp-gvfs-connection-mounted-p (vec) |
| 1330 | "Check, whether the location is already mounted." | 1334 | "Check, whether the location is already mounted." |
| @@ -1452,7 +1456,7 @@ It was \"a(say)\", but has changed to \"a{sv})\"." | |||
| 1452 | `(:struct ,(tramp-gvfs-dbus-string-to-byte-array mount-pref) ,mount-spec))) | 1456 | `(:struct ,(tramp-gvfs-dbus-string-to-byte-array mount-pref) ,mount-spec))) |
| 1453 | 1457 | ||
| 1454 | 1458 | ||
| 1455 | ;; Connection functions | 1459 | ;; Connection functions. |
| 1456 | 1460 | ||
| 1457 | (defun tramp-gvfs-maybe-open-connection (vec) | 1461 | (defun tramp-gvfs-maybe-open-connection (vec) |
| 1458 | "Maybe open a connection VEC. | 1462 | "Maybe open a connection VEC. |