Mercurial > emacs
annotate lisp/net/tramp-gvfs.el @ 103532:898b2151d69f
* net/trampver.el: Update release number. Make version check fit
for SXEmacs 22.
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Mon, 22 Jun 2009 21:08:55 +0000 |
parents | 1d519ed4c0f4 |
children | 84379ac80754 |
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 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
3 ;; Copyright (C) 2009 Free Software Foundation, Inc. |
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 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
7 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
8 ;; This file is free software: you can redistribute it and/or modify |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
9 ;; 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
|
10 ;; 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
|
11 ;; (at your option) any later version. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
12 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
13 ;; This file is distributed in the hope that it will be useful, but |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
14 ;; WITHOUT ANY WARRANTY; without even the implied warranty of |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
16 ;; General Public License for more details. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
17 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
18 ;; 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
|
19 ;; 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
|
20 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
21 ;;; Commentary: |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
22 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
23 ;; Access functions for the GVFS daemon from Tramp. Tested with GVFS |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
24 ;; 1.0.2 (Ubuntu 8.10, Gnome 2.24). |
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 ;; 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
|
27 ;; 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
|
28 ;; themselves are performed via the mounted filesystem in ~/.gvfs. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
29 ;; Consequently, GNU Emacs 23.0.90 with enabled D-Bus bindings is a |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
30 ;; precondition. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
31 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
32 ;; 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
|
33 ;; introspection data. The interface, as discovered during |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
34 ;; development time, is given in respective comments. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
35 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
36 ;; The customer option `tramp-gvfs-methods' contains the list of |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
37 ;; supported connection methods. Per default, these are "dav", "davs" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
38 ;; and "obex". Note that with "obex" it might be necessary to pair |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
39 ;; with the other bluetooth device, if it hasn't been done already. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
40 ;; There might be also some few seconds delay in discovering available |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
41 ;; bluetooth devices. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
42 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
43 ;; 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
|
44 ;; 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
|
45 ;; 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
|
46 ;; implementation. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
47 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
48 ;; 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
|
49 ;; 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
|
50 ;; retrieved by: |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
51 ;; |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
52 ;; (message |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
53 ;; "%s" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
54 ;; (mapcar |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
55 ;; 'car |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
56 ;; (dbus-call-method |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
57 ;; :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
|
58 ;; tramp-gvfs-interface-mounttracker "listMountableInfo"))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
59 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
60 ;; 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
|
61 ;; 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
|
62 ;; 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
|
63 ;; drop me a note. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
64 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
65 ;; For hostname completion, information is retrieved either from the |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
66 ;; bluez daemon (for the "obex" method), or from the zeroconf daemon |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
67 ;; (for the "dav", "davs", and "sftp" methods). The zeroconf daemon |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
68 ;; is pre-configured to discover services in the "local" domain. If |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
69 ;; another domain shall be used for discovering services, the customer |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
70 ;; option `tramp-gvfs-zeroconf-domain' can be set accordingly. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
71 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
72 ;; Restrictions: |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
73 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
74 ;; * 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
|
75 ;; remote bluetooth device via OBEX. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
76 ;; |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
77 ;; * 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
|
78 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
79 ;;; Code: |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
80 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
81 ;; 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
|
82 ;; option "--without-dbus". Declare used subroutines and variables. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
83 (declare-function dbus-call-method "dbusbind.c") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
84 (declare-function dbus-call-method-asynchronously "dbusbind.c") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
85 (declare-function dbus-get-unique-name "dbusbind.c") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
86 (declare-function dbus-register-method "dbusbind.c") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
87 (declare-function dbus-register-signal "dbusbind.c") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
88 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
89 ;; Pacify byte-compiler |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
90 (eval-when-compile |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
91 (require 'cl) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
92 (require 'custom)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
93 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
94 (require 'tramp) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
95 (require 'dbus) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
96 (require 'url-parse) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
97 (require 'zeroconf) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
98 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
99 (defcustom tramp-gvfs-methods '("dav" "davs" "obex") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
100 "*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
|
101 :group 'tramp |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
102 :type '(repeat (choice (const "dav") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
103 (const "davs") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
104 (const "ftp") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
105 (const "obex") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
106 (const "sftp") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
107 (const "smb")))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
108 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
109 (defcustom tramp-gvfs-zeroconf-domain "local" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
110 "*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
|
111 :group 'tramp |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
112 :type 'string) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
113 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
114 ;; 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
|
115 ;; completion. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
116 (eval-after-load "tramp-gvfs" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
117 '(when (featurep 'tramp-gvfs) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
118 (dolist (elt tramp-gvfs-methods) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
119 (unless (assoc elt tramp-methods) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
120 (add-to-list 'tramp-methods (cons elt nil)))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
121 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
122 (defconst tramp-gvfs-mount-point |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
123 (file-name-as-directory (expand-file-name ".gvfs" "~/")) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
124 "The directory name, fuses mounts remote ressources.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
125 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
126 (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
|
127 "The preceeding object path for own objects.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
128 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
129 (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
|
130 "The well known name of the GVFS daemon.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
131 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
132 ;; Check that GVFS is available. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
133 (unless (dbus-ping :session tramp-gvfs-service-daemon) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
134 (message "GVFS daemon not running") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
135 (throw 'tramp-loading nil)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
136 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
137 (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
|
138 "The object path of the GVFS daemon.") |
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 (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
|
141 "The mount tracking interface in the GVFS daemon.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
142 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
143 ;; <interface name='org.gtk.vfs.MountTracker'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
144 ;; <method name='listMounts'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
145 ;; <arg name='mount_info_list' |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
146 ;; type='a{sosssssbay{aya{say}}}' |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
147 ;; direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
148 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
149 ;; <method name='mountLocation'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
150 ;; <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
|
151 ;; <arg name='dbus_id' type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
152 ;; <arg name='object_path' type='o' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
153 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
154 ;; <signal name='mounted'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
155 ;; <arg name='mount_info' |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
156 ;; type='{sosssssbay{aya{say}}}'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
157 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
158 ;; <signal name='unmounted'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
159 ;; <arg name='mount_info' |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
160 ;; type='{sosssssbay{aya{say}}}'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
161 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
162 ;; </interface> |
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 ;; STRUCT mount_info |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
165 ;; STRING dbus_id |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
166 ;; OBJECT_PATH object_path |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
167 ;; STRING display_name |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
168 ;; STRING stable_name |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
169 ;; STRING x_content_types |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
170 ;; STRING icon |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
171 ;; STRING prefered_filename_encoding |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
172 ;; BOOLEAN user_visible |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
173 ;; ARRAY BYTE fuse_mountpoint |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
174 ;; STRUCT mount_spec |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
175 ;; ARRAY BYTE mount_prefix |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
176 ;; ARRAY |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
177 ;; STRUCT mount_spec_item |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
178 ;; STRING key (server, share, type, user, host, port) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
179 ;; ARRAY BYTE value |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
180 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
181 (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
|
182 "Used by the dbus-proxying implementation of GMountOperation.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
183 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
184 ;; <interface name='org.gtk.vfs.MountOperation'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
185 ;; <method name='askPassword'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
186 ;; <arg name='message' type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
187 ;; <arg name='default_user' type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
188 ;; <arg name='default_domain' type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
189 ;; <arg name='flags' type='u' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
190 ;; <arg name='handled' type='b' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
191 ;; <arg name='aborted' type='b' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
192 ;; <arg name='password' type='s' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
193 ;; <arg name='username' type='s' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
194 ;; <arg name='domain' type='s' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
195 ;; <arg name='anonymous' type='b' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
196 ;; <arg name='password_save' type='u' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
197 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
198 ;; <method name='askQuestion'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
199 ;; <arg name='message' type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
200 ;; <arg name='choices' type='as' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
201 ;; <arg name='handled' type='b' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
202 ;; <arg name='aborted' type='b' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
203 ;; <arg name='choice' type='u' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
204 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
205 ;; </interface> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
206 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
207 ;; 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
|
208 ;; /usr/include/glib-2.0/gio/gioenums.h. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
209 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
210 (defconst tramp-gvfs-password-need-password 1 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
211 "Operation requires a password.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
212 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
213 (defconst tramp-gvfs-password-need-username 2 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
214 "Operation requires a username.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
215 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
216 (defconst tramp-gvfs-password-need-domain 4 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
217 "Operation requires a domain.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
218 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
219 (defconst tramp-gvfs-password-saving-supported 8 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
220 "Operation supports saving settings.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
221 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
222 (defconst tramp-gvfs-password-anonymous-supported 16 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
223 "Operation supports anonymous users.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
224 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
225 (defconst tramp-bluez-service "org.bluez" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
226 "The well known name of the BLUEZ service.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
227 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
228 (defconst tramp-bluez-interface-manager "org.bluez.Manager" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
229 "The manager interface of the BLUEZ daemon.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
230 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
231 ;; <interface name='org.bluez.Manager'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
232 ;; <method name='DefaultAdapter'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
233 ;; <arg type='o' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
234 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
235 ;; <method name='FindAdapter'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
236 ;; <arg type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
237 ;; <arg type='o' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
238 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
239 ;; <method name='ListAdapters'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
240 ;; <arg type='ao' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
241 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
242 ;; <signal name='AdapterAdded'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
243 ;; <arg type='o'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
244 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
245 ;; <signal name='AdapterRemoved'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
246 ;; <arg type='o'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
247 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
248 ;; <signal name='DefaultAdapterChanged'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
249 ;; <arg type='o'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
250 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
251 ;; </interface> |
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-adapter "org.bluez.Adapter" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
254 "The adapter 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.Adapter'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
257 ;; <method name='GetProperties'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
258 ;; <arg type='a{sv}' 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='SetProperty'> |
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='v' direction='in'/> |
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='RequestMode'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
265 ;; <arg type='s' direction='in'/> |
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 ;; <method name='ReleaseMode'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
268 ;; <method name='RequestSession'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
269 ;; <method name='ReleaseSession'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
270 ;; <method name='StartDiscovery'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
271 ;; <method name='StopDiscovery'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
272 ;; <method name='ListDevices'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
273 ;; <arg type='ao' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
274 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
275 ;; <method name='CreateDevice'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
276 ;; <arg type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
277 ;; <arg type='o' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
278 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
279 ;; <method name='CreatePairedDevice'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
280 ;; <arg type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
281 ;; <arg type='o' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
282 ;; <arg type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
283 ;; <arg type='o' 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='CancelDeviceCreation'> |
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 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
288 ;; <method name='RemoveDevice'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
289 ;; <arg type='o' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
290 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
291 ;; <method name='FindDevice'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
292 ;; <arg type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
293 ;; <arg type='o' direction='out'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
294 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
295 ;; <method name='RegisterAgent'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
296 ;; <arg type='o' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
297 ;; <arg type='s' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
298 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
299 ;; <method name='UnregisterAgent'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
300 ;; <arg type='o' direction='in'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
301 ;; </method> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
302 ;; <signal name='DeviceCreated'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
303 ;; <arg type='o'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
304 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
305 ;; <signal name='DeviceRemoved'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
306 ;; <arg type='o'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
307 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
308 ;; <signal name='DeviceFound'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
309 ;; <arg type='s'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
310 ;; <arg type='a{sv}'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
311 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
312 ;; <signal name='PropertyChanged'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
313 ;; <arg type='s'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
314 ;; <arg type='v'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
315 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
316 ;; <signal name='DeviceDisappeared'> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
317 ;; <arg type='s'/> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
318 ;; </signal> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
319 ;; </interface> |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
320 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
321 (defcustom tramp-bluez-discover-devices-timeout 60 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
322 "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
|
323 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
|
324 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
|
325 devices." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
326 :group 'tramp |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
327 :type '(choice (const nil) integer)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
328 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
329 (defvar tramp-bluez-discovery nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
330 "Indicator for a running bluetooth device discovery. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
331 It keeps the timestamp of last discovery.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
332 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
333 (defvar tramp-bluez-devices nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
334 "Alist of detected bluetooth devices. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
335 Every entry is a list (NAME ADDRESS).") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
336 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
337 ;; New handlers should be added here. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
338 (defconst tramp-gvfs-file-name-handler-alist |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
339 '( |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
340 (access-file . ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
341 (add-name-to-file . tramp-gvfs-handle-copy-file) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
342 ;; `byte-compiler-base-file-name' performed by default handler |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
343 (copy-file . tramp-gvfs-handle-copy-file) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
344 (delete-directory . tramp-gvfs-handle-delete-directory) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
345 (delete-file . tramp-gvfs-handle-delete-file) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
346 ;; `diff-latest-backup-file' performed by default handler |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
347 (directory-file-name . tramp-handle-directory-file-name) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
348 (directory-files . tramp-gvfs-handle-directory-files) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
349 (directory-files-and-attributes |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
350 . tramp-gvfs-handle-directory-files-and-attributes) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
351 (dired-call-process . ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
352 (dired-compress-file . ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
353 (dired-uncache . tramp-handle-dired-uncache) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
354 (expand-file-name . tramp-gvfs-handle-expand-file-name) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
355 ;; `file-accessible-directory-p' performed by default handler |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
356 (file-attributes . tramp-gvfs-handle-file-attributes) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
357 (file-directory-p . tramp-smb-handle-file-directory-p) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
358 (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
|
359 (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
|
360 (file-local-copy . tramp-gvfs-handle-file-local-copy) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
361 (file-remote-p . tramp-handle-file-remote-p) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
362 ;; `file-modes' performed by default handler |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
363 (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
|
364 (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
|
365 (file-name-completion . tramp-handle-file-name-completion) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
366 (file-name-directory . tramp-handle-file-name-directory) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
367 (file-name-nondirectory . tramp-handle-file-name-nondirectory) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
368 ;; `file-name-sans-versions' performed by default handler |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
369 (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
|
370 (file-ownership-preserved-p . ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
371 (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
|
372 (file-regular-p . tramp-handle-file-regular-p) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
373 (file-symlink-p . tramp-handle-file-symlink-p) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
374 ;; `file-truename' performed by default handler |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
375 (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
|
376 (find-backup-file-name . tramp-handle-find-backup-file-name) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
377 ;; `find-file-noselect' performed by default handler |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
378 ;; `get-file-buffer' performed by default handler |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
379 (insert-directory . tramp-gvfs-handle-insert-directory) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
380 (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
|
381 (load . tramp-handle-load) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
382 (make-directory . tramp-gvfs-handle-make-directory) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
383 (make-directory-internal . ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
384 (make-symbolic-link . ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
385 (rename-file . tramp-gvfs-handle-rename-file) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
386 (set-file-modes . tramp-gvfs-handle-set-file-modes) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
387 (set-visited-file-modtime . tramp-gvfs-handle-set-visited-file-modtime) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
388 (shell-command . ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
389 (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
|
390 (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
|
391 (vc-registered . ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
392 (verify-visited-file-modtime |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
393 . tramp-gvfs-handle-verify-visited-file-modtime) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
394 (write-region . tramp-gvfs-handle-write-region) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
395 ) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
396 "Alist of handler functions for Tramp GVFS method. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
397 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
|
398 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
399 (defun tramp-gvfs-file-name-p (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
400 "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
|
401 (and (tramp-tramp-file-p filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
402 (let ((method |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
403 (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
|
404 (and (stringp method) (member method tramp-gvfs-methods))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
405 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
406 (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
|
407 "Invoke the GVFS related OPERATION. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
408 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
|
409 pass to the OPERATION." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
410 (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
|
411 (if fn |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
412 (save-match-data (apply (cdr fn) args)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
413 (tramp-run-real-handler operation args)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
414 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
415 ;; 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
|
416 ;; handler. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
417 (add-to-list 'tramp-foreign-file-name-handler-alist |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
418 (cons 'tramp-gvfs-file-name-p 'tramp-gvfs-file-name-handler)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
419 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
420 (defmacro with-tramp-dbus-call-method |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
421 (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
|
422 "Apply a D-Bus call on bus BUS. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
423 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
424 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
|
425 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
|
426 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
427 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
|
428 or `dbus-call-method-asynchronously'. Additionally, the call |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
429 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
|
430 `(let ((func (if ,synchronous |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
431 'dbus-call-method 'dbus-call-method-asynchronously)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
432 (args (append (list ,bus ,service ,path ,interface ,method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
433 (if ,synchronous (list ,@args) (list 'ignore ,@args)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
434 result) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
435 (tramp-message ,vec 6 "%s %s" func args) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
436 (setq result (apply func args)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
437 (tramp-message ,vec 6 "\n%s" result) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
438 result)) |
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 (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
|
441 (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
|
442 (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
|
443 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
444 (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
|
445 "Apply a Tramp GVFS `handler'. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
446 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
|
447 `filename' with its GVFS mounted name." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
448 `(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
|
449 elt) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
450 (condition-case err |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
451 (apply ,handler (list ,@args)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
452 (error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
453 (setq elt (cdr err)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
454 (while elt |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
455 (when (and (stringp (car elt)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
456 (string-match fuse-file-name (car elt))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
457 (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
|
458 (setq elt (cdr elt))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
459 (signal (car err) (cdr err)))))) |
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 (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
|
462 (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
|
463 (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
|
464 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
465 (defvar tramp-gvfs-dbus-event-vector nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
466 "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
|
467 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
|
468 is no information where to trace the message.") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
469 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
470 (defun tramp-gvfs-dbus-event-error (event err) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
471 "Called when a D-Bus error message arrives, see `dbus-event-error-hooks'." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
472 ; (tramp-cleanup-connection tramp-gvfs-dbus-event-vector) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
473 (tramp-message tramp-gvfs-dbus-event-vector 1 "%S" event) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
474 (tramp-error tramp-gvfs-dbus-event-vector 'file-error "%s" (cadr err))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
475 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
476 (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
|
477 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
478 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
479 ;; File name primitives. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
480 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
481 (defun tramp-gvfs-handle-copy-file |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
482 (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
483 "Like `copy-file' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
484 (copy-file |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
485 (if (tramp-gvfs-file-name-p filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
486 (tramp-gvfs-fuse-file-name filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
487 filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
488 (if (tramp-gvfs-file-name-p newname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
489 (tramp-gvfs-fuse-file-name newname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
490 newname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
491 ok-if-already-exists keep-date preserve-uid-gid)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
492 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
493 (defun tramp-gvfs-handle-delete-directory (directory) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
494 "Like `delete-directory' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
495 (delete-directory (tramp-gvfs-fuse-file-name directory))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
496 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
497 (defun tramp-gvfs-handle-delete-file (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
498 "Like `delete-file' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
499 (delete-file (tramp-gvfs-fuse-file-name filename))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
500 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
501 (defun tramp-gvfs-handle-directory-files |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
502 (directory &optional full match nosort) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
503 "Like `directory-files' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
504 (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
|
505 (mapcar |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
506 (lambda (x) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
507 (if (string-match fuse-file-name x) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
508 (replace-match directory t t x) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
509 x)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
510 (directory-files fuse-file-name full match nosort)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
511 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
512 (defun tramp-gvfs-handle-directory-files-and-attributes |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
513 (directory &optional full match nosort id-format) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
514 "Like `directory-files-and-attributes' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
515 (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
|
516 (mapcar |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
517 (lambda (x) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
518 (when (string-match fuse-file-name (car x)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
519 (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
|
520 x) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
521 (directory-files-and-attributes |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
522 fuse-file-name full match nosort id-format)))) |
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 (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
|
525 "Like `expand-file-name' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
526 ;; 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
|
527 (setq dir (or dir default-directory "/")) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
528 ;; Unless NAME is absolute, concat DIR and NAME. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
529 (unless (file-name-absolute-p name) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
530 (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
|
531 ;; 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
|
532 (if (not (tramp-tramp-file-p name)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
533 (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
|
534 ;; Dissect NAME. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
535 (with-parsed-tramp-file-name name nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
536 ;; Tilde expansion is not possible. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
537 (when (string-match "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
538 (tramp-error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
539 v 'file-error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
540 "Cannot expand tilde in file `%s'" name)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
541 (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
|
542 (setq localname (concat "/" localname))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
543 ;; We do not pass "/..". |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
544 (if (string-equal "smb" method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
545 (when (string-match "^/[^/]+\\(/\\.\\./?\\)" localname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
546 (setq localname (replace-match "/" t t localname 1))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
547 (when (string-match "^/\\.\\./?" localname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
548 (setq localname (replace-match "/" t t localname)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
549 ;; There might be a double slash. Remove this. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
550 (while (string-match "//" localname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
551 (setq localname (replace-match "/" t t localname))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
552 ;; No tilde characters in file name, do normal |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
553 ;; `expand-file-name' (this does "/./" and "/../"). |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
554 (tramp-make-tramp-file-name |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
555 method user host |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
556 (tramp-run-real-handler |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
557 'expand-file-name (list localname)))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
558 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
559 (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
|
560 "Like `file-attributes' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
561 (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
|
562 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
563 (defun tramp-gvfs-handle-file-executable-p (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
564 "Like `file-executable-p' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
565 (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
|
566 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
567 (defun tramp-gvfs-handle-file-exists-p (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
568 "Like `file-exists-p' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
569 (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
|
570 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
571 (defun tramp-gvfs-handle-file-local-copy (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
572 "Like `file-local-copy' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
573 (with-parsed-tramp-file-name filename nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
574 (let ((tmpfile (tramp-compat-make-temp-file filename))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
575 (unless (file-exists-p filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
576 (tramp-error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
577 v 'file-error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
578 "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
|
579 (copy-file filename tmpfile t t) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
580 tmpfile))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
581 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
582 (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
|
583 "Like `file-name-all-completions' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
584 (unless (save-match-data (string-match "/" filename)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
585 (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
|
586 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
587 (defun tramp-gvfs-handle-file-readable-p (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
588 "Like `file-readable-p' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
589 (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
|
590 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
591 (defun tramp-gvfs-handle-file-writable-p (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
592 "Like `file-writable-p' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
593 (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
|
594 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
595 (defun tramp-gvfs-handle-insert-directory |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
596 (filename switches &optional wildcard full-directory-p) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
597 "Like `insert-directory' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
598 (insert-directory |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
599 (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
|
600 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
601 (defun tramp-gvfs-handle-insert-file-contents |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
602 (filename &optional visit beg end replace) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
603 "Like `insert-file-contents' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
604 (unwind-protect |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
605 (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
|
606 (result |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
607 (insert-file-contents |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
608 (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
|
609 (when (string-match fuse-file-name (car result)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
610 (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
|
611 result) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
612 (setq buffer-file-name filename))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
613 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
614 (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
|
615 "Like `make-directory' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
616 (condition-case err |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
617 (with-tramp-gvfs-error-message dir 'make-directory |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
618 (tramp-gvfs-fuse-file-name dir) parents) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
619 ;; Error case. Let's try it with the GVFS utilities. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
620 (error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
621 (with-parsed-tramp-file-name filename nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
622 (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
|
623 (unless |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
624 (zerop |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
625 (tramp-local-call-process |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
626 "gvfs-mkdir" nil (tramp-get-buffer v) nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
627 (tramp-gvfs-url-file-name filename))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
628 (signal (car err) (cdr err))))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
629 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
630 (defun tramp-gvfs-handle-rename-file |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
631 (filename newname &optional ok-if-already-exists) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
632 "Like `rename-file' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
633 (rename-file |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
634 (if (tramp-gvfs-file-name-p filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
635 (tramp-gvfs-fuse-file-name filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
636 filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
637 (if (tramp-gvfs-file-name-p newname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
638 (tramp-gvfs-fuse-file-name newname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
639 newname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
640 ok-if-already-exists)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
641 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
642 (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
|
643 "Like `set-file-modes' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
644 (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
|
645 (tramp-gvfs-fuse-file-name filename) mode)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
646 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
647 (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
|
648 "Like `set-visited-file-modtime' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
649 (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
|
650 (set-visited-file-modtime time-list))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
651 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
652 (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
|
653 "Like `verify-visited-file-modtime' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
654 (with-current-buffer buf |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
655 (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
|
656 (verify-visited-file-modtime buf)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
657 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
658 (defun tramp-gvfs-handle-write-region |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
659 (start end filename &optional append visit lockname confirm) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
660 "Like `write-region' for Tramp files." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
661 (with-parsed-tramp-file-name filename nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
662 (condition-case err |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
663 (with-tramp-gvfs-error-message filename 'write-region |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
664 start end (tramp-gvfs-fuse-file-name filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
665 append visit lockname confirm) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
666 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
667 ;; Error case. Let's try it with the GVFS utilities. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
668 (error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
669 (let ((tmpfile (tramp-compat-make-temp-file filename))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
670 (tramp-message v 4 "`write-region' failed, trying `gvfs-save'") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
671 (write-region start end tmpfile) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
672 (unwind-protect |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
673 (unless |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
674 (zerop |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
675 (tramp-local-call-process |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
676 "gvfs-save" tmpfile (tramp-get-buffer v) nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
677 (tramp-gvfs-url-file-name filename))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
678 (signal (car err) (cdr err))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
679 (delete-file tmpfile))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
680 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
681 ;; The end. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
682 (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
|
683 (tramp-message v 0 "Wrote %s" filename)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
684 (run-hooks 'tramp-handle-write-region-hook))) |
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 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
687 ;; File name conversions. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
688 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
689 (defun tramp-gvfs-url-file-name (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
690 "Return FILENAME in URL syntax." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
691 (url-recreate-url |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
692 (if (tramp-tramp-file-p filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
693 (with-parsed-tramp-file-name (file-truename filename) nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
694 (when (string-match tramp-user-with-domain-regexp user) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
695 (setq user |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
696 (concat (match-string 2 user) ";" (match-string 2 user)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
697 (url-parse-make-urlobj |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
698 method user nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
699 (tramp-file-name-real-host v) (tramp-file-name-port v) localname)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
700 (url-parse-make-urlobj "file" nil nil nil nil (file-truename filename))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
701 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
702 (defun tramp-gvfs-object-path (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
703 "Create a D-Bus object path from FILENAME." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
704 (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
|
705 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
706 (defun tramp-gvfs-file-name (object-path) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
707 "Retrieve file name from D-Bus OBJECT-PATH." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
708 (dbus-unescape-from-identifier |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
709 (replace-regexp-in-string "^.*/\\([^/]+\\)$" "\\1" object-path))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
710 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
711 (defun tramp-gvfs-fuse-file-name (filename) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
712 "Return FUSE file name, which is directly accessible." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
713 (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
|
714 (tramp-gvfs-maybe-open-connection v) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
715 (let ((fuse-mountpoint |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
716 (tramp-get-file-property v "/" "fuse-mountpoint" nil))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
717 (unless fuse-mountpoint |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
718 (tramp-error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
719 v 'file-error "There is no FUSE mount point for `%s'" filename)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
720 ;; We must remove the share from the local name. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
721 (when (and (string-equal "smb" method) (string-match "/[^/]+" localname)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
722 (setq localname (replace-match "" t t localname))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
723 (concat tramp-gvfs-mount-point fuse-mountpoint localname)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
724 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
725 (defun tramp-bluez-address (device) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
726 "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
|
727 (when (stringp device) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
728 (if (string-match tramp-ipv6-regexp device) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
729 (match-string 0 device) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
730 (cadr (assoc device (tramp-bluez-list-devices)))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
731 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
732 (defun tramp-bluez-device (address) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
733 "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
|
734 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
|
735 (when (stringp address) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
736 (while (string-match "[][]" address) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
737 (setq address (replace-match "" t t address))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
738 (let (result) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
739 (dolist (item (tramp-bluez-list-devices) result) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
740 (when (string-match address (cadr item)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
741 (setq result (car item))))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
742 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
743 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
744 ;; D-Bus GVFS functions. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
745 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
746 (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
|
747 "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
|
748 (let* ((filename |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
749 (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
|
750 (pw-prompt |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
751 (format |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
752 "%s for %s " |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
753 (if (string-match "\\([pP]assword\\|[pP]assphrase\\)" message) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
754 (capitalize (match-string 1 message)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
755 "Password") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
756 filename)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
757 password) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
758 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
759 (condition-case nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
760 (with-parsed-tramp-file-name filename l |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
761 (when (and (zerop (length user)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
762 (not |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
763 (zerop (logand flags tramp-gvfs-password-need-username)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
764 (setq user (read-string "User name: "))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
765 (when (and (zerop (length domain)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
766 (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
|
767 (setq domain (read-string "Domain name: "))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
768 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
769 (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
|
770 (setq tramp-current-method l-method |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
771 tramp-current-user user |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
772 tramp-current-host l-host |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
773 password (tramp-read-passwd |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
774 (tramp-get-connection-process l) pw-prompt)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
775 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
776 ;; Return result. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
777 (if (stringp password) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
778 (list |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
779 t ;; password handled. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
780 nil ;; no abort of D-Bus. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
781 password |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
782 (tramp-file-name-real-user l) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
783 domain |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
784 nil ;; not anonymous. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
785 0) ;; no password save. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
786 ;; No password provided. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
787 (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
|
788 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
789 ;; 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
|
790 (quit (list nil t "" "" "" nil 0))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
791 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
792 (defun tramp-gvfs-handler-askquestion (message choices) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
793 "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
|
794 (save-window-excursion |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
795 (let ((enable-recursive-minibuffers t) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
796 choice) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
797 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
798 (condition-case nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
799 (with-parsed-tramp-file-name |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
800 (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
|
801 (tramp-message v 6 "%S %S" message choices) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
802 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
803 ;; 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
|
804 ;; 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
|
805 ;; host signature. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
806 (with-temp-buffer |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
807 (insert message) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
808 (pop-to-buffer (current-buffer)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
809 (setq choice (if (yes-or-no-p (concat (car choices) " ")) 0 1)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
810 (tramp-message v 6 "%d" choice)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
811 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
812 ;; When the choice is "no", we set an empty |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
813 ;; fuse-mountpoint in order to leave the timeout. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
814 (unless (zerop choice) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
815 (tramp-set-file-property v "/" "fuse-mountpoint" "")) |
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 (list |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
818 t ;; handled. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
819 nil ;; no abort of D-Bus. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
820 choice)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
821 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
822 ;; 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
|
823 (quit (list nil t 0)))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
824 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
825 (defun tramp-gvfs-handler-mounted-unmounted (mount-info) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
826 "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
|
827 \"org.gtk.vfs.MountTracker.unmounted\" signals." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
828 (ignore-errors |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
829 (let* ((signal-name (dbus-event-member-name last-input-event)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
830 (mount-spec (nth 1 (nth 9 mount-info))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
831 (method (dbus-byte-array-to-string (cadr (assoc "type" mount-spec)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
832 (user (dbus-byte-array-to-string (cadr (assoc "user" mount-spec)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
833 (domain (dbus-byte-array-to-string |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
834 (cadr (assoc "domain" mount-spec)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
835 (host (dbus-byte-array-to-string |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
836 (cadr (or (assoc "host" mount-spec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
837 (assoc "server" mount-spec))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
838 (port (dbus-byte-array-to-string (cadr (assoc "port" mount-spec)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
839 (ssl (dbus-byte-array-to-string (cadr (assoc "ssl" mount-spec))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
840 (when (string-match "^smb" method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
841 (setq method "smb")) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
842 (when (string-equal "obex" method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
843 (setq host (tramp-bluez-device host))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
844 (when (and (string-equal "dav" method) (string-equal "true" ssl)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
845 (setq method "davs")) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
846 (unless (zerop (length domain)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
847 (setq user (concat user tramp-prefix-domain-format domain))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
848 (unless (zerop (length port)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
849 (setq host (concat host tramp-prefix-port-format port))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
850 (with-parsed-tramp-file-name |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
851 (tramp-make-tramp-file-name method user host "") nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
852 (tramp-message v 6 "%s %s" signal-name mount-info) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
853 (tramp-set-file-property v "/" "list-mounts" 'undef) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
854 (if (string-equal signal-name "unmounted") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
855 (tramp-set-file-property v "/" "fuse-mountpoint" nil) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
856 (tramp-set-file-property |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
857 v "/" "fuse-mountpoint" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
858 (file-name-nondirectory |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
859 (dbus-byte-array-to-string (nth 8 mount-info))))))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
860 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
861 (dbus-register-signal |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
862 :session nil tramp-gvfs-path-mounttracker |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
863 tramp-gvfs-interface-mounttracker "mounted" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
864 'tramp-gvfs-handler-mounted-unmounted) |
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 (dbus-register-signal |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
867 :session nil tramp-gvfs-path-mounttracker |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
868 tramp-gvfs-interface-mounttracker "unmounted" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
869 'tramp-gvfs-handler-mounted-unmounted) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
870 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
871 (defun tramp-gvfs-connection-mounted-p (vec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
872 "Check, whether the location is already mounted." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
873 (catch 'mounted |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
874 (dolist |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
875 (elt |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
876 (with-file-property vec "/" "list-mounts" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
877 (with-tramp-dbus-call-method vec t |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
878 :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
|
879 tramp-gvfs-interface-mounttracker "listMounts")) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
880 nil) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
881 (let* ((mount-spec (nth 1 (nth 9 elt))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
882 (method (dbus-byte-array-to-string |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
883 (cadr (assoc "type" mount-spec)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
884 (user (dbus-byte-array-to-string |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
885 (cadr (assoc "user" mount-spec)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
886 (domain (dbus-byte-array-to-string |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
887 (cadr (assoc "domain" mount-spec)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
888 (host (dbus-byte-array-to-string |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
889 (cadr (or (assoc "host" mount-spec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
890 (assoc "server" mount-spec))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
891 (port (dbus-byte-array-to-string (cadr (assoc "port" mount-spec)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
892 (ssl (dbus-byte-array-to-string (cadr (assoc "ssl" mount-spec))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
893 (when (string-match "^smb" method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
894 (setq method "smb")) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
895 (when (string-equal "obex" method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
896 (setq host (tramp-bluez-device host))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
897 (when (and (string-equal "dav" method) (string-equal "true" ssl)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
898 (setq method "davs")) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
899 (unless (zerop (length domain)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
900 (setq user (concat user tramp-prefix-domain-format domain))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
901 (unless (zerop (length port)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
902 (setq host (concat host tramp-prefix-port-format port))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
903 (when (and |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
904 (string-equal method (tramp-file-name-method vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
905 (string-equal user (or (tramp-file-name-user vec) "")) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
906 (string-equal host (tramp-file-name-host vec))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
907 (tramp-set-file-property |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
908 vec "/" "fuse-mountpoint" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
909 (file-name-nondirectory (dbus-byte-array-to-string (nth 8 elt)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
910 (throw 'mounted t)))))) |
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 (defun tramp-gvfs-mount-spec (vec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
913 "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
|
914 (let* ((method (tramp-file-name-method vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
915 (user (tramp-file-name-real-user vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
916 (domain (tramp-file-name-domain vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
917 (host (tramp-file-name-real-host vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
918 (port (tramp-file-name-port vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
919 (localname (tramp-file-name-localname vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
920 (ssl (if (string-match "^davs" method) "true" "false")) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
921 (mount-spec `(:array))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
922 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
923 (setq |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
924 mount-spec |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
925 (append |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
926 mount-spec |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
927 (cond |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
928 ((string-equal "smb" method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
929 (string-match "^/?\\([^/]+\\)" localname) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
930 `((: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
|
931 (:struct "server" ,(dbus-string-to-byte-array host)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
932 (:struct "share" ,(dbus-string-to-byte-array |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
933 (match-string 1 localname))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
934 ((string-equal "obex" method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
935 `((:struct "type" ,(dbus-string-to-byte-array method)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
936 (:struct "host" ,(dbus-string-to-byte-array |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
937 (concat "[" (tramp-bluez-address host) "]"))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
938 ((string-match "^dav" method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
939 `((:struct "type" ,(dbus-string-to-byte-array "dav")) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
940 (:struct "host" ,(dbus-string-to-byte-array host)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
941 (:struct "ssl" ,(dbus-string-to-byte-array ssl)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
942 (t |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
943 `((:struct "type" ,(dbus-string-to-byte-array method)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
944 (:struct "host" ,(dbus-string-to-byte-array host))))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
945 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
946 (when user |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
947 (add-to-list |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
948 'mount-spec |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
949 `(:struct "user" ,(dbus-string-to-byte-array user)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
950 'append)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
951 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
952 (when domain |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
953 (add-to-list |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
954 'mount-spec |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
955 `(:struct "domain" ,(dbus-string-to-byte-array domain)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
956 'append)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
957 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
958 (when port |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
959 (add-to-list |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
960 'mount-spec |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
961 `(: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
|
962 'append)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
963 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
964 ;; Return. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
965 mount-spec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
966 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
967 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
968 ;; Connection functions |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
969 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
970 (defun tramp-gvfs-maybe-open-connection (vec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
971 "Maybe open a connection VEC. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
972 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
|
973 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
|
974 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
975 ;; 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
|
976 ;; D-Bus errors. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
977 (setq tramp-gvfs-dbus-event-vector vec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
978 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
979 ;; 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
|
980 ;; 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
|
981 ;; better solution? |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
982 (unless (get-buffer-process (tramp-get-buffer vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
983 (let ((p (make-network-process |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
984 :name (tramp-buffer-name vec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
985 :buffer (tramp-get-buffer vec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
986 :server t :host 'local :service t))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
987 (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
|
988 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
989 (unless (tramp-gvfs-connection-mounted-p vec) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
990 (let* ((method (tramp-file-name-method vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
991 (user (tramp-file-name-user vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
992 (host (tramp-file-name-host vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
993 (object-path |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
994 (tramp-gvfs-object-path |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
995 (tramp-make-tramp-file-name method user host "")))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
996 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
997 (if (zerop (length (tramp-file-name-user vec))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
998 (tramp-message |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
999 vec 3 "Opening connection for %s using %s..." host method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1000 (tramp-message |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1001 vec 3 "Opening connection for %s@%s using %s..." user host method)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1002 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1003 ;; Enable auth-sorce and password-cache. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1004 (tramp-set-connection-property |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1005 (tramp-get-connection-process vec) "first-password-request" t) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1006 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1007 ;; There will be a callback of "askPassword", when a password is |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1008 ;; needed. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1009 (dbus-register-method |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1010 :session dbus-service-emacs object-path |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1011 tramp-gvfs-interface-mountoperation "askPassword" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1012 'tramp-gvfs-handler-askpassword) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1013 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1014 ;; There could be a callback of "askQuestion", when adding fingerprint. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1015 (dbus-register-method |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1016 :session dbus-service-emacs object-path |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1017 tramp-gvfs-interface-mountoperation "askQuestion" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1018 'tramp-gvfs-handler-askquestion) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1019 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1020 ;; The call must be asynchronously, because of the "askPassword" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1021 ;; or "askQuestion"callbacks. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1022 (with-tramp-dbus-call-method vec nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1023 :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
|
1024 tramp-gvfs-interface-mounttracker "mountLocation" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1025 `(:struct |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1026 ,(dbus-string-to-byte-array "/") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1027 ,(tramp-gvfs-mount-spec vec)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1028 (dbus-get-unique-name :session) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1029 :object-path object-path) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1030 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1031 ;; We must wait, until the mount is applied. This will be |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1032 ;; indicated by the "mounted" signal, i.e. the "fuse-mountpoint" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1033 ;; file property. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1034 (with-timeout |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1035 (60 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1036 (if (zerop (length (tramp-file-name-user vec))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1037 (tramp-error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1038 vec 'file-error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1039 "Timeout reached mounting %s using %s" host method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1040 (tramp-error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1041 vec 'file-error |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1042 "Timeout reached mounting %s@%s using %s" user host method))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1043 (while (not (tramp-get-file-property vec "/" "fuse-mountpoint" nil)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1044 (sit-for 0.1))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1045 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1046 ;; We set the connection property "started" in order to put the |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1047 ;; remote location into the cache, which is helpful for further |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1048 ;; completion. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1049 (tramp-set-connection-property vec "started" t) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1050 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1051 (if (zerop (length (tramp-file-name-user vec))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1052 (tramp-message |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1053 vec 3 "Opening connection for %s using %s...done" host method) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1054 (tramp-message |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1055 vec 3 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1056 "Opening connection for %s@%s using %s...done" user host method))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1057 |
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 ;; D-Bus BLUEZ functions. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1060 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1061 (defun tramp-bluez-list-devices () |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1062 "Returns all discovered bluetooth devices as list. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1063 Every entry is a list (NAME ADDRESS). |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1064 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1065 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
|
1066 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
|
1067 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
|
1068 be used." |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1069 ;; 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
|
1070 (and (integerp tramp-bluez-discover-devices-timeout) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1071 (integerp tramp-bluez-discovery) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1072 (> (tramp-time-diff (current-time) tramp-bluez-discovery) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1073 tramp-bluez-discover-devices-timeout) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1074 (setq tramp-bluez-devices nil)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1075 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1076 ;; Rescan if needed. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1077 (unless tramp-bluez-devices |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1078 (let ((object-path |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1079 (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
|
1080 :system tramp-bluez-service "/" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1081 tramp-bluez-interface-manager "DefaultAdapter"))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1082 (setq tramp-bluez-devices nil |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1083 tramp-bluez-discovery t) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1084 (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
|
1085 :system tramp-bluez-service object-path |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1086 tramp-bluez-interface-adapter "StartDiscovery") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1087 (while tramp-bluez-discovery |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1088 (read-event nil nil 0.1)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1089 (setq tramp-bluez-discovery (current-time)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1090 (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
|
1091 tramp-bluez-devices) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1092 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1093 (defun tramp-bluez-property-changed (property value) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1094 "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
|
1095 (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
|
1096 (cond |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1097 ((string-equal property "Discovering") |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1098 (unless (car value) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1099 ;; "Discovering" FALSE means discovery run has been completed. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1100 ;; 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
|
1101 (setq tramp-bluez-discovery nil) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1102 (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
|
1103 :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
|
1104 tramp-bluez-interface-adapter "StopDiscovery"))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1105 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1106 (dbus-register-signal |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1107 :system nil nil tramp-bluez-interface-adapter "PropertyChanged" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1108 'tramp-bluez-property-changed) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1109 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1110 (defun tramp-bluez-device-found (device args) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1111 "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
|
1112 (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
|
1113 (let ((alias (car (cadr (assoc "Alias" args)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1114 (address (car (cadr (assoc "Address" args))))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1115 ;; 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
|
1116 ;; 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
|
1117 (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
|
1118 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1119 (dbus-register-signal |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1120 :system nil nil tramp-bluez-interface-adapter "DeviceFound" |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1121 'tramp-bluez-device-found) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1122 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1123 (defun tramp-bluez-parse-device-names (ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1124 "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
|
1125 (mapcar |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1126 (lambda (x) (list nil (car x))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1127 (tramp-bluez-list-devices))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1128 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1129 ;; Add completion function for OBEX method. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1130 (when (dbus-ping :system tramp-bluez-service) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1131 (tramp-set-completion-function |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1132 "obex" '((tramp-bluez-parse-device-names "")))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1133 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1134 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1135 ;; D-Bus zeroconf functions. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1136 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1137 (defun tramp-zeroconf-parse-workstation-device-names (ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1138 "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
|
1139 (mapcar |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1140 (lambda (x) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1141 (list nil (zeroconf-service-host x))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1142 (zeroconf-list-services "_workstation._tcp"))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1143 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1144 (defun tramp-zeroconf-parse-webdav-device-names (ignore) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1145 "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
|
1146 (mapcar |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1147 (lambda (x) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1148 (let ((host (zeroconf-service-host x)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1149 (port (zeroconf-service-port x)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1150 (text (zeroconf-service-txt x)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1151 user) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1152 (when port |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1153 (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
|
1154 ;; 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
|
1155 (while text |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1156 (when (string-match "u=\\(.+\\)$" (car text)) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1157 (setq user (match-string 1 (car text)))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1158 (setq text (cdr text))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1159 (list user host))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1160 (zeroconf-list-services "_webdav._tcp"))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1161 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1162 ;; Add completion function for DAV and DAVS methods. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1163 (when (dbus-ping :system zeroconf-service-avahi) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1164 (zeroconf-init tramp-gvfs-zeroconf-domain) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1165 (tramp-set-completion-function |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1166 "sftp" '((tramp-zeroconf-parse-workstation-device-names ""))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1167 (tramp-set-completion-function |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1168 "dav" '((tramp-zeroconf-parse-webdav-device-names ""))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1169 (tramp-set-completion-function |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1170 "davs" '((tramp-zeroconf-parse-webdav-device-names "")))) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1171 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1172 (provide 'tramp-gvfs) |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1173 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1174 ;;; TODO: |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1175 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1176 ;; * process-file and start-file-process on the local machine, but |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1177 ;; with remote files. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1178 ;; * 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
|
1179 ;; * 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
|
1180 ;; parallel. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1181 ;; * 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
|
1182 ;; capability. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1183 ;; * Implement obex for other serial communication but bluetooth. |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1184 |
1d519ed4c0f4
* net/tramp-gvfs.el: New package.
Michael Albinus <michael.albinus@gmx.de>
parents:
diff
changeset
|
1185 ;;; tramp-gvfs.el ends here |