Mercurial > emacs
annotate lisp/net/tramp-gvfs.el @ 110321:4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
* Makefile.in (TRAMP_SRC): Remove tramp-fish.el. Add tramp-sh.el.
* net/tramp.el (top): Don't show loading message. Require just
'tramp-compat, everything else is required there. Use
`ignore-errors' where appropriate.
(tramp-inline-compress-start-size, tramp-copy-size-limit)
(tramp-terminal-type, tramp-end-of-output)
(tramp-initial-end-of-output, tramp-completion-function-alist-rsh)
(tramp-completion-function-alist-ssh)
(tramp-completion-function-alist-telnet)
(tramp-completion-function-alist-su)
(tramp-completion-function-alist-putty, tramp-remote-path)
(tramp-remote-process-environment, tramp-sh-extra-args)
(tramp-actions-before-shell, tramp-uudecode)
(tramp-perl-file-truename, tramp-perl-file-name-all-completions)
(tramp-perl-file-attributes)
(tramp-perl-directory-files-and-attributes)
(tramp-perl-encode-with-module, tramp-perl-decode-with-module)
(tramp-perl-encode, tramp-perl-decode)
(tramp-vc-registered-read-file-names, tramp-file-mode-type-map)
(tramp-file-name-handler-alist, tramp-make-tramp-temp-file)
(tramp-handle-make-symbolic-link, tramp-handle-load)
(tramp-handle-file-name-as-directory)
(tramp-handle-file-name-directory)
(tramp-handle-file-name-nondirectory, tramp-handle-file-truename)
(tramp-handle-file-exists-p, tramp-handle-file-attributes)
(tramp-do-file-attributes-with-ls)
(tramp-do-file-attributes-with-perl)
(tramp-do-file-attributes-with-stat)
(tramp-handle-set-visited-file-modtime)
(tramp-handle-verify-visited-file-modtime)
(tramp-handle-set-file-modes, tramp-handle-set-file-times)
(tramp-set-file-uid-gid, tramp-remote-selinux-p)
(tramp-handle-file-selinux-context)
(tramp-handle-set-file-selinux-context)
(tramp-handle-file-executable-p, tramp-handle-file-readable-p)
(tramp-handle-file-newer-than-file-p, tramp-handle-file-modes)
(tramp-handle-file-directory-p, tramp-handle-file-regular-p)
(tramp-handle-file-symlink-p, tramp-handle-file-writable-p)
(tramp-handle-file-ownership-preserved-p)
(tramp-handle-directory-file-name, tramp-handle-directory-files)
(tramp-handle-directory-files-and-attributes)
(tramp-do-directory-files-and-attributes-with-perl)
(tramp-do-directory-files-and-attributes-with-stat)
(tramp-handle-file-name-all-completions)
(tramp-handle-file-name-completion, tramp-handle-add-name-to-file)
(tramp-handle-copy-file, tramp-handle-copy-directory)
(tramp-handle-rename-file, tramp-do-copy-or-rename-file)
(tramp-do-copy-or-rename-file-via-buffer)
(tramp-do-copy-or-rename-file-directly)
(tramp-do-copy-or-rename-file-out-of-band)
(tramp-handle-make-directory, tramp-handle-delete-directory)
(tramp-handle-delete-file)
(tramp-handle-dired-recursive-delete-directory)
(tramp-handle-dired-compress-file, tramp-handle-dired-uncache)
(tramp-handle-insert-directory)
(tramp-handle-unhandled-file-name-directory)
(tramp-handle-expand-file-name)
(tramp-handle-substitute-in-file-name)
(tramp-handle-executable-find, tramp-process-sentinel)
(tramp-handle-start-file-process, tramp-handle-process-file)
(tramp-handle-call-process-region, tramp-handle-shell-command)
(tramp-handle-file-local-copy, tramp-handle-file-remote-p)
(tramp-handle-insert-file-contents)
(tramp-handle-insert-file-contents-literally)
(tramp-handle-find-backup-file-name)
(tramp-handle-make-auto-save-file-name, tramp-handle-write-region)
(tramp-vc-registered-file-names, tramp-handle-vc-registered)
(tramp-sh-file-name-handler, tramp-vc-file-name-handler)
(tramp-maybe-send-script, tramp-set-auto-save, tramp-run-test)
(tramp-run-test2, tramp-find-executable, tramp-set-remote-path)
(tramp-find-file-exists-command, tramp-open-shell)
(tramp-find-shell, tramp-barf-if-no-shell-prompt)
(tramp-open-connection-setup-interactive-shell)
(tramp-local-coding-commands, tramp-remote-coding-commands)
(tramp-find-inline-encoding, tramp-call-local-coding-command)
(tramp-inline-compress-commands, tramp-find-inline-compress)
(tramp-compute-multi-hops, tramp-maybe-open-connection)
(tramp-send-command , tramp-wait-for-output)
(tramp-send-command-and-check, tramp-barf-unless-okay)
(tramp-send-command-and-read, tramp-mode-string-to-int)
(tramp-convert-file-attributes, tramp-check-cached-permissions)
(tramp-file-mode-from-int, tramp-file-mode-permissions)
(tramp-shell-case-fold, tramp-make-copy-program-file-name)
(tramp-method-out-of-band-p, tramp-local-host-p)
(tramp-get-remote-path, tramp-get-remote-tmpdir)
(tramp-get-ls-command, tramp-get-ls-command-with-dired)
(tramp-get-test-command, tramp-get-test-nt-command)
(tramp-get-file-exists-command, tramp-get-remote-ln)
(tramp-get-remote-perl, tramp-get-remote-stat)
(tramp-get-remote-readlink, tramp-get-remote-trash)
(tramp-get-remote-id, tramp-get-remote-uid, tramp-get-remote-gid)
(tramp-get-local-uid, tramp-get-local-gid)
(tramp-get-inline-compress, tramp-get-inline-coding, ): Move to
tramp-sh.el.
(tramp-methods, tramp-default-method-alist)
(tramp-default-user-alist, tramp-foreign-file-name-handler-alist):
Move initialization to tramp-sh.el.
(tramp-temp-name-prefix): Make it a defconst.
(tramp-dissect-file-name): Don't check anymore for multi-hop
methods.
(tramp-debug-outline-regexp): Add a docstring.
(tramp-debug-outline-level): Renamed from `tramp-outline-level'.
(tramp-get-debug-buffer): Use it.
* net/tramp-cache.el (top): Set tramp-autoload cookie for
initialization forms.
(tramp-set-connection-property): Don't protect `tramp-message'
call, it isn't necessary any longer.
(tramp-dump-connection-properties): Use `ignore-errors'.
* net/tramp-compat.el (top): Require 'advice, 'format-spec,
'password-cache and 'auth-source.
* net/tramp-gvfs.el (top):
* net/tramp-smb.el (top): Require 'tramp-sh.
* net/tramp-gw.el (tramp-gw-open-network-stream): Use `ignore-errors'.
* net/tramp-sh.el: New file, derived from tramp.el.
(top): Initialize `tramp-methods', `tramp-default-method-alist',
`tramp-default-user-alist', tramp-foreign-file-name-handler-alist.
Remove "scp1_old", "scp2_old", "ssh1_old", "ssh2_old". Use
`ignore-errors' where appropriate.
(tramp-sh-file-name-handler-alist): Renamed from
`tramp-file-name-handler-alist'.
(tramp-send-command-and-check): Return t or nil. Remove all
`zerop' checks, where called.
(tramp-handle-set-file-modes)
(tramp-do-copy-or-rename-file-directly)
(tramp-handle-delete-directory, tramp-handle-delete-file)
(tramp-maybe-send-script, ): Use `tramp-barf-unless-okay'.
(tramp-sh-file-name-handler, tramp-send-command-and-check)
(tramp-get-remote-ln): Set tramp-autoload cookie.
* net/tramp-fish.el: Remove file.
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Mon, 13 Sep 2010 17:17:01 +0200 |
parents | ec526909f60b |
children | 932697ced7aa |
rev | line source |
---|---|
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1 ;;; tramp-gvfs.el --- Tramp access functions for GVFS daemon |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
2 |
106815 | 3 ;; Copyright (C) 2009, 2010 Free Software Foundation, Inc. |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
4 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
5 ;; Author: Michael Albinus <michael.albinus@gmx.de> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
6 ;; Keywords: comm, processes |
110015
280c8ae2476d
Add "Package:" file headers to denote built-in packages.
Chong Yidong <cyd@stupidchicken.com>
parents:
109309
diff
changeset
|
7 ;; Package: tramp |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
8 |
103567 | 9 ;; This file is part of GNU Emacs. |
10 | |
11 ;; GNU Emacs is free software: you can redistribute it and/or modify | |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
12 ;; it under the terms of the GNU General Public License as published by |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
14 ;; (at your option) any later version. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
15 |
103567 | 16 ;; GNU Emacs is distributed in the hope that it will be useful, |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
20 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
21 ;; You should have received a copy of the GNU General Public License |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
23 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
24 ;;; Commentary: |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
25 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
26 ;; Access functions for the GVFS daemon from Tramp. Tested with GVFS |
103714
8d104b8ecf66
* net/tramp-gvfs.el (tramp-gvfs-methods)
Michael Albinus <michael.albinus@gmx.de>
parents:
103696
diff
changeset
|
27 ;; 1.0.2 (Ubuntu 8.10, Gnome 2.24). It has been reported also to run |
8d104b8ecf66
* net/tramp-gvfs.el (tramp-gvfs-methods)
Michael Albinus <michael.albinus@gmx.de>
parents:
103696
diff
changeset
|
28 ;; with GVFS 0.2.5 (Ubuntu 8.04, Gnome 2.22), but there is an |
8d104b8ecf66
* net/tramp-gvfs.el (tramp-gvfs-methods)
Michael Albinus <michael.albinus@gmx.de>
parents:
103696
diff
changeset
|
29 ;; incompatibility with the mount_info structure, which has been |
8d104b8ecf66
* net/tramp-gvfs.el (tramp-gvfs-methods)
Michael Albinus <michael.albinus@gmx.de>
parents:
103696
diff
changeset
|
30 ;; worked around. |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
31 |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
32 ;; It has also been tested with GVFS 1.6.2 (Ubuntu 10.04, Gnome 2.30), |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
33 ;; where the default_location has been added to mount_info (see |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
34 ;; <https://bugzilla.gnome.org/show_bug.cgi?id=561998>. |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
35 |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
36 ;; All actions to mount a remote location, and to retrieve mount |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
37 ;; information, are performed by D-Bus messages. File operations |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
38 ;; themselves are performed via the mounted filesystem in ~/.gvfs. |
103714
8d104b8ecf66
* net/tramp-gvfs.el (tramp-gvfs-methods)
Michael Albinus <michael.albinus@gmx.de>
parents:
103696
diff
changeset
|
39 ;; Consequently, GNU Emacs 23.1 with enabled D-Bus bindings is a |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
40 ;; precondition. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
41 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
42 ;; The GVFS D-Bus interface is said to be instable. There are even no |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
43 ;; introspection data. The interface, as discovered during |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
44 ;; development time, is given in respective comments. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
45 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
46 ;; The customer option `tramp-gvfs-methods' contains the list of |
103643
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
47 ;; supported connection methods. Per default, these are "dav", |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
48 ;; "davs", "obex" and "synce". Note that with "obex" it might be |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
49 ;; necessary to pair with the other bluetooth device, if it hasn't |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
50 ;; been done already. There might be also some few seconds delay in |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
51 ;; discovering available bluetooth devices. |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
52 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
53 ;; Other possible connection methods are "ftp", "sftp" and "smb". |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
54 ;; When one of these methods is added to the list, the remote access |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
55 ;; for that method is performed via GVFS instead of the native Tramp |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
56 ;; implementation. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
57 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
58 ;; GVFS offers even more connection methods. The complete list of |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
59 ;; connection methods of the actual GVFS implementation can be |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
60 ;; retrieved by: |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
61 ;; |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
62 ;; (message |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
63 ;; "%s" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
64 ;; (mapcar |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
65 ;; 'car |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
66 ;; (dbus-call-method |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
67 ;; :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
68 ;; tramp-gvfs-interface-mounttracker "listMountableInfo"))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
69 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
70 ;; Note that all other connection methods are not tested, beside the |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
71 ;; ones offered for customization in `tramp-gvfs-methods'. If you |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
72 ;; request an additional connection method to be supported, please |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
73 ;; drop me a note. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
74 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
75 ;; For hostname completion, information is retrieved either from the |
103643
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
76 ;; bluez daemon (for the "obex" method), the hal daemon (for the |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
77 ;; "synce" method), or from the zeroconf daemon (for the "dav", |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
78 ;; "davs", and "sftp" methods). The zeroconf daemon is pre-configured |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
79 ;; to discover services in the "local" domain. If another domain |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
80 ;; shall be used for discovering services, the customer option |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
81 ;; `tramp-gvfs-zeroconf-domain' can be set accordingly. |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
82 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
83 ;; Restrictions: |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
84 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
85 ;; * The current GVFS implementation does not allow to write on the |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
86 ;; remote bluetooth device via OBEX. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
87 ;; |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
88 ;; * Two shares of the same SMB server cannot be mounted in parallel. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
89 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
90 ;;; Code: |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
91 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
92 ;; D-Bus support in the Emacs core can be disabled with configuration |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
93 ;; option "--without-dbus". Declare used subroutines and variables. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
94 (declare-function dbus-call-method "dbusbind.c") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
95 (declare-function dbus-call-method-asynchronously "dbusbind.c") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
96 (declare-function dbus-get-unique-name "dbusbind.c") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
97 (declare-function dbus-register-method "dbusbind.c") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
98 (declare-function dbus-register-signal "dbusbind.c") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
99 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
100 ;; Pacify byte-compiler |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
101 (eval-when-compile |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
102 (require 'cl) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
103 (require 'custom)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
104 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
105 (require 'tramp) |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110264
diff
changeset
|
106 |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110264
diff
changeset
|
107 ;; We call several `tramp-handle-*' functions directly. So we must |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110264
diff
changeset
|
108 ;; reqire that package as well. |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110264
diff
changeset
|
109 (require 'tramp-sh) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110264
diff
changeset
|
110 |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
111 (require 'dbus) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
112 (require 'url-parse) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
113 (require 'url-util) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
114 (require 'zeroconf) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
115 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
116 ;;;###tramp-autoload |
103637
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
117 (defcustom tramp-gvfs-methods '("dav" "davs" "obex" "synce") |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
118 "*List of methods for remote files, accessed with GVFS." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
119 :group 'tramp |
103714
8d104b8ecf66
* net/tramp-gvfs.el (tramp-gvfs-methods)
Michael Albinus <michael.albinus@gmx.de>
parents:
103696
diff
changeset
|
120 :version "23.2" |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
121 :type '(repeat (choice (const "dav") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
122 (const "davs") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
123 (const "ftp") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
124 (const "obex") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
125 (const "sftp") |
103637
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
126 (const "smb") |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
127 (const "synce")))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
128 |
103643
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
129 ;; Add a default for `tramp-default-user-alist'. Rule: For the SYNCE |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
130 ;; method, no user is chosen. |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
131 (add-to-list 'tramp-default-user-alist |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
132 '("synce" nil nil)) |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
133 |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
134 (defcustom tramp-gvfs-zeroconf-domain "local" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
135 "*Zeroconf domain to be used for discovering services, like host names." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
136 :group 'tramp |
103714
8d104b8ecf66
* net/tramp-gvfs.el (tramp-gvfs-methods)
Michael Albinus <michael.albinus@gmx.de>
parents:
103696
diff
changeset
|
137 :version "23.2" |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
138 :type 'string) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
139 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
140 ;; Add the methods to `tramp-methods', in order to allow minibuffer |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
141 ;; completion. |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
142 ;;;###tramp-autoload |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
143 (when (featurep 'dbusbind) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
144 (dolist (elt tramp-gvfs-methods) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
145 (unless (assoc elt tramp-methods) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
146 (add-to-list 'tramp-methods (cons elt nil))))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
147 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
148 (defconst tramp-gvfs-path-tramp (concat dbus-path-emacs "/Tramp") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
149 "The preceeding object path for own objects.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
150 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
151 (defconst tramp-gvfs-service-daemon "org.gtk.vfs.Daemon" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
152 "The well known name of the GVFS daemon.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
153 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
154 ;; Check that GVFS is available. D-Bus integration is available since |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
155 ;; Emacs 23 on some system types. We don't call `dbus-ping', because |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
156 ;; this would load dbus.el. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
157 (unless (and (tramp-compat-funcall 'dbus-get-unique-name :session) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
158 (tramp-compat-process-running-p "gvfs-fuse-daemon")) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
159 (error "Package `tramp-gvfs' not supported")) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
160 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
161 (defconst tramp-gvfs-path-mounttracker "/org/gtk/vfs/mounttracker" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
162 "The object path of the GVFS daemon.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
163 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
164 (defconst tramp-gvfs-interface-mounttracker "org.gtk.vfs.MountTracker" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
165 "The mount tracking interface in the GVFS daemon.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
166 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
167 ;; <interface name='org.gtk.vfs.MountTracker'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
168 ;; <method name='listMounts'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
169 ;; <arg name='mount_info_list' |
108887
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
170 ;; type='a{sosssssbay{aya{say}}ay}' |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
171 ;; direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
172 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
173 ;; <method name='mountLocation'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
174 ;; <arg name='mount_spec' type='{aya{say}}' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
175 ;; <arg name='dbus_id' type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
176 ;; <arg name='object_path' type='o' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
177 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
178 ;; <signal name='mounted'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
179 ;; <arg name='mount_info' |
108887
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
180 ;; type='{sosssssbay{aya{say}}ay}'/> |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
181 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
182 ;; <signal name='unmounted'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
183 ;; <arg name='mount_info' |
108887
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
184 ;; type='{sosssssbay{aya{say}}ay}'/> |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
185 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
186 ;; </interface> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
187 ;; |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
188 ;; STRUCT mount_info |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
189 ;; STRING dbus_id |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
190 ;; OBJECT_PATH object_path |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
191 ;; STRING display_name |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
192 ;; STRING stable_name |
103714
8d104b8ecf66
* net/tramp-gvfs.el (tramp-gvfs-methods)
Michael Albinus <michael.albinus@gmx.de>
parents:
103696
diff
changeset
|
193 ;; STRING x_content_types Since GVFS 1.0 only !!! |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
194 ;; STRING icon |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
195 ;; STRING prefered_filename_encoding |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
196 ;; BOOLEAN user_visible |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
197 ;; ARRAY BYTE fuse_mountpoint |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
198 ;; STRUCT mount_spec |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
199 ;; ARRAY BYTE mount_prefix |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
200 ;; ARRAY |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
201 ;; STRUCT mount_spec_item |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
202 ;; STRING key (server, share, type, user, host, port) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
203 ;; ARRAY BYTE value |
108887
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
204 ;; ARRAY BYTE default_location Since GVFS 1.5 only !!! |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
205 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
206 (defconst tramp-gvfs-interface-mountoperation "org.gtk.vfs.MountOperation" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
207 "Used by the dbus-proxying implementation of GMountOperation.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
208 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
209 ;; <interface name='org.gtk.vfs.MountOperation'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
210 ;; <method name='askPassword'> |
106058
b6d8539323de
* net/tramp-gvfs.el (tramp-gvfs-dbus-event-error): Raise only an
Michael Albinus <michael.albinus@gmx.de>
parents:
105896
diff
changeset
|
211 ;; <arg name='message' type='s' direction='in'/> |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
212 ;; <arg name='default_user' type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
213 ;; <arg name='default_domain' type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
214 ;; <arg name='flags' type='u' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
215 ;; <arg name='handled' type='b' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
216 ;; <arg name='aborted' type='b' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
217 ;; <arg name='password' type='s' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
218 ;; <arg name='username' type='s' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
219 ;; <arg name='domain' type='s' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
220 ;; <arg name='anonymous' type='b' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
221 ;; <arg name='password_save' type='u' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
222 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
223 ;; <method name='askQuestion'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
224 ;; <arg name='message' type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
225 ;; <arg name='choices' type='as' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
226 ;; <arg name='handled' type='b' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
227 ;; <arg name='aborted' type='b' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
228 ;; <arg name='choice' type='u' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
229 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
230 ;; </interface> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
231 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
232 ;; The following flags are used in "askPassword". They are defined in |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
233 ;; /usr/include/glib-2.0/gio/gioenums.h. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
234 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
235 (defconst tramp-gvfs-password-need-password 1 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
236 "Operation requires a password.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
237 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
238 (defconst tramp-gvfs-password-need-username 2 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
239 "Operation requires a username.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
240 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
241 (defconst tramp-gvfs-password-need-domain 4 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
242 "Operation requires a domain.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
243 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
244 (defconst tramp-gvfs-password-saving-supported 8 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
245 "Operation supports saving settings.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
246 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
247 (defconst tramp-gvfs-password-anonymous-supported 16 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
248 "Operation supports anonymous users.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
249 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
250 (defconst tramp-bluez-service "org.bluez" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
251 "The well known name of the BLUEZ service.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
252 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
253 (defconst tramp-bluez-interface-manager "org.bluez.Manager" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
254 "The manager interface of the BLUEZ daemon.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
255 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
256 ;; <interface name='org.bluez.Manager'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
257 ;; <method name='DefaultAdapter'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
258 ;; <arg type='o' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
259 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
260 ;; <method name='FindAdapter'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
261 ;; <arg type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
262 ;; <arg type='o' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
263 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
264 ;; <method name='ListAdapters'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
265 ;; <arg type='ao' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
266 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
267 ;; <signal name='AdapterAdded'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
268 ;; <arg type='o'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
269 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
270 ;; <signal name='AdapterRemoved'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
271 ;; <arg type='o'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
272 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
273 ;; <signal name='DefaultAdapterChanged'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
274 ;; <arg type='o'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
275 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
276 ;; </interface> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
277 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
278 (defconst tramp-bluez-interface-adapter "org.bluez.Adapter" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
279 "The adapter interface of the BLUEZ daemon.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
280 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
281 ;; <interface name='org.bluez.Adapter'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
282 ;; <method name='GetProperties'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
283 ;; <arg type='a{sv}' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
284 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
285 ;; <method name='SetProperty'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
286 ;; <arg type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
287 ;; <arg type='v' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
288 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
289 ;; <method name='RequestMode'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
290 ;; <arg type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
291 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
292 ;; <method name='ReleaseMode'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
293 ;; <method name='RequestSession'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
294 ;; <method name='ReleaseSession'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
295 ;; <method name='StartDiscovery'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
296 ;; <method name='StopDiscovery'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
297 ;; <method name='ListDevices'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
298 ;; <arg type='ao' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
299 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
300 ;; <method name='CreateDevice'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
301 ;; <arg type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
302 ;; <arg type='o' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
303 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
304 ;; <method name='CreatePairedDevice'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
305 ;; <arg type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
306 ;; <arg type='o' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
307 ;; <arg type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
308 ;; <arg type='o' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
309 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
310 ;; <method name='CancelDeviceCreation'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
311 ;; <arg type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
312 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
313 ;; <method name='RemoveDevice'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
314 ;; <arg type='o' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
315 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
316 ;; <method name='FindDevice'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
317 ;; <arg type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
318 ;; <arg type='o' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
319 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
320 ;; <method name='RegisterAgent'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
321 ;; <arg type='o' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
322 ;; <arg type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
323 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
324 ;; <method name='UnregisterAgent'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
325 ;; <arg type='o' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
326 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
327 ;; <signal name='DeviceCreated'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
328 ;; <arg type='o'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
329 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
330 ;; <signal name='DeviceRemoved'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
331 ;; <arg type='o'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
332 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
333 ;; <signal name='DeviceFound'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
334 ;; <arg type='s'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
335 ;; <arg type='a{sv}'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
336 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
337 ;; <signal name='PropertyChanged'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
338 ;; <arg type='s'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
339 ;; <arg type='v'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
340 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
341 ;; <signal name='DeviceDisappeared'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
342 ;; <arg type='s'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
343 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
344 ;; </interface> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
345 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
346 (defcustom tramp-bluez-discover-devices-timeout 60 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
347 "Defines seconds since last bluetooth device discovery before rescanning. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
348 A value of 0 would require an immediate discovery during hostname |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
349 completion, nil means to use always cached values for discovered |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
350 devices." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
351 :group 'tramp |
103714
8d104b8ecf66
* net/tramp-gvfs.el (tramp-gvfs-methods)
Michael Albinus <michael.albinus@gmx.de>
parents:
103696
diff
changeset
|
352 :version "23.2" |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
353 :type '(choice (const nil) integer)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
354 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
355 (defvar tramp-bluez-discovery nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
356 "Indicator for a running bluetooth device discovery. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
357 It keeps the timestamp of last discovery.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
358 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
359 (defvar tramp-bluez-devices nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
360 "Alist of detected bluetooth devices. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
361 Every entry is a list (NAME ADDRESS).") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
362 |
103643
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
363 (defconst tramp-hal-service "org.freedesktop.Hal" |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
364 "The well known name of the HAL service.") |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
365 |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
366 (defconst tramp-hal-path-manager "/org/freedesktop/Hal/Manager" |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
367 "The object path of the HAL daemon manager.") |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
368 |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
369 (defconst tramp-hal-interface-manager "org.freedesktop.Hal.Manager" |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
370 "The manager interface of the HAL daemon.") |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
371 |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
372 (defconst tramp-hal-interface-device "org.freedesktop.Hal.Device" |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
373 "The device interface of the HAL daemon.") |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
374 |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
375 |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
376 ;; New handlers should be added here. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
377 (defconst tramp-gvfs-file-name-handler-alist |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
378 '( |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
379 (access-file . ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
380 (add-name-to-file . tramp-gvfs-handle-copy-file) |
103671
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
381 ;; `byte-compiler-base-file-name' performed by default handler. |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
382 (copy-file . tramp-gvfs-handle-copy-file) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
383 (delete-directory . tramp-gvfs-handle-delete-directory) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
384 (delete-file . tramp-gvfs-handle-delete-file) |
103671
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
385 ;; `diff-latest-backup-file' performed by default handler. |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
386 (directory-file-name . tramp-handle-directory-file-name) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
387 (directory-files . tramp-gvfs-handle-directory-files) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
388 (directory-files-and-attributes |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
389 . tramp-gvfs-handle-directory-files-and-attributes) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
390 (dired-call-process . ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
391 (dired-compress-file . ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
392 (dired-uncache . tramp-handle-dired-uncache) |
103671
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
393 ;; `executable-find' is not official yet. performed by default handler. |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
394 (expand-file-name . tramp-gvfs-handle-expand-file-name) |
103671
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
395 ;; `file-accessible-directory-p' performed by default handler. |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
396 (file-attributes . tramp-gvfs-handle-file-attributes) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
397 (file-directory-p . tramp-gvfs-handle-file-directory-p) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
398 (file-executable-p . tramp-gvfs-handle-file-executable-p) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
399 (file-exists-p . tramp-gvfs-handle-file-exists-p) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
400 (file-local-copy . tramp-gvfs-handle-file-local-copy) |
103671
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
401 ;; `file-modes' performed by default handler. |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
402 (file-name-all-completions . tramp-gvfs-handle-file-name-all-completions) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
403 (file-name-as-directory . tramp-handle-file-name-as-directory) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
404 (file-name-completion . tramp-handle-file-name-completion) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
405 (file-name-directory . tramp-handle-file-name-directory) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
406 (file-name-nondirectory . tramp-handle-file-name-nondirectory) |
103671
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
407 ;; `file-name-sans-versions' performed by default handler. |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
408 (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
409 (file-ownership-preserved-p . ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
410 (file-readable-p . tramp-gvfs-handle-file-readable-p) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
411 (file-regular-p . tramp-handle-file-regular-p) |
108077
93125d6fab29
Implement SELINUX backends.
Michael Albinus <michael.albinus@gmx.de>
parents:
107151
diff
changeset
|
412 (file-remote-p . tramp-handle-file-remote-p) |
93125d6fab29
Implement SELINUX backends.
Michael Albinus <michael.albinus@gmx.de>
parents:
107151
diff
changeset
|
413 (file-selinux-context . tramp-gvfs-handle-file-selinux-context) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
414 (file-symlink-p . tramp-handle-file-symlink-p) |
103671
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
415 ;; `file-truename' performed by default handler. |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
416 (file-writable-p . tramp-gvfs-handle-file-writable-p) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
417 (find-backup-file-name . tramp-handle-find-backup-file-name) |
103671
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
418 ;; `find-file-noselect' performed by default handler. |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
419 ;; `get-file-buffer' performed by default handler. |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
420 (insert-directory . tramp-gvfs-handle-insert-directory) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
421 (insert-file-contents . tramp-gvfs-handle-insert-file-contents) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
422 (load . tramp-handle-load) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
423 (make-directory . tramp-gvfs-handle-make-directory) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
424 (make-directory-internal . ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
425 (make-symbolic-link . ignore) |
103671
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
426 (process-file . tramp-gvfs-handle-process-file) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
427 (rename-file . tramp-gvfs-handle-rename-file) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
428 (set-file-modes . tramp-gvfs-handle-set-file-modes) |
108077
93125d6fab29
Implement SELINUX backends.
Michael Albinus <michael.albinus@gmx.de>
parents:
107151
diff
changeset
|
429 (set-file-selinux-context . tramp-gvfs-handle-set-file-selinux-context) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
430 (set-visited-file-modtime . tramp-gvfs-handle-set-visited-file-modtime) |
103671
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
431 (shell-command . tramp-gvfs-handle-shell-command) |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
432 (start-file-process . tramp-gvfs-handle-start-file-process) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
433 (substitute-in-file-name . tramp-handle-substitute-in-file-name) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
434 (unhandled-file-name-directory . tramp-handle-unhandled-file-name-directory) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
435 (vc-registered . ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
436 (verify-visited-file-modtime |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
437 . tramp-gvfs-handle-verify-visited-file-modtime) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
438 (write-region . tramp-gvfs-handle-write-region) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
439 ) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
440 "Alist of handler functions for Tramp GVFS method. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
441 Operations not mentioned here will be handled by the default Emacs primitives.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
442 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
443 ;;;###tramp-autoload |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
444 (defsubst tramp-gvfs-file-name-p (filename) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
445 "Check if it's a filename handled by the GVFS daemon." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
446 (and (tramp-tramp-file-p filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
447 (let ((method |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
448 (tramp-file-name-method (tramp-dissect-file-name filename)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
449 (and (stringp method) (member method tramp-gvfs-methods))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
450 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
451 ;;;###tramp-autoload |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
452 (defun tramp-gvfs-file-name-handler (operation &rest args) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
453 "Invoke the GVFS related OPERATION. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
454 First arg specifies the OPERATION, second arg is a list of arguments to |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
455 pass to the OPERATION." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
456 (let ((fn (assoc operation tramp-gvfs-file-name-handler-alist))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
457 (if fn |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
458 (save-match-data (apply (cdr fn) args)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
459 (tramp-run-real-handler operation args)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
460 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
461 ;; This might be moved to tramp.el. It shall be the first file name |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
462 ;; handler. |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
463 ;;;###tramp-autoload |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
464 (when (featurep 'dbusbind) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
465 (add-to-list 'tramp-foreign-file-name-handler-alist |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
466 (cons 'tramp-gvfs-file-name-p 'tramp-gvfs-file-name-handler))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
467 |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
468 (defun tramp-gvfs-stringify-dbus-message (message) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
469 "Convert a D-Bus message into readable UTF8 strings, used for traces." |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
470 (cond |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
471 ((and (consp message) (characterp (car message))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
472 (format "%S" (dbus-byte-array-to-string message))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
473 ((consp message) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
474 (mapcar 'tramp-gvfs-stringify-dbus-message message)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
475 ((stringp message) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
476 (format "%S" message)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
477 (t message))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
478 |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
479 (defmacro with-tramp-dbus-call-method |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
480 (vec synchronous bus service path interface method &rest args) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
481 "Apply a D-Bus call on bus BUS. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
482 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
483 If SYNCHRONOUS is non-nil, the call is synchronously. Otherwise, |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
484 it is an asynchronous call, with `ignore' as callback function. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
485 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
486 The other arguments have the same meaning as with `dbus-call-method' |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
487 or `dbus-call-method-asynchronously'. Additionally, the call |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
488 will be traced by Tramp with trace level 6." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
489 `(let ((func (if ,synchronous |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
490 'dbus-call-method 'dbus-call-method-asynchronously)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
491 (args (append (list ,bus ,service ,path ,interface ,method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
492 (if ,synchronous (list ,@args) (list 'ignore ,@args)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
493 result) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
494 (tramp-message ,vec 6 "%s %s" func args) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
495 (setq result (apply func args)) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
496 (tramp-message ,vec 6 "%s" (tramp-gvfs-stringify-dbus-message result)) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
497 result)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
498 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
499 (put 'with-tramp-dbus-call-method 'lisp-indent-function 2) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
500 (put 'with-tramp-dbus-call-method 'edebug-form-spec '(form symbolp body)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
501 (font-lock-add-keywords 'emacs-lisp-mode '("\\<with-tramp-dbus-call-method\\>")) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
502 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
503 (defmacro with-tramp-gvfs-error-message (filename handler &rest args) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
504 "Apply a Tramp GVFS `handler'. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
505 In case of an error, modify the error message by replacing |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
506 `filename' with its GVFS mounted name." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
507 `(let ((fuse-file-name (regexp-quote (tramp-gvfs-fuse-file-name ,filename))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
508 elt) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
509 (condition-case err |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
510 (tramp-compat-funcall ,handler ,@args) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
511 (error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
512 (setq elt (cdr err)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
513 (while elt |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
514 (when (and (stringp (car elt)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
515 (string-match fuse-file-name (car elt))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
516 (setcar elt (replace-match ,filename t t (car elt)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
517 (setq elt (cdr elt))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
518 (signal (car err) (cdr err)))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
519 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
520 (put 'with-tramp-gvfs-error-message 'lisp-indent-function 2) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
521 (put 'with-tramp-gvfs-error-message 'edebug-form-spec '(form symbolp body)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
522 (font-lock-add-keywords 'emacs-lisp-mode '("\\<with-tramp-gvfs-error-message\\>")) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
523 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
524 (defvar tramp-gvfs-dbus-event-vector nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
525 "Current Tramp file name to be used, as vector. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
526 It is needed when D-Bus signals or errors arrive, because there |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
527 is no information where to trace the message.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
528 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
529 (defun tramp-gvfs-dbus-event-error (event err) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
530 "Called when a D-Bus error message arrives, see `dbus-event-error-hooks'." |
106058
b6d8539323de
* net/tramp-gvfs.el (tramp-gvfs-dbus-event-error): Raise only an
Michael Albinus <michael.albinus@gmx.de>
parents:
105896
diff
changeset
|
531 (when tramp-gvfs-dbus-event-vector |
b6d8539323de
* net/tramp-gvfs.el (tramp-gvfs-dbus-event-error): Raise only an
Michael Albinus <michael.albinus@gmx.de>
parents:
105896
diff
changeset
|
532 ;(tramp-cleanup-connection tramp-gvfs-dbus-event-vector) |
b6d8539323de
* net/tramp-gvfs.el (tramp-gvfs-dbus-event-error): Raise only an
Michael Albinus <michael.albinus@gmx.de>
parents:
105896
diff
changeset
|
533 (tramp-message tramp-gvfs-dbus-event-vector 10 "%S" event) |
b6d8539323de
* net/tramp-gvfs.el (tramp-gvfs-dbus-event-error): Raise only an
Michael Albinus <michael.albinus@gmx.de>
parents:
105896
diff
changeset
|
534 (tramp-error tramp-gvfs-dbus-event-vector 'file-error "%s" (cadr err)))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
535 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
536 (add-hook 'dbus-event-error-hooks 'tramp-gvfs-dbus-event-error) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
537 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
538 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
539 ;; File name primitives. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
540 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
541 (defun tramp-gvfs-handle-copy-file |
108077
93125d6fab29
Implement SELINUX backends.
Michael Albinus <michael.albinus@gmx.de>
parents:
107151
diff
changeset
|
542 (filename newname &optional ok-if-already-exists keep-date |
93125d6fab29
Implement SELINUX backends.
Michael Albinus <michael.albinus@gmx.de>
parents:
107151
diff
changeset
|
543 preserve-uid-gid preserve-selinux-context) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
544 "Like `copy-file' for Tramp files." |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
545 (with-parsed-tramp-file-name |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
546 (if (tramp-tramp-file-p filename) filename newname) nil |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
547 (with-progress-reporter |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
548 v 0 (format "Copying %s to %s" filename newname) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
549 (condition-case err |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
550 (let ((args |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
551 (list |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
552 (if (tramp-gvfs-file-name-p filename) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
553 (tramp-gvfs-fuse-file-name filename) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
554 filename) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
555 (if (tramp-gvfs-file-name-p newname) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
556 (tramp-gvfs-fuse-file-name newname) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
557 newname) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
558 ok-if-already-exists keep-date preserve-uid-gid))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
559 (when preserve-selinux-context |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
560 (setq args (append args (list preserve-selinux-context)))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
561 (apply 'copy-file args)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
562 |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
563 ;; Error case. Let's try it with the GVFS utilities. |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
564 (error |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
565 (tramp-message v 4 "`copy-file' failed, trying `gvfs-copy'") |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
566 (unless |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
567 (zerop |
109309
1d46091f1f65
* net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Do not pass
Michael Albinus <albinus@detlef>
parents:
108887
diff
changeset
|
568 (let ((args |
1d46091f1f65
* net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Do not pass
Michael Albinus <albinus@detlef>
parents:
108887
diff
changeset
|
569 (append (if (or keep-date preserve-uid-gid) |
1d46091f1f65
* net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Do not pass
Michael Albinus <albinus@detlef>
parents:
108887
diff
changeset
|
570 (list "--preserve") |
1d46091f1f65
* net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Do not pass
Michael Albinus <albinus@detlef>
parents:
108887
diff
changeset
|
571 nil) |
1d46091f1f65
* net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Do not pass
Michael Albinus <albinus@detlef>
parents:
108887
diff
changeset
|
572 (list |
1d46091f1f65
* net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Do not pass
Michael Albinus <albinus@detlef>
parents:
108887
diff
changeset
|
573 (tramp-gvfs-url-file-name filename) |
1d46091f1f65
* net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Do not pass
Michael Albinus <albinus@detlef>
parents:
108887
diff
changeset
|
574 (tramp-gvfs-url-file-name newname))))) |
1d46091f1f65
* net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Do not pass
Michael Albinus <albinus@detlef>
parents:
108887
diff
changeset
|
575 (apply 'tramp-gvfs-send-command v "gvfs-copy" args))) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
576 ;; Propagate the error. |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
577 (tramp-error v (car err) "%s" (cdr err))))))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
578 |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
579 (when (file-remote-p newname) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
580 (with-parsed-tramp-file-name newname nil |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
581 (tramp-flush-file-property v (file-name-directory localname)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
582 (tramp-flush-file-property v localname)))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
583 |
105353
4f1a9f151253
* net/tramp-gvfs.el (tramp-gvfs-handle-delete-directory): Handle
Michael Albinus <michael.albinus@gmx.de>
parents:
104603
diff
changeset
|
584 (defun tramp-gvfs-handle-delete-directory (directory &optional recursive) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
585 "Like `delete-directory' for Tramp files." |
105896
471721be8fba
* net/tramp-fish.el (tramp-fish-handle-delete-directory):
Michael Albinus <michael.albinus@gmx.de>
parents:
105353
diff
changeset
|
586 (tramp-compat-delete-directory |
471721be8fba
* net/tramp-fish.el (tramp-fish-handle-delete-directory):
Michael Albinus <michael.albinus@gmx.de>
parents:
105353
diff
changeset
|
587 (tramp-gvfs-fuse-file-name directory) recursive)) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
588 |
108816
94d1d8a6dcfd
* net/tramp-compat.el (tramp-compat-delete-file): Use
Michael Albinus <michael.albinus@gmx.de>
parents:
108806
diff
changeset
|
589 (defun tramp-gvfs-handle-delete-file (filename &optional trash) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
590 "Like `delete-file' for Tramp files." |
108816
94d1d8a6dcfd
* net/tramp-compat.el (tramp-compat-delete-file): Use
Michael Albinus <michael.albinus@gmx.de>
parents:
108806
diff
changeset
|
591 (tramp-compat-delete-file (tramp-gvfs-fuse-file-name filename) trash)) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
592 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
593 (defun tramp-gvfs-handle-directory-files |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
594 (directory &optional full match nosort) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
595 "Like `directory-files' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
596 (let ((fuse-file-name (tramp-gvfs-fuse-file-name directory))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
597 (mapcar |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
598 (lambda (x) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
599 (if (string-match fuse-file-name x) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
600 (replace-match directory t t x) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
601 x)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
602 (directory-files fuse-file-name full match nosort)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
603 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
604 (defun tramp-gvfs-handle-directory-files-and-attributes |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
605 (directory &optional full match nosort id-format) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
606 "Like `directory-files-and-attributes' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
607 (let ((fuse-file-name (tramp-gvfs-fuse-file-name directory))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
608 (mapcar |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
609 (lambda (x) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
610 (when (string-match fuse-file-name (car x)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
611 (setcar x (replace-match directory t t (car x)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
612 x) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
613 (directory-files-and-attributes |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
614 fuse-file-name full match nosort id-format)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
615 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
616 (defun tramp-gvfs-handle-expand-file-name (name &optional dir) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
617 "Like `expand-file-name' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
618 ;; If DIR is not given, use DEFAULT-DIRECTORY or "/". |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
619 (setq dir (or dir default-directory "/")) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
620 ;; Unless NAME is absolute, concat DIR and NAME. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
621 (unless (file-name-absolute-p name) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
622 (setq name (concat (file-name-as-directory dir) name))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
623 ;; If NAME is not a Tramp file, run the real handler. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
624 (if (not (tramp-tramp-file-p name)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
625 (tramp-run-real-handler 'expand-file-name (list name nil)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
626 ;; Dissect NAME. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
627 (with-parsed-tramp-file-name name nil |
108887
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
628 ;; If there is a default location, expand tilde. |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
629 (when (string-match "\\`\\(~\\)\\(/\\|\\'\\)" localname) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
630 (save-match-data |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
631 (tramp-gvfs-maybe-open-connection (vector method user host "/"))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
632 (setq localname |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
633 (replace-match |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
634 (tramp-get-file-property v "/" "default-location" "~") |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
635 nil t localname 1))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
636 ;; Tilde expansion is not possible. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
637 (when (string-match "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
638 (tramp-error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
639 v 'file-error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
640 "Cannot expand tilde in file `%s'" name)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
641 (unless (tramp-run-real-handler 'file-name-absolute-p (list localname)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
642 (setq localname (concat "/" localname))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
643 ;; We do not pass "/..". |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
644 (if (string-equal "smb" method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
645 (when (string-match "^/[^/]+\\(/\\.\\./?\\)" localname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
646 (setq localname (replace-match "/" t t localname 1))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
647 (when (string-match "^/\\.\\./?" localname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
648 (setq localname (replace-match "/" t t localname)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
649 ;; There might be a double slash. Remove this. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
650 (while (string-match "//" localname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
651 (setq localname (replace-match "/" t t localname))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
652 ;; No tilde characters in file name, do normal |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
653 ;; `expand-file-name' (this does "/./" and "/../"). |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
654 (tramp-make-tramp-file-name |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
655 method user host |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
656 (tramp-run-real-handler |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
657 'expand-file-name (list localname)))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
658 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
659 (defun tramp-gvfs-handle-file-attributes (filename &optional id-format) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
660 "Like `file-attributes' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
661 (file-attributes (tramp-gvfs-fuse-file-name filename) id-format)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
662 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
663 (defun tramp-gvfs-handle-file-directory-p (filename) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
664 "Like `file-directory-p' for Tramp files." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
665 (file-directory-p (tramp-gvfs-fuse-file-name filename))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
666 |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
667 (defun tramp-gvfs-handle-file-executable-p (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
668 "Like `file-executable-p' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
669 (file-executable-p (tramp-gvfs-fuse-file-name filename))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
670 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
671 (defun tramp-gvfs-handle-file-exists-p (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
672 "Like `file-exists-p' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
673 (file-exists-p (tramp-gvfs-fuse-file-name filename))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
674 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
675 (defun tramp-gvfs-handle-file-local-copy (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
676 "Like `file-local-copy' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
677 (with-parsed-tramp-file-name filename nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
678 (let ((tmpfile (tramp-compat-make-temp-file filename))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
679 (unless (file-exists-p filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
680 (tramp-error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
681 v 'file-error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
682 "Cannot make local copy of non-existing file `%s'" filename)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
683 (copy-file filename tmpfile t t) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
684 tmpfile))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
685 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
686 (defun tramp-gvfs-handle-file-name-all-completions (filename directory) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
687 "Like `file-name-all-completions' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
688 (unless (save-match-data (string-match "/" filename)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
689 (file-name-all-completions filename (tramp-gvfs-fuse-file-name directory)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
690 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
691 (defun tramp-gvfs-handle-file-readable-p (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
692 "Like `file-readable-p' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
693 (file-readable-p (tramp-gvfs-fuse-file-name filename))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
694 |
108077
93125d6fab29
Implement SELINUX backends.
Michael Albinus <michael.albinus@gmx.de>
parents:
107151
diff
changeset
|
695 (defun tramp-gvfs-handle-file-selinux-context (filename) |
93125d6fab29
Implement SELINUX backends.
Michael Albinus <michael.albinus@gmx.de>
parents:
107151
diff
changeset
|
696 "Like `file-selinux-context' for Tramp files." |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
697 (tramp-compat-funcall |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
698 'file-selinux-context (tramp-gvfs-fuse-file-name filename))) |
108077
93125d6fab29
Implement SELINUX backends.
Michael Albinus <michael.albinus@gmx.de>
parents:
107151
diff
changeset
|
699 |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
700 (defun tramp-gvfs-handle-file-writable-p (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
701 "Like `file-writable-p' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
702 (file-writable-p (tramp-gvfs-fuse-file-name filename))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
703 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
704 (defun tramp-gvfs-handle-insert-directory |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
705 (filename switches &optional wildcard full-directory-p) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
706 "Like `insert-directory' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
707 (insert-directory |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
708 (tramp-gvfs-fuse-file-name filename) switches wildcard full-directory-p)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
709 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
710 (defun tramp-gvfs-handle-insert-file-contents |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
711 (filename &optional visit beg end replace) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
712 "Like `insert-file-contents' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
713 (unwind-protect |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
714 (let ((fuse-file-name (tramp-gvfs-fuse-file-name filename)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
715 (result |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
716 (insert-file-contents |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
717 (tramp-gvfs-fuse-file-name filename) visit beg end replace))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
718 (when (string-match fuse-file-name (car result)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
719 (setcar result (replace-match filename t t (car result)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
720 result) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
721 (setq buffer-file-name filename))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
722 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
723 (defun tramp-gvfs-handle-make-directory (dir &optional parents) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
724 "Like `make-directory' for Tramp files." |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
725 (with-parsed-tramp-file-name dir nil |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
726 (condition-case err |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
727 (with-tramp-gvfs-error-message dir 'make-directory |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
728 (tramp-gvfs-fuse-file-name dir) parents) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
729 |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
730 ;; Error case. Let's try it with the GVFS utilities. |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
731 (error |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
732 (tramp-message v 4 "`make-directory' failed, trying `gvfs-mkdir'") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
733 (unless |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
734 (zerop |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
735 (tramp-gvfs-send-command |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
736 v "gvfs-mkdir" (tramp-gvfs-url-file-name dir))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
737 ;; Propagate the error. |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
738 (tramp-error v (car err) "%s" (cdr err))))))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
739 |
103671
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
740 (defun tramp-gvfs-handle-process-file |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
741 (program &optional infile destination display &rest args) |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
742 "Like `process-file' for Tramp files." |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
743 (let ((default-directory (tramp-gvfs-fuse-file-name default-directory))) |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
744 (apply 'call-process program infile destination display args))) |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
745 |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
746 (defun tramp-gvfs-handle-rename-file |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
747 (filename newname &optional ok-if-already-exists) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
748 "Like `rename-file' for Tramp files." |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
749 (with-parsed-tramp-file-name |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
750 (if (tramp-tramp-file-p filename) filename newname) nil |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
751 (with-progress-reporter |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
752 v 0 (format "Renaming %s to %s" filename newname) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
753 (condition-case err |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
754 (rename-file |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
755 (if (tramp-gvfs-file-name-p filename) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
756 (tramp-gvfs-fuse-file-name filename) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
757 filename) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
758 (if (tramp-gvfs-file-name-p newname) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
759 (tramp-gvfs-fuse-file-name newname) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
760 newname) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
761 ok-if-already-exists) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
762 |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
763 ;; Error case. Let's try it with the GVFS utilities. |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
764 (error |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
765 (tramp-message v 4 "`rename-file' failed, trying `gvfs-move'") |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
766 (unless |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
767 (zerop |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
768 (tramp-gvfs-send-command |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
769 v "gvfs-move" |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
770 (tramp-gvfs-url-file-name filename) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
771 (tramp-gvfs-url-file-name newname))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
772 ;; Propagate the error. |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
773 (tramp-error v (car err) "%s" (cdr err))))))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
774 |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
775 (when (file-remote-p filename) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
776 (with-parsed-tramp-file-name filename nil |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
777 (tramp-flush-file-property v (file-name-directory localname)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
778 (tramp-flush-file-property v localname))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
779 |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
780 (when (file-remote-p newname) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
781 (with-parsed-tramp-file-name newname nil |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
782 (tramp-flush-file-property v (file-name-directory localname)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
783 (tramp-flush-file-property v localname)))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
784 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
785 (defun tramp-gvfs-handle-set-file-modes (filename mode) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
786 "Like `set-file-modes' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
787 (with-tramp-gvfs-error-message filename 'set-file-modes |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
788 (tramp-gvfs-fuse-file-name filename) mode)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
789 |
108077
93125d6fab29
Implement SELINUX backends.
Michael Albinus <michael.albinus@gmx.de>
parents:
107151
diff
changeset
|
790 (defun tramp-gvfs-handle-set-file-selinux-context (filename context) |
93125d6fab29
Implement SELINUX backends.
Michael Albinus <michael.albinus@gmx.de>
parents:
107151
diff
changeset
|
791 "Like `set-file-selinux-context' for Tramp files." |
93125d6fab29
Implement SELINUX backends.
Michael Albinus <michael.albinus@gmx.de>
parents:
107151
diff
changeset
|
792 (with-tramp-gvfs-error-message filename 'set-file-selinux-context |
93125d6fab29
Implement SELINUX backends.
Michael Albinus <michael.albinus@gmx.de>
parents:
107151
diff
changeset
|
793 (tramp-gvfs-fuse-file-name filename) context)) |
93125d6fab29
Implement SELINUX backends.
Michael Albinus <michael.albinus@gmx.de>
parents:
107151
diff
changeset
|
794 |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
795 (defun tramp-gvfs-handle-set-visited-file-modtime (&optional time-list) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
796 "Like `set-visited-file-modtime' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
797 (let ((buffer-file-name (tramp-gvfs-fuse-file-name (buffer-file-name)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
798 (set-visited-file-modtime time-list))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
799 |
103671
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
800 (defun tramp-gvfs-handle-shell-command |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
801 (command &optional output-buffer error-buffer) |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
802 "Like `shell-command' for Tramp files." |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
803 (let ((default-directory (tramp-gvfs-fuse-file-name default-directory))) |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
804 (shell-command command output-buffer error-buffer))) |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
805 |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
806 (defun tramp-gvfs-handle-start-file-process (name buffer program &rest args) |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
807 "Like `start-file-process' for Tramp files." |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
808 (let ((default-directory (tramp-gvfs-fuse-file-name default-directory))) |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
809 (apply 'start-process name buffer program args))) |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
810 |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
811 (defun tramp-gvfs-handle-verify-visited-file-modtime (buf) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
812 "Like `verify-visited-file-modtime' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
813 (with-current-buffer buf |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
814 (let ((buffer-file-name (tramp-gvfs-fuse-file-name (buffer-file-name)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
815 (verify-visited-file-modtime buf)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
816 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
817 (defun tramp-gvfs-handle-write-region |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
818 (start end filename &optional append visit lockname confirm) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
819 "Like `write-region' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
820 (with-parsed-tramp-file-name filename nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
821 (condition-case err |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
822 (with-tramp-gvfs-error-message filename 'write-region |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
823 start end (tramp-gvfs-fuse-file-name filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
824 append visit lockname confirm) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
825 |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
826 ;; Error case. Let's try rename. |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
827 (error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
828 (let ((tmpfile (tramp-compat-make-temp-file filename))) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
829 (tramp-message v 4 "`write-region' failed, trying `rename-file'") |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
830 (write-region start end tmpfile) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
831 (condition-case nil |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
832 (rename-file tmpfile filename) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
833 (error |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
834 (delete-file tmpfile) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
835 (tramp-error v (car err) "%s" (cdr err))))))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
836 |
106093
723842a98273
* net/tramp-gvfs.el (tramp-gvfs-handle-write-region): Set file
Michael Albinus <michael.albinus@gmx.de>
parents:
106058
diff
changeset
|
837 ;; Set file modification time. |
723842a98273
* net/tramp-gvfs.el (tramp-gvfs-handle-write-region): Set file
Michael Albinus <michael.albinus@gmx.de>
parents:
106058
diff
changeset
|
838 (when (or (eq visit t) (stringp visit)) |
723842a98273
* net/tramp-gvfs.el (tramp-gvfs-handle-write-region): Set file
Michael Albinus <michael.albinus@gmx.de>
parents:
106058
diff
changeset
|
839 (set-visited-file-modtime (nth 5 (file-attributes filename)))) |
723842a98273
* net/tramp-gvfs.el (tramp-gvfs-handle-write-region): Set file
Michael Albinus <michael.albinus@gmx.de>
parents:
106058
diff
changeset
|
840 |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
841 ;; The end. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
842 (when (or (eq visit t) (null visit) (stringp visit)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
843 (tramp-message v 0 "Wrote %s" filename)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
844 (run-hooks 'tramp-handle-write-region-hook))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
845 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
846 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
847 ;; File name conversions. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
848 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
849 (defun tramp-gvfs-url-file-name (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
850 "Return FILENAME in URL syntax." |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
851 ;; "/" must NOT be hexlified. |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
852 (let ((url-unreserved-chars (append '(?/) url-unreserved-chars))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
853 (url-recreate-url |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
854 (if (tramp-tramp-file-p filename) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
855 (with-parsed-tramp-file-name (file-truename filename) nil |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
856 (when (string-match tramp-user-with-domain-regexp user) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
857 (setq user |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
858 (concat (match-string 2 user) ";" (match-string 2 user)))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
859 (url-parse-make-urlobj |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
860 method user nil |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
861 (tramp-file-name-real-host v) (tramp-file-name-port v) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
862 (url-hexify-string localname))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
863 (url-parse-make-urlobj |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
864 "file" nil nil nil nil (url-hexify-string (file-truename filename))))))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
865 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
866 (defun tramp-gvfs-object-path (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
867 "Create a D-Bus object path from FILENAME." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
868 (expand-file-name (dbus-escape-as-identifier filename) tramp-gvfs-path-tramp)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
869 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
870 (defun tramp-gvfs-file-name (object-path) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
871 "Retrieve file name from D-Bus OBJECT-PATH." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
872 (dbus-unescape-from-identifier |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
873 (replace-regexp-in-string "^.*/\\([^/]+\\)$" "\\1" object-path))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
874 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
875 (defun tramp-gvfs-fuse-file-name (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
876 "Return FUSE file name, which is directly accessible." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
877 (with-parsed-tramp-file-name (expand-file-name filename) nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
878 (tramp-gvfs-maybe-open-connection v) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
879 (let ((prefix (tramp-get-file-property v "/" "prefix" "")) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
880 (fuse-mountpoint |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
881 (tramp-get-file-property v "/" "fuse-mountpoint" nil))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
882 (unless fuse-mountpoint |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
883 (tramp-error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
884 v 'file-error "There is no FUSE mount point for `%s'" filename)) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
885 ;; We must hide the prefix, if any. |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
886 (when (string-match (concat "^" (regexp-quote prefix)) localname) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
887 (setq localname (replace-match "" t t localname))) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
888 (tramp-message |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
889 v 10 "remote file `%s' is local file `%s'" |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
890 filename (concat fuse-mountpoint localname)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
891 (concat fuse-mountpoint localname)))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
892 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
893 (defun tramp-bluez-address (device) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
894 "Return bluetooth device address from a given bluetooth DEVICE name." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
895 (when (stringp device) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
896 (if (string-match tramp-ipv6-regexp device) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
897 (match-string 0 device) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
898 (cadr (assoc device (tramp-bluez-list-devices)))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
899 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
900 (defun tramp-bluez-device (address) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
901 "Return bluetooth device name from a given bluetooth device ADDRESS. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
902 ADDRESS can have the form \"xx:xx:xx:xx:xx:xx\" or \"[xx:xx:xx:xx:xx:xx]\"." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
903 (when (stringp address) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
904 (while (string-match "[][]" address) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
905 (setq address (replace-match "" t t address))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
906 (let (result) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
907 (dolist (item (tramp-bluez-list-devices) result) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
908 (when (string-match address (cadr item)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
909 (setq result (car item))))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
910 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
911 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
912 ;; D-Bus GVFS functions. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
913 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
914 (defun tramp-gvfs-handler-askpassword (message user domain flags) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
915 "Implementation for the \"org.gtk.vfs.MountOperation.askPassword\" method." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
916 (let* ((filename |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
917 (tramp-gvfs-file-name (dbus-event-path-name last-input-event))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
918 (pw-prompt |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
919 (format |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
920 "%s for %s " |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
921 (if (string-match "\\([pP]assword\\|[pP]assphrase\\)" message) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
922 (capitalize (match-string 1 message)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
923 "Password") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
924 filename)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
925 password) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
926 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
927 (condition-case nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
928 (with-parsed-tramp-file-name filename l |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
929 (when (and (zerop (length user)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
930 (not |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
931 (zerop (logand flags tramp-gvfs-password-need-username)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
932 (setq user (read-string "User name: "))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
933 (when (and (zerop (length domain)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
934 (not (zerop (logand flags tramp-gvfs-password-need-domain)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
935 (setq domain (read-string "Domain name: "))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
936 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
937 (tramp-message l 6 "%S %S %S %d" message user domain flags) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
938 (setq tramp-current-method l-method |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
939 tramp-current-user user |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
940 tramp-current-host l-host |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
941 password (tramp-read-passwd |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
942 (tramp-get-connection-process l) pw-prompt)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
943 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
944 ;; Return result. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
945 (if (stringp password) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
946 (list |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
947 t ;; password handled. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
948 nil ;; no abort of D-Bus. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
949 password |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
950 (tramp-file-name-real-user l) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
951 domain |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
952 nil ;; not anonymous. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
953 0) ;; no password save. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
954 ;; No password provided. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
955 (list nil t "" (tramp-file-name-real-user l) domain nil 0))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
956 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
957 ;; When QUIT is raised, we shall return this information to D-Bus. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
958 (quit (list nil t "" "" "" nil 0))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
959 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
960 (defun tramp-gvfs-handler-askquestion (message choices) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
961 "Implementation for the \"org.gtk.vfs.MountOperation.askQuestion\" method." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
962 (save-window-excursion |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
963 (let ((enable-recursive-minibuffers t) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
964 choice) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
965 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
966 (condition-case nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
967 (with-parsed-tramp-file-name |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
968 (tramp-gvfs-file-name (dbus-event-path-name last-input-event)) nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
969 (tramp-message v 6 "%S %S" message choices) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
970 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
971 ;; In theory, there can be several choices. Until now, |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
972 ;; there is only the question whether to accept an unknown |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
973 ;; host signature. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
974 (with-temp-buffer |
108775
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
975 ;; Preserve message for `progress-reporter'. |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
976 (with-temp-message "" |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
977 (insert message) |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
978 (pop-to-buffer (current-buffer)) |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
979 (setq choice (if (yes-or-no-p (concat (car choices) " ")) 0 1)) |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
980 (tramp-message v 6 "%d" choice))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
981 |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
982 ;; When the choice is "no", we set a dummy fuse-mountpoint |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
983 ;; in order to leave the timeout. |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
984 (unless (zerop choice) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
985 (tramp-set-file-property v "/" "fuse-mountpoint" "/")) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
986 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
987 (list |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
988 t ;; handled. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
989 nil ;; no abort of D-Bus. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
990 choice)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
991 |
108775
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
992 ;; When QUIT is raised, we shall return this information to D-Bus. |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
993 (quit (list nil t 0)))))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
994 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
995 (defun tramp-gvfs-handler-mounted-unmounted (mount-info) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
996 "Signal handler for the \"org.gtk.vfs.MountTracker.mounted\" and |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
997 \"org.gtk.vfs.MountTracker.unmounted\" signals." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
998 (ignore-errors |
108887
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
999 (let ((signal-name (dbus-event-member-name last-input-event)) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1000 (elt mount-info)) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1001 ;; Jump over the first elements of the mount info. Since there |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1002 ;; were changes in the antries, we cannot access dedicated |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1003 ;; elements. |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1004 (while (stringp (car elt)) (setq elt (cdr elt))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1005 (let* ((fuse-mountpoint (dbus-byte-array-to-string (cadr elt))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1006 (mount-spec (caddr elt)) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1007 (default-location (dbus-byte-array-to-string (cadddr elt))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1008 (method (dbus-byte-array-to-string |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1009 (cadr (assoc "type" (cadr mount-spec))))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1010 (user (dbus-byte-array-to-string |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1011 (cadr (assoc "user" (cadr mount-spec))))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1012 (domain (dbus-byte-array-to-string |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1013 (cadr (assoc "domain" (cadr mount-spec))))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1014 (host (dbus-byte-array-to-string |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1015 (cadr (or (assoc "host" (cadr mount-spec)) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1016 (assoc "server" (cadr mount-spec)))))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1017 (port (dbus-byte-array-to-string |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1018 (cadr (assoc "port" (cadr mount-spec))))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1019 (ssl (dbus-byte-array-to-string |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1020 (cadr (assoc "ssl" (cadr mount-spec))))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1021 (prefix (concat (dbus-byte-array-to-string (car mount-spec)) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1022 (dbus-byte-array-to-string |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1023 (cadr (assoc "share" (cadr mount-spec))))))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1024 (when (string-match "^smb" method) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1025 (setq method "smb")) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1026 (when (string-equal "obex" method) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1027 (setq host (tramp-bluez-device host))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1028 (when (and (string-equal "dav" method) (string-equal "true" ssl)) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1029 (setq method "davs")) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1030 (unless (zerop (length domain)) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1031 (setq user (concat user tramp-prefix-domain-format domain))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1032 (unless (zerop (length port)) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1033 (setq host (concat host tramp-prefix-port-format port))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1034 (with-parsed-tramp-file-name |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1035 (tramp-make-tramp-file-name method user host "") nil |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1036 (tramp-message |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1037 v 6 "%s %s" |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1038 signal-name (tramp-gvfs-stringify-dbus-message mount-info)) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1039 (tramp-set-file-property v "/" "list-mounts" 'undef) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1040 (if (string-equal signal-name "unmounted") |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1041 (tramp-set-file-property v "/" "fuse-mountpoint" nil) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1042 ;; Set prefix, mountpoint and location. |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1043 (unless (string-equal prefix "/") |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1044 (tramp-set-file-property v "/" "prefix" prefix)) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1045 (tramp-set-file-property v "/" "fuse-mountpoint" fuse-mountpoint) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1046 (tramp-set-file-property |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1047 v "/" "default-location" default-location))))))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1048 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1049 (dbus-register-signal |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1050 :session nil tramp-gvfs-path-mounttracker |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1051 tramp-gvfs-interface-mounttracker "mounted" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1052 'tramp-gvfs-handler-mounted-unmounted) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1053 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1054 (dbus-register-signal |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1055 :session nil tramp-gvfs-path-mounttracker |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1056 tramp-gvfs-interface-mounttracker "unmounted" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1057 'tramp-gvfs-handler-mounted-unmounted) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1058 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1059 (defun tramp-gvfs-connection-mounted-p (vec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1060 "Check, whether the location is already mounted." |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1061 (or |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1062 (tramp-get-file-property vec "/" "fuse-mountpoint" nil) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1063 (catch 'mounted |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1064 (dolist |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1065 (elt |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1066 (with-file-property vec "/" "list-mounts" |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1067 (with-tramp-dbus-call-method vec t |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1068 :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1069 tramp-gvfs-interface-mounttracker "listMounts")) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1070 nil) |
108887
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1071 ;; Jump over the first elements of the mount info. Since there |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1072 ;; were changes in the antries, we cannot access dedicated |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1073 ;; elements. |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1074 (while (stringp (car elt)) (setq elt (cdr elt))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1075 (let* ((fuse-mountpoint (dbus-byte-array-to-string (cadr elt))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1076 (mount-spec (caddr elt)) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1077 (default-location (dbus-byte-array-to-string (cadddr elt))) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1078 (method (dbus-byte-array-to-string |
108887
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1079 (cadr (assoc "type" (cadr mount-spec))))) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1080 (user (dbus-byte-array-to-string |
108887
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1081 (cadr (assoc "user" (cadr mount-spec))))) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1082 (domain (dbus-byte-array-to-string |
108887
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1083 (cadr (assoc "domain" (cadr mount-spec))))) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1084 (host (dbus-byte-array-to-string |
108887
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1085 (cadr (or (assoc "host" (cadr mount-spec)) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1086 (assoc "server" (cadr mount-spec)))))) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1087 (port (dbus-byte-array-to-string |
108887
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1088 (cadr (assoc "port" (cadr mount-spec))))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1089 (ssl (dbus-byte-array-to-string |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1090 (cadr (assoc "ssl" (cadr mount-spec))))) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1091 (prefix (concat (dbus-byte-array-to-string (car mount-spec)) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1092 (dbus-byte-array-to-string |
108887
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1093 (cadr (assoc "share" (cadr mount-spec))))))) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1094 (when (string-match "^smb" method) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1095 (setq method "smb")) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1096 (when (string-equal "obex" method) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1097 (setq host (tramp-bluez-device host))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1098 (when (and (string-equal "dav" method) (string-equal "true" ssl)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1099 (setq method "davs")) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1100 (when (and (string-equal "synce" method) (zerop (length user))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1101 (setq user (or (tramp-file-name-user vec) ""))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1102 (unless (zerop (length domain)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1103 (setq user (concat user tramp-prefix-domain-format domain))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1104 (unless (zerop (length port)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1105 (setq host (concat host tramp-prefix-port-format port))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1106 (when (and |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1107 (string-equal method (tramp-file-name-method vec)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1108 (string-equal user (or (tramp-file-name-user vec) "")) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1109 (string-equal host (tramp-file-name-host vec)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1110 (string-match (concat "^" (regexp-quote prefix)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1111 (tramp-file-name-localname vec))) |
108887
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1112 ;; Set prefix, mountpoint and location. |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1113 (unless (string-equal prefix "/") |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1114 (tramp-set-file-property vec "/" "prefix" prefix)) |
108887
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1115 (tramp-set-file-property vec "/" "fuse-mountpoint" fuse-mountpoint) |
2c20a51413cb
* net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): Expand "~/".
Michael Albinus <michael.albinus@gmx.de>
parents:
108863
diff
changeset
|
1116 (tramp-set-file-property vec "/" "default-location" default-location) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1117 (throw 'mounted t))))))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1118 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1119 (defun tramp-gvfs-mount-spec (vec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1120 "Return a mount-spec for \"org.gtk.vfs.MountTracker.mountLocation\"." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1121 (let* ((method (tramp-file-name-method vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1122 (user (tramp-file-name-real-user vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1123 (domain (tramp-file-name-domain vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1124 (host (tramp-file-name-real-host vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1125 (port (tramp-file-name-port vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1126 (localname (tramp-file-name-localname vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1127 (ssl (if (string-match "^davs" method) "true" "false")) |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1128 (mount-spec '(:array)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1129 (mount-pref "/")) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1130 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1131 (setq |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1132 mount-spec |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1133 (append |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1134 mount-spec |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1135 (cond |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1136 ((string-equal "smb" method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1137 (string-match "^/?\\([^/]+\\)" localname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1138 `((:struct "type" ,(dbus-string-to-byte-array "smb-share")) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1139 (:struct "server" ,(dbus-string-to-byte-array host)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1140 (:struct "share" ,(dbus-string-to-byte-array |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1141 (match-string 1 localname))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1142 ((string-equal "obex" method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1143 `((:struct "type" ,(dbus-string-to-byte-array method)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1144 (:struct "host" ,(dbus-string-to-byte-array |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1145 (concat "[" (tramp-bluez-address host) "]"))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1146 ((string-match "^dav" method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1147 `((:struct "type" ,(dbus-string-to-byte-array "dav")) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1148 (:struct "host" ,(dbus-string-to-byte-array host)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1149 (:struct "ssl" ,(dbus-string-to-byte-array ssl)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1150 (t |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1151 `((:struct "type" ,(dbus-string-to-byte-array method)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1152 (:struct "host" ,(dbus-string-to-byte-array host))))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1153 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1154 (when user |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1155 (add-to-list |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1156 'mount-spec |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1157 `(:struct "user" ,(dbus-string-to-byte-array user)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1158 'append)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1159 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1160 (when domain |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1161 (add-to-list |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1162 'mount-spec |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1163 `(:struct "domain" ,(dbus-string-to-byte-array domain)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1164 'append)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1165 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1166 (when port |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1167 (add-to-list |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1168 'mount-spec |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1169 `(:struct "port" ,(dbus-string-to-byte-array (number-to-string port))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1170 'append)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1171 |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1172 (when (and (string-match "^dav" method) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1173 (string-match "^/?[^/]+" localname)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1174 (setq mount-pref (match-string 0 localname))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1175 |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1176 ;; Return. |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1177 `(:struct ,(dbus-string-to-byte-array mount-pref) ,mount-spec))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1178 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1179 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1180 ;; Connection functions |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1181 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1182 (defun tramp-gvfs-maybe-open-connection (vec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1183 "Maybe open a connection VEC. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1184 Does not do anything if a connection is already open, but re-opens the |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1185 connection if a previous connection has died for some reason." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1186 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1187 ;; We set the file name, in case there are incoming D-Bus signals or |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1188 ;; D-Bus errors. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1189 (setq tramp-gvfs-dbus-event-vector vec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1190 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1191 ;; For password handling, we need a process bound to the connection |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1192 ;; buffer. Therefore, we create a dummy process. Maybe there is a |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1193 ;; better solution? |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1194 (unless (get-buffer-process (tramp-get-buffer vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1195 (let ((p (make-network-process |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1196 :name (tramp-buffer-name vec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1197 :buffer (tramp-get-buffer vec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1198 :server t :host 'local :service t))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1199 (tramp-set-process-query-on-exit-flag p nil))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1200 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1201 (unless (tramp-gvfs-connection-mounted-p vec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1202 (let* ((method (tramp-file-name-method vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1203 (user (tramp-file-name-user vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1204 (host (tramp-file-name-host vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1205 (object-path |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1206 (tramp-gvfs-object-path |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1207 (tramp-make-tramp-file-name method user host "")))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1208 |
108739
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1209 (with-progress-reporter |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1210 vec 3 |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1211 (if (zerop (length user)) |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1212 (format "Opening connection for %s using %s" host method) |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1213 (format "Opening connection for %s@%s using %s" user host method)) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1214 |
108739
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1215 ;; Enable auth-sorce and password-cache. |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1216 (tramp-set-connection-property vec "first-password-request" t) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1217 |
108739
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1218 ;; There will be a callback of "askPassword", when a password is |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1219 ;; needed. |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1220 (dbus-register-method |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1221 :session dbus-service-emacs object-path |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1222 tramp-gvfs-interface-mountoperation "askPassword" |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1223 'tramp-gvfs-handler-askpassword) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1224 |
108739
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1225 ;; There could be a callback of "askQuestion", when adding fingerprint. |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1226 (dbus-register-method |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1227 :session dbus-service-emacs object-path |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1228 tramp-gvfs-interface-mountoperation "askQuestion" |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1229 'tramp-gvfs-handler-askquestion) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1230 |
108739
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1231 ;; The call must be asynchronously, because of the "askPassword" |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1232 ;; or "askQuestion"callbacks. |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1233 (with-tramp-dbus-call-method vec nil |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1234 :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1235 tramp-gvfs-interface-mounttracker "mountLocation" |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1236 (tramp-gvfs-mount-spec vec) (dbus-get-unique-name :session) |
108739
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1237 :object-path object-path) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1238 |
108739
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1239 ;; We must wait, until the mount is applied. This will be |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1240 ;; indicated by the "mounted" signal, i.e. the "fuse-mountpoint" |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1241 ;; file property. |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1242 (with-timeout |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1243 (60 |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1244 (if (zerop (length (tramp-file-name-user vec))) |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1245 (tramp-error |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1246 vec 'file-error |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1247 "Timeout reached mounting %s using %s" host method) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1248 (tramp-error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1249 vec 'file-error |
108739
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1250 "Timeout reached mounting %s@%s using %s" user host method))) |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1251 (while (not (tramp-get-file-property vec "/" "fuse-mountpoint" nil)) |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1252 (read-event nil nil 0.1))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1253 |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1254 ;; If `tramp-gvfs-handler-askquestion' has returned "No", it |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1255 ;; is marked with the fuse-mountpoint "/". We shall react. |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1256 (when (string-equal |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1257 (tramp-get-file-property vec "/" "fuse-mountpoint" "") "/") |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1258 (tramp-error vec 'file-error "FUSE mount denied")) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1259 |
108739
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1260 ;; We set the connection property "started" in order to put the |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1261 ;; remote location into the cache, which is helpful for further |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1262 ;; completion. |
ae0f7dfcf9c9
* net/tramp.el (tramp-do-copy-or-rename-file)
Michael Albinus <michael.albinus@gmx.de>
parents:
108377
diff
changeset
|
1263 (tramp-set-connection-property vec "started" t))))) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1264 |
108863
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1265 (defun tramp-gvfs-send-command (vec command &rest args) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1266 "Send the COMMAND with its ARGS to connection VEC. |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1267 COMMAND is usually a command from the gvfs-* utilities. |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1268 `call-process' is applied, and its return code is returned." |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1269 (let (result) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1270 (with-current-buffer (tramp-get-buffer vec) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1271 (erase-buffer) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1272 (tramp-message vec 6 "%s %s" command (mapconcat 'identity args " ")) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1273 (setq result (apply 'tramp-local-call-process command nil t nil args)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1274 (tramp-message vec 6 "%s" (buffer-string)) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1275 result))) |
608a41397301
* net/tramp-gvfs.el (top): Require url-util.
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1276 |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1277 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1278 ;; D-Bus BLUEZ functions. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1279 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1280 (defun tramp-bluez-list-devices () |
103671
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
1281 "Return all discovered bluetooth devices as list. |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1282 Every entry is a list (NAME ADDRESS). |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1283 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1284 If `tramp-bluez-discover-devices-timeout' is an integer, and the last |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1285 discovery happened more time before indicated there, a rescan will be |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1286 started, which lasts some ten seconds. Otherwise, cached results will |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1287 be used." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1288 ;; Reset the scanned devices list if time has passed. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1289 (and (integerp tramp-bluez-discover-devices-timeout) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1290 (integerp tramp-bluez-discovery) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1291 (> (tramp-time-diff (current-time) tramp-bluez-discovery) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1292 tramp-bluez-discover-devices-timeout) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1293 (setq tramp-bluez-devices nil)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1294 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1295 ;; Rescan if needed. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1296 (unless tramp-bluez-devices |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1297 (let ((object-path |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1298 (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1299 :system tramp-bluez-service "/" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1300 tramp-bluez-interface-manager "DefaultAdapter"))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1301 (setq tramp-bluez-devices nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1302 tramp-bluez-discovery t) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1303 (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1304 :system tramp-bluez-service object-path |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1305 tramp-bluez-interface-adapter "StartDiscovery") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1306 (while tramp-bluez-discovery |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1307 (read-event nil nil 0.1)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1308 (setq tramp-bluez-discovery (current-time)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1309 (tramp-message tramp-gvfs-dbus-event-vector 10 "%s" tramp-bluez-devices) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1310 tramp-bluez-devices) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1311 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1312 (defun tramp-bluez-property-changed (property value) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1313 "Signal handler for the \"org.bluez.Adapter.PropertyChanged\" signal." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1314 (tramp-message tramp-gvfs-dbus-event-vector 6 "%s %s" property value) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1315 (cond |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1316 ((string-equal property "Discovering") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1317 (unless (car value) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1318 ;; "Discovering" FALSE means discovery run has been completed. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1319 ;; We stop it, because we don't need another run. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1320 (setq tramp-bluez-discovery nil) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1321 (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1322 :system tramp-bluez-service (dbus-event-path-name last-input-event) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1323 tramp-bluez-interface-adapter "StopDiscovery"))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1324 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1325 (dbus-register-signal |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1326 :system nil nil tramp-bluez-interface-adapter "PropertyChanged" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1327 'tramp-bluez-property-changed) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1328 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1329 (defun tramp-bluez-device-found (device args) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1330 "Signal handler for the \"org.bluez.Adapter.DeviceFound\" signal." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1331 (tramp-message tramp-gvfs-dbus-event-vector 6 "%s %s" device args) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1332 (let ((alias (car (cadr (assoc "Alias" args)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1333 (address (car (cadr (assoc "Address" args))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1334 ;; Maybe we shall check the device class for being a proper |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1335 ;; device, and call also SDP in order to find the obex service. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1336 (add-to-list 'tramp-bluez-devices (list alias address)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1337 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1338 (dbus-register-signal |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1339 :system nil nil tramp-bluez-interface-adapter "DeviceFound" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1340 'tramp-bluez-device-found) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1341 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1342 (defun tramp-bluez-parse-device-names (ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1343 "Return a list of (nil host) tuples allowed to access." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1344 (mapcar |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1345 (lambda (x) (list nil (car x))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1346 (tramp-bluez-list-devices))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1347 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1348 ;; Add completion function for OBEX method. |
104603
d52f81521f32
* net/tramp-gvfs.el (top): Use timeout of 100 msec pinging GVFS
Michael Albinus <michael.albinus@gmx.de>
parents:
104142
diff
changeset
|
1349 (when (member tramp-bluez-service (dbus-list-known-names :system)) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1350 (tramp-set-completion-function |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1351 "obex" '((tramp-bluez-parse-device-names "")))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1352 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1353 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1354 ;; D-Bus zeroconf functions. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1355 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1356 (defun tramp-zeroconf-parse-workstation-device-names (ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1357 "Return a list of (user host) tuples allowed to access." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1358 (mapcar |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1359 (lambda (x) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1360 (list nil (zeroconf-service-host x))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1361 (zeroconf-list-services "_workstation._tcp"))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1362 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1363 (defun tramp-zeroconf-parse-webdav-device-names (ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1364 "Return a list of (user host) tuples allowed to access." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1365 (mapcar |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1366 (lambda (x) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1367 (let ((host (zeroconf-service-host x)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1368 (port (zeroconf-service-port x)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1369 (text (zeroconf-service-txt x)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1370 user) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1371 (when port |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1372 (setq host (format "%s%s%d" host tramp-prefix-port-regexp port))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1373 ;; A user is marked in a TXT field like "u=guest". |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1374 (while text |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1375 (when (string-match "u=\\(.+\\)$" (car text)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1376 (setq user (match-string 1 (car text)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1377 (setq text (cdr text))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1378 (list user host))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1379 (zeroconf-list-services "_webdav._tcp"))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1380 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1381 ;; Add completion function for DAV and DAVS methods. |
104603
d52f81521f32
* net/tramp-gvfs.el (top): Use timeout of 100 msec pinging GVFS
Michael Albinus <michael.albinus@gmx.de>
parents:
104142
diff
changeset
|
1382 (when (member zeroconf-service-avahi (dbus-list-known-names :system)) |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1383 (zeroconf-init tramp-gvfs-zeroconf-domain) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1384 (tramp-set-completion-function |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1385 "sftp" '((tramp-zeroconf-parse-workstation-device-names ""))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1386 (tramp-set-completion-function |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1387 "dav" '((tramp-zeroconf-parse-webdav-device-names ""))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1388 (tramp-set-completion-function |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1389 "davs" '((tramp-zeroconf-parse-webdav-device-names "")))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1390 |
103637
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1391 |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1392 ;; D-Bus SYNCE functions. |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1393 |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1394 (defun tramp-synce-list-devices () |
103671
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
1395 "Return all discovered synce devices as list. |
103643
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
1396 They are retrieved from the hal daemon." |
103637
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1397 (let (tramp-synce-devices) |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1398 (dolist (device |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1399 (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t |
103643
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
1400 :system tramp-hal-service tramp-hal-path-manager |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
1401 tramp-hal-interface-manager "GetAllDevices")) |
103671
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
1402 (when (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
1403 :system tramp-hal-service device tramp-hal-interface-device |
2d532360a64b
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add
Michael Albinus <michael.albinus@gmx.de>
parents:
103643
diff
changeset
|
1404 "PropertyExists" "sync.plugin") |
103637
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1405 (add-to-list |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1406 'tramp-synce-devices |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1407 (with-tramp-dbus-call-method tramp-gvfs-dbus-event-vector t |
103643
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
1408 :system tramp-hal-service device tramp-hal-interface-device |
d4908813a2a1
* net/tramp-gvfs.el (top): Add a default for "synce" in
Michael Albinus <michael.albinus@gmx.de>
parents:
103637
diff
changeset
|
1409 "GetPropertyString" "pda.pocketpc.name")))) |
103637
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1410 (tramp-message tramp-gvfs-dbus-event-vector 10 "%s" tramp-synce-devices) |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1411 tramp-synce-devices)) |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1412 |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1413 (defun tramp-synce-parse-device-names (ignore) |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1414 "Return a list of (nil host) tuples allowed to access." |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1415 (mapcar |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1416 (lambda (x) (list nil x)) |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1417 (tramp-synce-list-devices))) |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1418 |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1419 ;; Add completion function for SYNCE method. |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1420 (tramp-set-completion-function |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1421 "synce" '((tramp-synce-parse-device-names ""))) |
9742a3174e95
* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
Michael Albinus <michael.albinus@gmx.de>
parents:
103576
diff
changeset
|
1422 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
1423 (add-hook 'tramp-unload-hook |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
1424 (lambda () |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
1425 (unload-feature 'tramp-gvfs 'force))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
110015
diff
changeset
|
1426 |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1427 (provide 'tramp-gvfs) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1428 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1429 ;;; TODO: |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1430 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1431 ;; * Host name completion via smb-server or smb-network. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1432 ;; * Check, how two shares of the same SMB server can be mounted in |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1433 ;; parallel. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1434 ;; * Apply SDP on bluetooth devices, in order to filter out obex |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1435 ;; capability. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1436 ;; * Implement obex for other serial communication but bluetooth. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1437 |
103554 | 1438 ;; arch-tag: f7f660ce-77f4-4132-9663-f5c25a47f7ed |
103526
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1439 ;;; tramp-gvfs.el ends here |