Mercurial > emacs
annotate lisp/net/tramp.el @ 112235:b1eac6d41a93
[Gnus] Update copyright years.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Sat, 15 Jan 2011 00:35:35 +0000 |
parents | 417b1e4d63cd |
children | 4f72b1e43644 |
rev | line source |
---|---|
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
1 ;;; tramp.el --- Transparent Remote Access, Multiple Protocol |
45861 | 2 |
64701
34bd8e434dd7
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64559
diff
changeset
|
3 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
112218
376148b31b5e
Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents:
112091
diff
changeset
|
4 ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. |
45861 | 5 |
93103
19a32f437b65
Fix up encoding.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93082
diff
changeset
|
6 ;; Author: Kai Großjohann <kai.grossjohann@gmx.net> |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7 ;; Michael Albinus <michael.albinus@gmx.de> |
45861 | 8 ;; Keywords: comm, processes |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
9 ;; Package: tramp |
45861 | 10 |
11 ;; This file is part of GNU Emacs. | |
12 | |
94677
91e5880a36c1
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94436
diff
changeset
|
13 ;; GNU Emacs is free software: you can redistribute it and/or modify |
45861 | 14 ;; it under the terms of the GNU General Public License as published by |
94677
91e5880a36c1
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94436
diff
changeset
|
15 ;; the Free Software Foundation, either version 3 of the License, or |
91e5880a36c1
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94436
diff
changeset
|
16 ;; (at your option) any later version. |
45861 | 17 |
18 ;; GNU Emacs is distributed in the hope that it will be useful, | |
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 ;; GNU General Public License for more details. | |
22 | |
23 ;; You should have received a copy of the GNU General Public License | |
94677
91e5880a36c1
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94436
diff
changeset
|
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
45861 | 25 |
26 ;;; Commentary: | |
27 | |
28 ;; This package provides remote file editing, similar to ange-ftp. | |
29 ;; The difference is that ange-ftp uses FTP to transfer files between | |
30 ;; the local and the remote host, whereas tramp.el uses a combination | |
31 ;; of rsh and rcp or other work-alike programs, such as ssh/scp. | |
32 ;; | |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
33 ;; For more detailed instructions, please see the info file. |
45861 | 34 ;; |
35 ;; Notes: | |
36 ;; ----- | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
37 ;; |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
38 ;; This package only works for Emacs 22.1 and higher, and for XEmacs 21.4 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
39 ;; and higher. For XEmacs 21, you need the package `fsf-compat' for |
106643
9e3bbd77797c
* net/tramp.el (tramp-handle-insert-directory): Quote "'" in the
Michael Albinus <michael.albinus@gmx.de>
parents:
106613
diff
changeset
|
40 ;; the `with-timeout' macro. |
45861 | 41 ;; |
42 ;; Also see the todo list at the bottom of this file. | |
43 ;; | |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
44 ;; The current version of Tramp can be retrieved from the following URL: |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
45 ;; http://ftp.gnu.org/gnu/tramp/ |
45861 | 46 ;; |
47 ;; There's a mailing list for this, as well. Its name is: | |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
48 ;; tramp-devel@gnu.org |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
49 ;; You can use the Web to subscribe, under the following URL: |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
50 ;; http://lists.gnu.org/mailman/listinfo/tramp-devel |
45861 | 51 ;; |
52 ;; For the adventurous, the current development sources are available | |
53 ;; via CVS. You can find instructions about this at the following URL: | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
54 ;; http://savannah.gnu.org/projects/tramp/ |
45861 | 55 ;; Click on "CVS" in the navigation bar near the top. |
56 ;; | |
57 ;; Don't forget to put on your asbestos longjohns, first! | |
58 | |
59 ;;; Code: | |
60 | |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
61 (require 'tramp-compat) |
77986
0cc9b64806d2
Sync with Tramp 2.0.56.
Michael Albinus <michael.albinus@gmx.de>
parents:
76846
diff
changeset
|
62 |
45861 | 63 ;;; User Customizable Internal Variables: |
64 | |
65 (defgroup tramp nil | |
66 "Edit remote files with a combination of rsh and rcp or similar programs." | |
58005
f15a720d0f24
(tramp group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents:
57995
diff
changeset
|
67 :group 'files |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
68 :group 'comm |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
69 :version "22.1") |
45861 | 70 |
94436
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
71 ;; Maybe we need once a real Tramp mode, with key bindings etc. |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
72 ;;;###autoload |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
73 (defcustom tramp-mode t |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
74 "*Whether Tramp is enabled. |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
75 If it is set to nil, all remote file names are used literally." |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
76 :group 'tramp |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
77 :type 'boolean) |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
78 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
79 (defcustom tramp-verbose 3 |
105462
f6c5cf0fc0c9
* net/tramp.el (tramp-verbose): Fix docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
105351
diff
changeset
|
80 "*Verbosity level for Tramp messages. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
81 Any level x includes messages for all levels 1 .. x-1. The levels are |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
82 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
83 0 silent (no tramp messages at all) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
84 1 errors |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
85 2 warnings |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
86 3 connection to remote hosts (default level) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
87 4 activities |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
88 5 internal |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
89 6 sent and received strings |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
90 7 file caching |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
91 8 connection properties |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
92 9 test commands |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
93 10 traces (huge)." |
45861 | 94 :group 'tramp |
95 :type 'integer) | |
96 | |
105462
f6c5cf0fc0c9
* net/tramp.el (tramp-verbose): Fix docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
105351
diff
changeset
|
97 ;; Emacs case. |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
98 (eval-and-compile |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
99 (when (boundp 'backup-directory-alist) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
100 (defcustom tramp-backup-directory-alist nil |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
101 "Alist of filename patterns and backup directory names. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
102 Each element looks like (REGEXP . DIRECTORY), with the same meaning like |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
103 in `backup-directory-alist'. If a Tramp file is backed up, and DIRECTORY |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
104 is a local file name, the backup directory is prepended with Tramp file |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
105 name prefix \(method, user, host\) of file. |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
106 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
107 \(setq tramp-backup-directory-alist backup-directory-alist\) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
108 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
109 gives the same backup policy for Tramp files on their hosts like the |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
110 policy for local files." |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
111 :group 'tramp |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
112 :type '(repeat (cons (regexp :tag "Regexp matching filename") |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
113 (directory :tag "Backup directory name")))))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
114 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
115 ;; XEmacs case. We cannot check for `bkup-backup-directory-info', because |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
116 ;; the package "backup-dir" might not be loaded yet. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
117 (eval-and-compile |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
118 (when (featurep 'xemacs) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
119 (defcustom tramp-bkup-backup-directory-info nil |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
120 "*Alist of (FILE-REGEXP BACKUP-DIR OPTIONS ...)) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
121 It has the same meaning like `bkup-backup-directory-info' from package |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
122 `backup-dir'. If a Tramp file is backed up, and BACKUP-DIR is a local |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
123 file name, the backup directory is prepended with Tramp file name prefix |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
124 \(method, user, host\) of file. |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
125 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
126 \(setq tramp-bkup-backup-directory-info bkup-backup-directory-info\) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
127 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
128 gives the same backup policy for Tramp files on their hosts like the |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
129 policy for local files." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
130 :type '(repeat |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
131 (list (regexp :tag "File regexp") |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
132 (string :tag "Backup Dir") |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
133 (set :inline t |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
134 (const ok-create) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
135 (const full-path) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
136 (const prepend-name) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
137 (const search-upward)))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
138 :group 'tramp))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
139 |
45861 | 140 (defcustom tramp-auto-save-directory nil |
141 "*Put auto-save files in this directory, if set. | |
142 The idea is to use a local directory so that auto-saving is faster." | |
143 :group 'tramp | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
144 :type '(choice (const nil) string)) |
45861 | 145 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
146 (defcustom tramp-encoding-shell |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
147 (if (memq system-type '(windows-nt)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
148 (getenv "COMSPEC") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
149 "/bin/sh") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
150 "*Use this program for encoding and decoding commands on the local host. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
151 This shell is used to execute the encoding and decoding command on the |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
152 local host, so if you want to use `~' in those commands, you should |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
153 choose a shell here which groks tilde expansion. `/bin/sh' normally |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
154 does not understand tilde expansion. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
155 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
156 For encoding and deocding, commands like the following are executed: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
157 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
158 /bin/sh -c COMMAND < INPUT > OUTPUT |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
159 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
160 This variable can be used to change the \"/bin/sh\" part. See the |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
161 variable `tramp-encoding-command-switch' for the \"-c\" part. |
45861 | 162 |
163 Note that this variable is not used for remote commands. There are | |
164 mechanisms in tramp.el which automatically determine the right shell to | |
165 use for the remote host." | |
166 :group 'tramp | |
167 :type '(file :must-match t)) | |
168 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
169 (defcustom tramp-encoding-command-switch |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
170 (if (string-match "cmd\\.exe" tramp-encoding-shell) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
171 "/c" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
172 "-c") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
173 "*Use this switch together with `tramp-encoding-shell' for local commands. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
174 See the variable `tramp-encoding-shell' for more information." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
175 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
176 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
177 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
178 ;;;###tramp-autoload |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
179 (defvar tramp-methods nil |
45861 | 180 "*Alist of methods for remote files. |
181 This is a list of entries of the form (NAME PARAM1 PARAM2 ...). | |
182 Each NAME stands for a remote access method. Each PARAM is a | |
183 pair of the form (KEY VALUE). The following KEYs are defined: | |
184 * `tramp-remote-sh' | |
185 This specifies the Bourne shell to use on the remote host. This | |
186 MUST be a Bourne-like shell. It is normally not necessary to set | |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
187 this to any value other than \"/bin/sh\": Tramp wants to use a shell |
45861 | 188 which groks tilde expansion, but it can search for it. Also note |
189 that \"/bin/sh\" exists on all Unixen, this might not be true for | |
190 the value that you decide to use. You Have Been Warned. | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
191 * `tramp-login-program' |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
192 This specifies the name of the program to use for logging in to the |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
193 remote host. This may be the name of rsh or a workalike program, |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
194 or the name of telnet or a workalike, or the name of su or a workalike. |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
195 * `tramp-login-args' |
45861 | 196 This specifies the list of arguments to pass to the above |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
197 mentioned program. Please note that this is a list of list of arguments, |
45861 | 198 that is, normally you don't want to put \"-a -b\" or \"-f foo\" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
199 here. Instead, you want a list (\"-a\" \"-b\"), or (\"-f\" \"foo\"). |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
200 There are some patterns: \"%h\" in this list is replaced by the host |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
201 name, \"%u\" is replaced by the user name, \"%p\" is replaced by the |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
202 port number, and \"%%\" can be used to obtain a literal percent character. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
203 If a list containing \"%h\", \"%u\" or \"%p\" is unchanged during |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
204 expansion (i.e. no host or no user specified), this list is not used as |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
205 argument. By this, arguments like (\"-l\" \"%u\") are optional. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
206 \"%t\" is replaced by the temporary file name produced with |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
207 `tramp-make-tramp-temp-file'. \"%k\" indicates the keep-date |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
208 parameter of a program, if exists. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
209 * `tramp-async-args' |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
210 When an asynchronous process is started, we know already that |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
211 the connection works. Therefore, we can pass additional |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
212 parameters to suppress diagnostic messages, in order not to |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
213 tamper the process output. |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
214 * `tramp-copy-program' |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
215 This specifies the name of the program to use for remotely copying |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
216 the file; this might be the absolute filename of rcp or the name of |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
217 a workalike program. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
218 * `tramp-copy-args' |
45861 | 219 This specifies the list of parameters to pass to the above mentioned |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
220 program, the hints for `tramp-login-args' also apply here. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
221 * `tramp-copy-keep-date' |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
222 This specifies whether the copying program when the preserves the |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
223 timestamp of the original file. |
105718
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
224 * `tramp-copy-keep-tmpfile' |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
225 This specifies whether a temporary local file shall be kept |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
226 for optimization reasons (useful for \"rsync\" methods). |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
227 * `tramp-copy-recursive' |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
228 Whether the operation copies directories recursively. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
229 * `tramp-default-port' |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
230 The default port of a method is needed in case of gateway connections. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
231 Additionally, it is used as indication which method is prepared for |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
232 passing gateways. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
233 * `tramp-gw-args' |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
234 As the attribute name says, additional arguments are specified here |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
235 when a method is applied via a gateway. |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
236 * `tramp-password-end-of-line' |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
237 This specifies the string to use for terminating the line after |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
238 submitting the password. If this method parameter is nil, then the |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
239 value of the normal variable `tramp-default-password-end-of-line' |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
240 is used. This parameter is necessary because the \"plink\" program |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
241 requires any two characters after sending the password. These do |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
242 not have to be newline or carriage return characters. Other login |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
243 programs are happy with just one character, the newline character. |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
244 We use \"xy\" as the value for methods using \"plink\". |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
245 |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
246 What does all this mean? Well, you should specify `tramp-login-program' |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
247 for all methods; this program is used to log in to the remote site. Then, |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
248 there are two ways to actually transfer the files between the local and the |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
249 remote side. One way is using an additional rcp-like program. If you want |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
250 to do this, set `tramp-copy-program' in the method. |
45861 | 251 |
252 Another possibility for file transfer is inline transfer, i.e. the | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
253 file is passed through the same buffer used by `tramp-login-program'. In |
45861 | 254 this case, the file contents need to be protected since the |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
255 `tramp-login-program' might use escape codes or the connection might not |
45861 | 256 be eight-bit clean. Therefore, file contents are encoded for transit. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
257 See the variables `tramp-local-coding-commands' and |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
258 `tramp-remote-coding-commands' for details. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
259 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
260 So, to summarize: if the method is an out-of-band method, then you |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
261 must specify `tramp-copy-program' and `tramp-copy-args'. If it is an |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
262 inline method, then these two parameters should be nil. Methods which |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
263 are fit for gateways must have `tramp-default-port' at least. |
45861 | 264 |
265 Notes: | |
266 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
267 When using `su' or `sudo' the phrase `open connection to a remote |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
268 host' sounds strange, but it is used nevertheless, for consistency. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
269 No connection is opened to a remote host, but `su' or `sudo' is |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
270 started on the local host. You should specify a remote host |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
271 `localhost' or the name of the local host. Another host name is |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
272 useful only in combination with `tramp-default-proxies-alist'.") |
45861 | 273 |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
274 (defun tramp-detect-ssh-controlmaster () |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
275 "Call ssh to detect whether it supports the ControlMaster argument. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
276 This function may return nil when the argument is supported, but |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
277 shouldn't return t when it isn't." |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
278 (ignore-errors |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
279 (with-temp-buffer |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
280 (call-process "ssh" nil t nil "-o" "ControlMaster") |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
281 (goto-char (point-min)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
282 (search-forward-regexp "Missing ControlMaster argument" nil t)))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
283 |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
284 (defcustom tramp-default-method |
74777
948c86bf6396
* net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents:
74766
diff
changeset
|
285 ;; An external copy method seems to be preferred, because it is much |
948c86bf6396
* net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents:
74766
diff
changeset
|
286 ;; more performant for large files, and it hasn't too serious delays |
948c86bf6396
* net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents:
74766
diff
changeset
|
287 ;; for small files. But it must be ensured that there aren't |
948c86bf6396
* net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents:
74766
diff
changeset
|
288 ;; permanent password queries. Either a password agent like |
105462
f6c5cf0fc0c9
* net/tramp.el (tramp-verbose): Fix docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
105351
diff
changeset
|
289 ;; "ssh-agent" or "Pageant" shall run, or the optional |
f6c5cf0fc0c9
* net/tramp.el (tramp-verbose): Fix docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
105351
diff
changeset
|
290 ;; password-cache.el or auth-sources.el packages shall be active for |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
291 ;; password caching. "scpc" is chosen if we detect that the user is |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
292 ;; running OpenSSH 4.0 or newer. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
293 (cond |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
294 ;; PuTTY is installed. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
295 ((executable-find "pscp") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
296 (if (or (fboundp 'password-read) |
105462
f6c5cf0fc0c9
* net/tramp.el (tramp-verbose): Fix docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
105351
diff
changeset
|
297 (fboundp 'auth-source-user-or-password) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
298 ;; Pageant is running. |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
299 (tramp-compat-process-running-p "Pageant")) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
300 "pscp" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
301 "plink")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
302 ;; There is an ssh installation. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
303 ((executable-find "scp") |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
304 (cond |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
305 ((tramp-detect-ssh-controlmaster) "scpc") |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
306 ((or (fboundp 'password-read) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
307 (fboundp 'auth-source-user-or-password) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
308 ;; ssh-agent is running. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
309 (getenv "SSH_AUTH_SOCK") |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
310 (getenv "SSH_AGENT_PID")) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
311 "scp") |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
312 (t "ssh"))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
313 ;; Fallback. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
314 (t "ftp")) |
45861 | 315 "*Default method to use for transferring files. |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
316 See `tramp-methods' for possibilities. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
317 Also see `tramp-default-method-alist'." |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
318 :group 'tramp |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
319 :type 'string) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
320 |
112032
209df3f0dcc6
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111964
diff
changeset
|
321 ;;;###tramp-autoload |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
322 (defcustom tramp-default-method-alist nil |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
323 "*Default method to use for specific host/user pairs. |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
324 This is an alist of items (HOST USER METHOD). The first matching item |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
325 specifies the method to use for a file name which does not specify a |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
326 method. HOST and USER are regular expressions or nil, which is |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
327 interpreted as a regular expression which always matches. If no entry |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
328 matches, the variable `tramp-default-method' takes effect. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
329 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
330 If the file name does not specify the user, lookup is done using the |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
331 empty string for the user name. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
332 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
333 See `tramp-methods' for a list of possibilities for METHOD." |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
334 :group 'tramp |
111765
202eb704e80b
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111612
diff
changeset
|
335 :type '(repeat (list (choice :tag "Host regexp" regexp sexp) |
202eb704e80b
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111612
diff
changeset
|
336 (choice :tag "User regexp" regexp sexp) |
202eb704e80b
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111612
diff
changeset
|
337 (choice :tag "Method name" string (const nil))))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
338 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
339 (defcustom tramp-default-user nil |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
340 "*Default user to use for transferring files. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
341 It is nil by default; otherwise settings in configuration files like |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
342 \"~/.ssh/config\" would be overwritten. Also see `tramp-default-user-alist'. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
343 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
344 This variable is regarded as obsolete, and will be removed soon." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
345 :group 'tramp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
346 :type '(choice (const nil) string)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
347 |
112032
209df3f0dcc6
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111964
diff
changeset
|
348 ;;;###tramp-autoload |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
349 (defcustom tramp-default-user-alist nil |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
350 "*Default user to use for specific method/host pairs. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
351 This is an alist of items (METHOD HOST USER). The first matching item |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
352 specifies the user to use for a file name which does not specify a |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
353 user. METHOD and USER are regular expressions or nil, which is |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
354 interpreted as a regular expression which always matches. If no entry |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
355 matches, the variable `tramp-default-user' takes effect. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
356 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
357 If the file name does not specify the method, lookup is done using the |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
358 empty string for the method name." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
359 :group 'tramp |
111765
202eb704e80b
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111612
diff
changeset
|
360 :type '(repeat (list (choice :tag "Method regexp" regexp sexp) |
202eb704e80b
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111612
diff
changeset
|
361 (choice :tag " Host regexp" regexp sexp) |
202eb704e80b
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111612
diff
changeset
|
362 (choice :tag " User name" string (const nil))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
363 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
364 (defcustom tramp-default-host (system-name) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
365 "*Default host to use for transferring files. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
366 Useful for su and sudo methods mostly." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
367 :group 'tramp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
368 :type 'string) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
369 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
370 (defcustom tramp-default-proxies-alist nil |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
371 "*Route to be followed for specific host/user pairs. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
372 This is an alist of items (HOST USER PROXY). The first matching |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
373 item specifies the proxy to be passed for a file name located on |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
374 a remote target matching USER@HOST. HOST and USER are regular |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
375 expressions. PROXY must be a Tramp filename without a localname |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
376 part. Method and user name on PROXY are optional, which is |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
377 interpreted with the default values. PROXY can contain the |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
378 patterns %h and %u, which are replaced by the strings matching |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
379 HOST or USER, respectively. |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
380 |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
381 HOST, USER or PROXY could also be Lisp forms, which will be |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
382 evaluated. The result must be a string or nil, which is |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
383 interpreted as a regular expression which always matches." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
384 :group 'tramp |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
385 :type '(repeat (list (choice :tag "Host regexp" regexp sexp) |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
386 (choice :tag "User regexp" regexp sexp) |
111765
202eb704e80b
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111612
diff
changeset
|
387 (choice :tag " Proxy name" string (const nil))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
388 |
112032
209df3f0dcc6
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111964
diff
changeset
|
389 ;;;###tramp-autoload |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
390 (defconst tramp-local-host-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
391 (concat |
111788
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
392 "\\`" |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
393 (regexp-opt |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
394 (list "localhost" "localhost6" (system-name) "127\.0\.0\.1" "::1") t) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
395 "\\'") |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
396 "*Host names which are regarded as local host.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
397 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
398 (defvar tramp-completion-function-alist nil |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
399 "*Alist of methods for remote files. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
400 This is a list of entries of the form \(NAME PAIR1 PAIR2 ...\). |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
401 Each NAME stands for a remote access method. Each PAIR is of the form |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
402 \(FUNCTION FILE\). FUNCTION is responsible to extract user names and host |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
403 names from FILE for completion. The following predefined FUNCTIONs exists: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
404 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
405 * `tramp-parse-rhosts' for \"~/.rhosts\" like files, |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
406 * `tramp-parse-shosts' for \"~/.ssh/known_hosts\" like files, |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
407 * `tramp-parse-sconfig' for \"~/.ssh/config\" like files, |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
408 * `tramp-parse-shostkeys' for \"~/.ssh2/hostkeys/*\" like files, |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
409 * `tramp-parse-sknownhosts' for \"~/.ssh2/knownhosts/*\" like files, |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
410 * `tramp-parse-hosts' for \"/etc/hosts\" like files, |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
411 * `tramp-parse-passwd' for \"/etc/passwd\" like files. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
412 * `tramp-parse-netrc' for \"~/.netrc\" like files. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
413 * `tramp-parse-putty' for PuTTY registry keys. |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
414 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
415 FUNCTION can also be a customer defined function. For more details see |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
416 the info pages.") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
417 |
94975
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
418 (defconst tramp-echo-mark-marker "_echo" |
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
419 "String marker to surround echoed commands.") |
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
420 |
106597
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
421 (defconst tramp-echo-mark-marker-length (length tramp-echo-mark-marker) |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
422 "String length of `tramp-echo-mark-marker'.") |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
423 |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
424 (defconst tramp-echo-mark |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
425 (concat tramp-echo-mark-marker |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
426 (make-string tramp-echo-mark-marker-length ?\b)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
427 "String mark to be transmitted around shell commands. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
428 Used to separate their echo from the output they produce. This |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
429 will only be used if we cannot disable remote echo via stty. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
430 This string must have no effect on the remote shell except for |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
431 producing some echo which can later be detected by |
94975
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
432 `tramp-echoed-echo-mark-regexp'. Using `tramp-echo-mark-marker', |
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
433 followed by an equal number of backspaces to erase them will |
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
434 usually suffice.") |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
435 |
106597
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
436 (defconst tramp-echoed-echo-mark-regexp |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
437 (format "%s\\(\b\\( \b\\)?\\)\\{%d\\}" |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
438 tramp-echo-mark-marker tramp-echo-mark-marker-length) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
439 "Regexp which matches `tramp-echo-mark' as it gets echoed by |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
440 the remote shell.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
441 |
45861 | 442 (defcustom tramp-rsh-end-of-line "\n" |
443 "*String used for end of line in rsh connections. | |
444 I don't think this ever needs to be changed, so please tell me about it | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
445 if you need to change this. |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
446 Also see the method parameter `tramp-password-end-of-line' and the normal |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
447 variable `tramp-default-password-end-of-line'." |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
448 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
449 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
450 |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
451 (defcustom tramp-default-password-end-of-line |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
452 tramp-rsh-end-of-line |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
453 "*String used for end of line after sending a password. |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
454 This variable provides the default value for the method parameter |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
455 `tramp-password-end-of-line', see `tramp-methods' for more details. |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
456 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
457 It seems that people using plink under Windows need to send |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
458 \"\\r\\n\" (carriage-return, then newline) after a password, but just |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
459 \"\\n\" after all other lines. This variable can be used for the |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
460 password, see `tramp-rsh-end-of-line' for the other cases. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
461 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
462 The default value is to use the same value as `tramp-rsh-end-of-line'." |
45861 | 463 :group 'tramp |
464 :type 'string) | |
465 | |
466 (defcustom tramp-login-prompt-regexp | |
65605
efa862a76bc2
* net/tramp.el (tramp-login-prompt-regexp): Expand regexp in order to
Michael Albinus <michael.albinus@gmx.de>
parents:
65359
diff
changeset
|
467 ".*ogin\\( .*\\)?: *" |
45861 | 468 "*Regexp matching login-like prompts. |
65605
efa862a76bc2
* net/tramp.el (tramp-login-prompt-regexp): Expand regexp in order to
Michael Albinus <michael.albinus@gmx.de>
parents:
65359
diff
changeset
|
469 The regexp should match at end of buffer. |
efa862a76bc2
* net/tramp.el (tramp-login-prompt-regexp): Expand regexp in order to
Michael Albinus <michael.albinus@gmx.de>
parents:
65359
diff
changeset
|
470 |
efa862a76bc2
* net/tramp.el (tramp-login-prompt-regexp): Expand regexp in order to
Michael Albinus <michael.albinus@gmx.de>
parents:
65359
diff
changeset
|
471 Sometimes the prompt is reported to look like \"login as:\"." |
45861 | 472 :group 'tramp |
473 :type 'regexp) | |
474 | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
475 (defcustom tramp-shell-prompt-pattern |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
476 ;; Allow a prompt to start right after a ^M since it indeed would be |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
477 ;; displayed at the beginning of the line (and Zsh uses it). This |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
478 ;; regexp works only for GNU Emacs. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
479 (concat (if (featurep 'xemacs) "" "\\(?:^\\|\r\\)") |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
480 "[^#$%>\n]*#?[#$%>] *\\(\e\\[[0-9;]*[a-zA-Z] *\\)*") |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
481 "Regexp to match prompts from remote shell. |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
482 Normally, Tramp expects you to configure `shell-prompt-pattern' |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
483 correctly, but sometimes it happens that you are connecting to a |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
484 remote host which sends a different kind of shell prompt. Therefore, |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
485 Tramp recognizes things matched by `shell-prompt-pattern' as prompt, |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
486 and also things matched by this variable. The default value of this |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
487 variable is similar to the default value of `shell-prompt-pattern', |
106470
9e96dbbd314e
Handle prompt rules of ksh in OpenBSD 4.5. Reported by Raphal
Michael Albinus <michael.albinus@gmx.de>
parents:
106390
diff
changeset
|
488 which should work well in many cases. |
9e96dbbd314e
Handle prompt rules of ksh in OpenBSD 4.5. Reported by Raphal
Michael Albinus <michael.albinus@gmx.de>
parents:
106390
diff
changeset
|
489 |
9e96dbbd314e
Handle prompt rules of ksh in OpenBSD 4.5. Reported by Raphal
Michael Albinus <michael.albinus@gmx.de>
parents:
106390
diff
changeset
|
490 This regexp must match both `tramp-initial-end-of-output' and |
9e96dbbd314e
Handle prompt rules of ksh in OpenBSD 4.5. Reported by Raphal
Michael Albinus <michael.albinus@gmx.de>
parents:
106390
diff
changeset
|
491 `tramp-end-of-output'." |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
492 :group 'tramp |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
493 :type 'regexp) |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
494 |
45861 | 495 (defcustom tramp-password-prompt-regexp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
496 "^.*\\([pP]assword\\|[pP]assphrase\\).*:\^@? *" |
45861 | 497 "*Regexp matching password-like prompts. |
46752 | 498 The regexp should match at end of buffer. |
45861 | 499 |
500 The `sudo' program appears to insert a `^@' character into the prompt." | |
501 :group 'tramp | |
502 :type 'regexp) | |
503 | |
504 (defcustom tramp-wrong-passwd-regexp | |
46790 | 505 (concat "^.*" |
506 ;; These strings should be on the last line | |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
507 (regexp-opt '("Permission denied" |
46790 | 508 "Login incorrect" |
509 "Login Incorrect" | |
510 "Connection refused" | |
511 "Connection closed" | |
107021
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
512 "Timeout, server not responding." |
46790 | 513 "Sorry, try again." |
514 "Name or service not known" | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
515 "Host key verification failed." |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
516 "No supported authentication methods left to try!") t) |
46790 | 517 ".*" |
518 "\\|" | |
519 "^.*\\(" | |
520 ;; Here comes a list of regexes, separated by \\| | |
521 "Received signal [0-9]+" | |
522 "\\).*") | |
45861 | 523 "*Regexp matching a `login failed' message. |
46752 | 524 The regexp should match at end of buffer." |
525 :group 'tramp | |
526 :type 'regexp) | |
527 | |
528 (defcustom tramp-yesno-prompt-regexp | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
529 (concat |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
530 (regexp-opt '("Are you sure you want to continue connecting (yes/no)?") t) |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
531 "\\s-*") |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
532 "Regular expression matching all yes/no queries which need to be confirmed. |
46752 | 533 The confirmation should be done with yes or no. |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
534 The regexp should match at end of buffer. |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
535 See also `tramp-yn-prompt-regexp'." |
45861 | 536 :group 'tramp |
537 :type 'regexp) | |
538 | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
539 (defcustom tramp-yn-prompt-regexp |
74985
155a8e75cd11
Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents:
74777
diff
changeset
|
540 (concat |
155a8e75cd11
Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents:
74777
diff
changeset
|
541 (regexp-opt '("Store key in cache? (y/n)" |
155a8e75cd11
Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents:
74777
diff
changeset
|
542 "Update cached key? (y/n, Return cancels connection)") t) |
155a8e75cd11
Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents:
74777
diff
changeset
|
543 "\\s-*") |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
544 "Regular expression matching all y/n queries which need to be confirmed. |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
545 The confirmation should be done with y or n. |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
546 The regexp should match at end of buffer. |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
547 See also `tramp-yesno-prompt-regexp'." |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
548 :group 'tramp |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
549 :type 'regexp) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
550 |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
551 (defcustom tramp-terminal-prompt-regexp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
552 (concat "\\(" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
553 "TERM = (.*)" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
554 "\\|" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
555 "Terminal type\\? \\[.*\\]" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
556 "\\)\\s-*") |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
557 "Regular expression matching all terminal setting prompts. |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
558 The regexp should match at end of buffer. |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
559 The answer will be provided by `tramp-action-terminal', which see." |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
560 :group 'tramp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
561 :type 'regexp) |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
562 |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
563 (defcustom tramp-operation-not-permitted-regexp |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
564 (concat "\\(" "preserving times.*" "\\|" "set mode" "\\)" ":\\s-*" |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
565 (regexp-opt '("Operation not permitted") t)) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
566 "Regular expression matching keep-date problems in (s)cp operations. |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
567 Copying has been performed successfully already, so this message can |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
568 be ignored safely." |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
569 :group 'tramp |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
570 :type 'regexp) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
571 |
74166
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
572 (defcustom tramp-copy-failed-regexp |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
573 (concat "\\(.+: " |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
574 (regexp-opt '("Permission denied" |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
575 "not a regular file" |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
576 "is a directory" |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
577 "No such file or directory") t) |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
578 "\\)\\s-*") |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
579 "Regular expression matching copy problems in (s)cp operations." |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
580 :group 'tramp |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
581 :type 'regexp) |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
582 |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
583 (defcustom tramp-process-alive-regexp |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
584 "" |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
585 "Regular expression indicating a process has finished. |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
586 In fact this expression is empty by intention, it will be used only to |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
587 check regularly the status of the associated process. |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
588 The answer will be provided by `tramp-action-process-alive', |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
589 `tramp-action-out-of-band', which see." |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
590 :group 'tramp |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
591 :type 'regexp) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
592 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
593 (defconst tramp-temp-name-prefix "tramp." |
45861 | 594 "*Prefix to use for temporary files. |
595 If this is a relative file name (such as \"tramp.\"), it is considered | |
596 relative to the directory name returned by the function | |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
597 `tramp-compat-temporary-file-directory' (which see). It may also be an |
45861 | 598 absolute file name; don't forget to include a prefix for the filename |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
599 part, though.") |
45861 | 600 |
96941
940a290a5646
* net/tramp.el (tramp-methods): Add "-q" for "scp", "scp1",
Michael Albinus <michael.albinus@gmx.de>
parents:
96392
diff
changeset
|
601 (defconst tramp-temp-buffer-name " *tramp temp*" |
940a290a5646
* net/tramp.el (tramp-methods): Add "-q" for "scp", "scp1",
Michael Albinus <michael.albinus@gmx.de>
parents:
96392
diff
changeset
|
602 "Buffer name for a temporary buffer. |
940a290a5646
* net/tramp.el (tramp-methods): Add "-q" for "scp", "scp1",
Michael Albinus <michael.albinus@gmx.de>
parents:
96392
diff
changeset
|
603 It shall be used in combination with `generate-new-buffer-name'.") |
940a290a5646
* net/tramp.el (tramp-methods): Add "-q" for "scp", "scp1",
Michael Albinus <michael.albinus@gmx.de>
parents:
96392
diff
changeset
|
604 |
105718
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
605 (defvar tramp-temp-buffer-file-name nil |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
606 "File name of a persistent local temporary file. |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
607 Useful for \"rsync\" like methods.") |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
608 (make-variable-buffer-local 'tramp-temp-buffer-file-name) |
111964
ec45dfa69a06
* net/tramp.el (tramp-temp-buffer-file-name): Make it permanent-local.
Michael Albinus <michael.albinus@gmx.de>
parents:
111945
diff
changeset
|
609 (put 'tramp-temp-buffer-file-name 'permanent-local t) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
610 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
611 ;; XEmacs is distributed with few Lisp packages. Further packages are |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
612 ;; installed using EFS. If we use a unified filename format, then |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
613 ;; Tramp is required in addition to EFS. (But why can't Tramp just |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
614 ;; disable EFS when Tramp is loaded? Then XEmacs can ship with EFS |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
615 ;; just like before.) Another reason for using a separate filename |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
616 ;; syntax on XEmacs is that EFS hooks into XEmacs in many places, but |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
617 ;; Tramp only knows how to deal with `file-name-handler-alist', not |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
618 ;; the other places. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
619 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
620 ;; Currently, we have the choice between 'ftp, 'sep, and 'url. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
621 ;;;###autoload |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
622 (defcustom tramp-syntax |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
623 (if (featurep 'xemacs) 'sep 'ftp) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
624 "Tramp filename syntax to be used. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
625 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
626 It can have the following values: |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
627 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
628 'ftp -- Ange-FTP respective EFS like syntax (GNU Emacs default) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
629 'sep -- Syntax as defined for XEmacs (not available yet for GNU Emacs) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
630 'url -- URL-like syntax." |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
631 :group 'tramp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
632 :type (if (featurep 'xemacs) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
633 '(choice (const :tag "EFS" ftp) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
634 (const :tag "XEmacs" sep) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
635 (const :tag "URL" url)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
636 '(choice (const :tag "Ange-FTP" ftp) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
637 (const :tag "URL" url)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
638 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
639 (defconst tramp-prefix-format |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
640 (cond ((equal tramp-syntax 'ftp) "/") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
641 ((equal tramp-syntax 'sep) "/[") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
642 ((equal tramp-syntax 'url) "/") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
643 (t (error "Wrong `tramp-syntax' defined"))) |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
644 "*String matching the very beginning of Tramp file names. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
645 Used in `tramp-make-tramp-file-name'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
646 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
647 (defconst tramp-prefix-regexp |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
648 (concat "^" (regexp-quote tramp-prefix-format)) |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
649 "*Regexp matching the very beginning of Tramp file names. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
650 Should always start with \"^\". Derived from `tramp-prefix-format'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
651 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
652 (defconst tramp-method-regexp |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
653 "[a-zA-Z_0-9-]+" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
654 "*Regexp matching methods identifiers.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
655 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
656 (defconst tramp-postfix-method-format |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
657 (cond ((equal tramp-syntax 'ftp) ":") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
658 ((equal tramp-syntax 'sep) "/") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
659 ((equal tramp-syntax 'url) "://") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
660 (t (error "Wrong `tramp-syntax' defined"))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
661 "*String matching delimeter between method and user or host names. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
662 Used in `tramp-make-tramp-file-name'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
663 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
664 (defconst tramp-postfix-method-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
665 (regexp-quote tramp-postfix-method-format) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
666 "*Regexp matching delimeter between method and user or host names. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
667 Derived from `tramp-postfix-method-format'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
668 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
669 (defconst tramp-user-regexp "[^:/ \t]+" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
670 "*Regexp matching user names.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
671 |
112032
209df3f0dcc6
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111964
diff
changeset
|
672 ;;;###tramp-autoload |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
673 (defconst tramp-prefix-domain-format "%" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
674 "*String matching delimeter between user and domain names.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
675 |
112032
209df3f0dcc6
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111964
diff
changeset
|
676 ;;;###tramp-autoload |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
677 (defconst tramp-prefix-domain-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
678 (regexp-quote tramp-prefix-domain-format) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
679 "*Regexp matching delimeter between user and domain names. |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
680 Derived from `tramp-prefix-domain-format'.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
681 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
682 (defconst tramp-domain-regexp "[-a-zA-Z0-9_.]+" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
683 "*Regexp matching domain names.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
684 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
685 (defconst tramp-user-with-domain-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
686 (concat "\\(" tramp-user-regexp "\\)" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
687 tramp-prefix-domain-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
688 "\\(" tramp-domain-regexp "\\)") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
689 "*Regexp matching user names with domain names.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
690 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
691 (defconst tramp-postfix-user-format "@" |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
692 "*String matching delimeter between user and host names. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
693 Used in `tramp-make-tramp-file-name'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
694 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
695 (defconst tramp-postfix-user-regexp |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
696 (regexp-quote tramp-postfix-user-format) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
697 "*Regexp matching delimeter between user and host names. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
698 Derived from `tramp-postfix-user-format'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
699 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
700 (defconst tramp-host-regexp "[a-zA-Z0-9_.-]+" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
701 "*Regexp matching host names.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
702 |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
703 (defconst tramp-prefix-ipv6-format |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
704 (cond ((equal tramp-syntax 'ftp) "[") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
705 ((equal tramp-syntax 'sep) "") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
706 ((equal tramp-syntax 'url) "[") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
707 (t (error "Wrong `tramp-syntax' defined"))) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
708 "*String matching left hand side of IPv6 addresses. |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
709 Used in `tramp-make-tramp-file-name'.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
710 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
711 (defconst tramp-prefix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
712 (regexp-quote tramp-prefix-ipv6-format) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
713 "*Regexp matching left hand side of IPv6 addresses. |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
714 Derived from `tramp-prefix-ipv6-format'.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
715 |
101282
986acdda4aac
* net/tramp.el (tramp-ipv6-regexp): The regexp shall cover also
Michael Albinus <michael.albinus@gmx.de>
parents:
101020
diff
changeset
|
716 ;; The following regexp is a bit sloppy. But it shall serve our |
986acdda4aac
* net/tramp.el (tramp-ipv6-regexp): The regexp shall cover also
Michael Albinus <michael.albinus@gmx.de>
parents:
101020
diff
changeset
|
717 ;; purposes. It covers also IPv4 mapped IPv6 addresses, like in |
986acdda4aac
* net/tramp.el (tramp-ipv6-regexp): The regexp shall cover also
Michael Albinus <michael.albinus@gmx.de>
parents:
101020
diff
changeset
|
718 ;; "::ffff:192.168.0.1". |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
719 (defconst tramp-ipv6-regexp |
101282
986acdda4aac
* net/tramp.el (tramp-ipv6-regexp): The regexp shall cover also
Michael Albinus <michael.albinus@gmx.de>
parents:
101020
diff
changeset
|
720 "\\(?:\\(?:[a-zA-Z0-9]+\\)?:\\)+[a-zA-Z0-9.]+" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
721 "*Regexp matching IPv6 addresses.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
722 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
723 (defconst tramp-postfix-ipv6-format |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
724 (cond ((equal tramp-syntax 'ftp) "]") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
725 ((equal tramp-syntax 'sep) "") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
726 ((equal tramp-syntax 'url) "]") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
727 (t (error "Wrong `tramp-syntax' defined"))) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
728 "*String matching right hand side of IPv6 addresses. |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
729 Used in `tramp-make-tramp-file-name'.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
730 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
731 (defconst tramp-postfix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
732 (regexp-quote tramp-postfix-ipv6-format) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
733 "*Regexp matching right hand side of IPv6 addresses. |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
734 Derived from `tramp-postfix-ipv6-format'.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
735 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
736 (defconst tramp-prefix-port-format |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
737 (cond ((equal tramp-syntax 'ftp) "#") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
738 ((equal tramp-syntax 'sep) "#") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
739 ((equal tramp-syntax 'url) ":") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
740 (t (error "Wrong `tramp-syntax' defined"))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
741 "*String matching delimeter between host names and port numbers.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
742 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
743 (defconst tramp-prefix-port-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
744 (regexp-quote tramp-prefix-port-format) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
745 "*Regexp matching delimeter between host names and port numbers. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
746 Derived from `tramp-prefix-port-format'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
747 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
748 (defconst tramp-port-regexp "[0-9]+" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
749 "*Regexp matching port numbers.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
750 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
751 (defconst tramp-host-with-port-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
752 (concat "\\(" tramp-host-regexp "\\)" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
753 tramp-prefix-port-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
754 "\\(" tramp-port-regexp "\\)") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
755 "*Regexp matching host names with port numbers.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
756 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
757 (defconst tramp-postfix-host-format |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
758 (cond ((equal tramp-syntax 'ftp) ":") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
759 ((equal tramp-syntax 'sep) "]") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
760 ((equal tramp-syntax 'url) "") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
761 (t (error "Wrong `tramp-syntax' defined"))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
762 "*String matching delimeter between host names and localnames. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
763 Used in `tramp-make-tramp-file-name'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
764 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
765 (defconst tramp-postfix-host-regexp |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
766 (regexp-quote tramp-postfix-host-format) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
767 "*Regexp matching delimeter between host names and localnames. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
768 Derived from `tramp-postfix-host-format'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
769 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
770 (defconst tramp-localname-regexp ".*$" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
771 "*Regexp matching localnames.") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
772 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
773 ;;; File name format: |
45861 | 774 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
775 (defconst tramp-file-name-structure |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
776 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
777 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
778 tramp-prefix-regexp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
779 "\\(" "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp "\\)?" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
780 "\\(" "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp "\\)?" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
781 "\\(" "\\(" tramp-host-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
782 "\\|" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
783 tramp-prefix-ipv6-regexp tramp-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
784 tramp-postfix-ipv6-regexp "\\)" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
785 "\\(" tramp-prefix-port-regexp tramp-port-regexp "\\)?" "\\)?" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
786 tramp-postfix-host-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
787 "\\(" tramp-localname-regexp "\\)") |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
788 2 4 5 8) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
789 |
45861 | 790 "*List of five elements (REGEXP METHOD USER HOST FILE), detailing \ |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
791 the Tramp file name structure. |
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
792 |
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
793 The first element REGEXP is a regular expression matching a Tramp file |
45861 | 794 name. The regex should contain parentheses around the method name, |
795 the user name, the host name, and the file name parts. | |
796 | |
797 The second element METHOD is a number, saying which pair of | |
798 parentheses matches the method name. The third element USER is | |
799 similar, but for the user name. The fourth element HOST is similar, | |
800 but for the host name. The fifth element FILE is for the file name. | |
801 These numbers are passed directly to `match-string', which see. That | |
802 means the opening parentheses are counted to identify the pair. | |
803 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
804 See also `tramp-file-name-regexp'.") |
45861 | 805 |
806 ;;;###autoload | |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
807 (defconst tramp-file-name-regexp-unified |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
808 (if (memq system-type '(cygwin windows-nt)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
809 "\\`/\\([^[/:]\\{2,\\}\\|[^/]\\{2,\\}]\\):" |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
810 "\\`/\\([^[/:]+\\|[^/]+]\\):") |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
811 "Value for `tramp-file-name-regexp' for unified remoting. |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
812 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
813 Tramp. See `tramp-file-name-structure' for more explanations. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
814 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
815 On W32 systems, the volume letter must be ignored.") |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
816 |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
817 ;;;###autoload |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
818 (defconst tramp-file-name-regexp-separate "\\`/\\[.*\\]" |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
819 "Value for `tramp-file-name-regexp' for separate remoting. |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
820 XEmacs uses a separate filename syntax for Tramp and EFS. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
821 See `tramp-file-name-structure' for more explanations.") |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
822 |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
823 ;;;###autoload |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
824 (defconst tramp-file-name-regexp-url "\\`/[^/:]+://" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
825 "Value for `tramp-file-name-regexp' for URL-like remoting. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
826 See `tramp-file-name-structure' for more explanations.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
827 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
828 ;;;###autoload |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
829 (defconst tramp-file-name-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
830 (cond ((equal tramp-syntax 'ftp) tramp-file-name-regexp-unified) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
831 ((equal tramp-syntax 'sep) tramp-file-name-regexp-separate) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
832 ((equal tramp-syntax 'url) tramp-file-name-regexp-url) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
833 (t (error "Wrong `tramp-syntax' defined"))) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84985
diff
changeset
|
834 "*Regular expression matching file names handled by Tramp. |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
835 This regexp should match Tramp file names but no other file names. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
836 When tramp.el is loaded, this regular expression is prepended to |
45861 | 837 `file-name-handler-alist', and that is searched sequentially. Thus, |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
838 if the Tramp entry appears rather early in the `file-name-handler-alist' |
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
839 and is a bit too general, then some files might be considered Tramp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
840 files which are not really Tramp files. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
841 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
842 Please note that the entry in `file-name-handler-alist' is made when |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
843 this file \(tramp.el\) is loaded. This means that this variable must be set |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
844 before loading tramp.el. Alternatively, `file-name-handler-alist' can be |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
845 updated after changing this variable. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
846 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
847 Also see `tramp-file-name-structure'.") |
45861 | 848 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
849 ;;;###autoload |
92982
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
850 (defconst tramp-root-regexp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
851 (if (memq system-type '(cygwin windows-nt)) |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
852 "\\`\\([a-zA-Z]:\\)?/" |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
853 "\\`/") |
92982
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
854 "Beginning of an incomplete Tramp file name. |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
855 Usually, it is just \"\\\\`/\". On W32 systems, there might be a |
93040
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
856 volume letter, which will be removed by `tramp-drop-volume-letter'.") |
92982
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
857 |
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
858 ;;;###autoload |
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
859 (defconst tramp-completion-file-name-regexp-unified |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
860 (if (memq system-type '(cygwin windows-nt)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
861 (concat tramp-root-regexp "[^/]\\{2,\\}\\'") |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
862 (concat tramp-root-regexp "[^/]*\\'")) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
863 "Value for `tramp-completion-file-name-regexp' for unified remoting. |
92982
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
864 GNU Emacs uses a unified filename syntax for Tramp and Ange-FTP. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
865 See `tramp-file-name-structure' for more explanations. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
866 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
867 On W32 systems, the volume letter must be ignored.") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
868 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
869 ;;;###autoload |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
870 (defconst tramp-completion-file-name-regexp-separate |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
871 (concat tramp-root-regexp "\\([[][^]]*\\)?\\'") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
872 "Value for `tramp-completion-file-name-regexp' for separate remoting. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
873 XEmacs uses a separate filename syntax for Tramp and EFS. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
874 See `tramp-file-name-structure' for more explanations.") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
875 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
876 ;;;###autoload |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
877 (defconst tramp-completion-file-name-regexp-url |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
878 (concat tramp-root-regexp "[^/:]+\\(:\\(/\\(/[^/]*\\)?\\)?\\)?\\'") |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
879 "Value for `tramp-completion-file-name-regexp' for URL-like remoting. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
880 See `tramp-file-name-structure' for more explanations.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
881 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
882 ;;;###autoload |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
883 (defconst tramp-completion-file-name-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
884 (cond ((equal tramp-syntax 'ftp) tramp-completion-file-name-regexp-unified) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
885 ((equal tramp-syntax 'sep) tramp-completion-file-name-regexp-separate) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
886 ((equal tramp-syntax 'url) tramp-completion-file-name-regexp-url) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
887 (t (error "Wrong `tramp-syntax' defined"))) |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
888 "*Regular expression matching file names handled by Tramp completion. |
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
889 This regexp should match partial Tramp file names only. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
890 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
891 Please note that the entry in `file-name-handler-alist' is made when |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
892 this file (tramp.el) is loaded. This means that this variable must be set |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
893 before loading tramp.el. Alternatively, `file-name-handler-alist' can be |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
894 updated after changing this variable. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
895 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
896 Also see `tramp-file-name-structure'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
897 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
898 ;; Chunked sending kludge. We set this to 500 for black-listed constellations |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
899 ;; known to have a bug in `process-send-string'; some ssh connections appear |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
900 ;; to drop bytes when data is sent too quickly. There is also a connection |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
901 ;; buffer local variable, which is computed depending on remote host properties |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
902 ;; when `tramp-chunksize' is zero or nil. |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
903 (defcustom tramp-chunksize |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
904 (when (and (not (featurep 'xemacs)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
905 (memq system-type '(hpux))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
906 500) |
66561
742e40a6bf3c
* net/tramp.el (tramp-chunksize): Escape parentheses in docstring
Michael Albinus <michael.albinus@gmx.de>
parents:
66496
diff
changeset
|
907 ;; Parentheses in docstring starting at beginning of line are escaped. |
742e40a6bf3c
* net/tramp.el (tramp-chunksize): Escape parentheses in docstring
Michael Albinus <michael.albinus@gmx.de>
parents:
66496
diff
changeset
|
908 ;; Fontification is messed up when |
742e40a6bf3c
* net/tramp.el (tramp-chunksize): Escape parentheses in docstring
Michael Albinus <michael.albinus@gmx.de>
parents:
66496
diff
changeset
|
909 ;; `open-paren-in-column-0-is-defun-start' set to t. |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
910 "*If non-nil, chunksize for sending input to local process. |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
911 It is necessary only on systems which have a buggy `process-send-string' |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
912 implementation. The necessity, whether this variable must be set, can be |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
913 checked via the following code: |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
914 |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
915 (with-temp-buffer |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
916 (let* ((user \"xxx\") (host \"yyy\") |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
917 (init 0) (step 50) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
918 (sent init) (received init)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
919 (while (= sent received) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
920 (setq sent (+ sent step)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
921 (erase-buffer) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
922 (let ((proc (start-process (buffer-name) (current-buffer) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
923 \"ssh\" \"-l\" user host \"wc\" \"-c\"))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
924 (when (memq (process-status proc) '(run open)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
925 (process-send-string proc (make-string sent ?\\ )) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
926 (process-send-eof proc) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
927 (process-send-eof proc)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
928 (while (not (progn (goto-char (point-min)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
929 (re-search-forward \"\\\\w+\" (point-max) t))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
930 (accept-process-output proc 1)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
931 (when (memq (process-status proc) '(run open)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
932 (setq received (string-to-number (match-string 0))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
933 (delete-process proc) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
934 (message \"Bytes sent: %s\\tBytes received: %s\" sent received) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
935 (sit-for 0)))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
936 (if (> sent (+ init step)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
937 (message \"You should set `tramp-chunksize' to a maximum of %s\" |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
938 (- sent step)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
939 (message \"Test does not work\") |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
940 (display-buffer (current-buffer)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
941 (sit-for 30)))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
942 |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
943 In the Emacs normally running Tramp, evaluate the above code |
66561
742e40a6bf3c
* net/tramp.el (tramp-chunksize): Escape parentheses in docstring
Michael Albinus <michael.albinus@gmx.de>
parents:
66496
diff
changeset
|
944 \(replace \"xxx\" and \"yyy\" by the remote user and host name, |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
945 respectively\). You can do this, for example, by pasting it into |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
946 the `*scratch*' buffer and then hitting C-j with the cursor after the |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
947 last closing parenthesis. Note that it works only if you have configured |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
948 \"ssh\" to run without password query, see ssh-agent\(1\). |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
949 |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
950 You will see the number of bytes sent successfully to the remote host. |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
951 If that number exceeds 1000, you can stop the execution by hitting |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
952 C-g, because your Emacs is likely clean. |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
953 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
954 When it is necessary to set `tramp-chunksize', you might consider to |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
955 use an out-of-the-band method \(like \"scp\"\) instead of an internal one |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
956 \(like \"ssh\"\), because setting `tramp-chunksize' to non-nil decreases |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
957 performance. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
958 |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
959 If your Emacs is buggy, the code stops and gives you an indication |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
960 about the value `tramp-chunksize' should be set. Maybe you could just |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
961 experiment a bit, e.g. changing the values of `init' and `step' |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
962 in the third line of the code. |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
963 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
964 Please raise a bug report via \"M-x tramp-bug\" if your system needs |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
965 this variable to be set as well." |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
966 :group 'tramp |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
967 :type '(choice (const nil) integer)) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
968 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
969 ;; Logging in to a remote host normally requires obtaining a pty. But |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
970 ;; Emacs on MacOS X has process-connection-type set to nil by default, |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
971 ;; so on those systems Tramp doesn't obtain a pty. Here, we allow |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
972 ;; for an override of the system default. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
973 (defcustom tramp-process-connection-type t |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
974 "Overrides `process-connection-type' for connections from Tramp. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
975 Tramp binds process-connection-type to the value given here before |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
976 opening a connection to a remote host." |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
977 :group 'tramp |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
978 :type '(choice (const nil) (const t) (const pty))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
979 |
86204
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
980 (defcustom tramp-completion-reread-directory-timeout 10 |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
981 "Defines seconds since last remote command before rereading a directory. |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
982 A remote directory might have changed its contents. In order to |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
983 make it visible during file name completion in the minibuffer, |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
984 Tramp flushes its cache and rereads the directory contents when |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
985 more than `tramp-completion-reread-directory-timeout' seconds |
110702
4e901a2d3669
* files.el (remote-file-name-inhibit-cache): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
110374
diff
changeset
|
986 have been gone since last remote command execution. A value of `t' |
4e901a2d3669
* files.el (remote-file-name-inhibit-cache): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
110374
diff
changeset
|
987 would require an immediate reread during filename completion, `nil' |
86204
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
988 means to use always cached values for the directory contents." |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
989 :group 'tramp |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
990 :type '(choice (const nil) integer)) |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
991 |
45861 | 992 ;;; Internal Variables: |
993 | |
994 (defvar tramp-current-method nil | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
995 "Connection method for this *tramp* buffer.") |
45861 | 996 |
997 (defvar tramp-current-user nil | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
998 "Remote login name for this *tramp* buffer.") |
45861 | 999 |
1000 (defvar tramp-current-host nil | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1001 "Remote host for this *tramp* buffer.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1002 |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1003 ;;;###autoload |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1004 (defconst tramp-completion-file-name-handler-alist |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1005 '((file-name-all-completions . tramp-completion-handle-file-name-all-completions) |
70276
32b384911b4f
tramp-file-name-handler-alist): Delete expand-file-name and other
Richard M. Stallman <rms@gnu.org>
parents:
70255
diff
changeset
|
1006 (file-name-completion . tramp-completion-handle-file-name-completion)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1007 "Alist of completion handler functions. |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1008 Used for file names matching `tramp-file-name-regexp'. Operations |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1009 not mentioned here will be handled by Tramp's file name handler |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1010 functions, or the normal Emacs functions.") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1011 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1012 ;; Handlers for foreign methods, like FTP or SMB, shall be plugged here. |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1013 ;;;###tramp-autoload |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1014 (defvar tramp-foreign-file-name-handler-alist nil |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1015 "Alist of elements (FUNCTION . HANDLER) for foreign methods handled specially. |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1016 If (FUNCTION FILENAME) returns non-nil, then all I/O on that file is done by |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1017 calling HANDLER.") |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1018 |
87648
7ae99e295dfd
* vc-git.el (vc-git--call): Apply `process-file' instead of
Michael Albinus <michael.albinus@gmx.de>
parents:
87368
diff
changeset
|
1019 ;;; Internal functions which must come first: |
45861 | 1020 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1021 ;; Conversion functions between external representation and |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1022 ;; internal data structure. Convenience functions for internal |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1023 ;; data structure. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1024 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1025 (defun tramp-file-name-p (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1026 "Check, whether VEC is a Tramp object." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1027 (and (vectorp vec) (= 4 (length vec)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1028 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1029 (defun tramp-file-name-method (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1030 "Return method component of VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1031 (and (tramp-file-name-p vec) (aref vec 0))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1032 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1033 (defun tramp-file-name-user (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1034 "Return user component of VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1035 (and (tramp-file-name-p vec) (aref vec 1))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1036 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1037 (defun tramp-file-name-host (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1038 "Return host component of VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1039 (and (tramp-file-name-p vec) (aref vec 2))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1040 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1041 (defun tramp-file-name-localname (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1042 "Return localname component of VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1043 (and (tramp-file-name-p vec) (aref vec 3))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1044 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1045 ;; The user part of a Tramp file name vector can be of kind |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1046 ;; "user%domain". Sometimes, we must extract these parts. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1047 (defun tramp-file-name-real-user (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1048 "Return the user name of VEC without domain." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1049 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1050 (let ((user (tramp-file-name-user vec))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1051 (if (and (stringp user) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1052 (string-match tramp-user-with-domain-regexp user)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1053 (match-string 1 user) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1054 user)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1055 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1056 (defun tramp-file-name-domain (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1057 "Return the domain name of VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1058 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1059 (let ((user (tramp-file-name-user vec))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1060 (and (stringp user) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1061 (string-match tramp-user-with-domain-regexp user) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1062 (match-string 2 user))))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1063 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1064 ;; The host part of a Tramp file name vector can be of kind |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1065 ;; "host#port". Sometimes, we must extract these parts. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1066 (defun tramp-file-name-real-host (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1067 "Return the host name of VEC without port." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1068 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1069 (let ((host (tramp-file-name-host vec))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1070 (if (and (stringp host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1071 (string-match tramp-host-with-port-regexp host)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1072 (match-string 1 host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1073 host)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1074 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1075 (defun tramp-file-name-port (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1076 "Return the port number of VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1077 (save-match-data |
111788
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1078 (let ((method (tramp-file-name-method vec)) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1079 (host (tramp-file-name-host vec))) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1080 (or (and (stringp host) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1081 (string-match tramp-host-with-port-regexp host) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1082 (string-to-number (match-string 2 host))) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1083 (tramp-get-method-parameter method 'tramp-default-port))))) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1084 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1085 ;;;###tramp-autoload |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1086 (defun tramp-tramp-file-p (name) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1087 "Return t if NAME is a string with Tramp file name syntax." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1088 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1089 (and (stringp name) (string-match tramp-file-name-regexp name)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1090 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1091 (defun tramp-find-method (method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1092 "Return the right method string to use. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1093 This is METHOD, if non-nil. Otherwise, do a lookup in |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1094 `tramp-default-method-alist'." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1095 (or method |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1096 (let ((choices tramp-default-method-alist) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1097 lmethod item) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1098 (while choices |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1099 (setq item (pop choices)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1100 (when (and (string-match (or (nth 0 item) "") (or host "")) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1101 (string-match (or (nth 1 item) "") (or user ""))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1102 (setq lmethod (nth 2 item)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1103 (setq choices nil))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1104 lmethod) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1105 tramp-default-method)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1106 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1107 (defun tramp-find-user (method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1108 "Return the right user string to use. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1109 This is USER, if non-nil. Otherwise, do a lookup in |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1110 `tramp-default-user-alist'." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1111 (or user |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1112 (let ((choices tramp-default-user-alist) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1113 luser item) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1114 (while choices |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1115 (setq item (pop choices)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1116 (when (and (string-match (or (nth 0 item) "") (or method "")) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1117 (string-match (or (nth 1 item) "") (or host ""))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1118 (setq luser (nth 2 item)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1119 (setq choices nil))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1120 luser) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1121 tramp-default-user)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1122 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1123 (defun tramp-find-host (method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1124 "Return the right host string to use. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1125 This is HOST, if non-nil. Otherwise, it is `tramp-default-host'." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1126 (or (and (> (length host) 0) host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1127 tramp-default-host)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1128 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1129 (defun tramp-dissect-file-name (name &optional nodefault) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1130 "Return a `tramp-file-name' structure. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1131 The structure consists of remote method, remote user, remote host |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1132 and localname (file name on remote host). If NODEFAULT is |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1133 non-nil, the file name parts are not expanded to their default |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1134 values." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1135 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1136 (let ((match (string-match (nth 0 tramp-file-name-structure) name))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1137 (unless match (error "Not a Tramp file name: %s" name)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1138 (let ((method (match-string (nth 1 tramp-file-name-structure) name)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1139 (user (match-string (nth 2 tramp-file-name-structure) name)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1140 (host (match-string (nth 3 tramp-file-name-structure) name)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1141 (localname (match-string (nth 4 tramp-file-name-structure) name))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1142 (when host |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1143 (when (string-match tramp-prefix-ipv6-regexp host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1144 (setq host (replace-match "" nil t host))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1145 (when (string-match tramp-postfix-ipv6-regexp host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1146 (setq host (replace-match "" nil t host)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1147 (if nodefault |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1148 (vector method user host localname) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1149 (vector |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1150 (tramp-find-method method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1151 (tramp-find-user method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1152 (tramp-find-host method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1153 localname)))))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1154 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1155 (defun tramp-buffer-name (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1156 "A name for the connection buffer VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1157 ;; We must use `tramp-file-name-real-host', because for gateway |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1158 ;; methods the default port will be expanded later on, which would |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1159 ;; tamper the name. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1160 (let ((method (tramp-file-name-method vec)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1161 (user (tramp-file-name-user vec)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1162 (host (tramp-file-name-real-host vec))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1163 (if (not (zerop (length user))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1164 (format "*tramp/%s %s@%s*" method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1165 (format "*tramp/%s %s*" method host)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1166 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1167 (defun tramp-make-tramp-file-name (method user host localname) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1168 "Constructs a Tramp file name from METHOD, USER, HOST and LOCALNAME." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1169 (concat tramp-prefix-format |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1170 (when (not (zerop (length method))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1171 (concat method tramp-postfix-method-format)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1172 (when (not (zerop (length user))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1173 (concat user tramp-postfix-user-format)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1174 (when host |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1175 (if (string-match tramp-ipv6-regexp host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1176 (concat tramp-prefix-ipv6-format host tramp-postfix-ipv6-format) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1177 host)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1178 tramp-postfix-host-format |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1179 (when localname localname))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1180 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1181 (defun tramp-completion-make-tramp-file-name (method user host localname) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1182 "Constructs a Tramp file name from METHOD, USER, HOST and LOCALNAME. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1183 It must not be a complete Tramp file name, but as long as there are |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1184 necessary only. This function will be used in file name completion." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1185 (concat tramp-prefix-format |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1186 (when (not (zerop (length method))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1187 (concat method tramp-postfix-method-format)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1188 (when (not (zerop (length user))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1189 (concat user tramp-postfix-user-format)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1190 (when (not (zerop (length host))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1191 (concat |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1192 (if (string-match tramp-ipv6-regexp host) |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1193 (concat |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1194 tramp-prefix-ipv6-format host tramp-postfix-ipv6-format) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1195 host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1196 tramp-postfix-host-format)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1197 (when localname localname))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1198 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1199 (defun tramp-get-buffer (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1200 "Get the connection buffer to be used for VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1201 (or (get-buffer (tramp-buffer-name vec)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1202 (with-current-buffer (get-buffer-create (tramp-buffer-name vec)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1203 (setq buffer-undo-list t) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1204 (setq default-directory |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1205 (tramp-make-tramp-file-name |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1206 (tramp-file-name-method vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1207 (tramp-file-name-user vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1208 (tramp-file-name-host vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1209 "/")) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1210 (current-buffer)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1211 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1212 (defun tramp-get-connection-buffer (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1213 "Get the connection buffer to be used for VEC. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1214 In case a second asynchronous communication has been started, it is different |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1215 from `tramp-get-buffer'." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1216 (or (tramp-get-connection-property vec "process-buffer" nil) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1217 (tramp-get-buffer vec))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1218 |
111788
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1219 (defun tramp-get-connection-name (vec) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1220 "Get the connection name to be used for VEC. |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1221 In case a second asynchronous communication has been started, it is different |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1222 from the default one." |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1223 (or (tramp-get-connection-property vec "process-name" nil) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1224 (tramp-buffer-name vec))) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1225 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1226 (defun tramp-get-connection-process (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1227 "Get the connection process to be used for VEC. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1228 In case a second asynchronous communication has been started, it is different |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1229 from the default one." |
111788
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1230 (get-process (tramp-get-connection-name vec))) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1231 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1232 (defun tramp-debug-buffer-name (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1233 "A name for the debug buffer for VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1234 ;; We must use `tramp-file-name-real-host', because for gateway |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1235 ;; methods the default port will be expanded later on, which would |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1236 ;; tamper the name. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1237 (let ((method (tramp-file-name-method vec)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1238 (user (tramp-file-name-user vec)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1239 (host (tramp-file-name-real-host vec))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1240 (if (not (zerop (length user))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1241 (format "*debug tramp/%s %s@%s*" method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1242 (format "*debug tramp/%s %s*" method host)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1243 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1244 (defconst tramp-debug-outline-regexp |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1245 "[0-9]+:[0-9]+:[0-9]+\\.[0-9]+ [a-z0-9-]+ (\\([0-9]+\\)) #" |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1246 "Used for highlighting Tramp debug buffers in `outline-mode'.") |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1247 |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1248 (defun tramp-debug-outline-level () |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1249 "Return the depth to which a statement is nested in the outline. |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1250 Point must be at the beginning of a header line. |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1251 |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1252 The outline level is equal to the verbosity of the Tramp message." |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1253 (1+ (string-to-number (match-string 1)))) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1254 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1255 (defun tramp-get-debug-buffer (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1256 "Get the debug buffer for VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1257 (with-current-buffer |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1258 (get-buffer-create (tramp-debug-buffer-name vec)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1259 (when (bobp) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1260 (setq buffer-undo-list t) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1261 ;; Activate `outline-mode'. This runs `text-mode-hook' and |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1262 ;; `outline-mode-hook'. We must prevent that local processes |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1263 ;; die. Yes: I've seen `flyspell-mode', which starts "ispell". |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1264 ;; Furthermore, `outline-regexp' must have the correct value |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1265 ;; already, because it is used by `font-lock-compile-keywords'. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1266 (let ((default-directory (tramp-compat-temporary-file-directory)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1267 (outline-regexp tramp-debug-outline-regexp)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1268 (outline-mode)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1269 (set (make-local-variable 'outline-regexp) tramp-debug-outline-regexp) |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1270 (set (make-local-variable 'outline-level) 'tramp-debug-outline-level)) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1271 (current-buffer))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1272 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1273 (defsubst tramp-debug-message (vec fmt-string &rest args) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1274 "Append message to debug buffer. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1275 Message is formatted with FMT-STRING as control string and the remaining |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1276 ARGS to actually emit the message (if applicable)." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1277 (when (get-buffer (tramp-buffer-name vec)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1278 (with-current-buffer (tramp-get-debug-buffer vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1279 (goto-char (point-max)) |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1280 ;; Headline. |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1281 (when (bobp) |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1282 (insert |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1283 (format |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1284 ";; %sEmacs: %s Tramp: %s -*- mode: outline; -*-" |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1285 (if (featurep 'sxemacs) "SX" (if (featurep 'xemacs) "X" "GNU ")) |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1286 emacs-version tramp-version))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1287 (unless (bolp) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1288 (insert "\n")) |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1289 ;; Timestamp. |
104125
fd4d8124e329
* net/tramp.el (tramp-debug-message): Print also microseconds.
Michael Albinus <michael.albinus@gmx.de>
parents:
104097
diff
changeset
|
1290 (let ((now (current-time))) |
fd4d8124e329
* net/tramp.el (tramp-debug-message): Print also microseconds.
Michael Albinus <michael.albinus@gmx.de>
parents:
104097
diff
changeset
|
1291 (insert (format-time-string "%T." now)) |
fd4d8124e329
* net/tramp.el (tramp-debug-message): Print also microseconds.
Michael Albinus <michael.albinus@gmx.de>
parents:
104097
diff
changeset
|
1292 (insert (format "%06d " (nth 2 now)))) |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1293 ;; Calling function. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1294 (let ((btn 1) btf fn) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1295 (while (not fn) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1296 (setq btf (nth 1 (backtrace-frame btn))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1297 (if (not btf) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1298 (setq fn "") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1299 (when (symbolp btf) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1300 (setq fn (symbol-name btf)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1301 (unless (and (string-match "^tramp" fn) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1302 (not (string-match |
111788
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1303 "^tramp\\(-debug\\)?\\(-message\\|-error\\|-compat\\(-funcall\\|-with-temp-message\\)\\)$" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1304 fn))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1305 (setq fn nil))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1306 (setq btn (1+ btn)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1307 ;; The following code inserts filename and line number. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1308 ;; Should be deactivated by default, because it is time |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1309 ;; consuming. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1310 ; (let ((ffn (find-function-noselect (intern fn)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1311 ; (insert |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1312 ; (format |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1313 ; "%s:%d: " |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1314 ; (file-name-nondirectory (buffer-file-name (car ffn))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1315 ; (with-current-buffer (car ffn) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1316 ; (1+ (count-lines (point-min) (cdr ffn))))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1317 (insert (format "%s " fn))) |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1318 ;; The message. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1319 (insert (apply 'format fmt-string args))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1320 |
104642
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1321 (defvar tramp-message-show-message t |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1322 "Show Tramp message in the minibuffer. |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1323 This variable is used to disable messages from `tramp-error'. |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1324 The messages are visible anyway, because an error is raised.") |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1325 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1326 (defsubst tramp-message (vec-or-proc level fmt-string &rest args) |
45861 | 1327 "Emit a message depending on verbosity level. |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
1328 VEC-OR-PROC identifies the Tramp buffer to use. It can be either a |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1329 vector or a process. LEVEL says to be quiet if `tramp-verbose' is |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1330 less than LEVEL. The message is emitted only if `tramp-verbose' is |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1331 greater than or equal to LEVEL. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1332 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1333 The message is also logged into the debug buffer when `tramp-verbose' |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1334 is greater than or equal 4. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1335 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1336 Calls functions `message' and `tramp-debug-message' with FMT-STRING as |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1337 control string and the remaining ARGS to actually emit the message (if |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1338 applicable)." |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1339 (ignore-errors |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1340 (when (<= level tramp-verbose) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1341 ;; Match data must be preserved! |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1342 (save-match-data |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1343 ;; Display only when there is a minimum level. |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1344 (when (and tramp-message-show-message (<= level 3)) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1345 (apply 'message |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1346 (concat |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1347 (cond |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1348 ((= level 0) "") |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1349 ((= level 1) "") |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1350 ((= level 2) "Warning: ") |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1351 (t "Tramp: ")) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1352 fmt-string) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1353 args)) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1354 ;; Log only when there is a minimum level. |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1355 (when (>= tramp-verbose 4) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1356 (when (and vec-or-proc |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1357 (processp vec-or-proc) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1358 (buffer-name (process-buffer vec-or-proc))) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1359 (with-current-buffer (process-buffer vec-or-proc) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1360 ;; Translate proc to vec. |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1361 (setq vec-or-proc (tramp-dissect-file-name default-directory)))) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1362 (when (and vec-or-proc (vectorp vec-or-proc)) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1363 (apply 'tramp-debug-message |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1364 vec-or-proc |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1365 (concat (format "(%d) # " level) fmt-string) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1366 args))))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1367 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1368 (defsubst tramp-error (vec-or-proc signal fmt-string &rest args) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1369 "Emit an error. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1370 VEC-OR-PROC identifies the connection to use, SIGNAL is the |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1371 signal identifier to be raised, remaining args passed to |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1372 `tramp-message'. Finally, signal SIGNAL is raised." |
104642
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1373 (let (tramp-message-show-message) |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1374 (tramp-message |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1375 vec-or-proc 1 "%s" |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1376 (error-message-string |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1377 (list signal |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1378 (get signal 'error-message) |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1379 (apply 'format fmt-string args)))) |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1380 (signal signal (list (apply 'format fmt-string args))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1381 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1382 (defsubst tramp-error-with-buffer |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1383 (buffer vec-or-proc signal fmt-string &rest args) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1384 "Emit an error, and show BUFFER. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1385 If BUFFER is nil, show the connection buffer. Wait for 30\", or until |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1386 an input event arrives. The other arguments are passed to `tramp-error'." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1387 (save-window-excursion |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1388 (unwind-protect |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1389 (apply 'tramp-error vec-or-proc signal fmt-string args) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1390 (when (and vec-or-proc |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1391 (not (zerop tramp-verbose)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1392 (not (tramp-completion-mode-p))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1393 (let ((enable-recursive-minibuffers t)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1394 (pop-to-buffer |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1395 (or (and (bufferp buffer) buffer) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1396 (and (processp vec-or-proc) (process-buffer vec-or-proc)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1397 (tramp-get-buffer vec-or-proc))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1398 (sit-for 30)))))) |
45861 | 1399 |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1400 (defmacro with-parsed-tramp-file-name (filename var &rest body) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1401 "Parse a Tramp filename and make components available in the body. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1402 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1403 First arg FILENAME is evaluated and dissected into its components. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1404 Second arg VAR is a symbol. It is used as a variable name to hold |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1405 the filename structure. It is also used as a prefix for the variables |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1406 holding the components. For example, if VAR is the symbol `foo', then |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1407 `foo' will be bound to the whole structure, `foo-method' will be bound to |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1408 the method component, and so on for `foo-user', `foo-host', `foo-localname'. |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1409 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1410 Remaining args are Lisp expressions to be evaluated (inside an implicit |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1411 `progn'). |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1412 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1413 If VAR is nil, then we bind `v' to the structure and `method', `user', |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1414 `host', `localname' to the components." |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1415 `(let* ((,(or var 'v) (tramp-dissect-file-name ,filename)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1416 (,(if var (intern (concat (symbol-name var) "-method")) 'method) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1417 (tramp-file-name-method ,(or var 'v))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1418 (,(if var (intern (concat (symbol-name var) "-user")) 'user) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1419 (tramp-file-name-user ,(or var 'v))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1420 (,(if var (intern (concat (symbol-name var) "-host")) 'host) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1421 (tramp-file-name-host ,(or var 'v))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1422 (,(if var (intern (concat (symbol-name var) "-localname")) 'localname) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1423 (tramp-file-name-localname ,(or var 'v)))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1424 ,@body)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1425 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1426 (put 'with-parsed-tramp-file-name 'lisp-indent-function 2) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1427 (put 'with-parsed-tramp-file-name 'edebug-form-spec '(form symbolp body)) |
110374
932697ced7aa
* net/tramp-compat.el (tramp-compat-with-temp-message)
Michael Albinus <michael.albinus@gmx.de>
parents:
110321
diff
changeset
|
1428 (tramp-compat-font-lock-add-keywords |
932697ced7aa
* net/tramp-compat.el (tramp-compat-with-temp-message)
Michael Albinus <michael.albinus@gmx.de>
parents:
110321
diff
changeset
|
1429 'emacs-lisp-mode '("\\<with-parsed-tramp-file-name\\>")) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1430 |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1431 (defun tramp-progress-reporter-update (reporter &optional value) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1432 (let* ((parameters (cdr reporter)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1433 (message (aref parameters 3))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1434 (when (string-match message (or (current-message) "")) |
110374
932697ced7aa
* net/tramp-compat.el (tramp-compat-with-temp-message)
Michael Albinus <michael.albinus@gmx.de>
parents:
110321
diff
changeset
|
1435 (tramp-compat-funcall 'progress-reporter-update reporter value)))) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1436 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1437 (defmacro with-progress-reporter (vec level message &rest body) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1438 "Executes BODY, spinning a progress reporter with MESSAGE. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1439 If LEVEL does not fit for visible messages, or if this is a |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1440 nested call of the macro, there are only traces without a visible |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1441 progress reporter." |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1442 `(let (pr tm) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1443 (tramp-message ,vec ,level "%s..." ,message) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1444 ;; We start a pulsing progress reporter after 3 seconds. Feature |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1445 ;; introduced in Emacs 24.1. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1446 (when (and tramp-message-show-message |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1447 ;; Display only when there is a minimum level. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1448 (<= ,level (min tramp-verbose 3))) |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1449 (ignore-errors |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1450 (setq pr (tramp-compat-funcall 'make-progress-reporter ,message) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1451 tm (when pr |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1452 (run-at-time 3 0.1 'tramp-progress-reporter-update pr))))) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1453 (unwind-protect |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1454 ;; Execute the body. Unset `tramp-message-show-message' when |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1455 ;; the timer object is created, in order to suppress |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1456 ;; concurrent timers. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1457 (let ((tramp-message-show-message |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1458 (and tramp-message-show-message (not tm)))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1459 ,@body) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1460 ;; Stop progress reporter. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1461 (if tm (tramp-compat-funcall 'cancel-timer tm)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1462 (tramp-message ,vec ,level "%s...done" ,message)))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1463 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1464 (put 'with-progress-reporter 'lisp-indent-function 3) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1465 (put 'with-progress-reporter 'edebug-form-spec t) |
110374
932697ced7aa
* net/tramp-compat.el (tramp-compat-with-temp-message)
Michael Albinus <michael.albinus@gmx.de>
parents:
110321
diff
changeset
|
1466 (tramp-compat-font-lock-add-keywords |
932697ced7aa
* net/tramp-compat.el (tramp-compat-with-temp-message)
Michael Albinus <michael.albinus@gmx.de>
parents:
110321
diff
changeset
|
1467 'emacs-lisp-mode '("\\<with-progress-reporter\\>")) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1468 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1469 (eval-and-compile ;; Silence compiler. |
93566
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1470 (if (memq system-type '(cygwin windows-nt)) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1471 (defun tramp-drop-volume-letter (name) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1472 "Cut off unnecessary drive letter from file NAME. |
111788
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1473 The functions `tramp-*-handle-expand-file-name' call `expand-file-name' |
93566
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1474 locally on a remote file name. When the local system is a W32 system |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1475 but the remote system is Unix, this introduces a superfluous drive |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1476 letter into the file name. This function removes it." |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1477 (save-match-data |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1478 (if (string-match tramp-root-regexp name) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1479 (replace-match "/" nil t name) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1480 name))) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1481 |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1482 (defalias 'tramp-drop-volume-letter 'identity))) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1483 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1484 ;;; Config Manipulation Functions: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1485 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1486 (defun tramp-set-completion-function (method function-list) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1487 "Sets the list of completion functions for METHOD. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1488 FUNCTION-LIST is a list of entries of the form (FUNCTION FILE). |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1489 The FUNCTION is intended to parse FILE according its syntax. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1490 It might be a predefined FUNCTION, or a user defined FUNCTION. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1491 Predefined FUNCTIONs are `tramp-parse-rhosts', `tramp-parse-shosts', |
99540
c5c8f07bc47c
* w32-fns.el (w32-shell-dos-semantics):
Juanma Barranquero <lekktu@gmail.com>
parents:
98699
diff
changeset
|
1492 `tramp-parse-sconfig', `tramp-parse-hosts', `tramp-parse-passwd', |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1493 and `tramp-parse-netrc'. |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1494 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1495 Example: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1496 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1497 (tramp-set-completion-function |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1498 \"ssh\" |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1499 '((tramp-parse-sconfig \"/etc/ssh_config\") |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1500 (tramp-parse-sconfig \"~/.ssh/config\")))" |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1501 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1502 (let ((r function-list) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1503 (v function-list)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1504 (setq tramp-completion-function-alist |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1505 (delete (assoc method tramp-completion-function-alist) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1506 tramp-completion-function-alist)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1507 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1508 (while v |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1509 ;; Remove double entries. |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1510 (when (member (car v) (cdr v)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1511 (setcdr v (delete (car v) (cdr v)))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1512 ;; Check for function and file or registry key. |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1513 (unless (and (functionp (nth 0 (car v))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1514 (if (string-match "^HKEY_CURRENT_USER" (nth 1 (car v))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1515 ;; Windows registry. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1516 (and (memq system-type '(cygwin windows-nt)) |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
1517 (zerop |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1518 (tramp-compat-call-process |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
1519 "reg" nil nil nil "query" (nth 1 (car v))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1520 ;; Configuration file. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1521 (file-exists-p (nth 1 (car v))))) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1522 (setq r (delete (car v) r))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1523 (setq v (cdr v))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1524 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1525 (when r |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1526 (add-to-list 'tramp-completion-function-alist |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1527 (cons method r))))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1528 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1529 (defun tramp-get-completion-function (method) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1530 "Returns a list of completion functions for METHOD. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1531 For definition of that list see `tramp-set-completion-function'." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1532 (cons |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1533 ;; Hosts visited once shall be remembered. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1534 `(tramp-parse-connection-properties ,method) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1535 ;; The method related defaults. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1536 (cdr (assoc method tramp-completion-function-alist)))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1537 |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1538 |
87648
7ae99e295dfd
* vc-git.el (vc-git--call): Apply `process-file' instead of
Michael Albinus <michael.albinus@gmx.de>
parents:
87368
diff
changeset
|
1539 ;;; Fontification of `read-file-name': |
7ae99e295dfd
* vc-git.el (vc-git--call): Apply `process-file' instead of
Michael Albinus <michael.albinus@gmx.de>
parents:
87368
diff
changeset
|
1540 |
7ae99e295dfd
* vc-git.el (vc-git--call): Apply `process-file' instead of
Michael Albinus <michael.albinus@gmx.de>
parents:
87368
diff
changeset
|
1541 ;; rfn-eshadow.el is part of Emacs 22. It is autoloaded. |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1542 (defvar tramp-rfn-eshadow-overlay) |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1543 (make-variable-buffer-local 'tramp-rfn-eshadow-overlay) |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1544 |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1545 (defun tramp-rfn-eshadow-setup-minibuffer () |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1546 "Set up a minibuffer for `file-name-shadow-mode'. |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1547 Adds another overlay hiding filename parts according to Tramp's |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1548 special handling of `substitute-in-file-name'." |
84966
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1549 (when (symbol-value 'minibuffer-completing-file-name) |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1550 (setq tramp-rfn-eshadow-overlay |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1551 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1552 'make-overlay |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1553 (tramp-compat-funcall 'minibuffer-prompt-end) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1554 (tramp-compat-funcall 'minibuffer-prompt-end))) |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1555 ;; Copy rfn-eshadow-overlay properties. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1556 (let ((props (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1557 'overlay-properties (symbol-value 'rfn-eshadow-overlay)))) |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1558 (while props |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1559 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1560 'overlay-put tramp-rfn-eshadow-overlay (pop props) (pop props)))))) |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1561 |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1562 (when (boundp 'rfn-eshadow-setup-minibuffer-hook) |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1563 (add-hook 'rfn-eshadow-setup-minibuffer-hook |
95659
926453fe3d68
* net/tramp.el (top): Quote feature names. Remove
Michael Albinus <michael.albinus@gmx.de>
parents:
95067
diff
changeset
|
1564 'tramp-rfn-eshadow-setup-minibuffer) |
926453fe3d68
* net/tramp.el (top): Quote feature names. Remove
Michael Albinus <michael.albinus@gmx.de>
parents:
95067
diff
changeset
|
1565 (add-hook 'tramp-unload-hook |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1566 (lambda () |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1567 (remove-hook 'rfn-eshadow-setup-minibuffer-hook |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1568 'tramp-rfn-eshadow-setup-minibuffer)))) |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1569 |
104137
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1570 (defconst tramp-rfn-eshadow-update-overlay-regexp |
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1571 (format "[^%s/~]*\\(/\\|~\\)" tramp-postfix-host-format)) |
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1572 |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1573 (defun tramp-rfn-eshadow-update-overlay () |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1574 "Update `rfn-eshadow-overlay' to cover shadowed part of minibuffer input. |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1575 This is intended to be used as a minibuffer `post-command-hook' for |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1576 `file-name-shadow-mode'; the minibuffer should have already |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1577 been set up by `rfn-eshadow-setup-minibuffer'." |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1578 ;; In remote files name, there is a shadowing just for the local part. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1579 (let ((end (or (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1580 'overlay-end (symbol-value 'rfn-eshadow-overlay)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1581 (tramp-compat-funcall 'minibuffer-prompt-end)))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1582 (when |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1583 (file-remote-p |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1584 (tramp-compat-funcall 'buffer-substring-no-properties end (point-max))) |
85428
ad84adc0e027
From_ Johan Bockgrd, <http://article.gmane.org/gmane.emacs.devel/81056>
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
85126
diff
changeset
|
1585 (save-excursion |
ad84adc0e027
From_ Johan Bockgrd, <http://article.gmane.org/gmane.emacs.devel/81056>
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
85126
diff
changeset
|
1586 (save-restriction |
ad84adc0e027
From_ Johan Bockgrd, <http://article.gmane.org/gmane.emacs.devel/81056>
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
85126
diff
changeset
|
1587 (narrow-to-region |
104137
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1588 (1+ (or (string-match |
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1589 tramp-rfn-eshadow-update-overlay-regexp (buffer-string) end) |
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1590 end)) |
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1591 (point-max)) |
85428
ad84adc0e027
From_ Johan Bockgrd, <http://article.gmane.org/gmane.emacs.devel/81056>
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
85126
diff
changeset
|
1592 (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay) |
ad84adc0e027
From_ Johan Bockgrd, <http://article.gmane.org/gmane.emacs.devel/81056>
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
85126
diff
changeset
|
1593 (rfn-eshadow-update-overlay-hook nil)) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1594 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1595 'move-overlay rfn-eshadow-overlay (point-max) (point-max)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1596 (tramp-compat-funcall 'rfn-eshadow-update-overlay))))))) |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1597 |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1598 (when (boundp 'rfn-eshadow-update-overlay-hook) |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1599 (add-hook 'rfn-eshadow-update-overlay-hook |
105718
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
1600 'tramp-rfn-eshadow-update-overlay) |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
1601 (add-hook 'tramp-unload-hook |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
1602 (lambda () |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
1603 (remove-hook 'rfn-eshadow-update-overlay-hook |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
1604 'tramp-rfn-eshadow-update-overlay)))) |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1605 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1606 ;; Inodes don't exist for some file systems. Therefore we must |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1607 ;; generate virtual ones. Used in `find-buffer-visiting'. The method |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1608 ;; applied might be not so efficient (Ange-FTP uses hashes). But |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1609 ;; performance isn't the major issue given that file transfer will |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1610 ;; take time. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1611 (defvar tramp-inodes nil |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1612 "Keeps virtual inodes numbers.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1613 |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1614 ;; Devices must distinguish physical file systems. The device numbers |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1615 ;; provided by "lstat" aren't unique, because we operate on different hosts. |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1616 ;; So we use virtual device numbers, generated by Tramp. Both Ange-FTP and |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1617 ;; EFS use device number "-1". In order to be different, we use device number |
97052
bed318e44ebd
* net/tramp.el (tramp-perl-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
97035
diff
changeset
|
1618 ;; (-1 . x), whereby "x" is unique for a given (method user host). |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1619 (defvar tramp-devices nil |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1620 "Keeps virtual device numbers.") |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1621 |
102851
5cc9a4c776e8
* net/tramp.el (tramp-default-file-modes) New defun. Replace all
Michael Albinus <michael.albinus@gmx.de>
parents:
102287
diff
changeset
|
1622 (defun tramp-default-file-modes (filename) |
5cc9a4c776e8
* net/tramp.el (tramp-default-file-modes) New defun. Replace all
Michael Albinus <michael.albinus@gmx.de>
parents:
102287
diff
changeset
|
1623 "Return file modes of FILENAME as integer. |
5cc9a4c776e8
* net/tramp.el (tramp-default-file-modes) New defun. Replace all
Michael Albinus <michael.albinus@gmx.de>
parents:
102287
diff
changeset
|
1624 If the file modes of FILENAME cannot be determined, return the |
103639
6be9692e90bf
* net/tramp.el (tramp-default-file-modes) Remove execute permissions.
Michael Albinus <michael.albinus@gmx.de>
parents:
103635
diff
changeset
|
1625 value of `default-file-modes', without execute permissions." |
6be9692e90bf
* net/tramp.el (tramp-default-file-modes) Remove execute permissions.
Michael Albinus <michael.albinus@gmx.de>
parents:
103635
diff
changeset
|
1626 (or (file-modes filename) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1627 (logand (default-file-modes) (tramp-compat-octal-to-decimal "0666")))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1628 |
94395
f020c9568544
* net/tramp.el (tramp-replace-environment-variables): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
94333
diff
changeset
|
1629 (defun tramp-replace-environment-variables (filename) |
f020c9568544
* net/tramp.el (tramp-replace-environment-variables): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
94333
diff
changeset
|
1630 "Replace environment variables in FILENAME. |
f020c9568544
* net/tramp.el (tramp-replace-environment-variables): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
94333
diff
changeset
|
1631 Return the string with the replaced variables." |
94436
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1632 (save-match-data |
105615
33df72cf19f1
* net/tramp.el (tramp-replace-environment-variables): Do not fail
Michael Albinus <michael.albinus@gmx.de>
parents:
105549
diff
changeset
|
1633 (let ((idx (string-match "$\\(\\w+\\)" filename))) |
94436
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1634 ;; `$' is coded as `$$'. |
105615
33df72cf19f1
* net/tramp.el (tramp-replace-environment-variables): Do not fail
Michael Albinus <michael.albinus@gmx.de>
parents:
105549
diff
changeset
|
1635 (when (and idx |
33df72cf19f1
* net/tramp.el (tramp-replace-environment-variables): Do not fail
Michael Albinus <michael.albinus@gmx.de>
parents:
105549
diff
changeset
|
1636 (or (zerop idx) (not (eq ?$ (aref filename (1- idx))))) |
33df72cf19f1
* net/tramp.el (tramp-replace-environment-variables): Do not fail
Michael Albinus <michael.albinus@gmx.de>
parents:
105549
diff
changeset
|
1637 (getenv (match-string 1 filename))) |
94436
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1638 (setq filename |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1639 (replace-match |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1640 (substitute-in-file-name (match-string 0 filename)) |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1641 t nil filename))) |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1642 filename))) |
94395
f020c9568544
* net/tramp.el (tramp-replace-environment-variables): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
94333
diff
changeset
|
1643 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1644 ;; In XEmacs, electricity is implemented via a key map for ?/ and ?~, |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1645 ;; which calls corresponding functions (see minibuf.el). |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1646 (when (fboundp 'minibuffer-electric-separator) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
1647 (mapc |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1648 (lambda (x) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1649 (eval |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1650 `(defadvice ,x |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1651 (around ,(intern (format "tramp-advice-%s" x)) activate) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1652 "Invoke `substitute-in-file-name' for Tramp files." |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1653 (if (and (symbol-value 'minibuffer-electric-file-name-behavior) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1654 (tramp-tramp-file-p (buffer-substring))) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1655 ;; We don't need to handle `last-input-event', because |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1656 ;; due to the key map we know it must be ?/ or ?~. |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1657 (let ((s (concat (buffer-substring (point-min) (point)) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1658 (string last-command-char)))) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1659 (delete-region (point-min) (point)) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1660 (insert (substitute-in-file-name s)) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1661 (setq ad-return-value last-command-char)) |
105952
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1662 ad-do-it))) |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1663 (eval |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1664 `(add-hook |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1665 'tramp-unload-hook |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1666 (lambda () |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1667 (ad-remove-advice ',x 'around ',(intern (format "tramp-advice-%s" x))) |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1668 (ad-activate ',x))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1669 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1670 '(minibuffer-electric-separator |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1671 minibuffer-electric-tilde))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1672 |
93938
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1673 (defun tramp-find-file-name-coding-system-alist (filename tmpname) |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1674 "Like `find-operation-coding-system' for Tramp filenames. |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1675 Tramp's `insert-file-contents' and `write-region' work over |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1676 temporary file names. If `file-coding-system-alist' contains an |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1677 expression, which matches more than the file name suffix, the |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1678 coding system might not be determined. This function repairs it." |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1679 (let (result) |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1680 (dolist (elt file-coding-system-alist result) |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1681 (when (and (consp elt) (string-match (car elt) filename)) |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1682 ;; We found a matching entry in `file-coding-system-alist'. |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1683 ;; So we add a similar entry, but with the temporary file name |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1684 ;; as regexp. |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1685 (add-to-list |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1686 'result (cons (regexp-quote tmpname) (cdr elt)) 'append))))) |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1687 |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1688 ;;;###autoload |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1689 (progn (defun tramp-run-real-handler (operation args) |
45861 | 1690 "Invoke normal file name handler for OPERATION. |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1691 First arg specifies the OPERATION, second arg is a list of arguments to |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1692 pass to the OPERATION." |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1693 (let* ((inhibit-file-name-handlers |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1694 `(tramp-file-name-handler |
104642
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1695 tramp-vc-file-name-handler |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1696 tramp-completion-file-name-handler |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1697 cygwin-mount-name-hook-function |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1698 cygwin-mount-map-drive-hook-function |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1699 . |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1700 ,(and (eq inhibit-file-name-operation operation) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1701 inhibit-file-name-handlers))) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1702 (inhibit-file-name-operation operation)) |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1703 (apply operation args)))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1704 |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1705 ;;;###autoload |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1706 (progn (defun tramp-completion-run-real-handler (operation args) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1707 "Invoke `tramp-file-name-handler' for OPERATION. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1708 First arg specifies the OPERATION, second arg is a list of arguments to |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1709 pass to the OPERATION." |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1710 (let* ((inhibit-file-name-handlers |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1711 `(tramp-completion-file-name-handler |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1712 cygwin-mount-name-hook-function |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1713 cygwin-mount-map-drive-hook-function |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1714 . |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1715 ,(and (eq inhibit-file-name-operation operation) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1716 inhibit-file-name-handlers))) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1717 (inhibit-file-name-operation operation)) |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1718 (apply operation args)))) |
45861 | 1719 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1720 ;; We handle here all file primitives. Most of them have the file |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1721 ;; name as first parameter; nevertheless we check for them explicitly |
96361
a99299e4d2de
American English spelling fix.
Glenn Morris <rgm@gnu.org>
parents:
95967
diff
changeset
|
1722 ;; in order to be signaled if a new primitive appears. This |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1723 ;; scenario is needed because there isn't a way to decide by |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1724 ;; syntactical means whether a foreign method must be called. It would |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1725 ;; ease the life if `file-name-handler-alist' would support a decision |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1726 ;; function as well but regexp only. |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1727 (defun tramp-file-name-for-operation (operation &rest args) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1728 "Return file name related to OPERATION file primitive. |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1729 ARGS are the arguments OPERATION has been called with." |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1730 (cond |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1731 ;; FILE resp DIRECTORY. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1732 ((member operation |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1733 (list 'access-file 'byte-compiler-base-file-name 'delete-directory |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1734 'delete-file 'diff-latest-backup-file 'directory-file-name |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1735 'directory-files 'directory-files-and-attributes |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1736 'dired-compress-file 'dired-uncache |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1737 'file-accessible-directory-p 'file-attributes |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1738 'file-directory-p 'file-executable-p 'file-exists-p |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1739 'file-local-copy 'file-remote-p 'file-modes |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1740 'file-name-as-directory 'file-name-directory |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1741 'file-name-nondirectory 'file-name-sans-versions |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1742 'file-ownership-preserved-p 'file-readable-p |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1743 'file-regular-p 'file-symlink-p 'file-truename |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1744 'file-writable-p 'find-backup-file-name 'find-file-noselect |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1745 'get-file-buffer 'insert-directory 'insert-file-contents |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1746 'load 'make-directory 'make-directory-internal |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1747 'set-file-modes 'substitute-in-file-name |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1748 'unhandled-file-name-directory 'vc-registered |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1749 ;; Emacs 22+ only. |
81938
26330ef1aa46
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
81758
diff
changeset
|
1750 'set-file-times |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1751 ;; Emacs 24+ only. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1752 'file-selinux-context 'set-file-selinux-context |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1753 ;; XEmacs only. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1754 'abbreviate-file-name 'create-file-buffer |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1755 'dired-file-modtime 'dired-make-compressed-filename |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1756 'dired-recursive-delete-directory 'dired-set-file-modtime |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1757 'dired-shell-unhandle-file-name 'dired-uucode-file |
95025
bdaea36b81dd
* net/tramp.el: Load auth-source library.
Michael Albinus <michael.albinus@gmx.de>
parents:
94975
diff
changeset
|
1758 'insert-file-contents-literally 'make-temp-name 'recover-file |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1759 'vm-imap-check-mail 'vm-pop-check-mail 'vm-spool-check-mail)) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1760 (if (file-name-absolute-p (nth 0 args)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1761 (nth 0 args) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1762 (expand-file-name (nth 0 args)))) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1763 ;; FILE DIRECTORY resp FILE1 FILE2. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1764 ((member operation |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1765 (list 'add-name-to-file 'copy-file 'expand-file-name |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1766 'file-name-all-completions 'file-name-completion |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1767 'file-newer-than-file-p 'make-symbolic-link 'rename-file |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1768 ;; Emacs 23+ only. |
105462
f6c5cf0fc0c9
* net/tramp.el (tramp-verbose): Fix docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
105351
diff
changeset
|
1769 'copy-directory |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1770 ;; XEmacs only. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1771 'dired-make-relative-symlink |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1772 'vm-imap-move-mail 'vm-pop-move-mail 'vm-spool-move-mail)) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1773 (save-match-data |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1774 (cond |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1775 ((string-match tramp-file-name-regexp (nth 0 args)) (nth 0 args)) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1776 ((string-match tramp-file-name-regexp (nth 1 args)) (nth 1 args)) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1777 (t (buffer-file-name (current-buffer)))))) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1778 ;; START END FILE. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1779 ((eq operation 'write-region) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1780 (nth 2 args)) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1781 ;; BUFFER. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1782 ((member operation |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1783 (list 'set-visited-file-modtime 'verify-visited-file-modtime |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1784 ;; Emacs 22+ only. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1785 'make-auto-save-file-name |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1786 ;; XEmacs only. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1787 'backup-buffer)) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1788 (buffer-file-name |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1789 (if (bufferp (nth 0 args)) (nth 0 args) (current-buffer)))) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1790 ;; COMMAND. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1791 ((member operation |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1792 (list ;; not in Emacs 23+. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1793 'dired-call-process |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1794 ;; Emacs only. |
60287
865aec6814c3
(tramp-file-name-for-operation): Fix misapplied
Andreas Schwab <schwab@suse.de>
parents:
60156
diff
changeset
|
1795 'shell-command |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1796 ;; Emacs 22+ only. |
57653
b324ca4df07c
* simple.el (process-file): New function, similar to call-process
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
57559
diff
changeset
|
1797 'process-file |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1798 ;; Emacs 23+ only. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1799 'start-file-process |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1800 ;; XEmacs only. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1801 'dired-print-file 'dired-shell-call-process |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1802 ;; nowhere yet. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1803 'executable-find 'start-process |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1804 'call-process 'call-process-region)) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1805 default-directory) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1806 ;; Unknown file primitive. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1807 (t (error "unknown file I/O primitive: %s" operation)))) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1808 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1809 (defun tramp-find-foreign-file-name-handler (filename) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1810 "Return foreign file name handler if exists." |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1811 (when (tramp-tramp-file-p filename) |
84966
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1812 (let ((v (tramp-dissect-file-name filename t)) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1813 (handler tramp-foreign-file-name-handler-alist) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1814 elt res) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1815 ;; When we are not fully sure that filename completion is safe, |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1816 ;; we should not return a handler. |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1817 (when (or (tramp-file-name-method v) (tramp-file-name-user v) |
85089
8fb95bcda144
* net/tramp.el (tramp-find-foreign-file-name-handler): Check also
Michael Albinus <michael.albinus@gmx.de>
parents:
85067
diff
changeset
|
1818 (and (tramp-file-name-host v) |
8fb95bcda144
* net/tramp.el (tramp-find-foreign-file-name-handler): Check also
Michael Albinus <michael.albinus@gmx.de>
parents:
85067
diff
changeset
|
1819 (not (member (tramp-file-name-host v) |
8fb95bcda144
* net/tramp.el (tramp-find-foreign-file-name-handler): Check also
Michael Albinus <michael.albinus@gmx.de>
parents:
85067
diff
changeset
|
1820 (mapcar 'car tramp-methods)))) |
84966
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1821 (not (tramp-completion-mode-p))) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1822 (while handler |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1823 (setq elt (car handler) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1824 handler (cdr handler)) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1825 (when (funcall (car elt) filename) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1826 (setq handler nil |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1827 res (cdr elt)))) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1828 res)))) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1829 |
45861 | 1830 ;; Main function. |
1831 ;;;###autoload | |
1832 (defun tramp-file-name-handler (operation &rest args) | |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
1833 "Invoke Tramp file name handler. |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
1834 Falls back to normal file name handler if no Tramp file name handler exists." |
94436
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1835 (if tramp-mode |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1836 (save-match-data |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1837 (let* ((filename |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1838 (tramp-replace-environment-variables |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1839 (apply 'tramp-file-name-for-operation operation args))) |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1840 (completion (tramp-completion-mode-p)) |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1841 (foreign (tramp-find-foreign-file-name-handler filename))) |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1842 (with-parsed-tramp-file-name filename nil |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1843 ;; Call the backend function. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1844 (if foreign |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1845 (condition-case err |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1846 (apply foreign operation args) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1847 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1848 ;; Trace, that somebody has interrupted the operation. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1849 (quit |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1850 (let (tramp-message-show-message) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1851 (tramp-message |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1852 v 1 "Interrupt received in operation %s" |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1853 (append (list operation) args))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1854 ;; Propagate the quit signal. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1855 (signal (car err) (cdr err))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1856 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1857 ;; When we are in completion mode, some failed |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1858 ;; operations shall return at least a default value |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1859 ;; in order to give the user a chance to correct the |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1860 ;; file name in the minibuffer. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1861 (error |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1862 (cond |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1863 ((and completion (zerop (length localname)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1864 (memq operation '(file-exists-p file-directory-p))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1865 t) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1866 ((and completion (zerop (length localname)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1867 (memq operation |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1868 '(expand-file-name file-name-as-directory))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1869 filename) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1870 ;; Propagate the error. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1871 (t (signal (car err) (cdr err)))))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1872 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1873 ;; Nothing to do for us. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1874 (tramp-run-real-handler operation args))))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1875 |
94436
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1876 ;; When `tramp-mode' is not enabled, we don't do anything. |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1877 (tramp-run-real-handler operation args))) |
45861 | 1878 |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1879 ;; In Emacs, there is some concurrency due to timers. If a timer |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1880 ;; interrupts Tramp and wishes to use the same connection buffer as |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1881 ;; the "main" Emacs, then garbage might occur in the connection |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1882 ;; buffer. Therefore, we need to make sure that a timer does not use |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1883 ;; the same connection buffer as the "main" Emacs. We implement a |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1884 ;; cheap global lock, instead of locking each connection buffer |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1885 ;; separately. The global lock is based on two variables, |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1886 ;; `tramp-locked' and `tramp-locker'. `tramp-locked' is set to true |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1887 ;; (with setq) to indicate a lock. But Tramp also calls itself during |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1888 ;; processing of a single file operation, so we need to allow |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1889 ;; recursive calls. That's where the `tramp-locker' variable comes in |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1890 ;; -- it is let-bound to t during the execution of the current |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1891 ;; handler. So if `tramp-locked' is t and `tramp-locker' is also t, |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1892 ;; then we should just proceed because we have been called |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1893 ;; recursively. But if `tramp-locker' is nil, then we are a timer |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1894 ;; interrupting the "main" Emacs, and then we signal an error. |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1895 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1896 (defvar tramp-locked nil |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1897 "If non-nil, then Tramp is currently busy. |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1898 Together with `tramp-locker', this implements a locking mechanism |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1899 preventing reentrant calls of Tramp.") |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1900 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1901 (defvar tramp-locker nil |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1902 "If non-nil, then a caller has locked Tramp. |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1903 Together with `tramp-locked', this implements a locking mechanism |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1904 preventing reentrant calls of Tramp.") |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1905 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1906 ;;;###autoload |
70255
d57fb8c98714
* net/tramp.el (tramp-completion-file-name-handler): Disable
Michael Albinus <michael.albinus@gmx.de>
parents:
70191
diff
changeset
|
1907 (progn (defun tramp-completion-file-name-handler (operation &rest args) |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
1908 "Invoke Tramp file name completion handler. |
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
1909 Falls back to normal file name handler if no Tramp file name handler exists." |
93040
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
1910 ;; We bind `directory-sep-char' here for XEmacs on Windows, which |
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
1911 ;; would otherwise use backslash. |
93082
7e079018403b
* net/tramp.el (tramp-let-maybe): Removed.
Michael Albinus <michael.albinus@gmx.de>
parents:
93062
diff
changeset
|
1912 (let ((directory-sep-char ?/) |
7e079018403b
* net/tramp.el (tramp-let-maybe): Removed.
Michael Albinus <michael.albinus@gmx.de>
parents:
93062
diff
changeset
|
1913 (fn (assoc operation tramp-completion-file-name-handler-alist))) |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1914 (if (and |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1915 ;; When `tramp-mode' is not enabled, we don't do anything. |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1916 fn tramp-mode |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1917 ;; For other syntaxes than `sep', the regexp matches many common |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1918 ;; situations where the user doesn't actually want to use Tramp. |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1919 ;; So to avoid autoloading Tramp after typing just "/s", we |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1920 ;; disable this part of the completion, unless the user implicitly |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1921 ;; indicated his interest in using a fancier completion system. |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1922 (or (eq tramp-syntax 'sep) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1923 (featurep 'tramp) ;; If it's loaded, we may as well use it. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1924 ;; `partial-completion-mode' does not exist in XEmacs. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1925 ;; It is obsoleted with Emacs 24.1. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1926 (and (boundp 'partial-completion-mode) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1927 (symbol-value 'partial-completion-mode)) |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1928 ;; FIXME: These may have been loaded even if the user never |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1929 ;; intended to use them. |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1930 (featurep 'ido) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1931 (featurep 'icicles))) |
93082
7e079018403b
* net/tramp.el (tramp-let-maybe): Removed.
Michael Albinus <michael.albinus@gmx.de>
parents:
93062
diff
changeset
|
1932 (save-match-data (apply (cdr fn) args)) |
7e079018403b
* net/tramp.el (tramp-let-maybe): Removed.
Michael Albinus <michael.albinus@gmx.de>
parents:
93062
diff
changeset
|
1933 (tramp-completion-run-real-handler operation args))))) |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1934 |
45861 | 1935 ;;;###autoload |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1936 (progn (defun tramp-register-file-name-handlers () |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1937 "Add Tramp file name handlers to `file-name-handler-alist'." |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1938 ;; Remove autoloaded handlers from file name handler alist. Useful, |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1939 ;; if `tramp-syntax' has been changed. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1940 (let ((a1 (rassq 'tramp-file-name-handler file-name-handler-alist))) |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1941 (setq file-name-handler-alist (delq a1 file-name-handler-alist))) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1942 (let ((a1 (rassq |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1943 'tramp-completion-file-name-handler file-name-handler-alist))) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1944 (setq file-name-handler-alist (delq a1 file-name-handler-alist))) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1945 ;; Add the handlers. |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1946 (add-to-list 'file-name-handler-alist |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1947 (cons tramp-file-name-regexp 'tramp-file-name-handler)) |
107040
5555e86608c1
* net/ange-ftp.el (ange-ftp-insert-directory): Handle the case,
Michael Albinus <albinus@detlef>
parents:
107021
diff
changeset
|
1948 (put 'tramp-file-name-handler 'safe-magic t) |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1949 (add-to-list 'file-name-handler-alist |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1950 (cons tramp-completion-file-name-regexp |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1951 'tramp-completion-file-name-handler)) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1952 (put 'tramp-completion-file-name-handler 'safe-magic t) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1953 ;; If jka-compr or epa-file are already loaded, move them to the |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1954 ;; front of `file-name-handler-alist'. |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1955 (dolist (fnh '(epa-file-handler jka-compr-handler)) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1956 (let ((entry (rassoc fnh file-name-handler-alist))) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1957 (when entry |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1958 (setq file-name-handler-alist |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1959 (cons entry (delete entry file-name-handler-alist)))))))) |
76846
d55ab93ab5bf
* net/tramp.el (tramp-register-file-name-handler)
Michael Albinus <michael.albinus@gmx.de>
parents:
76326
diff
changeset
|
1960 |
d55ab93ab5bf
* net/tramp.el (tramp-register-file-name-handler)
Michael Albinus <michael.albinus@gmx.de>
parents:
76326
diff
changeset
|
1961 ;; `tramp-file-name-handler' must be registered before evaluation of |
d55ab93ab5bf
* net/tramp.el (tramp-register-file-name-handler)
Michael Albinus <michael.albinus@gmx.de>
parents:
76326
diff
changeset
|
1962 ;; site-start and init files, because there might exist remote files |
d55ab93ab5bf
* net/tramp.el (tramp-register-file-name-handler)
Michael Albinus <michael.albinus@gmx.de>
parents:
76326
diff
changeset
|
1963 ;; already, f.e. files kept via recentf-mode. |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1964 ;;;###autoload |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1965 (tramp-register-file-name-handlers) |
45861 | 1966 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1967 (defun tramp-exists-file-name-handler (operation &rest args) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1968 "Check, whether OPERATION runs a file name handler." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1969 ;; The file name handler is determined on base of either an |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1970 ;; argument, `buffer-file-name', or `default-directory'. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1971 (ignore-errors |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1972 (let* ((buffer-file-name "/") |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1973 (default-directory "/") |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1974 (fnha file-name-handler-alist) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1975 (check-file-name-operation operation) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1976 (file-name-handler-alist |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1977 (list |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1978 (cons "/" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1979 (lambda (operation &rest args) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1980 "Returns OPERATION if it is the one to be checked." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1981 (if (equal check-file-name-operation operation) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1982 operation |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1983 (let ((file-name-handler-alist fnha)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1984 (apply operation args)))))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1985 (equal (apply operation args) operation)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1986 |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1987 ;;;###autoload |
70191
3a3093f77da8
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
70073
diff
changeset
|
1988 (defun tramp-unload-file-name-handlers () |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1989 (setq file-name-handler-alist |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1990 (delete (rassoc 'tramp-file-name-handler |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1991 file-name-handler-alist) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1992 (delete (rassoc 'tramp-completion-file-name-handler |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1993 file-name-handler-alist) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1994 file-name-handler-alist)))) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1995 |
70191
3a3093f77da8
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
70073
diff
changeset
|
1996 (add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1997 |
87648
7ae99e295dfd
* vc-git.el (vc-git--call): Apply `process-file' instead of
Michael Albinus <michael.albinus@gmx.de>
parents:
87368
diff
changeset
|
1998 ;;; File name handler functions for completion mode: |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1999 |
66496
63563507d684
(tramp-completion-mode): defvar moved up.
Richard M. Stallman <rms@gnu.org>
parents:
66135
diff
changeset
|
2000 (defvar tramp-completion-mode nil |
78997
ef0a2673bf5e
* net/tramp.el (tramp-completion-mode): Extend doc-string.
Michael Albinus <michael.albinus@gmx.de>
parents:
78887
diff
changeset
|
2001 "If non-nil, external packages signal that they are in file name completion. |
ef0a2673bf5e
* net/tramp.el (tramp-completion-mode): Extend doc-string.
Michael Albinus <michael.albinus@gmx.de>
parents:
78887
diff
changeset
|
2002 |
ef0a2673bf5e
* net/tramp.el (tramp-completion-mode): Extend doc-string.
Michael Albinus <michael.albinus@gmx.de>
parents:
78887
diff
changeset
|
2003 This is necessary, because Tramp uses a heuristic depending on last |
ef0a2673bf5e
* net/tramp.el (tramp-completion-mode): Extend doc-string.
Michael Albinus <michael.albinus@gmx.de>
parents:
78887
diff
changeset
|
2004 input event. This fails when external packages use other characters |
ef0a2673bf5e
* net/tramp.el (tramp-completion-mode): Extend doc-string.
Michael Albinus <michael.albinus@gmx.de>
parents:
78887
diff
changeset
|
2005 but <TAB>, <SPACE> or ?\\? for file name completion. This variable |
ef0a2673bf5e
* net/tramp.el (tramp-completion-mode): Extend doc-string.
Michael Albinus <michael.albinus@gmx.de>
parents:
78887
diff
changeset
|
2006 should never be set globally, the intention is to let-bind it.") |
66496
63563507d684
(tramp-completion-mode): defvar moved up.
Richard M. Stallman <rms@gnu.org>
parents:
66135
diff
changeset
|
2007 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2008 ;; Necessary because `tramp-file-name-regexp-unified' and |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2009 ;; `tramp-completion-file-name-regexp-unified' aren't different. If |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2010 ;; nil, `tramp-completion-run-real-handler' is called (i.e. forwarding |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2011 ;; to `tramp-file-name-handler'). Otherwise, it takes |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2012 ;; `tramp-run-real-handler'. Using `last-input-event' is a little bit |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2013 ;; risky, because completing a file might require loading other files, |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2014 ;; like "~/.netrc", and for them it shouldn't be decided based on that |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2015 ;; variable. On the other hand, those files shouldn't have partial |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
2016 ;; Tramp file name syntax. Maybe another variable should be introduced |
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
2017 ;; overwriting this check in such cases. Or we change Tramp file name |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2018 ;; syntax in order to avoid ambiguities, like in XEmacs ... |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
2019 ;;;###tramp-autoload |
84833
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2020 (defun tramp-completion-mode-p () |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2021 "Check, whether method / user name / host name completion is active." |
84833
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2022 (or |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2023 ;; Signal from outside. `non-essential' has been introduced in Emacs 24. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2024 (and (boundp 'non-essential) (symbol-value 'non-essential)) |
85067
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
2025 tramp-completion-mode |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
2026 ;; Emacs. |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84985
diff
changeset
|
2027 (equal last-input-event 'tab) |
84833
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2028 (and (natnump last-input-event) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84985
diff
changeset
|
2029 (or |
85067
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
2030 ;; ?\t has event-modifier 'control. |
93036
50a5f7c885c1
(tramp-completion-mode-p): Don't use char-equal for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92982
diff
changeset
|
2031 (equal last-input-event ?\t) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84985
diff
changeset
|
2032 (and (not (event-modifiers last-input-event)) |
93036
50a5f7c885c1
(tramp-completion-mode-p): Don't use char-equal for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92982
diff
changeset
|
2033 (or (equal last-input-event ?\?) |
50a5f7c885c1
(tramp-completion-mode-p): Don't use char-equal for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92982
diff
changeset
|
2034 (equal last-input-event ?\ ))))) |
85067
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
2035 ;; XEmacs. |
84833
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2036 (and (featurep 'xemacs) |
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2037 ;; `last-input-event' might be nil. |
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2038 (not (null last-input-event)) |
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2039 ;; `last-input-event' may have no character approximation. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2040 (tramp-compat-funcall 'event-to-character last-input-event) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84985
diff
changeset
|
2041 (or |
85067
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
2042 ;; ?\t has event-modifier 'control. |
93036
50a5f7c885c1
(tramp-completion-mode-p): Don't use char-equal for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92982
diff
changeset
|
2043 (equal |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2044 (tramp-compat-funcall 'event-to-character last-input-event) ?\t) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84985
diff
changeset
|
2045 (and (not (event-modifiers last-input-event)) |
93036
50a5f7c885c1
(tramp-completion-mode-p): Don't use char-equal for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92982
diff
changeset
|
2046 (or (equal |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2047 (tramp-compat-funcall 'event-to-character last-input-event) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2048 ?\?) |
93036
50a5f7c885c1
(tramp-completion-mode-p): Don't use char-equal for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92982
diff
changeset
|
2049 (equal |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2050 (tramp-compat-funcall 'event-to-character last-input-event) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2051 ?\ ))))))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2052 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2053 (defun tramp-connectable-p (filename) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2054 "Check, whether it is possible to connect the remote host w/o side-effects. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2055 This is true, if either the remote host is already connected, or if we are |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2056 not in completion mode." |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2057 (and (tramp-tramp-file-p filename) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2058 (with-parsed-tramp-file-name filename nil |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2059 (or (get-buffer (tramp-buffer-name v)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2060 (not (tramp-completion-mode-p)))))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2061 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2062 ;; Method, host name and user name completion. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2063 ;; `tramp-completion-dissect-file-name' returns a list of |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2064 ;; tramp-file-name structures. For all of them we return possible completions. |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
2065 ;;;###autoload |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2066 (defun tramp-completion-handle-file-name-all-completions (filename directory) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2067 "Like `file-name-all-completions' for partial Tramp files." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2068 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2069 (let* ((fullname (tramp-drop-volume-letter |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2070 (expand-file-name filename directory))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2071 ;; Possible completion structures. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2072 (v (tramp-completion-dissect-file-name fullname)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2073 result result1) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2074 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2075 (while v |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2076 (let* ((car (car v)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2077 (method (tramp-file-name-method car)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2078 (user (tramp-file-name-user car)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2079 (host (tramp-file-name-host car)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2080 (localname (tramp-file-name-localname car)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2081 (m (tramp-find-method method user host)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2082 (tramp-current-user user) ; see `tramp-parse-passwd' |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2083 all-user-hosts) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2084 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2085 (unless localname ;; Nothing to complete. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2086 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2087 (if (or user host) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2088 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2089 ;; Method dependent user / host combinations. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2090 (progn |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2091 (mapc |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2092 (lambda (x) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2093 (setq all-user-hosts |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2094 (append all-user-hosts |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2095 (funcall (nth 0 x) (nth 1 x))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2096 (tramp-get-completion-function m)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2097 |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2098 (setq result |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2099 (append result |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2100 (mapcar |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2101 (lambda (x) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2102 (tramp-get-completion-user-host |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2103 method user host (nth 0 x) (nth 1 x))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2104 (delq nil all-user-hosts))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2105 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2106 ;; Possible methods. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2107 (setq result |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2108 (append result (tramp-get-completion-methods m))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2109 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2110 (setq v (cdr v)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2111 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2112 ;; Unify list, remove nil elements. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2113 (while result |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2114 (let ((car (car result))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2115 (when car |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2116 (add-to-list |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2117 'result1 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2118 (substring car (length (tramp-drop-volume-letter directory))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2119 (setq result (cdr result)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2120 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2121 ;; Complete local parts. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2122 (append |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2123 result1 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2124 (ignore-errors |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2125 (apply (if (tramp-connectable-p fullname) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2126 'tramp-completion-run-real-handler |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2127 'tramp-run-real-handler) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2128 'file-name-all-completions (list (list filename directory))))))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2129 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2130 ;; Method, host name and user name completion for a file. |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
2131 ;;;###autoload |
74766
ca4412906dbd
* net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
74739
diff
changeset
|
2132 (defun tramp-completion-handle-file-name-completion |
ca4412906dbd
* net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
74739
diff
changeset
|
2133 (filename directory &optional predicate) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2134 "Like `file-name-completion' for Tramp files." |
74766
ca4412906dbd
* net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
74739
diff
changeset
|
2135 (try-completion |
ca4412906dbd
* net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
74739
diff
changeset
|
2136 filename |
ca4412906dbd
* net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
74739
diff
changeset
|
2137 (mapcar 'list (file-name-all-completions filename directory)) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2138 (when (and predicate |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2139 (tramp-connectable-p (expand-file-name filename directory))) |
74777
948c86bf6396
* net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents:
74766
diff
changeset
|
2140 (lambda (x) (funcall predicate (expand-file-name (car x) directory)))))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2141 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2142 ;; I misuse a little bit the tramp-file-name structure in order to handle |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2143 ;; completion possibilities for partial methods / user names / host names. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2144 ;; Return value is a list of tramp-file-name structures according to possible |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2145 ;; completions. If "localname" is non-nil it means there |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2146 ;; shouldn't be a completion anymore. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2147 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2148 ;; Expected results: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2149 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2150 ;; "/x" "/[x" "/x@" "/[x@" "/x@y" "/[x@y" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2151 ;; [nil nil "x" nil] [nil "x" nil nil] [nil "x" "y" nil] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2152 ;; [nil "x" nil nil] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2153 ;; ["x" nil nil nil] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2154 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2155 ;; "/x:" "/x:y" "/x:y:" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2156 ;; [nil nil "x" ""] [nil nil "x" "y"] ["x" nil "y" ""] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2157 ;; "/[x/" "/[x/y" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2158 ;; ["x" nil "" nil] ["x" nil "y" nil] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2159 ;; ["x" "" nil nil] ["x" "y" nil nil] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2160 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2161 ;; "/x:y@" "/x:y@z" "/x:y@z:" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2162 ;; [nil nil "x" "y@"] [nil nil "x" "y@z"] ["x" "y" "z" ""] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2163 ;; "/[x/y@" "/[x/y@z" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2164 ;; ["x" nil "y" nil] ["x" "y" "z" nil] |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2165 (defun tramp-completion-dissect-file-name (name) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2166 "Returns a list of `tramp-file-name' structures. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2167 They are collected by `tramp-completion-dissect-file-name1'." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2168 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2169 (let* ((result) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2170 (x-nil "\\|\\(\\)") |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2171 (tramp-completion-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2172 (format |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2173 "[^%s]*" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2174 (if (zerop (length tramp-postfix-ipv6-format)) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2175 tramp-postfix-host-format |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2176 tramp-postfix-ipv6-format))) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2177 ;; "/method" "/[method" |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2178 (tramp-completion-file-name-structure1 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2179 (list (concat tramp-prefix-regexp "\\(" tramp-method-regexp x-nil "\\)$") |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2180 1 nil nil nil)) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2181 ;; "/user" "/[user" |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2182 (tramp-completion-file-name-structure2 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2183 (list (concat tramp-prefix-regexp "\\(" tramp-user-regexp x-nil "\\)$") |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2184 nil 1 nil nil)) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2185 ;; "/host" "/[host" |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2186 (tramp-completion-file-name-structure3 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2187 (list (concat tramp-prefix-regexp "\\(" tramp-host-regexp x-nil "\\)$") |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2188 nil nil 1 nil)) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2189 ;; "/[ipv6" "/[ipv6" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2190 (tramp-completion-file-name-structure4 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2191 (list (concat tramp-prefix-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2192 tramp-prefix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2193 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2194 nil nil 1 nil)) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2195 ;; "/user@host" "/[user@host" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2196 (tramp-completion-file-name-structure5 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2197 (list (concat tramp-prefix-regexp |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2198 "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2199 "\\(" tramp-host-regexp x-nil "\\)$") |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2200 nil 1 2 nil)) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2201 ;; "/user@[ipv6" "/[user@ipv6" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2202 (tramp-completion-file-name-structure6 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2203 (list (concat tramp-prefix-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2204 "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2205 tramp-prefix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2206 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2207 nil 1 2 nil)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2208 ;; "/method:user" "/[method/user" "/method://user" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2209 (tramp-completion-file-name-structure7 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2210 (list (concat tramp-prefix-regexp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2211 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2212 "\\(" tramp-user-regexp x-nil "\\)$") |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2213 1 2 nil nil)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2214 ;; "/method:host" "/[method/host" "/method://host" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2215 (tramp-completion-file-name-structure8 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2216 (list (concat tramp-prefix-regexp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2217 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2218 "\\(" tramp-host-regexp x-nil "\\)$") |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2219 1 nil 2 nil)) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2220 ;; "/method:[ipv6" "/[method/ipv6" "/method://[ipv6" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2221 (tramp-completion-file-name-structure9 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2222 (list (concat tramp-prefix-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2223 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2224 tramp-prefix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2225 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2226 1 nil 2 nil)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2227 ;; "/method:user@host" "/[method/user@host" "/method://user@host" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2228 (tramp-completion-file-name-structure10 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2229 (list (concat tramp-prefix-regexp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2230 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2231 "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2232 "\\(" tramp-host-regexp x-nil "\\)$") |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2233 1 2 3 nil)) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2234 ;; "/method:user@[ipv6" "/[method/user@ipv6" "/method://user@[ipv6" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2235 (tramp-completion-file-name-structure11 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2236 (list (concat tramp-prefix-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2237 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2238 "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2239 tramp-prefix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2240 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2241 1 2 3 nil)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2242 ;; "/method: "/method:/" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2243 (tramp-completion-file-name-structure12 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2244 (list |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2245 (if (equal tramp-syntax 'url) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2246 (concat tramp-prefix-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2247 "\\(" tramp-method-regexp "\\)" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2248 "\\(" (substring tramp-postfix-method-regexp 0 1) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2249 "\\|" (substring tramp-postfix-method-regexp 1 2) "\\)" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2250 "\\(" "\\)$") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2251 ;; Should not match if not URL syntax. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2252 (concat tramp-prefix-regexp "/$")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2253 1 3 nil nil)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2254 ;; "/method: "/method:/" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2255 (tramp-completion-file-name-structure13 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2256 (list |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2257 (if (equal tramp-syntax 'url) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2258 (concat tramp-prefix-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2259 "\\(" tramp-method-regexp "\\)" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2260 "\\(" (substring tramp-postfix-method-regexp 0 1) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2261 "\\|" (substring tramp-postfix-method-regexp 1 2) "\\)" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2262 "\\(" "\\)$") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2263 ;; Should not match if not URL syntax. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2264 (concat tramp-prefix-regexp "/$")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2265 1 nil 3 nil))) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2266 |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2267 (mapc (lambda (regexp) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2268 (add-to-list 'result |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2269 (tramp-completion-dissect-file-name1 regexp name))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2270 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2271 tramp-completion-file-name-structure1 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2272 tramp-completion-file-name-structure2 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2273 tramp-completion-file-name-structure3 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2274 tramp-completion-file-name-structure4 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2275 tramp-completion-file-name-structure5 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2276 tramp-completion-file-name-structure6 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2277 tramp-completion-file-name-structure7 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2278 tramp-completion-file-name-structure8 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2279 tramp-completion-file-name-structure9 |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2280 tramp-completion-file-name-structure10 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2281 tramp-completion-file-name-structure11 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2282 tramp-completion-file-name-structure12 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2283 tramp-completion-file-name-structure13 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2284 tramp-file-name-structure)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2285 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2286 (delq nil result))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2287 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2288 (defun tramp-completion-dissect-file-name1 (structure name) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2289 "Returns a `tramp-file-name' structure matching STRUCTURE. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2290 The structure consists of remote method, remote user, |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2291 remote host and localname (filename on remote host)." |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2292 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2293 (save-match-data |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2294 (when (string-match (nth 0 structure) name) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2295 (let ((method (and (nth 1 structure) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2296 (match-string (nth 1 structure) name))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2297 (user (and (nth 2 structure) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2298 (match-string (nth 2 structure) name))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2299 (host (and (nth 3 structure) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2300 (match-string (nth 3 structure) name))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2301 (localname (and (nth 4 structure) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2302 (match-string (nth 4 structure) name)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2303 (vector method user host localname))))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2304 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2305 ;; This function returns all possible method completions, adding the |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2306 ;; trailing method delimeter. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2307 (defun tramp-get-completion-methods (partial-method) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2308 "Returns all method completions for PARTIAL-METHOD." |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2309 (mapcar |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2310 (lambda (method) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2311 (and method |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2312 (string-match (concat "^" (regexp-quote partial-method)) method) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2313 (tramp-completion-make-tramp-file-name method nil nil nil))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2314 (mapcar 'car tramp-methods))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2315 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2316 ;; Compares partial user and host names with possible completions. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2317 (defun tramp-get-completion-user-host (method partial-user partial-host user host) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2318 "Returns the most expanded string for user and host name completion. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2319 PARTIAL-USER must match USER, PARTIAL-HOST must match HOST." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2320 (cond |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2321 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2322 ((and partial-user partial-host) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2323 (if (and host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2324 (string-match (concat "^" (regexp-quote partial-host)) host) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2325 (string-equal partial-user (or user partial-user))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2326 (setq user partial-user) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2327 (setq user nil |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2328 host nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2329 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2330 (partial-user |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2331 (setq host nil) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2332 (unless |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2333 (and user (string-match (concat "^" (regexp-quote partial-user)) user)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2334 (setq user nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2335 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2336 (partial-host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2337 (setq user nil) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2338 (unless |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2339 (and host (string-match (concat "^" (regexp-quote partial-host)) host)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2340 (setq host nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2341 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2342 (t (setq user nil |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2343 host nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2344 |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2345 (unless (zerop (+ (length user) (length host))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2346 (tramp-completion-make-tramp-file-name method user host nil))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2347 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2348 (defun tramp-parse-rhosts (filename) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2349 "Return a list of (user host) tuples allowed to access. |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2350 Either user or host may be nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2351 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2352 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2353 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2354 res) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2355 (when (file-readable-p filename) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2356 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2357 (insert-file-contents filename) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2358 (goto-char (point-min)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2359 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2360 (push (tramp-parse-rhosts-group) res)))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2361 res)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2362 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2363 (defun tramp-parse-rhosts-group () |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2364 "Return a (user host) tuple allowed to access. |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2365 Either user or host may be nil." |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2366 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2367 (regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2368 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2369 "^\\(" tramp-host-regexp "\\)" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2370 "\\([ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?"))) |
111525
49c1b16ca6b1
* net/tramp-compat.el (tramp-compat-line-beginning-position)
Michael Albinus <michael.albinus@gmx.de>
parents:
111449
diff
changeset
|
2371 (narrow-to-region (point) (point-at-eol)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2372 (when (re-search-forward regexp nil t) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2373 (setq result (append (list (match-string 3) (match-string 1))))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2374 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2375 (forward-line 1) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2376 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2377 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2378 (defun tramp-parse-shosts (filename) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2379 "Return a list of (user host) tuples allowed to access. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2380 User is always nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2381 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2382 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2383 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2384 res) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2385 (when (file-readable-p filename) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2386 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2387 (insert-file-contents filename) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2388 (goto-char (point-min)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2389 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2390 (push (tramp-parse-shosts-group) res)))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2391 res)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2392 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2393 (defun tramp-parse-shosts-group () |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2394 "Return a (user host) tuple allowed to access. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2395 User is always nil." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2396 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2397 (regexp (concat "^\\(" tramp-host-regexp "\\)"))) |
111525
49c1b16ca6b1
* net/tramp-compat.el (tramp-compat-line-beginning-position)
Michael Albinus <michael.albinus@gmx.de>
parents:
111449
diff
changeset
|
2398 (narrow-to-region (point) (point-at-eol)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2399 (when (re-search-forward regexp nil t) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2400 (setq result (list nil (match-string 1)))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2401 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2402 (or |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2403 (> (skip-chars-forward ",") 0) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2404 (forward-line 1)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2405 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2406 |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2407 (defun tramp-parse-sconfig (filename) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2408 "Return a list of (user host) tuples allowed to access. |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2409 User is always nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2410 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2411 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2412 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2413 res) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2414 (when (file-readable-p filename) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2415 (with-temp-buffer |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2416 (insert-file-contents filename) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2417 (goto-char (point-min)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2418 (while (not (eobp)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2419 (push (tramp-parse-sconfig-group) res)))) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2420 res)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2421 |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2422 (defun tramp-parse-sconfig-group () |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2423 "Return a (user host) tuple allowed to access. |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2424 User is always nil." |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2425 (let ((result) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2426 (regexp (concat "^[ \t]*Host[ \t]+" "\\(" tramp-host-regexp "\\)"))) |
111525
49c1b16ca6b1
* net/tramp-compat.el (tramp-compat-line-beginning-position)
Michael Albinus <michael.albinus@gmx.de>
parents:
111449
diff
changeset
|
2427 (narrow-to-region (point) (point-at-eol)) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2428 (when (re-search-forward regexp nil t) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2429 (setq result (list nil (match-string 1)))) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2430 (widen) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2431 (or |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2432 (> (skip-chars-forward ",") 0) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2433 (forward-line 1)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2434 result)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2435 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2436 (defun tramp-parse-shostkeys (dirname) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2437 "Return a list of (user host) tuples allowed to access. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2438 User is always nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2439 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2440 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2441 (let* ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2442 (regexp (concat "^key_[0-9]+_\\(" tramp-host-regexp "\\)\\.pub$")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2443 (files (when (file-directory-p dirname) (directory-files dirname))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2444 result) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2445 (while files |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2446 (when (string-match regexp (car files)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2447 (push (list nil (match-string 1 (car files))) result)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2448 (setq files (cdr files))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2449 result)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2450 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2451 (defun tramp-parse-sknownhosts (dirname) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2452 "Return a list of (user host) tuples allowed to access. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2453 User is always nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2454 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2455 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2456 (let* ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2457 (regexp (concat "^\\(" tramp-host-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2458 "\\)\\.ssh-\\(dss\\|rsa\\)\\.pub$")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2459 (files (when (file-directory-p dirname) (directory-files dirname))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2460 result) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2461 (while files |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2462 (when (string-match regexp (car files)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2463 (push (list nil (match-string 1 (car files))) result)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2464 (setq files (cdr files))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2465 result)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2466 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2467 (defun tramp-parse-hosts (filename) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2468 "Return a list of (user host) tuples allowed to access. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2469 User is always nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2470 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2471 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2472 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2473 res) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2474 (when (file-readable-p filename) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2475 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2476 (insert-file-contents filename) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2477 (goto-char (point-min)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2478 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2479 (push (tramp-parse-hosts-group) res)))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2480 res)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2481 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2482 (defun tramp-parse-hosts-group () |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2483 "Return a (user host) tuple allowed to access. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2484 User is always nil." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2485 (let ((result) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2486 (regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2487 (concat "^\\(" tramp-ipv6-regexp "\\|" tramp-host-regexp "\\)"))) |
111525
49c1b16ca6b1
* net/tramp-compat.el (tramp-compat-line-beginning-position)
Michael Albinus <michael.albinus@gmx.de>
parents:
111449
diff
changeset
|
2488 (narrow-to-region (point) (point-at-eol)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2489 (when (re-search-forward regexp nil t) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2490 (setq result (list nil (match-string 1)))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2491 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2492 (or |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2493 (> (skip-chars-forward " \t") 0) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2494 (forward-line 1)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2495 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2496 |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2497 ;; For su-alike methods it would be desirable to return "root@localhost" |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2498 ;; as default. Unfortunately, we have no information whether any user name |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2499 ;; has been typed already. So we use `tramp-current-user' as indication, |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2500 ;; assuming it is set in `tramp-completion-handle-file-name-all-completions'. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2501 (defun tramp-parse-passwd (filename) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2502 "Return a list of (user host) tuples allowed to access. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2503 Host is always \"localhost\"." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2504 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2505 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2506 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2507 res) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2508 (if (zerop (length tramp-current-user)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2509 '(("root" nil)) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2510 (when (file-readable-p filename) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2511 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2512 (insert-file-contents filename) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2513 (goto-char (point-min)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2514 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2515 (push (tramp-parse-passwd-group) res)))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2516 res))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2517 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2518 (defun tramp-parse-passwd-group () |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2519 "Return a (user host) tuple allowed to access. |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2520 Host is always \"localhost\"." |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2521 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2522 (regexp (concat "^\\(" tramp-user-regexp "\\):"))) |
111525
49c1b16ca6b1
* net/tramp-compat.el (tramp-compat-line-beginning-position)
Michael Albinus <michael.albinus@gmx.de>
parents:
111449
diff
changeset
|
2523 (narrow-to-region (point) (point-at-eol)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2524 (when (re-search-forward regexp nil t) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2525 (setq result (list (match-string 1) "localhost"))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2526 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2527 (forward-line 1) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2528 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2529 |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2530 (defun tramp-parse-netrc (filename) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2531 "Return a list of (user host) tuples allowed to access. |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2532 User may be nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2533 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2534 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2535 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2536 res) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2537 (when (file-readable-p filename) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2538 (with-temp-buffer |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2539 (insert-file-contents filename) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2540 (goto-char (point-min)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2541 (while (not (eobp)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2542 (push (tramp-parse-netrc-group) res)))) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2543 res)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2544 |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2545 (defun tramp-parse-netrc-group () |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2546 "Return a (user host) tuple allowed to access. |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2547 User may be nil." |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2548 (let ((result) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2549 (regexp |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2550 (concat |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2551 "^[ \t]*machine[ \t]+" "\\(" tramp-host-regexp "\\)" |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2552 "\\([ \t]+login[ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?"))) |
111525
49c1b16ca6b1
* net/tramp-compat.el (tramp-compat-line-beginning-position)
Michael Albinus <michael.albinus@gmx.de>
parents:
111449
diff
changeset
|
2553 (narrow-to-region (point) (point-at-eol)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2554 (when (re-search-forward regexp nil t) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2555 (setq result (list (match-string 3) (match-string 1)))) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2556 (widen) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2557 (forward-line 1) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2558 result)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2559 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2560 (defun tramp-parse-putty (registry) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2561 "Return a list of (user host) tuples allowed to access. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2562 User is always nil." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2563 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2564 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2565 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2566 res) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2567 (with-temp-buffer |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
2568 (when (zerop (tramp-compat-call-process "reg" nil t nil "query" registry)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2569 (goto-char (point-min)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2570 (while (not (eobp)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2571 (push (tramp-parse-putty-group registry) res)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2572 res)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2573 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2574 (defun tramp-parse-putty-group (registry) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2575 "Return a (user host) tuple allowed to access. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2576 User is always nil." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2577 (let ((result) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2578 (regexp (concat (regexp-quote registry) "\\\\\\(.+\\)"))) |
111525
49c1b16ca6b1
* net/tramp-compat.el (tramp-compat-line-beginning-position)
Michael Albinus <michael.albinus@gmx.de>
parents:
111449
diff
changeset
|
2579 (narrow-to-region (point) (point-at-eol)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2580 (when (re-search-forward regexp nil t) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2581 (setq result (list nil (match-string 1)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2582 (widen) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2583 (forward-line 1) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2584 result)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2585 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2586 ;;; Common file name handler functions for different backends: |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2587 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2588 (defvar tramp-handle-file-local-copy-hook nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2589 "Normal hook to be run at the end of `tramp-*-handle-file-local-copy'.") |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2590 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2591 (defvar tramp-handle-write-region-hook nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2592 "Normal hook to be run at the end of `tramp-*-handle-write-region'.") |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2593 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2594 (defun tramp-handle-directory-file-name (directory) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2595 "Like `directory-file-name' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2596 ;; If localname component of filename is "/", leave it unchanged. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2597 ;; Otherwise, remove any trailing slash from localname component. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2598 ;; Method, host, etc, are unchanged. Does it make sense to try |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2599 ;; to avoid parsing the filename? |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2600 (with-parsed-tramp-file-name directory nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2601 (if (and (not (zerop (length localname))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2602 (eq (aref localname (1- (length localname))) ?/) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2603 (not (string= localname "/"))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2604 (substring directory 0 -1) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2605 directory))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2606 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2607 (defun tramp-handle-directory-files |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2608 (directory &optional full match nosort files-only) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2609 "Like `directory-files' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2610 ;; FILES-ONLY is valid for XEmacs only. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2611 (when (file-directory-p directory) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2612 (setq directory (file-name-as-directory (expand-file-name directory))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2613 (let ((temp (nreverse (file-name-all-completions "" directory))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2614 result item) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2615 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2616 (while temp |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2617 (setq item (directory-file-name (pop temp))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2618 (when (and (or (null match) (string-match match item)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2619 (or (null files-only) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2620 ;; Files only. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2621 (and (equal files-only t) (file-regular-p item)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2622 ;; Directories only. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2623 (file-directory-p item))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2624 (push (if full (concat directory item) item) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2625 result))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2626 (if nosort result (sort result 'string<))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2627 |
110776
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2628 (defun tramp-handle-directory-files-and-attributes |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2629 (directory &optional full match nosort id-format) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2630 "Like `directory-files-and-attributes' for Tramp files." |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2631 (mapcar |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2632 (lambda (x) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2633 (cons x (tramp-compat-file-attributes |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2634 (if full x (expand-file-name x directory)) id-format))) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2635 (directory-files directory full match nosort))) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2636 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2637 (defun tramp-handle-dired-uncache (dir &optional dir-p) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2638 "Like `dired-uncache' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2639 ;; DIR-P is valid for XEmacs only. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2640 (with-parsed-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2641 (if (or dir-p (file-directory-p dir)) dir (file-name-directory dir)) nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2642 (tramp-flush-directory-property v localname))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2643 |
110776
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2644 (defun tramp-handle-file-exists-p (filename) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2645 "Like `file-exists-p' for Tramp files." |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2646 (not (null (file-attributes filename)))) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2647 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2648 (defun tramp-handle-file-modes (filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2649 "Like `file-modes' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2650 (let ((truename (or (file-truename filename) filename))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2651 (when (file-exists-p truename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2652 (tramp-mode-string-to-int (nth 8 (file-attributes truename)))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2653 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2654 ;; Localname manipulation functions that grok Tramp localnames... |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2655 (defun tramp-handle-file-name-as-directory (file) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2656 "Like `file-name-as-directory' but aware of Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2657 ;; `file-name-as-directory' would be sufficient except localname is |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2658 ;; the empty string. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2659 (let ((v (tramp-dissect-file-name file t))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2660 ;; Run the command on the localname portion only. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2661 (tramp-make-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2662 (tramp-file-name-method v) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2663 (tramp-file-name-user v) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2664 (tramp-file-name-host v) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2665 (tramp-run-real-handler |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2666 'file-name-as-directory (list (or (tramp-file-name-localname v) "")))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2667 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2668 (defun tramp-handle-file-name-completion |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2669 (filename directory &optional predicate) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2670 "Like `file-name-completion' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2671 (unless (tramp-tramp-file-p directory) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2672 (error |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2673 "tramp-handle-file-name-completion invoked on non-tramp directory `%s'" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2674 directory)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2675 (try-completion |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2676 filename |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2677 (mapcar 'list (file-name-all-completions filename directory)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2678 (when predicate |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2679 (lambda (x) (funcall predicate (expand-file-name (car x) directory)))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2680 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2681 (defun tramp-handle-file-name-directory (file) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2682 "Like `file-name-directory' but aware of Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2683 ;; Everything except the last filename thing is the directory. We |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2684 ;; cannot apply `with-parsed-tramp-file-name', because this expands |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2685 ;; the remote file name parts. This is a problem when we are in |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2686 ;; file name completion. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2687 (let ((v (tramp-dissect-file-name file t))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2688 ;; Run the command on the localname portion only. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2689 (tramp-make-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2690 (tramp-file-name-method v) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2691 (tramp-file-name-user v) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2692 (tramp-file-name-host v) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2693 (tramp-run-real-handler |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2694 'file-name-directory (list (or (tramp-file-name-localname v) "")))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2695 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2696 (defun tramp-handle-file-name-nondirectory (file) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2697 "Like `file-name-nondirectory' but aware of Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2698 (with-parsed-tramp-file-name file nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2699 (tramp-run-real-handler 'file-name-nondirectory (list localname)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2700 |
110776
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2701 (defun tramp-handle-file-newer-than-file-p (file1 file2) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2702 "Like `file-newer-than-file-p' for Tramp files." |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2703 (cond |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2704 ((not (file-exists-p file1)) nil) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2705 ((not (file-exists-p file2)) t) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2706 (t (tramp-time-less-p (nth 5 (file-attributes file2)) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2707 (nth 5 (file-attributes file1)))))) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2708 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2709 (defun tramp-handle-file-regular-p (filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2710 "Like `file-regular-p' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2711 (and (file-exists-p filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2712 (eq ?- (aref (nth 8 (file-attributes filename)) 0)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2713 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2714 (defun tramp-handle-file-remote-p (filename &optional identification connected) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2715 "Like `file-remote-p' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2716 (let ((tramp-verbose 3)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2717 (when (tramp-tramp-file-p filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2718 (let* ((v (tramp-dissect-file-name filename)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2719 (p (tramp-get-connection-process v)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2720 (c (and p (processp p) (memq (process-status p) '(run open))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2721 ;; We expand the file name only, if there is already a connection. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2722 (with-parsed-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2723 (if c (expand-file-name filename) filename) nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2724 (and (or (not connected) c) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2725 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2726 ((eq identification 'method) method) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2727 ((eq identification 'user) user) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2728 ((eq identification 'host) host) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2729 ((eq identification 'localname) localname) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2730 (t (tramp-make-tramp-file-name method user host ""))))))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2731 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2732 (defun tramp-handle-file-symlink-p (filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2733 "Like `file-symlink-p' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2734 (with-parsed-tramp-file-name filename nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2735 (let ((x (car (file-attributes filename)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2736 (when (stringp x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2737 ;; When Tramp is running on VMS, then `file-name-absolute-p' |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2738 ;; might do weird things. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2739 (if (file-name-absolute-p x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2740 (tramp-make-tramp-file-name method user host x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2741 x))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2742 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2743 (defun tramp-handle-find-backup-file-name (filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2744 "Like `find-backup-file-name' for Tramp files." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2745 (with-parsed-tramp-file-name filename nil |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2746 ;; We set both variables. It doesn't matter whether it is |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2747 ;; Emacs or XEmacs. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2748 (let ((backup-directory-alist |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2749 ;; Emacs case. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2750 (when (boundp 'backup-directory-alist) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2751 (if (symbol-value 'tramp-backup-directory-alist) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2752 (mapcar |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2753 (lambda (x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2754 (cons |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2755 (car x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2756 (if (and (stringp (cdr x)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2757 (file-name-absolute-p (cdr x)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2758 (not (tramp-file-name-p (cdr x)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2759 (tramp-make-tramp-file-name method user host (cdr x)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2760 (cdr x)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2761 (symbol-value 'tramp-backup-directory-alist)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2762 (symbol-value 'backup-directory-alist)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2763 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2764 (bkup-backup-directory-info |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2765 ;; XEmacs case. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2766 (when (boundp 'bkup-backup-directory-info) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2767 (if (symbol-value 'tramp-bkup-backup-directory-info) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2768 (mapcar |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2769 (lambda (x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2770 (nconc |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2771 (list (car x)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2772 (list |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2773 (if (and (stringp (car (cdr x))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2774 (file-name-absolute-p (car (cdr x))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2775 (not (tramp-file-name-p (car (cdr x))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2776 (tramp-make-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2777 method user host (car (cdr x))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2778 (car (cdr x)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2779 (cdr (cdr x)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2780 (symbol-value 'tramp-bkup-backup-directory-info)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2781 (symbol-value 'bkup-backup-directory-info))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2782 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2783 (tramp-run-real-handler 'find-backup-file-name (list filename))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2784 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2785 (defun tramp-handle-insert-file-contents |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2786 (filename &optional visit beg end replace) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2787 "Like `insert-file-contents' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2788 (barf-if-buffer-read-only) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2789 (setq filename (expand-file-name filename)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2790 (let (result local-copy remote-copy) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2791 (with-parsed-tramp-file-name filename nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2792 (unwind-protect |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2793 (if (not (file-exists-p filename)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2794 ;; We don't raise a Tramp error, because it might be |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2795 ;; suppressed, like in `find-file-noselect-1'. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2796 (signal 'file-error |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2797 (list "File not found on remote host" filename)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2798 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2799 (if (and (tramp-local-host-p v) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2800 (let (file-name-handler-alist) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2801 (file-readable-p localname))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2802 ;; Short track: if we are on the local host, we can |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2803 ;; run directly. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2804 (setq result |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2805 (tramp-run-real-handler |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2806 'insert-file-contents |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2807 (list localname visit beg end replace))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2808 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2809 ;; When we shall insert only a part of the file, we copy |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2810 ;; this part. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2811 (when (or beg end) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2812 (setq remote-copy (tramp-make-tramp-temp-file v)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2813 ;; This is defined in tramp-sh.el. Let's assume this |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2814 ;; is loaded already. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2815 (tramp-compat-funcall 'tramp-send-command |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2816 v |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2817 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2818 ((and beg end) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2819 (format "tail -c +%d %s | head -c +%d >%s" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2820 (1+ beg) (tramp-shell-quote-argument localname) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2821 (- end beg) remote-copy)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2822 (beg |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2823 (format "tail -c +%d %s >%s" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2824 (1+ beg) (tramp-shell-quote-argument localname) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2825 remote-copy)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2826 (end |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2827 (format "head -c +%d %s >%s" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2828 (1+ end) (tramp-shell-quote-argument localname) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2829 remote-copy))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2830 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2831 ;; `insert-file-contents-literally' takes care to avoid |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2832 ;; calling jka-compr. By let-binding |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2833 ;; `inhibit-file-name-operation', we propagate that care |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2834 ;; to the `file-local-copy' operation. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2835 (setq local-copy |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2836 (let ((inhibit-file-name-operation |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2837 (when (eq inhibit-file-name-operation |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2838 'insert-file-contents) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2839 'file-local-copy))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2840 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2841 ((stringp remote-copy) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2842 (file-local-copy |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2843 (tramp-make-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2844 method user host remote-copy))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2845 ((stringp tramp-temp-buffer-file-name) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2846 (copy-file filename tramp-temp-buffer-file-name 'ok) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2847 tramp-temp-buffer-file-name) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2848 (t (file-local-copy filename))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2849 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2850 ;; When the file is not readable for the owner, it |
111964
ec45dfa69a06
* net/tramp.el (tramp-temp-buffer-file-name): Make it permanent-local.
Michael Albinus <michael.albinus@gmx.de>
parents:
111945
diff
changeset
|
2851 ;; cannot be inserted, even if it is readable for the |
ec45dfa69a06
* net/tramp.el (tramp-temp-buffer-file-name): Make it permanent-local.
Michael Albinus <michael.albinus@gmx.de>
parents:
111945
diff
changeset
|
2852 ;; group or for everybody. |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2853 (set-file-modes local-copy (tramp-compat-octal-to-decimal "0600")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2854 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2855 (when (and (null remote-copy) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2856 (tramp-get-method-parameter |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2857 method 'tramp-copy-keep-tmpfile)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2858 ;; We keep the local file for performance reasons, |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2859 ;; useful for "rsync". |
111964
ec45dfa69a06
* net/tramp.el (tramp-temp-buffer-file-name): Make it permanent-local.
Michael Albinus <michael.albinus@gmx.de>
parents:
111945
diff
changeset
|
2860 (setq tramp-temp-buffer-file-name local-copy)) |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2861 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2862 (with-progress-reporter |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2863 v 3 (format "Inserting local temp file `%s'" local-copy) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2864 ;; We must ensure that `file-coding-system-alist' |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2865 ;; matches `local-copy'. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2866 (let ((file-coding-system-alist |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2867 (tramp-find-file-name-coding-system-alist |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2868 filename local-copy))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2869 (setq result |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2870 (insert-file-contents |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2871 local-copy nil nil nil replace)))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2872 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2873 ;; Save exit. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2874 (progn |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2875 (when visit |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2876 (setq buffer-file-name filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2877 (setq buffer-read-only (not (file-writable-p filename))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2878 (set-visited-file-modtime) |
111667
daaca509a6d8
* files.el (backup-by-copying-when-mismatch): The default value is
Michael Albinus <michael.albinus@gmx.de>
parents:
111647
diff
changeset
|
2879 (set-buffer-modified-p nil)) |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2880 (when (and (stringp local-copy) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2881 (or remote-copy (null tramp-temp-buffer-file-name))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2882 (delete-file local-copy)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2883 (when (stringp remote-copy) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2884 (delete-file |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2885 (tramp-make-tramp-file-name method user host remote-copy)))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2886 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2887 ;; Result. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2888 (list (expand-file-name filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2889 (cadr result)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2890 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2891 (defun tramp-handle-load (file &optional noerror nomessage nosuffix must-suffix) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2892 "Like `load' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2893 (with-parsed-tramp-file-name (expand-file-name file) nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2894 (unless nosuffix |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2895 (cond ((file-exists-p (concat file ".elc")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2896 (setq file (concat file ".elc"))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2897 ((file-exists-p (concat file ".el")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2898 (setq file (concat file ".el"))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2899 (when must-suffix |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2900 ;; The first condition is always true for absolute file names. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2901 ;; Included for safety's sake. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2902 (unless (or (file-name-directory file) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2903 (string-match "\\.elc?\\'" file)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2904 (tramp-error |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2905 v 'file-error |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2906 "File `%s' does not include a `.el' or `.elc' suffix" file))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2907 (unless noerror |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2908 (when (not (file-exists-p file)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2909 (tramp-error v 'file-error "Cannot load nonexistent file `%s'" file))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2910 (if (not (file-exists-p file)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2911 nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2912 (let ((tramp-message-show-message (not nomessage))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2913 (with-progress-reporter v 0 (format "Loading %s" file) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2914 (let ((local-copy (file-local-copy file))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2915 ;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2916 (unwind-protect |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2917 (load local-copy noerror t t) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2918 (delete-file local-copy))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2919 t))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2920 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2921 (defun tramp-handle-substitute-in-file-name (filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2922 "Like `substitute-in-file-name' for Tramp files. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2923 \"//\" and \"/~\" substitute only in the local filename part. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2924 If the URL Tramp syntax is chosen, \"//\" as method delimeter and \"/~\" at |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2925 beginning of local filename are not substituted." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2926 ;; First, we must replace environment variables. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2927 (setq filename (tramp-replace-environment-variables filename)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2928 (with-parsed-tramp-file-name filename nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2929 (if (equal tramp-syntax 'url) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2930 ;; We need to check localname only. The other parts cannot contain |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2931 ;; "//" or "/~". |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2932 (if (and (> (length localname) 1) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2933 (or (string-match "//" localname) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2934 (string-match "/~" localname 1))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2935 (tramp-run-real-handler 'substitute-in-file-name (list filename)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2936 (tramp-make-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2937 (when method (substitute-in-file-name method)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2938 (when user (substitute-in-file-name user)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2939 (when host (substitute-in-file-name host)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2940 (when localname |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2941 (tramp-run-real-handler |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2942 'substitute-in-file-name (list localname))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2943 ;; Ignore in LOCALNAME everything before "//" or "/~". |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2944 (when (and (stringp localname) (string-match ".+?/\\(/\\|~\\)" localname)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2945 (setq filename |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2946 (concat (file-remote-p filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2947 (replace-match "\\1" nil nil localname))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2948 ;; "/m:h:~" does not work for completion. We use "/m:h:~/". |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2949 (when (string-match "~$" filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2950 (setq filename (concat filename "/")))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2951 (tramp-run-real-handler 'substitute-in-file-name (list filename))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2952 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2953 (defun tramp-handle-unhandled-file-name-directory (filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2954 "Like `unhandled-file-name-directory' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2955 ;; With Emacs 23, we could simply return `nil'. But we must keep it |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2956 ;; for backward compatibility. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2957 (expand-file-name "~/")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2958 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2959 ;;; Functions for establishing connection: |
45861 | 2960 |
46752 | 2961 ;; The following functions are actions to be taken when seeing certain |
2962 ;; prompts from the remote host. See the variable | |
2963 ;; `tramp-actions-before-shell' for usage of these functions. | |
2964 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2965 (defun tramp-action-login (proc vec) |
46752 | 2966 "Send the login name." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2967 (when (not (stringp tramp-current-user)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2968 (save-window-excursion |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2969 (let ((enable-recursive-minibuffers t)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2970 (pop-to-buffer (tramp-get-connection-buffer vec)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2971 (setq tramp-current-user (read-string (match-string 0)))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2972 (tramp-message vec 3 "Sending login name `%s'" tramp-current-user) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2973 (with-current-buffer (tramp-get-connection-buffer vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2974 (tramp-message vec 6 "\n%s" (buffer-string))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2975 (tramp-send-string vec tramp-current-user)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2976 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2977 (defun tramp-action-password (proc vec) |
46752 | 2978 "Query the user for a password." |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
2979 (with-current-buffer (process-buffer proc) |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
2980 (tramp-check-for-regexp proc tramp-password-prompt-regexp) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2981 (tramp-message vec 3 "Sending %s" (match-string 1)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2982 (tramp-enter-password proc) |
111932
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
2983 ;; Hide password prompt. |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
2984 (narrow-to-region (point-max) (point-max)))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2985 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2986 (defun tramp-action-succeed (proc vec) |
46752 | 2987 "Signal success in finding shell prompt." |
2988 (throw 'tramp-action 'ok)) | |
2989 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2990 (defun tramp-action-permission-denied (proc vec) |
46752 | 2991 "Signal permission denied." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2992 (kill-process proc) |
46752 | 2993 (throw 'tramp-action 'permission-denied)) |
2994 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2995 (defun tramp-action-yesno (proc vec) |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
2996 "Ask the user for confirmation using `yes-or-no-p'. |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
2997 Send \"yes\" to remote process on confirmation, abort otherwise. |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
2998 See also `tramp-action-yn'." |
46752 | 2999 (save-window-excursion |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3000 (let ((enable-recursive-minibuffers t)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3001 (save-match-data (pop-to-buffer (tramp-get-connection-buffer vec))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3002 (unless (yes-or-no-p (match-string 0)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3003 (kill-process proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3004 (throw 'tramp-action 'permission-denied)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3005 (with-current-buffer (tramp-get-connection-buffer vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3006 (tramp-message vec 6 "\n%s" (buffer-string))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3007 (tramp-send-string vec "yes")))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3008 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3009 (defun tramp-action-yn (proc vec) |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
3010 "Ask the user for confirmation using `y-or-n-p'. |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
3011 Send \"y\" to remote process on confirmation, abort otherwise. |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
3012 See also `tramp-action-yesno'." |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
3013 (save-window-excursion |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3014 (let ((enable-recursive-minibuffers t)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3015 (save-match-data (pop-to-buffer (tramp-get-connection-buffer vec))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3016 (unless (y-or-n-p (match-string 0)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3017 (kill-process proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3018 (throw 'tramp-action 'permission-denied)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3019 (with-current-buffer (tramp-get-connection-buffer vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3020 (tramp-message vec 6 "\n%s" (buffer-string))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3021 (tramp-send-string vec "y")))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3022 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3023 (defun tramp-action-terminal (proc vec) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3024 "Tell the remote host which terminal type to use. |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3025 The terminal type can be configured with `tramp-terminal-type'." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3026 (tramp-message vec 5 "Setting `%s' as terminal type." tramp-terminal-type) |
85553
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3027 (with-current-buffer (tramp-get-connection-buffer vec) |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3028 (tramp-message vec 6 "\n%s" (buffer-string))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3029 (tramp-send-string vec tramp-terminal-type)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3030 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3031 (defun tramp-action-process-alive (proc vec) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3032 "Check, whether a process has finished." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3033 (unless (memq (process-status proc) '(run open)) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3034 (throw 'tramp-action 'process-died))) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3035 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3036 (defun tramp-action-out-of-band (proc vec) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3037 "Check, whether an out-of-band copy has finished." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3038 (cond ((and (memq (process-status proc) '(stop exit)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3039 (zerop (process-exit-status proc))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3040 (tramp-message vec 3 "Process has finished.") |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3041 (throw 'tramp-action 'ok)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3042 ((or (and (memq (process-status proc) '(stop exit)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3043 (not (zerop (process-exit-status proc)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3044 (memq (process-status proc) '(signal))) |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3045 ;; `scp' could have copied correctly, but set modes could have failed. |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3046 ;; This can be ignored. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3047 (with-current-buffer (process-buffer proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3048 (goto-char (point-min)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3049 (if (re-search-forward tramp-operation-not-permitted-regexp nil t) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3050 (progn |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3051 (tramp-message vec 5 "'set mode' error ignored.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3052 (tramp-message vec 3 "Process has finished.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3053 (throw 'tramp-action 'ok)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3054 (tramp-message vec 3 "Process has died.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3055 (throw 'tramp-action 'process-died)))) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3056 (t nil))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3057 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3058 ;;; Functions for processing the actions: |
46752 | 3059 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3060 (defun tramp-process-one-action (proc vec actions) |
46752 | 3061 "Wait for output from the shell and perform one action." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3062 (let (found todo item pattern action) |
75148
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3063 (while (not found) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3064 ;; Reread output once all actions have been performed. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3065 ;; Obviously, the output was not complete. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3066 (tramp-accept-process-output proc 1) |
75148
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3067 (setq todo actions) |
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3068 (while todo |
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3069 (setq item (pop todo)) |
98699
f3c1254483a0
* net/tramp.el (tramp-process-one-action): Embed regexp in
Michael Albinus <michael.albinus@gmx.de>
parents:
97613
diff
changeset
|
3070 (setq pattern (format "\\(%s\\)\\'" (symbol-value (nth 0 item)))) |
75148
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3071 (setq action (nth 1 item)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3072 (tramp-message |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3073 vec 5 "Looking for regexp \"%s\" from remote shell" pattern) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3074 (when (tramp-check-for-regexp proc pattern) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3075 (tramp-message vec 5 "Call `%s'" (symbol-name action)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3076 (setq found (funcall action proc vec))))) |
75148
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3077 found)) |
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3078 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3079 (defun tramp-process-actions (proc vec actions &optional timeout) |
75148
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3080 "Perform actions until success or TIMEOUT." |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3081 ;; Preserve message for `progress-reporter'. |
110374
932697ced7aa
* net/tramp-compat.el (tramp-compat-with-temp-message)
Michael Albinus <michael.albinus@gmx.de>
parents:
110321
diff
changeset
|
3082 (tramp-compat-with-temp-message "" |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3083 ;; Enable auth-source and password-cache. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3084 (tramp-set-connection-property vec "first-password-request" t) |
111932
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3085 (save-restriction |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3086 (let (exit) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3087 (while (not exit) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3088 (tramp-message proc 3 "Waiting for prompts from remote shell") |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3089 (setq exit |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3090 (catch 'tramp-action |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3091 (if timeout |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3092 (with-timeout (timeout) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3093 (tramp-process-one-action proc vec actions)) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3094 (tramp-process-one-action proc vec actions))))) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3095 (with-current-buffer (tramp-get-connection-buffer vec) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3096 (widen) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3097 (tramp-message vec 6 "\n%s" (buffer-string))) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3098 (unless (eq exit 'ok) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3099 (tramp-clear-passwd vec) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3100 (tramp-error-with-buffer |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3101 nil vec 'file-error |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3102 (cond |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3103 ((eq exit 'permission-denied) "Permission denied") |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3104 ((eq exit 'process-died) "Process died") |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3105 (t "Login failed")))))))) |
45861 | 3106 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3107 :;; Utility functions: |
45861 | 3108 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3109 (defun tramp-accept-process-output (&optional proc timeout timeout-msecs) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
3110 "Like `accept-process-output' for Tramp processes. |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
3111 This is needed in order to hide `last-coding-system-used', which is set |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
3112 for process communication also." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3113 (with-current-buffer (process-buffer proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3114 (tramp-message proc 10 "%s %s" proc (process-status proc)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3115 (let (buffer-read-only last-coding-system-used) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3116 ;; Under Windows XP, accept-process-output doesn't return |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3117 ;; sometimes. So we add an additional timeout. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3118 (with-timeout ((or timeout 1)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3119 (accept-process-output proc timeout timeout-msecs))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3120 (tramp-message proc 10 "\n%s" (buffer-string)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3121 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3122 (defun tramp-check-for-regexp (proc regexp) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3123 "Check, whether REGEXP is contained in process buffer of PROC. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3124 Erase echoed commands if exists." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3125 (with-current-buffer (process-buffer proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3126 (goto-char (point-min)) |
94975
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
3127 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3128 ;; Check whether we need to remove echo output. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3129 (when (and (tramp-get-connection-property proc "check-remote-echo" nil) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3130 (re-search-forward tramp-echoed-echo-mark-regexp nil t)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3131 (let ((begin (match-beginning 0))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3132 (when (re-search-forward tramp-echoed-echo-mark-regexp nil t) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3133 ;; Discard echo from remote output. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3134 (tramp-set-connection-property proc "check-remote-echo" nil) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3135 (tramp-message proc 5 "echo-mark found") |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3136 (forward-line 1) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3137 (delete-region begin (point)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3138 (goto-char (point-min))))) |
94975
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
3139 |
106597
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
3140 (when (or (not (tramp-get-connection-property proc "check-remote-echo" nil)) |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
3141 ;; Sometimes, the echo string is suppressed on the remote side. |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
3142 (not (string-equal |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3143 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3144 'substring-no-properties tramp-echo-mark-marker |
106597
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
3145 0 (min tramp-echo-mark-marker-length (1- (point-max)))) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3146 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3147 'buffer-substring-no-properties |
106597
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
3148 1 (min (1+ tramp-echo-mark-marker-length) (point-max)))))) |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
3149 ;; No echo to be handled, now we can look for the regexp. |
94975
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
3150 (goto-char (point-min)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3151 (re-search-forward regexp nil t)))) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
3152 |
45861 | 3153 (defun tramp-wait-for-regexp (proc timeout regexp) |
3154 "Wait for a REGEXP to appear from process PROC within TIMEOUT seconds. | |
3155 Expects the output of PROC to be sent to the current buffer. Returns | |
3156 the string that matched, or nil. Waits indefinitely if TIMEOUT is | |
3157 nil." | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3158 (with-current-buffer (process-buffer proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3159 (let ((found (tramp-check-for-regexp proc regexp)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3160 (start-time (current-time))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3161 (cond (timeout |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3162 ;; Work around a bug in XEmacs 21, where the timeout |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3163 ;; expires faster than it should. This degenerates |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3164 ;; to polling for buggy XEmacsen, but oh, well. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3165 (while (and (not found) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3166 (< (tramp-time-diff (current-time) start-time) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3167 timeout)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3168 (with-timeout (timeout) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3169 (while (not found) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3170 (tramp-accept-process-output proc 1) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3171 (unless (memq (process-status proc) '(run open)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3172 (tramp-error-with-buffer |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3173 nil proc 'file-error "Process has died")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3174 (setq found (tramp-check-for-regexp proc regexp)))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3175 (t |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3176 (while (not found) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3177 (tramp-accept-process-output proc 1) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3178 (unless (memq (process-status proc) '(run open)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3179 (tramp-error-with-buffer |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3180 nil proc 'file-error "Process has died")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3181 (setq found (tramp-check-for-regexp proc regexp))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3182 (tramp-message proc 6 "\n%s" (buffer-string)) |
45861 | 3183 (when (not found) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3184 (if timeout |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3185 (tramp-error |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3186 proc 'file-error "[[Regexp `%s' not found in %d secs]]" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3187 regexp timeout) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3188 (tramp-error proc 'file-error "[[Regexp `%s' not found]]" regexp))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3189 found))) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
3190 |
85553
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3191 ;; We don't call `tramp-send-string' in order to hide the password |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3192 ;; from the debug buffer, and because end-of-line handling of the |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3193 ;; string. |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3194 (defun tramp-enter-password (proc) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3195 "Prompt for a password and send it to the remote end." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3196 (process-send-string |
85553
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3197 proc (concat (tramp-read-passwd proc) |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3198 (or (tramp-get-method-parameter |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3199 tramp-current-method |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3200 'tramp-password-end-of-line) |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3201 tramp-default-password-end-of-line)))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3202 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3203 ;; It seems that Tru64 Unix does not like it if long strings are sent |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3204 ;; to it in one go. (This happens when sending the Perl |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3205 ;; `file-attributes' implementation, for instance.) Therefore, we |
82324
5399c02bfd07
* net/tramp.el (tramp-wrong-passwd-regexp): Make the regexp more
Michael Albinus <michael.albinus@gmx.de>
parents:
82201
diff
changeset
|
3206 ;; have this function which sends the string in chunks. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3207 (defun tramp-send-string (vec string) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3208 "Send the STRING via connection VEC. |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3209 |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3210 The STRING is expected to use Unix line-endings, but the lines sent to |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3211 the remote host use line-endings as defined in the variable |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3212 `tramp-rsh-end-of-line'. The communication buffer is erased before sending." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3213 (let* ((p (tramp-get-connection-process vec)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3214 (chunksize (tramp-get-connection-property p "chunksize" nil))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3215 (unless p |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3216 (tramp-error |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3217 vec 'file-error "Can't send string to remote host -- not logged in")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3218 (tramp-set-connection-property p "last-cmd-time" (current-time)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3219 (tramp-message vec 10 "%s" string) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3220 (with-current-buffer (tramp-get-connection-buffer vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3221 ;; Clean up the buffer. We cannot call `erase-buffer' because |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3222 ;; narrowing might be in effect. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3223 (let (buffer-read-only) (delete-region (point-min) (point-max))) |
82324
5399c02bfd07
* net/tramp.el (tramp-wrong-passwd-regexp): Make the regexp more
Michael Albinus <michael.albinus@gmx.de>
parents:
82201
diff
changeset
|
3224 ;; Replace "\n" by `tramp-rsh-end-of-line'. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3225 (setq string |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3226 (mapconcat 'identity |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
3227 (tramp-compat-split-string string "\n") |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3228 tramp-rsh-end-of-line)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3229 (unless (or (string= string "") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3230 (string-equal (substring string -1) tramp-rsh-end-of-line)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3231 (setq string (concat string tramp-rsh-end-of-line))) |
82324
5399c02bfd07
* net/tramp.el (tramp-wrong-passwd-regexp): Make the regexp more
Michael Albinus <michael.albinus@gmx.de>
parents:
82201
diff
changeset
|
3232 ;; Send the string. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3233 (if (and chunksize (not (zerop chunksize))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3234 (let ((pos 0) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3235 (end (length string))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3236 (while (< pos end) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3237 (tramp-message |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3238 vec 10 "Sending chunk from %s to %s" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3239 pos (min (+ pos chunksize) end)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3240 (process-send-string |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3241 p (substring string pos (min (+ pos chunksize) end))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3242 (setq pos (+ pos chunksize)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3243 (process-send-string p string))))) |
45861 | 3244 |
81938
26330ef1aa46
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
81758
diff
changeset
|
3245 (defun tramp-get-inode (vec) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3246 "Returns the virtual inode number. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3247 If it doesn't exist, generate a new one." |
81938
26330ef1aa46
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
81758
diff
changeset
|
3248 (let ((string (tramp-make-tramp-file-name |
26330ef1aa46
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
81758
diff
changeset
|
3249 (tramp-file-name-method vec) |
26330ef1aa46
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
81758
diff
changeset
|
3250 (tramp-file-name-user vec) |
26330ef1aa46
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
81758
diff
changeset
|
3251 (tramp-file-name-host vec) |
26330ef1aa46
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
81758
diff
changeset
|
3252 ""))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3253 (unless (assoc string tramp-inodes) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3254 (add-to-list 'tramp-inodes |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3255 (list string (length tramp-inodes)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3256 (nth 1 (assoc string tramp-inodes)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3257 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3258 (defun tramp-get-device (vec) |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3259 "Returns the virtual device number. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3260 If it doesn't exist, generate a new one." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3261 (let ((string (tramp-make-tramp-file-name |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3262 (tramp-file-name-method vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3263 (tramp-file-name-user vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3264 (tramp-file-name-host vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3265 ""))) |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3266 (unless (assoc string tramp-devices) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3267 (add-to-list 'tramp-devices |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3268 (list string (length tramp-devices)))) |
97052
bed318e44ebd
* net/tramp.el (tramp-perl-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
97035
diff
changeset
|
3269 (cons -1 (nth 1 (assoc string tramp-devices))))) |
45861 | 3270 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3271 (defun tramp-equal-remote (file1 file2) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3272 "Check, whether the remote parts of FILE1 and FILE2 are identical. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3273 The check depends on method, user and host name of the files. If |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3274 one of the components is missing, the default values are used. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3275 The local file name parts of FILE1 and FILE2 are not taken into |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3276 account. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3277 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3278 Example: |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3279 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3280 (tramp-equal-remote \"/ssh::/etc\" \"/<your host name>:/home\") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3281 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3282 would yield `t'. On the other hand, the following check results in nil: |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3283 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3284 (tramp-equal-remote \"/sudo::/etc\" \"/su::/etc\")" |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
3285 (and (stringp (file-remote-p file1)) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
3286 (stringp (file-remote-p file2)) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84985
diff
changeset
|
3287 (string-equal (file-remote-p file1) (file-remote-p file2)))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3288 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3289 (defun tramp-get-method-parameter (method param) |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
3290 "Return the method parameter PARAM. |
108186
3287df4f3442
Implement compression for inline methods.
Michael Albinus <albinus@detlef>
parents:
108158
diff
changeset
|
3291 If the `tramp-methods' entry does not exist, return nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3292 (let ((entry (assoc param (assoc method tramp-methods)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3293 (when entry (cadr entry)))) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3294 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3295 (defun tramp-mode-string-to-int (mode-string) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3296 "Converts a ten-letter `drwxrwxrwx'-style mode string into mode bits." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3297 (let* (case-fold-search |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3298 (mode-chars (string-to-vector mode-string)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3299 (owner-read (aref mode-chars 1)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3300 (owner-write (aref mode-chars 2)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3301 (owner-execute-or-setid (aref mode-chars 3)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3302 (group-read (aref mode-chars 4)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3303 (group-write (aref mode-chars 5)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3304 (group-execute-or-setid (aref mode-chars 6)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3305 (other-read (aref mode-chars 7)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3306 (other-write (aref mode-chars 8)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3307 (other-execute-or-sticky (aref mode-chars 9))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3308 (save-match-data |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3309 (logior |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3310 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3311 ((char-equal owner-read ?r) (tramp-compat-octal-to-decimal "00400")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3312 ((char-equal owner-read ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3313 (t (error "Second char `%c' must be one of `r-'" owner-read))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3314 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3315 ((char-equal owner-write ?w) (tramp-compat-octal-to-decimal "00200")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3316 ((char-equal owner-write ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3317 (t (error "Third char `%c' must be one of `w-'" owner-write))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3318 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3319 ((char-equal owner-execute-or-setid ?x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3320 (tramp-compat-octal-to-decimal "00100")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3321 ((char-equal owner-execute-or-setid ?S) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3322 (tramp-compat-octal-to-decimal "04000")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3323 ((char-equal owner-execute-or-setid ?s) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3324 (tramp-compat-octal-to-decimal "04100")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3325 ((char-equal owner-execute-or-setid ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3326 (t (error "Fourth char `%c' must be one of `xsS-'" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3327 owner-execute-or-setid))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3328 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3329 ((char-equal group-read ?r) (tramp-compat-octal-to-decimal "00040")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3330 ((char-equal group-read ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3331 (t (error "Fifth char `%c' must be one of `r-'" group-read))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3332 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3333 ((char-equal group-write ?w) (tramp-compat-octal-to-decimal "00020")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3334 ((char-equal group-write ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3335 (t (error "Sixth char `%c' must be one of `w-'" group-write))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3336 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3337 ((char-equal group-execute-or-setid ?x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3338 (tramp-compat-octal-to-decimal "00010")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3339 ((char-equal group-execute-or-setid ?S) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3340 (tramp-compat-octal-to-decimal "02000")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3341 ((char-equal group-execute-or-setid ?s) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3342 (tramp-compat-octal-to-decimal "02010")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3343 ((char-equal group-execute-or-setid ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3344 (t (error "Seventh char `%c' must be one of `xsS-'" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3345 group-execute-or-setid))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3346 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3347 ((char-equal other-read ?r) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3348 (tramp-compat-octal-to-decimal "00004")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3349 ((char-equal other-read ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3350 (t (error "Eighth char `%c' must be one of `r-'" other-read))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3351 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3352 ((char-equal other-write ?w) (tramp-compat-octal-to-decimal "00002")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3353 ((char-equal other-write ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3354 (t (error "Nineth char `%c' must be one of `w-'" other-write))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3355 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3356 ((char-equal other-execute-or-sticky ?x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3357 (tramp-compat-octal-to-decimal "00001")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3358 ((char-equal other-execute-or-sticky ?T) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3359 (tramp-compat-octal-to-decimal "01000")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3360 ((char-equal other-execute-or-sticky ?t) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3361 (tramp-compat-octal-to-decimal "01001")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3362 ((char-equal other-execute-or-sticky ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3363 (t (error "Tenth char `%c' must be one of `xtT-'" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3364 other-execute-or-sticky))))))) |
45861 | 3365 |
82808
6e5814967ffb
* net/tramp.el (tramp-local-host-p): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
82603
diff
changeset
|
3366 (defun tramp-local-host-p (vec) |
6e5814967ffb
* net/tramp.el (tramp-local-host-p): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
82603
diff
changeset
|
3367 "Return t if this points to the local host, nil otherwise." |
87748
e958bc9885ca
* net/tramp.el (tramp-local-host-p): Use `tramp-file-name-host'
Michael Albinus <michael.albinus@gmx.de>
parents:
87649
diff
changeset
|
3368 ;; We cannot use `tramp-file-name-real-host'. A port is an |
e958bc9885ca
* net/tramp.el (tramp-local-host-p): Use `tramp-file-name-host'
Michael Albinus <michael.albinus@gmx.de>
parents:
87649
diff
changeset
|
3369 ;; indication for an ssh tunnel or alike. |
e958bc9885ca
* net/tramp.el (tramp-local-host-p): Use `tramp-file-name-host'
Michael Albinus <michael.albinus@gmx.de>
parents:
87649
diff
changeset
|
3370 (let ((host (tramp-file-name-host vec))) |
82808
6e5814967ffb
* net/tramp.el (tramp-local-host-p): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
82603
diff
changeset
|
3371 (and |
6e5814967ffb
* net/tramp.el (tramp-local-host-p): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
82603
diff
changeset
|
3372 (stringp host) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
3373 (string-match tramp-local-host-regexp host) |
105549
e7c777c6e230
* net/tramp.el (tramp-local-host-p): Function shall return nil for
Michael Albinus <michael.albinus@gmx.de>
parents:
105523
diff
changeset
|
3374 ;; The method shall be applied to one of the shell file name |
e7c777c6e230
* net/tramp.el (tramp-local-host-p): Function shall return nil for
Michael Albinus <michael.albinus@gmx.de>
parents:
105523
diff
changeset
|
3375 ;; handler. `tramp-local-host-p' is also called for "smb" and |
e7c777c6e230
* net/tramp.el (tramp-local-host-p): Function shall return nil for
Michael Albinus <michael.albinus@gmx.de>
parents:
105523
diff
changeset
|
3376 ;; alike, where it must fail. |
e7c777c6e230
* net/tramp.el (tramp-local-host-p): Function shall return nil for
Michael Albinus <michael.albinus@gmx.de>
parents:
105523
diff
changeset
|
3377 (tramp-get-method-parameter |
e7c777c6e230
* net/tramp.el (tramp-local-host-p): Function shall return nil for
Michael Albinus <michael.albinus@gmx.de>
parents:
105523
diff
changeset
|
3378 (tramp-file-name-method vec) 'tramp-login-program) |
87921
c49bc2860fd0
* net/tramp.el (tramp-remote-process-environment): Set "LC_ALL=C".
Michael Albinus <michael.albinus@gmx.de>
parents:
87748
diff
changeset
|
3379 ;; The local temp directory must be writable for the other user. |
c49bc2860fd0
* net/tramp.el (tramp-remote-process-environment): Set "LC_ALL=C".
Michael Albinus <michael.albinus@gmx.de>
parents:
87748
diff
changeset
|
3380 (file-writable-p |
c49bc2860fd0
* net/tramp.el (tramp-remote-process-environment): Set "LC_ALL=C".
Michael Albinus <michael.albinus@gmx.de>
parents:
87748
diff
changeset
|
3381 (tramp-make-tramp-file-name |
c49bc2860fd0
* net/tramp.el (tramp-remote-process-environment): Set "LC_ALL=C".
Michael Albinus <michael.albinus@gmx.de>
parents:
87748
diff
changeset
|
3382 (tramp-file-name-method vec) |
c49bc2860fd0
* net/tramp.el (tramp-remote-process-environment): Set "LC_ALL=C".
Michael Albinus <michael.albinus@gmx.de>
parents:
87748
diff
changeset
|
3383 (tramp-file-name-user vec) |
c49bc2860fd0
* net/tramp.el (tramp-remote-process-environment): Set "LC_ALL=C".
Michael Albinus <michael.albinus@gmx.de>
parents:
87748
diff
changeset
|
3384 host |
103782
c5225871ee78
* net/tramp.el (tramp-set-file-uid-gid): Handle the case the
Michael Albinus <michael.albinus@gmx.de>
parents:
103735
diff
changeset
|
3385 (tramp-compat-temporary-file-directory))) |
c5225871ee78
* net/tramp.el (tramp-set-file-uid-gid): Handle the case the
Michael Albinus <michael.albinus@gmx.de>
parents:
103735
diff
changeset
|
3386 ;; On some systems, chown runs only for root. |
c5225871ee78
* net/tramp.el (tramp-set-file-uid-gid): Handle the case the
Michael Albinus <michael.albinus@gmx.de>
parents:
103735
diff
changeset
|
3387 (or (zerop (user-uid)) |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3388 ;; This is defined in tramp-sh.el. Let's assume this is |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3389 ;; loaded already. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3390 (zerop (tramp-compat-funcall 'tramp-get-remote-uid vec 'integer)))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3391 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3392 (defun tramp-make-tramp-temp-file (vec) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3393 "Create a temporary file on the remote host identified by VEC. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3394 Return the local name of the temporary file." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3395 (let ((prefix |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3396 (tramp-make-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3397 (tramp-file-name-method vec) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3398 (tramp-file-name-user vec) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3399 (tramp-file-name-host vec) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3400 (tramp-drop-volume-letter |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3401 (expand-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3402 tramp-temp-name-prefix |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3403 ;; This is defined in tramp-sh.el. Let's assume this is |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3404 ;; loaded already. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3405 (tramp-compat-funcall 'tramp-get-remote-tmpdir vec))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3406 result) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3407 (while (not result) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3408 ;; `make-temp-file' would be the natural choice for |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3409 ;; implementation. But it calls `write-region' internally, |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3410 ;; which also needs a temporary file - we would end in an |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3411 ;; infinite loop. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3412 (setq result (make-temp-name prefix)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3413 (if (file-exists-p result) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3414 (setq result nil) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3415 ;; This creates the file by side effect. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3416 (set-file-times result) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3417 (set-file-modes result (tramp-compat-octal-to-decimal "0700")))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3418 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3419 ;; Return the local part. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3420 (with-parsed-tramp-file-name result nil localname))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3421 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3422 (defun tramp-delete-temp-file-function () |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3423 "Remove temporary files related to current buffer." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3424 (when (stringp tramp-temp-buffer-file-name) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3425 (ignore-errors (delete-file tramp-temp-buffer-file-name)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3426 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3427 (add-hook 'kill-buffer-hook 'tramp-delete-temp-file-function) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3428 (add-hook 'tramp-cache-unload-hook |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3429 (lambda () |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3430 (remove-hook 'kill-buffer-hook |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3431 'tramp-delete-temp-file-function))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3432 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3433 ;;; Auto saving to a special directory: |
65248
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3434 |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3435 (unless (tramp-exists-file-name-handler 'make-auto-save-file-name) |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3436 (defadvice make-auto-save-file-name |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3437 (around tramp-advice-make-auto-save-file-name () activate) |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
3438 "Invoke `tramp-*-handle-make-auto-save-file-name' for Tramp files." |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3439 (if (tramp-tramp-file-p (buffer-file-name)) |
104807
509a5b989179
* net/tramp.el (tramp-handle-file-attributes-with-ls)
Michael Albinus <michael.albinus@gmx.de>
parents:
104673
diff
changeset
|
3440 ;; We cannot call `tramp-handle-make-auto-save-file-name' |
509a5b989179
* net/tramp.el (tramp-handle-file-attributes-with-ls)
Michael Albinus <michael.albinus@gmx.de>
parents:
104673
diff
changeset
|
3441 ;; directly, because this would bypass the locking mechanism. |
509a5b989179
* net/tramp.el (tramp-handle-file-attributes-with-ls)
Michael Albinus <michael.albinus@gmx.de>
parents:
104673
diff
changeset
|
3442 (setq ad-return-value |
509a5b989179
* net/tramp.el (tramp-handle-file-attributes-with-ls)
Michael Albinus <michael.albinus@gmx.de>
parents:
104673
diff
changeset
|
3443 (tramp-file-name-handler 'make-auto-save-file-name)) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3444 ad-do-it)) |
105907
9abdd578d117
* net/tramp.el (tramp-advice-make-auto-save-file-name)
Michael Albinus <michael.albinus@gmx.de>
parents:
105893
diff
changeset
|
3445 (add-hook |
9abdd578d117
* net/tramp.el (tramp-advice-make-auto-save-file-name)
Michael Albinus <michael.albinus@gmx.de>
parents:
105893
diff
changeset
|
3446 'tramp-unload-hook |
9abdd578d117
* net/tramp.el (tramp-advice-make-auto-save-file-name)
Michael Albinus <michael.albinus@gmx.de>
parents:
105893
diff
changeset
|
3447 (lambda () |
9abdd578d117
* net/tramp.el (tramp-advice-make-auto-save-file-name)
Michael Albinus <michael.albinus@gmx.de>
parents:
105893
diff
changeset
|
3448 (ad-remove-advice |
9abdd578d117
* net/tramp.el (tramp-advice-make-auto-save-file-name)
Michael Albinus <michael.albinus@gmx.de>
parents:
105893
diff
changeset
|
3449 'make-auto-save-file-name |
105952
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
3450 'around 'tramp-advice-make-auto-save-file-name) |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
3451 (ad-activate 'make-auto-save-file-name)))) |
45861 | 3452 |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3453 ;; In XEmacs < 21.5, autosaved remote files have permission 0666 minus |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3454 ;; umask. This is a security threat. |
57463
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
3455 |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
3456 (defun tramp-set-auto-save-file-modes () |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
3457 "Set permissions of autosaved remote files to the original permissions." |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
3458 (let ((bfn (buffer-file-name))) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3459 (when (and (tramp-tramp-file-p bfn) |
86204
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
3460 (buffer-modified-p) |
57463
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
3461 (stringp buffer-auto-save-file-name) |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
3462 (not (equal bfn buffer-auto-save-file-name))) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
3463 (unless (file-exists-p buffer-auto-save-file-name) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
3464 (write-region "" nil buffer-auto-save-file-name)) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
3465 ;; Permissions should be set always, because there might be an old |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
3466 ;; auto-saved file belonging to another original file. This could |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
3467 ;; be a security threat. |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
3468 (set-file-modes |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
3469 buffer-auto-save-file-name |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
3470 (or (file-modes bfn) (tramp-compat-octal-to-decimal "0600")))))) |
57463
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
3471 |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3472 (unless (and (featurep 'xemacs) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3473 (= emacs-major-version 21) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3474 (> emacs-minor-version 4)) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3475 (add-hook 'auto-save-hook 'tramp-set-auto-save-file-modes) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3476 (add-hook 'tramp-unload-hook |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
3477 (lambda () |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
3478 (remove-hook 'auto-save-hook 'tramp-set-auto-save-file-modes)))) |
57463
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
3479 |
45861 | 3480 (defun tramp-subst-strs-in-string (alist string) |
3481 "Replace all occurrences of the string FROM with TO in STRING. | |
3482 ALIST is of the form ((FROM . TO) ...)." | |
3483 (save-match-data | |
3484 (while alist | |
3485 (let* ((pr (car alist)) | |
3486 (from (car pr)) | |
3487 (to (cdr pr))) | |
3488 (while (string-match (regexp-quote from) string) | |
3489 (setq string (replace-match to t t string))) | |
3490 (setq alist (cdr alist)))) | |
3491 string)) | |
3492 | |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3493 ;;; Compatibility functions section: |
45861 | 3494 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3495 (defun tramp-read-passwd (proc &optional prompt) |
45861 | 3496 "Read a password from user (compat function). |
95025
bdaea36b81dd
* net/tramp.el: Load auth-source library.
Michael Albinus <michael.albinus@gmx.de>
parents:
94975
diff
changeset
|
3497 Consults the auth-source package. |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3498 Invokes `password-read' if available, `read-passwd' else." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3499 (let* ((key (tramp-make-tramp-file-name |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3500 tramp-current-method tramp-current-user |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3501 tramp-current-host "")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3502 (pw-prompt |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3503 (or prompt |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3504 (with-current-buffer (process-buffer proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3505 (tramp-check-for-regexp proc tramp-password-prompt-regexp) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3506 (format "%s for %s " (capitalize (match-string 1)) key))))) |
107151
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3507 (with-parsed-tramp-file-name key nil |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3508 (prog1 |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3509 (or |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3510 ;; See if auth-sources contains something useful, if it's bound. |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3511 (and (boundp 'auth-sources) |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3512 (tramp-get-connection-property v "first-password-request" nil) |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3513 ;; Try with Tramp's current method. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3514 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3515 'auth-source-user-or-password |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3516 "password" tramp-current-host tramp-current-method)) |
107151
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3517 ;; Try the password cache. |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3518 (when (functionp 'password-read) |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3519 (unless (tramp-get-connection-property |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3520 v "first-password-request" nil) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3521 (tramp-compat-funcall 'password-cache-remove key)) |
107151
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3522 (let ((password |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3523 (tramp-compat-funcall 'password-read pw-prompt key))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3524 (tramp-compat-funcall 'password-cache-add key password) |
107151
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3525 password)) |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3526 ;; Else, get the password interactively. |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3527 (read-passwd pw-prompt)) |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3528 (tramp-set-connection-property v "first-password-request" nil))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3529 |
85508
05c8e6a18913
* net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
85428
diff
changeset
|
3530 (defun tramp-clear-passwd (vec) |
05c8e6a18913
* net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
85428
diff
changeset
|
3531 "Clear password cache for connection related to VEC." |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3532 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3533 'password-cache-remove |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3534 (tramp-make-tramp-file-name |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3535 (tramp-file-name-method vec) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3536 (tramp-file-name-user vec) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3537 (tramp-file-name-host vec) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3538 ""))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3539 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3540 ;; Snarfed code from time-date.el and parse-time.el |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3541 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3542 (defconst tramp-half-a-year '(241 17024) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3543 "Evaluated by \"(days-to-time 183)\".") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3544 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3545 (defconst tramp-parse-time-months |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3546 '(("jan" . 1) ("feb" . 2) ("mar" . 3) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3547 ("apr" . 4) ("may" . 5) ("jun" . 6) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3548 ("jul" . 7) ("aug" . 8) ("sep" . 9) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3549 ("oct" . 10) ("nov" . 11) ("dec" . 12)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3550 "Alist mapping month names to integers.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3551 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3552 (defun tramp-time-less-p (t1 t2) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3553 "Say whether time value T1 is less than time value T2." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3554 (unless t1 (setq t1 '(0 0))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3555 (unless t2 (setq t2 '(0 0))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3556 (or (< (car t1) (car t2)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3557 (and (= (car t1) (car t2)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3558 (< (nth 1 t1) (nth 1 t2))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3559 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3560 (defun tramp-time-subtract (t1 t2) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3561 "Subtract two time values. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3562 Return the difference in the format of a time value." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3563 (unless t1 (setq t1 '(0 0))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3564 (unless t2 (setq t2 '(0 0))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3565 (let ((borrow (< (cadr t1) (cadr t2)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3566 (list (- (car t1) (car t2) (if borrow 1 0)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3567 (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2))))) |
45861 | 3568 |
3569 (defun tramp-time-diff (t1 t2) | |
3570 "Return the difference between the two times, in seconds. | |
72569
7457615d594a
Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents:
71561
diff
changeset
|
3571 T1 and T2 are time values (as returned by `current-time' for example)." |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3572 (cond ((and (fboundp 'subtract-time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3573 (fboundp 'float-time)) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3574 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3575 'float-time (tramp-compat-funcall 'subtract-time t1 t2))) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3576 ((and (fboundp 'subtract-time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3577 (fboundp 'time-to-seconds)) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3578 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3579 'time-to-seconds (tramp-compat-funcall 'subtract-time t1 t2))) |
45861 | 3580 ((fboundp 'itimer-time-difference) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3581 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3582 'itimer-time-difference |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3583 (if (< (length t1) 3) (append t1 '(0)) t1) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3584 (if (< (length t2) 3) (append t2 '(0)) t2))) |
45861 | 3585 (t |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3586 (let ((time (tramp-time-subtract t1 t2))) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3587 (+ (* (car time) 65536.0) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3588 (cadr time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3589 (/ (or (nth 2 time) 0) 1000000.0)))))) |
45861 | 3590 |
3591 ;; Currently (as of Emacs 20.5), the function `shell-quote-argument' | |
3592 ;; does not deal well with newline characters. Newline is replaced by | |
3593 ;; backslash newline. But if, say, the string `a backslash newline b' | |
3594 ;; is passed to a shell, the shell will expand this into "ab", | |
3595 ;; completely omitting the newline. This is not what was intended. | |
3596 ;; It does not appear to be possible to make the function | |
3597 ;; `shell-quote-argument' work with newlines without making it | |
3598 ;; dependent on the shell used. But within this package, we know that | |
3599 ;; we will always use a Bourne-like shell, so we use an approach which | |
3600 ;; groks newlines. | |
3601 ;; | |
3602 ;; The approach is simple: we call `shell-quote-argument', then | |
3603 ;; massage the newline part of the result. | |
3604 ;; | |
3605 ;; This function should produce a string which is grokked by a Unix | |
3606 ;; shell, even if the Emacs is running on Windows. Since this is the | |
3607 ;; kludges section, we bind `system-type' in such a way that | |
3608 ;; `shell-quote-arguments' behaves as if on Unix. | |
3609 ;; | |
3610 ;; Thanks to Mario DeWeerd for the hint that it is sufficient for this | |
3611 ;; function to work with Bourne-like shells. | |
3612 ;; | |
3613 ;; CCC: This function should be rewritten so that | |
3614 ;; `shell-quote-argument' is not used. This way, we are safe from | |
3615 ;; changes in `shell-quote-argument'. | |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
3616 ;;;###tramp-autoload |
45861 | 3617 (defun tramp-shell-quote-argument (s) |
3618 "Similar to `shell-quote-argument', but groks newlines. | |
3619 Only works for Bourne-like shells." | |
3620 (let ((system-type 'not-windows)) | |
3621 (save-match-data | |
3622 (let ((result (shell-quote-argument s)) | |
3623 (nl (regexp-quote (format "\\%s" tramp-rsh-end-of-line)))) | |
3624 (when (and (>= (length result) 2) | |
3625 (string= (substring result 0 2) "\\~")) | |
3626 (setq result (substring result 1))) | |
3627 (while (string-match nl result) | |
3628 (setq result (replace-match (format "'%s'" tramp-rsh-end-of-line) | |
3629 t t result))) | |
3630 result)))) | |
3631 | |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3632 ;; Checklist for `tramp-unload-hook' |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3633 ;; - Unload all `tramp-*' packages |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3634 ;; - Reset `file-name-handler-alist' |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3635 ;; - Cleanup hooks where Tramp functions are in |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3636 ;; - Cleanup advised functions |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3637 ;; - Cleanup autoloads |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3638 ;;;###autoload |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3639 (defun tramp-unload-tramp () |
71485
5b1bf37e044d
* net/rcompile.el (remote-compile): Replace ange-ftp based
Michael Albinus <michael.albinus@gmx.de>
parents:
71350
diff
changeset
|
3640 "Discard Tramp from loading remote files." |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3641 (interactive) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3642 ;; ange-ftp settings must be enabled. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3643 (tramp-compat-funcall 'tramp-ftp-enable-ange-ftp) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
3644 ;; Maybe it's not loaded yet. |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
3645 (ignore-errors (unload-feature 'tramp 'force))) |
100216
9c5b974a0a5b
* net/tramp.el (top): Write a message, when loading Tramp.
Michael Albinus <michael.albinus@gmx.de>
parents:
99950
diff
changeset
|
3646 |
45861 | 3647 (provide 'tramp) |
3648 | |
3649 ;;; TODO: | |
3650 | |
3651 ;; * Rewrite `tramp-shell-quote-argument' to abstain from using | |
46790 | 3652 ;; `shell-quote-argument'. |
45861 | 3653 ;; * In Emacs 21, `insert-directory' shows total number of bytes used |
3654 ;; by the files in that directory. Add this here. | |
3655 ;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman) | |
3656 ;; * Make ffap.el grok Tramp filenames. (Eli Tziperman) | |
3657 ;; * abbreviate-file-name | |
104216
bf65b05e8cf1
* net/tramp.el (tramp-get-ls-command-with-dired): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
104143
diff
changeset
|
3658 ;; * Better error checking. At least whenever we see something |
45861 | 3659 ;; strange when doing zerop, we should kill the process and start |
3660 ;; again. (Greg Stark) | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
3661 ;; * Username and hostname completion. |
78887
8faf94b6c420
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
78489
diff
changeset
|
3662 ;; ** Try to avoid usage of `last-input-event' in `tramp-completion-mode-p'. |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
3663 ;; ** Unify `tramp-parse-{rhosts,shosts,sconfig,hosts,passwd,netrc}'. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3664 ;; Code is nearly identical. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3665 ;; * Make `tramp-default-user' obsolete. |
103735
d3d4dbf21c9b
* net/tramp.el (tramp-handle-write-region): Flush file properties
Michael Albinus <michael.albinus@gmx.de>
parents:
103642
diff
changeset
|
3666 ;; * Implement a general server-local-variable mechanism, as there are |
d3d4dbf21c9b
* net/tramp.el (tramp-handle-write-region): Flush file properties
Michael Albinus <michael.albinus@gmx.de>
parents:
103642
diff
changeset
|
3667 ;; probably other variables that need different values for different |
d3d4dbf21c9b
* net/tramp.el (tramp-handle-write-region): Flush file properties
Michael Albinus <michael.albinus@gmx.de>
parents:
103642
diff
changeset
|
3668 ;; servers too. The user could then configure a variable (such as |
d3d4dbf21c9b
* net/tramp.el (tramp-handle-write-region): Flush file properties
Michael Albinus <michael.albinus@gmx.de>
parents:
103642
diff
changeset
|
3669 ;; tramp-server-local-variable-alist) to define any such variables |
d3d4dbf21c9b
* net/tramp.el (tramp-handle-write-region): Flush file properties
Michael Albinus <michael.albinus@gmx.de>
parents:
103642
diff
changeset
|
3670 ;; that they need to, which would then be let bound as appropriate |
107189
a48b193e3b5f
(tramp-handle-insert-file-contents): Set always the permissions of the
Michael Albinus <michael.albinus@gmx.de>
parents:
107170
diff
changeset
|
3671 ;; in tramp functions. (Jason Rumney) |
107021
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
3672 ;; * IMHO, it's a drawback that currently Tramp doesn't support |
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
3673 ;; Unicode in Dired file names by default. Is it possible to |
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
3674 ;; improve Tramp to set LC_ALL to "C" only for commands where Tramp |
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
3675 ;; expects English? Or just to set LC_MESSAGES to "C" if Tramp |
107189
a48b193e3b5f
(tramp-handle-insert-file-contents): Set always the permissions of the
Michael Albinus <michael.albinus@gmx.de>
parents:
107170
diff
changeset
|
3676 ;; expects only English messages? (Juri Linkov) |
107021
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
3677 ;; * Make shadowfile.el grok Tramp filenames. (Bug#4526, Bug#4846) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3678 ;; * I was wondering it it would be possible to use tramp even if I'm |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3679 ;; actually using sshfs. But when I launch a command I would like |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3680 ;; to get it executed on the remote machine where the files really |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3681 ;; are. (Andrea Crotti) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3682 ;; * Run emerge on two remote files. Bug is described here: |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3683 ;; <http://www.mail-archive.com/tramp-devel@nongnu.org/msg01041.html>. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3684 ;; (Bug#6850) |
45861 | 3685 |
3686 ;; Functions for file-name-handler-alist: | |
3687 ;; diff-latest-backup-file -- in diff.el | |
3688 | |
3689 ;;; tramp.el ends here | |
93040
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
3690 |
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
3691 ;; Local Variables: |
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
3692 ;; mode: Emacs-Lisp |
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
3693 ;; coding: utf-8 |
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
3694 ;; End: |