Mercurial > emacs
annotate lisp/net/tramp.el @ 89956:b9eee0a7bef5
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-25
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-459
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-463
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-464
Update from CVS: lisp/progmodes/make-mode.el: Fix comments.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-465
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Fri, 23 Jul 2004 04:30:44 +0000 |
parents | 97905c4f1a42 6b42a91e3595 |
children | d8411455de48 |
rev | line source |
---|---|
50494
5b6aaf393205
Version 2.0.33 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50432
diff
changeset
|
1 ;;; -*- mode: Emacs-Lisp; coding: iso-2022-7bit; -*- |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
2 ;;; tramp.el --- Transparent Remote Access, Multiple Protocol |
45861 | 3 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. |
45861 | 5 |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
6 ;; Author: kai.grossjohann@gmx.net |
45861 | 7 ;; Keywords: comm, processes |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
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 ;; ----- | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
37 ;; |
45861 | 38 ;; This package only works for Emacs 20 and higher, and for XEmacs 21 |
39 ;; and higher. (XEmacs 20 is missing the `with-timeout' macro. Emacs | |
40 ;; 19 is reported to have other problems. For XEmacs 21, you need the | |
41 ;; package `fsf-compat' for the `with-timeout' macro.) | |
42 ;; | |
43 ;; This version might not work with pre-Emacs 21 VC unless VC is | |
44 ;; loaded before tramp.el. Could you please test this and tell me about | |
45 ;; the result? Thanks. | |
46 ;; | |
47 ;; Also see the todo list at the bottom of this file. | |
48 ;; | |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
49 ;; The current version of Tramp can be retrieved from the following URL: |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
50 ;; http://savannah.nongnu.org/download/tramp/ |
45861 | 51 ;; |
52 ;; There's a mailing list for this, as well. Its name is: | |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
53 ;; tramp-devel@mail.freesoftware.fsf.org |
45861 | 54 ;; Send a mail with `help' in the subject (!) to the administration |
55 ;; address for instructions on joining the list. The administration | |
56 ;; address is: | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
57 ;; tramp-devel-request@mail.freesoftware.fsf.org |
45861 | 58 ;; You can also use the Web to subscribe, under the following URL: |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
59 ;; http://mail.freesoftware.fsf.org/mailman/listinfo/tramp-devel |
45861 | 60 ;; |
61 ;; For the adventurous, the current development sources are available | |
62 ;; 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
|
63 ;; http://savannah.gnu.org/projects/tramp/ |
45861 | 64 ;; Click on "CVS" in the navigation bar near the top. |
65 ;; | |
66 ;; Don't forget to put on your asbestos longjohns, first! | |
67 | |
68 ;;; Code: | |
69 | |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
70 ;; The Tramp version number and bug report address, as prepared by configure. |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
71 (require 'trampver) |
45861 | 72 |
73 (require 'timer) | |
74 (require 'format-spec) ;from Gnus 5.8, also in tar ball | |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
75 ;; As long as password.el is not part of (X)Emacs, it shouldn't |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
76 ;; be mandatory |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
77 (if (featurep 'xemacs) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
78 (load "password" 'noerror) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
79 (require 'password nil 'noerror)) ;from No Gnus, also in tar ball |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
80 |
47205
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
81 ;; The explicit check is not necessary in Emacs, which provides the |
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
82 ;; feature even if implemented in C, but it appears to be necessary |
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
83 ;; in XEmacs. |
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
84 (unless (and (fboundp 'base64-encode-region) |
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
85 (fboundp 'base64-decode-region)) |
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
86 (require 'base64)) ;for the mimencode methods |
45861 | 87 (require 'shell) |
88 (require 'advice) | |
89 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
90 (autoload 'tramp-uuencode-region "tramp-uu" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
91 "Implementation of `uuencode' in Lisp.") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
92 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
93 (unless (fboundp 'uudecode-decode-region) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
94 (autoload 'uudecode-decode-region "uudecode")) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
95 |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
96 ;; XEmacs is distributed with few Lisp packages. Further packages are |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
97 ;; installed using EFS. If we use a unified filename format, then |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
98 ;; Tramp is required in addition to EFS. (But why can't Tramp just |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
99 ;; disable EFS when Tramp is loaded? Then XEmacs can ship with EFS |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
100 ;; just like before.) Another reason for using a separate filename |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
101 ;; syntax on XEmacs is that EFS hooks into XEmacs in many places, but |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
102 ;; Tramp only knows how to deal with `file-name-handler-alist', not |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
103 ;; the other places. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
104 ;;;###autoload |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
105 (defvar tramp-unified-filenames (not (featurep 'xemacs)) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
106 "Non-nil means to use unified Ange-FTP/Tramp filename syntax. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
107 Nil means to use a separate filename syntax for Tramp.") |
45861 | 108 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
109 ;; Load foreign methods. Because they do require Tramp internally, this |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
110 ;; must be done with the `eval-after-load' trick. |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
111 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
112 ;; tramp-ftp supports Ange-FTP only. Not suited for XEmacs therefore. |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
113 (unless (featurep 'xemacs) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
114 (eval-after-load "tramp" |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
115 '(require 'tramp-ftp))) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
116 (when (and tramp-unified-filenames (featurep 'xemacs)) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
117 (eval-after-load "tramp" |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
118 '(require 'tramp-efs))) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
119 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
120 ;; tramp-smb uses "smbclient" from Samba. |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
121 ;; Not available under Cygwin and Windows, because they don't offer |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
122 ;; "smbclient". And even not necessary there, because Emacs supports |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
123 ;; UNC file names like "//host/share/localname". |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
124 (unless (memq system-type '(cygwin windows-nt)) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
125 (eval-after-load "tramp" |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
126 '(require 'tramp-smb))) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
127 |
45861 | 128 (eval-when-compile |
129 (require 'cl) | |
130 (require 'custom) | |
131 ;; Emacs 19.34 compatibility hack -- is this needed? | |
132 (or (>= emacs-major-version 20) | |
133 (load "cl-seq"))) | |
134 | |
135 (unless (boundp 'custom-print-functions) | |
136 (defvar custom-print-functions nil)) ; not autoloaded before Emacs 20.4 | |
137 | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
138 ;; Avoid byte-compiler warnings if the byte-compiler supports this. |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
139 ;; Currently, XEmacs supports this. |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
140 (eval-when-compile |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
141 (when (fboundp 'byte-compiler-options) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
142 (let (unused-vars) ; Pacify Emacs byte-compiler |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
143 (defalias 'warnings 'identity) ; Pacify Emacs byte-compiler |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
144 (byte-compiler-options (warnings (- unused-vars)))))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
145 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
146 ;; `directory-sep-char' is an obsolete variable in Emacs. But it is |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
147 ;; used in XEmacs, so we set it here and there. The following is needed |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
148 ;; to pacify Emacs byte-compiler. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
149 (eval-when-compile |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
150 (when (boundp 'byte-compile-not-obsolete-var) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
151 (setq byte-compile-not-obsolete-var 'directory-sep-char))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
152 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
153 ;; XEmacs byte-compiler raises warning abouts `last-coding-system-used'. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
154 (eval-when-compile |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
155 (unless (boundp 'last-coding-system-used) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
156 (defvar last-coding-system-used 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
|
157 |
45861 | 158 ;;; User Customizable Internal Variables: |
159 | |
160 (defgroup tramp nil | |
161 "Edit remote files with a combination of rsh and rcp or similar programs." | |
162 :group 'files) | |
163 | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
164 (defcustom tramp-verbose 9 |
45861 | 165 "*Verbosity level for tramp.el. 0 means be silent, 10 is most verbose." |
166 :group 'tramp | |
167 :type 'integer) | |
168 | |
169 (defcustom tramp-debug-buffer nil | |
170 "*Whether to send all commands and responses to a debug buffer." | |
171 :group 'tramp | |
172 :type 'boolean) | |
173 | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
174 ;; Emacs case |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
175 (eval-and-compile |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
176 (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
|
177 (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
|
178 "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
|
179 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
|
180 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
|
181 is a local file name, the backup directory is prepended with Tramp file |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
182 name prefix \(multi-method, method, user, host\) of file. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
183 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
184 \(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
|
185 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
186 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
|
187 policy for local files." |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
188 :group 'tramp |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
189 :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
|
190 (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
|
191 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
192 ;; 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
|
193 ;; 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
|
194 (eval-and-compile |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
195 (when (featurep 'xemacs) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
196 (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
|
197 "*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
|
198 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
|
199 `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
|
200 file name, the backup directory is prepended with Tramp file name prefix |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
201 \(multi-method, method, user, host\) of file. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
202 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
203 \(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
|
204 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
205 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
|
206 policy for local files." |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
207 :type '(repeat |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
208 (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
|
209 (string :tag "Backup Dir") |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
210 (set :inline t |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
211 (const ok-create) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
212 (const full-path) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
213 (const prepend-name) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
214 (const search-upward)))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
215 :group 'tramp))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
216 |
45861 | 217 (defcustom tramp-auto-save-directory nil |
218 "*Put auto-save files in this directory, if set. | |
219 The idea is to use a local directory so that auto-saving is faster." | |
220 :group 'tramp | |
221 :type '(choice (const nil) | |
222 string)) | |
223 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
224 (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
|
225 (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
|
226 (getenv "COMSPEC") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
227 "/bin/sh") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
228 "*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
|
229 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
|
230 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
|
231 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
|
232 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
|
233 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
234 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
|
235 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
236 /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
|
237 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
238 This variable can be used to change the \"/bin/sh\" part. See the |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
239 variable `tramp-encoding-command-switch' for the \"-c\" part. Also, see the |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
240 variable `tramp-encoding-reads-stdin' to specify whether the commands read |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
241 standard input or a file. |
45861 | 242 |
243 Note that this variable is not used for remote commands. There are | |
244 mechanisms in tramp.el which automatically determine the right shell to | |
245 use for the remote host." | |
246 :group 'tramp | |
247 :type '(file :must-match t)) | |
248 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
249 (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
|
250 (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
|
251 "/c" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
252 "-c") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
253 "*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
|
254 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
|
255 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
256 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
257 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
258 (defcustom tramp-encoding-reads-stdin t |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
259 "*If non-nil, encoding commands read from standard input. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
260 If nil, the filename is the last argument. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
261 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
262 Note that the commands always must write to standard output." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
263 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
264 :type 'boolean) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
265 |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
266 (defcustom tramp-multi-sh-program |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
267 tramp-encoding-shell |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
268 "*Use this program for bootstrapping multi-hop connections. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
269 This variable is similar to `tramp-encoding-shell', but it is only used |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
270 when initializing a multi-hop connection. Therefore, the set of |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
271 commands sent to this shell is quite restricted, and if you are |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
272 careful it works to use CMD.EXE under Windows (instead of a Bourne-ish |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
273 shell which does not normally exist on Windows anyway). |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
274 |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
275 To use multi-hop methods from Windows, you also need suitable entries |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
276 in `tramp-multi-connection-function-alist' for the first hop. |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
277 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
278 This variable defaults to the value of `tramp-encoding-shell'." |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
279 :group 'tramp |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
280 :type '(file :must-match t)) |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
281 |
45861 | 282 ;; CCC I have changed all occurrences of comint-quote-filename with |
283 ;; tramp-shell-quote-argument, except in tramp-handle-expand-many-files. | |
284 ;; There, comint-quote-filename was removed altogether. If it turns | |
285 ;; out to be necessary there, something will need to be done. | |
286 ;;-(defcustom tramp-file-name-quote-list | |
287 ;;- '(?] ?[ ?\| ?& ?< ?> ?\( ?\) ?\; ?\ ?\* ?\? ?\! ?\" ?\' ?\` ?# ?\@ ?\+ ) | |
288 ;;- "*Protect these characters from the remote shell. | |
289 ;;-Any character in this list is quoted (preceded with a backslash) | |
290 ;;-because it means something special to the shell. This takes effect | |
291 ;;-when sending file and directory names to the remote shell. | |
292 ;;- | |
293 ;;-See `comint-file-name-quote-list' for details." | |
294 ;;- :group 'tramp | |
295 ;;- :type '(repeat character)) | |
296 | |
297 (defcustom tramp-methods | |
298 '( ("rcp" (tramp-connection-function tramp-open-connection-rsh) | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
299 (tramp-login-program "rsh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
300 (tramp-copy-program "rcp") |
45861 | 301 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
302 (tramp-login-args nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
303 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
304 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
305 (tramp-password-end-of-line nil)) |
45861 | 306 ("scp" (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
307 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
308 (tramp-copy-program "scp") |
45861 | 309 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
310 (tramp-login-args ("-e" "none")) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
311 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
312 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
313 (tramp-password-end-of-line nil)) |
45861 | 314 ("scp1" (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
315 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
316 (tramp-copy-program "scp") |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
317 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
318 (tramp-login-args ("-1" "-e" "none")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
319 (tramp-copy-args ("-1")) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
320 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
321 (tramp-password-end-of-line nil)) |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
322 ("scp2" (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
323 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
324 (tramp-copy-program "scp") |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
325 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
326 (tramp-login-args ("-2" "-e" "none")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
327 (tramp-copy-args ("-2")) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
328 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
329 (tramp-password-end-of-line nil)) |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
330 ("scp1_old" |
46752 | 331 (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
332 (tramp-login-program "ssh1") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
333 (tramp-copy-program "scp1") |
45861 | 334 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
335 (tramp-login-args ("-e" "none")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
336 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
337 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
338 (tramp-password-end-of-line nil)) |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
339 ("scp2_old" |
46752 | 340 (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
341 (tramp-login-program "ssh2") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
342 (tramp-copy-program "scp2") |
45861 | 343 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
344 (tramp-login-args ("-e" "none")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
345 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
346 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
347 (tramp-password-end-of-line nil)) |
45861 | 348 ("rsync" (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
349 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
350 (tramp-copy-program "rsync") |
45861 | 351 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
352 (tramp-login-args ("-e" "none")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
353 (tramp-copy-args ("-e" "ssh")) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
354 (tramp-copy-keep-date-arg "-t") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
355 (tramp-password-end-of-line nil)) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
356 ("remcp" (tramp-connection-function tramp-open-connection-rsh) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
357 (tramp-login-program "remsh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
358 (tramp-copy-program "rcp") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
359 (tramp-remote-sh "/bin/sh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
360 (tramp-login-args nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
361 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
362 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
363 (tramp-password-end-of-line nil)) |
46752 | 364 ("rsh" (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
365 (tramp-login-program "rsh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
366 (tramp-copy-program nil) |
45861 | 367 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
368 (tramp-login-args nil) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
369 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
370 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
371 (tramp-password-end-of-line nil)) |
46752 | 372 ("ssh" (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
373 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
374 (tramp-copy-program nil) |
45861 | 375 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
376 (tramp-login-args ("-e" "none")) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
377 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
378 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
379 (tramp-password-end-of-line nil)) |
46752 | 380 ("ssh1" (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
381 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
382 (tramp-copy-program nil) |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
383 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
384 (tramp-login-args ("-1" "-e" "none")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
385 (tramp-copy-args ("-1")) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
386 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
387 (tramp-password-end-of-line nil)) |
46752 | 388 ("ssh2" (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
389 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
390 (tramp-copy-program nil) |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
391 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
392 (tramp-login-args ("-2" "-e" "none")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
393 (tramp-copy-args ("-2")) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
394 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
395 (tramp-password-end-of-line nil)) |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
396 ("ssh1_old" |
46752 | 397 (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
398 (tramp-login-program "ssh1") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
399 (tramp-copy-program nil) |
45861 | 400 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
401 (tramp-login-args ("-e" "none")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
402 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
403 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
404 (tramp-password-end-of-line nil)) |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
405 ("ssh2_old" |
46752 | 406 (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
407 (tramp-login-program "ssh2") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
408 (tramp-copy-program nil) |
45861 | 409 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
410 (tramp-login-args ("-e" "none")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
411 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
412 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
413 (tramp-password-end-of-line nil)) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
414 ("remsh" (tramp-connection-function tramp-open-connection-rsh) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
415 (tramp-login-program "remsh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
416 (tramp-copy-program nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
417 (tramp-remote-sh "/bin/sh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
418 (tramp-login-args nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
419 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
420 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
421 (tramp-password-end-of-line nil)) |
46752 | 422 ("telnet" |
423 (tramp-connection-function tramp-open-connection-telnet) | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
424 (tramp-login-program "telnet") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
425 (tramp-copy-program nil) |
45861 | 426 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
427 (tramp-login-args nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
428 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
429 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
430 (tramp-password-end-of-line nil)) |
46752 | 431 ("su" (tramp-connection-function tramp-open-connection-su) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
432 (tramp-login-program "su") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
433 (tramp-copy-program nil) |
45861 | 434 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
435 (tramp-login-args ("-" "%u")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
436 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
437 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
438 (tramp-password-end-of-line nil)) |
46752 | 439 ("sudo" (tramp-connection-function tramp-open-connection-su) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
440 (tramp-login-program "sudo") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
441 (tramp-copy-program nil) |
45861 | 442 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
443 (tramp-login-args ("-u" "%u" "-s" |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
444 "-p" "Password:")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
445 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
446 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
447 (tramp-password-end-of-line nil)) |
45861 | 448 ("multi" (tramp-connection-function tramp-open-connection-multi) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
449 (tramp-login-program nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
450 (tramp-copy-program nil) |
45861 | 451 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
452 (tramp-login-args nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
453 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
454 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
455 (tramp-password-end-of-line nil)) |
45861 | 456 ("scpx" (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
457 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
458 (tramp-copy-program "scp") |
45861 | 459 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
460 (tramp-login-args ("-e" "none" "-t" "-t" "/bin/sh")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
461 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
462 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
463 (tramp-password-end-of-line nil)) |
46752 | 464 ("sshx" (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
465 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
466 (tramp-copy-program nil) |
45861 | 467 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
468 (tramp-login-args ("-e" "none" "-t" "-t" "/bin/sh")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
469 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
470 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
471 (tramp-password-end-of-line nil)) |
46752 | 472 ("krlogin" |
45861 | 473 (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
474 (tramp-login-program "krlogin") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
475 (tramp-copy-program nil) |
45861 | 476 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
477 (tramp-login-args ("-x")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
478 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
479 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
480 (tramp-password-end-of-line nil)) |
46752 | 481 ("plink" |
45861 | 482 (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
483 (tramp-login-program "plink") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
484 (tramp-copy-program nil) |
45861 | 485 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
486 (tramp-login-args ("-ssh")) ;optionally add "-v" |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
487 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
488 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
489 (tramp-password-end-of-line "xy")) ;see docstring for "xy" |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
490 ("plink1" |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
491 (tramp-connection-function tramp-open-connection-rsh) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
492 (tramp-login-program "plink") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
493 (tramp-copy-program nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
494 (tramp-remote-sh "/bin/sh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
495 (tramp-login-args ("-1" "-ssh")) ;optionally add "-v" |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
496 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
497 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
498 (tramp-password-end-of-line "xy")) ;see docstring for "xy" |
45861 | 499 ("pscp" |
500 (tramp-connection-function tramp-open-connection-rsh) | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
501 (tramp-login-program "plink") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
502 (tramp-copy-program "pscp") |
45861 | 503 (tramp-remote-sh "/bin/sh") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
504 (tramp-login-args ("-ssh")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
505 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
506 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
507 (tramp-password-end-of-line "xy")) ;see docstring for "xy" |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
508 ("fcp" |
45861 | 509 (tramp-connection-function tramp-open-connection-rsh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
510 (tramp-login-program "fsh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
511 (tramp-copy-program "fcp") |
45861 | 512 (tramp-remote-sh "/bin/sh -i") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
513 (tramp-login-args ("sh" "-i")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
514 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
515 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
516 (tramp-password-end-of-line nil)) |
45861 | 517 ) |
518 "*Alist of methods for remote files. | |
519 This is a list of entries of the form (NAME PARAM1 PARAM2 ...). | |
520 Each NAME stands for a remote access method. Each PARAM is a | |
521 pair of the form (KEY VALUE). The following KEYs are defined: | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
522 * `tramp-connection-function' |
45861 | 523 This specifies the function to use to connect to the remote host. |
524 Currently, `tramp-open-connection-rsh', `tramp-open-connection-telnet' | |
525 and `tramp-open-connection-su' are defined. See the documentation | |
526 of these functions for more details. | |
527 * `tramp-remote-sh' | |
528 This specifies the Bourne shell to use on the remote host. This | |
529 MUST be a Bourne-like shell. It is normally not necessary to set | |
530 this to any value other than \"/bin/sh\": tramp wants to use a shell | |
531 which groks tilde expansion, but it can search for it. Also note | |
532 that \"/bin/sh\" exists on all Unixen, this might not be true for | |
533 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
|
534 * `tramp-login-program' |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
535 This specifies the name of the program to use for logging in to the |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
536 remote host. Depending on `tramp-connection-function', this may be |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
537 the name of rsh or a workalike program (when |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
538 `tramp-connection-function' is `tramp-open-connection-rsh'), or the |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
539 name of telnet or a workalike (for `tramp-open-connection-telnet'), |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
540 or the name of su or a workalike (for `tramp-open-connection-su'). |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
541 * `tramp-login-args' |
45861 | 542 This specifies the list of arguments to pass to the above |
543 mentioned program. Please note that this is a list of arguments, | |
544 that is, normally you don't want to put \"-a -b\" or \"-f foo\" | |
545 here. Instead, you want two list elements, one for \"-a\" and one | |
546 for \"-b\", or one for \"-f\" and one for \"foo\". | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
547 If `tramp-connection-function' is `tramp-open-connection-su', then |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
548 \"%u\" in this list is replaced by the user name, and \"%%\" can |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
549 be used to obtain a literal percent character. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
550 * `tramp-copy-program' |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
551 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
|
552 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
|
553 a workalike program. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
554 * `tramp-copy-args' |
45861 | 555 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
|
556 program, the hints for `tramp-login-args' also apply here. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
557 * `tramp-copy-keep-date-arg' |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
558 This specifies the parameter to use for the copying program when the |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
559 timestamp of the original file should be kept. For `rcp', use `-p', for |
45861 | 560 `rsync', use `-t'. |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
561 * `tramp-password-end-of-line' |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
562 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
|
563 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
|
564 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
|
565 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
|
566 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
|
567 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
|
568 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
|
569 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
|
570 |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
571 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
|
572 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
|
573 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
|
574 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
|
575 to do this, set `tramp-copy-program' in the method. |
45861 | 576 |
577 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
|
578 file is passed through the same buffer used by `tramp-login-program'. In |
45861 | 579 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
|
580 `tramp-login-program' might use escape codes or the connection might not |
45861 | 581 be eight-bit clean. Therefore, file contents are encoded for transit. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
582 See the variable `tramp-coding-commands' for details. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
583 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
584 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
|
585 must specify `tramp-copy-program' and `tramp-copy-args'. If it is an |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
586 inline method, then these two parameters should be nil. Every method, |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
587 inline or out of band, must specify `tramp-connection-function' plus |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
588 the associated arguments (for example, the login program if you chose |
45861 | 589 `tramp-open-connection-telnet'). |
590 | |
591 Notes: | |
592 | |
593 When using `tramp-open-connection-su' the phrase `open connection to a | |
594 remote host' sounds strange, but it is used nevertheless, for | |
595 consistency. No connection is opened to a remote host, but `su' is | |
596 started on the local host. You are not allowed to specify a remote | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
597 host other than `localhost' or the name of the local host." |
45861 | 598 :group 'tramp |
599 :type '(repeat | |
600 (cons string | |
601 (set (list (const tramp-connection-function) function) | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
602 (list (const tramp-login-program) |
45861 | 603 (choice (const nil) string)) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
604 (list (const tramp-copy-program) |
45861 | 605 (choice (const nil) string)) |
606 (list (const tramp-remote-sh) | |
607 (choice (const nil) string)) | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
608 (list (const tramp-login-args) (repeat string)) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
609 (list (const tramp-copy-args) (repeat string)) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
610 (list (const tramp-copy-keep-date-arg) |
45861 | 611 (choice (const nil) string)) |
612 (list (const tramp-encoding-command) | |
613 (choice (const nil) string)) | |
614 (list (const tramp-decoding-command) | |
615 (choice (const nil) string)) | |
616 (list (const tramp-encoding-function) | |
617 (choice (const nil) function)) | |
618 (list (const tramp-decoding-function) | |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
619 (choice (const nil) function)) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
620 (list (const tramp-password-end-of-line) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
621 (choice (const nil) string)))))) |
45861 | 622 |
623 (defcustom tramp-multi-methods '("multi" "multiu") | |
624 "*List of multi-hop methods. | |
625 Each entry in this list should be a method name as mentioned in the | |
626 variable `tramp-methods'." | |
627 :group 'tramp | |
628 :type '(repeat string)) | |
629 | |
630 (defcustom tramp-multi-connection-function-alist | |
631 '(("telnet" tramp-multi-connect-telnet "telnet %h%n") | |
632 ("rsh" tramp-multi-connect-rlogin "rsh %h -l %u%n") | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
633 ("remsh" tramp-multi-connect-rlogin "remsh %h -l %u%n") |
45861 | 634 ("ssh" tramp-multi-connect-rlogin "ssh %h -l %u%n") |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
635 ("ssht" tramp-multi-connect-rlogin "ssh %h -e none -t -t -l %u%n") |
45861 | 636 ("su" tramp-multi-connect-su "su - %u%n") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
637 ("sudo" tramp-multi-connect-su "sudo -u %u -s -p Password:%n")) |
45861 | 638 "*List of connection functions for multi-hop methods. |
639 Each list item is a list of three items (METHOD FUNCTION COMMAND), | |
640 where METHOD is the name as used in the file name, FUNCTION is the | |
641 function to be executed, and COMMAND is the shell command used for | |
642 connecting. | |
643 | |
644 COMMAND may contain percent escapes. `%u' will be replaced with the | |
645 user name, `%h' will be replaced with the host name, and `%n' will be | |
646 replaced with an end-of-line character, as specified in the variable | |
647 `tramp-rsh-end-of-line'. Use `%%' for a literal percent character. | |
648 Note that the interpretation of the percent escapes also depends on | |
649 the FUNCTION. For example, the `%u' escape is forbidden with the | |
650 function `tramp-multi-connect-telnet'. See the documentation of the | |
651 various functions for details." | |
652 :group 'tramp | |
653 :type '(repeat (list string function string))) | |
654 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
655 (defcustom tramp-default-method |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
656 (if (and (fboundp 'executable-find) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
657 (executable-find "plink")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
658 "plink" |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
659 "ssh") |
45861 | 660 "*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
|
661 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
|
662 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
|
663 :group 'tramp |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
664 :type 'string) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
665 |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
666 (defcustom tramp-default-method-alist |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
667 '(("\\`localhost\\'" "\\`root\\'" "su")) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
668 "*Default method to use for specific user/host pairs. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
669 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
|
670 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
|
671 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
|
672 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
|
673 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
|
674 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
675 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
|
676 empty string for the user name. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
677 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
678 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
|
679 :group 'tramp |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
680 :type '(repeat (list (regexp :tag "Host regexp") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
681 (regexp :tag "User regexp") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
682 (string :tag "Method")))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
683 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
684 ;; Default values for non-Unices seeked |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
685 (defconst tramp-completion-function-alist-rsh |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
686 (unless (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
|
687 '((tramp-parse-rhosts "/etc/hosts.equiv") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
688 (tramp-parse-rhosts "~/.rhosts"))) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
689 "Default list of (FUNCTION FILE) pairs to be examined for rsh methods.") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
690 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
691 ;; Default values for non-Unices seeked |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
692 (defconst tramp-completion-function-alist-ssh |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
693 (unless (memq system-type '(windows-nt)) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
694 '((tramp-parse-rhosts "/etc/hosts.equiv") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
695 (tramp-parse-rhosts "/etc/shosts.equiv") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
696 (tramp-parse-shosts "/etc/ssh_known_hosts") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
697 (tramp-parse-sconfig "/etc/ssh_config") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
698 (tramp-parse-shostkeys "/etc/ssh2/hostkeys") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
699 (tramp-parse-sknownhosts "/etc/ssh2/knownhosts") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
700 (tramp-parse-rhosts "~/.rhosts") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
701 (tramp-parse-rhosts "~/.shosts") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
702 (tramp-parse-shosts "~/.ssh/known_hosts") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
703 (tramp-parse-sconfig "~/.ssh/config") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
704 (tramp-parse-shostkeys "~/.ssh2/hostkeys") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
705 (tramp-parse-sknownhosts "~/.ssh2/knownhosts"))) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
706 "Default list of (FUNCTION FILE) pairs to be examined for ssh methods.") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
707 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
708 ;; Default values for non-Unices seeked |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
709 (defconst tramp-completion-function-alist-telnet |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
710 (unless (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
|
711 '((tramp-parse-hosts "/etc/hosts"))) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
712 "Default list of (FUNCTION FILE) pairs to be examined for telnet methods.") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
713 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
714 ;; Default values for non-Unices seeked |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
715 (defconst tramp-completion-function-alist-su |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
716 (unless (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
|
717 '((tramp-parse-passwd "/etc/passwd"))) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
718 "Default list of (FUNCTION FILE) pairs to be examined for su methods.") |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
719 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
720 (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
|
721 "*Alist of methods for remote files. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
722 This is a list of entries of the form (NAME PAIR1 PAIR2 ...). |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
723 Each NAME stands for a remote access method. Each PAIR is of the form |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
724 \(FUNCTION FILE). FUNCTION is responsible to extract user names and host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
725 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
|
726 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
727 * `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
|
728 * `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
|
729 * `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
|
730 * `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
|
731 * `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
|
732 * `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
|
733 * `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
|
734 * `tramp-parse-netrc' for \"~/.netrc\" like files. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
735 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
736 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
|
737 the info pages.") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
738 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
739 (eval-after-load "tramp" |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
740 '(progn |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
741 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
742 "rcp" tramp-completion-function-alist-rsh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
743 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
744 "scp" tramp-completion-function-alist-ssh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
745 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
746 "scp1" tramp-completion-function-alist-ssh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
747 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
748 "scp2" tramp-completion-function-alist-ssh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
749 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
750 "scp1_old" tramp-completion-function-alist-ssh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
751 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
752 "scp2_old" tramp-completion-function-alist-ssh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
753 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
754 "rsync" tramp-completion-function-alist-rsh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
755 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
756 "remcp" tramp-completion-function-alist-rsh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
757 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
758 "rsh" tramp-completion-function-alist-rsh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
759 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
760 "ssh" tramp-completion-function-alist-ssh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
761 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
762 "ssh1" tramp-completion-function-alist-ssh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
763 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
764 "ssh2" tramp-completion-function-alist-ssh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
765 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
766 "ssh1_old" tramp-completion-function-alist-ssh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
767 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
768 "ssh2_old" tramp-completion-function-alist-ssh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
769 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
770 "remsh" tramp-completion-function-alist-rsh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
771 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
772 "telnet" tramp-completion-function-alist-telnet) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
773 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
774 "su" tramp-completion-function-alist-su) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
775 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
776 "sudo" tramp-completion-function-alist-su) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
777 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
778 "multi" nil) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
779 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
780 "scpx" tramp-completion-function-alist-ssh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
781 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
782 "sshx" tramp-completion-function-alist-ssh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
783 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
784 "krlogin" tramp-completion-function-alist-rsh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
785 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
786 "plink" tramp-completion-function-alist-ssh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
787 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
788 "plink1" tramp-completion-function-alist-ssh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
789 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
790 "pscp" tramp-completion-function-alist-ssh) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
791 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
792 "fcp" tramp-completion-function-alist-ssh))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
793 |
45861 | 794 (defcustom tramp-rsh-end-of-line "\n" |
795 "*String used for end of line in rsh connections. | |
796 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
|
797 if you need to change this. |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
798 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
|
799 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
|
800 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
801 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
802 |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
803 (defcustom tramp-default-password-end-of-line |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
804 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
|
805 "*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
|
806 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
|
807 `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
|
808 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
809 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
|
810 \"\\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
|
811 \"\\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
|
812 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
|
813 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
814 The default value is to use the same value as `tramp-rsh-end-of-line'." |
45861 | 815 :group 'tramp |
816 :type 'string) | |
817 | |
818 (defcustom tramp-remote-path | |
819 '("/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin" "/usr/ccs/bin" | |
820 "/local/bin" "/local/freeware/bin" "/local/gnu/bin" | |
821 "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin") | |
822 "*List of directories to search for executables on remote host. | |
823 Please notify me about other semi-standard directories to include here. | |
824 | |
825 You can use `~' in this list, but when searching for a shell which groks | |
826 tilde expansion, all directory names starting with `~' will be ignored." | |
827 :group 'tramp | |
828 :type '(repeat string)) | |
829 | |
830 (defcustom tramp-login-prompt-regexp | |
46752 | 831 ".*ogin: *" |
45861 | 832 "*Regexp matching login-like prompts. |
46752 | 833 The regexp should match at end of buffer." |
45861 | 834 :group 'tramp |
835 :type 'regexp) | |
836 | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
837 (defcustom tramp-shell-prompt-pattern |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
838 "^[^#$%>\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
|
839 "Regexp to match prompts from remote shell. |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
840 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
|
841 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
|
842 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
|
843 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
|
844 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
|
845 variable is similar to the default value of `shell-prompt-pattern', |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
846 which should work well in many cases." |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
847 :group 'tramp |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
848 :type 'regexp) |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
849 |
45861 | 850 (defcustom tramp-password-prompt-regexp |
46752 | 851 "^.*\\([pP]assword\\|passphrase.*\\):\^@? *" |
45861 | 852 "*Regexp matching password-like prompts. |
46752 | 853 The regexp should match at end of buffer. |
45861 | 854 |
855 The `sudo' program appears to insert a `^@' character into the prompt." | |
856 :group 'tramp | |
857 :type 'regexp) | |
858 | |
859 (defcustom tramp-wrong-passwd-regexp | |
46790 | 860 (concat "^.*" |
861 ;; These strings should be on the last line | |
862 (regexp-opt '("Permission denied." | |
863 "Login incorrect" | |
864 "Login Incorrect" | |
865 "Connection refused" | |
866 "Connection closed" | |
867 "Sorry, try again." | |
868 "Name or service not known" | |
869 "Host key verification failed.") t) | |
870 ".*" | |
871 "\\|" | |
872 "^.*\\(" | |
873 ;; Here comes a list of regexes, separated by \\| | |
874 "Received signal [0-9]+" | |
875 "\\).*") | |
45861 | 876 "*Regexp matching a `login failed' message. |
46752 | 877 The regexp should match at end of buffer." |
878 :group 'tramp | |
879 :type 'regexp) | |
880 | |
881 (defcustom tramp-yesno-prompt-regexp | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
882 (concat |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
883 (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
|
884 "\\s-*") |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
885 "Regular expression matching all yes/no queries which need to be confirmed. |
46752 | 886 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
|
887 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
|
888 See also `tramp-yn-prompt-regexp'." |
45861 | 889 :group 'tramp |
890 :type 'regexp) | |
891 | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
892 (defcustom tramp-yn-prompt-regexp |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
893 (concat (regexp-opt '("Store key in cache? (y/n)") t) |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
894 "\\s-*") |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
895 "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
|
896 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
|
897 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
|
898 See also `tramp-yesno-prompt-regexp'." |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
899 :group 'tramp |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
900 :type 'regexp) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
901 |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
902 (defcustom tramp-terminal-prompt-regexp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
903 (concat "\\(" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
904 "TERM = (.*)" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
905 "\\|" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
906 "Terminal type\\? \\[.*\\]" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
907 "\\)\\s-*") |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
908 "Regular expression matching all terminal setting prompts. |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
909 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
|
910 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
|
911 :group 'tramp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
912 :type 'regexp) |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
913 |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
914 (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
|
915 "" |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
916 "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
|
917 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
|
918 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
|
919 The answer will be provided by `tramp-action-process-alive', |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
920 `tramp-multi-action-process-alive' and`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
|
921 :group 'tramp |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
922 :type 'regexp) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
923 |
45861 | 924 (defcustom tramp-temp-name-prefix "tramp." |
925 "*Prefix to use for temporary files. | |
926 If this is a relative file name (such as \"tramp.\"), it is considered | |
927 relative to the directory name returned by the function | |
928 `tramp-temporary-file-directory' (which see). It may also be an | |
929 absolute file name; don't forget to include a prefix for the filename | |
930 part, though." | |
931 :group 'tramp | |
932 :type 'string) | |
933 | |
934 (defcustom tramp-discard-garbage nil | |
935 "*If non-nil, try to discard garbage sent by remote shell. | |
936 Some shells send such garbage upon connection setup." | |
937 :group 'tramp | |
938 :type 'boolean) | |
939 | |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
940 (defcustom tramp-sh-extra-args '(("/bash\\'" . "-norc -noprofile")) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
941 "*Alist specifying extra arguments to pass to the remote shell. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
942 Entries are (REGEXP . ARGS) where REGEXP is a regular expression |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
943 matching the shell file name and ARGS is a string specifying the |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
944 arguments. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
945 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
946 This variable is only used when Tramp needs to start up another shell |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
947 for tilde expansion. The extra arguments should typically prevent the |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
948 shell from reading its init file." |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
949 :group 'tramp |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
950 ;; This might be the wrong way to test whether the widget type |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
951 ;; `alist' is available. Who knows the right way to test it? |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
952 :type (if (get 'alist 'widget-type) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
953 '(alist :key-type string :value-type string) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
954 '(repeat (cons string string)))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
955 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
956 (defcustom tramp-prefix-format |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
957 (if tramp-unified-filenames "/" "/[") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
958 "*String matching the very beginning of tramp file names. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
959 Used in `tramp-make-tramp-file-name' and `tramp-make-tramp-multi-file-name'." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
960 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
961 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
962 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
963 (defcustom tramp-prefix-regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
964 (concat "^" (regexp-quote tramp-prefix-format)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
965 "*Regexp matching the very beginning of tramp file names. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
966 Should always start with \"^\". Derived from `tramp-prefix-format'." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
967 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
968 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
969 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
970 (defcustom tramp-method-regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
971 "[a-zA-Z_0-9-]+" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
972 "*Regexp matching methods identifiers." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
973 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
974 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
975 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
976 ;; It is a little bit annoying that in XEmacs case this delimeter is different |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
977 ;; for single-hop and multi-hop cases. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
978 (defcustom tramp-postfix-single-method-format |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
979 (if tramp-unified-filenames ":" "/") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
980 "*String matching delimeter between method and user or host names. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
981 Applicable for single-hop methods. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
982 Used in `tramp-make-tramp-file-name'." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
983 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
984 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
985 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
986 (defcustom tramp-postfix-single-method-regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
987 (regexp-quote tramp-postfix-single-method-format) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
988 "*Regexp matching delimeter between method and user or host names. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
989 Applicable for single-hop methods. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
990 Derived from `tramp-postfix-single-method-format'." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
991 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
992 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
993 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
994 (defcustom tramp-postfix-multi-method-format |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
995 ":" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
996 "*String matching delimeter between method and user or host names. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
997 Applicable for multi-hop methods. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
998 Used in `tramp-make-tramp-multi-file-name'." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
999 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1000 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1001 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1002 (defcustom tramp-postfix-multi-method-regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1003 (regexp-quote tramp-postfix-multi-method-format) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1004 "*Regexp matching delimeter between method and user or host names. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1005 Applicable for multi-hop methods. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1006 Derived from `tramp-postfix-multi-method-format'." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1007 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1008 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1009 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1010 (defcustom tramp-postfix-multi-hop-format |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1011 (if tramp-unified-filenames ":" "/") |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1012 "*String matching delimeter between host and next method. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1013 Applicable for multi-hop methods. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1014 Used in `tramp-make-tramp-multi-file-name'." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1015 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1016 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1017 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1018 (defcustom tramp-postfix-multi-hop-regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1019 (regexp-quote tramp-postfix-multi-hop-format) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1020 "*Regexp matching delimeter between host and next method. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1021 Applicable for multi-hop methods. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1022 Derived from `tramp-postfix-multi-hop-format'." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1023 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1024 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1025 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1026 (defcustom tramp-user-regexp |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
1027 "[^:@/ \t]*" |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1028 "*Regexp matching user names." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1029 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1030 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1031 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1032 (defcustom 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
|
1033 "@" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1034 "*String matching delimeter between user and host names. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1035 Used in `tramp-make-tramp-file-name' and `tramp-make-tramp-multi-file-name'." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1036 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1037 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1038 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1039 (defcustom tramp-postfix-user-regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1040 (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
|
1041 "*Regexp matching delimeter between user and host names. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1042 Derived from `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
|
1043 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1044 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1045 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1046 (defcustom tramp-host-regexp |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1047 "[a-zA-Z0-9_.-]*" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1048 "*Regexp matching host names." |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1049 :group 'tramp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1050 :type 'regexp) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1051 |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1052 (defcustom tramp-host-with-port-regexp |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
1053 "[a-zA-Z0-9_.#-]*" |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1054 "*Regexp matching host names." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1055 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1056 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1057 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1058 (defcustom tramp-postfix-host-format |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1059 (if tramp-unified-filenames ":" "]") |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1060 "*String matching delimeter between host names and localnames. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1061 Used in `tramp-make-tramp-file-name' and `tramp-make-tramp-multi-file-name'." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1062 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1063 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1064 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1065 (defcustom tramp-postfix-host-regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1066 (regexp-quote tramp-postfix-host-format) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1067 "*Regexp matching delimeter between host names and localnames. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1068 Derived from `tramp-postfix-host-format'." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1069 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1070 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1071 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1072 (defcustom tramp-localname-regexp |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1073 ".*$" |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1074 "*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
|
1075 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1076 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1077 |
45861 | 1078 ;; File name format. |
1079 | |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1080 (defcustom 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
|
1081 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1082 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1083 tramp-prefix-regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1084 "\\(" "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp "\\)?" |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1085 "\\(" "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp "\\)?" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1086 "\\(" tramp-host-with-port-regexp "\\)" tramp-postfix-host-regexp |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1087 "\\(" tramp-localname-regexp "\\)") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1088 2 4 5 6) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1089 |
45861 | 1090 "*List of five elements (REGEXP METHOD USER HOST FILE), detailing \ |
1091 the tramp file name structure. | |
1092 | |
1093 The first element REGEXP is a regular expression matching a tramp file | |
1094 name. The regex should contain parentheses around the method name, | |
1095 the user name, the host name, and the file name parts. | |
1096 | |
1097 The second element METHOD is a number, saying which pair of | |
1098 parentheses matches the method name. The third element USER is | |
1099 similar, but for the user name. The fourth element HOST is similar, | |
1100 but for the host name. The fifth element FILE is for the file name. | |
1101 These numbers are passed directly to `match-string', which see. That | |
1102 means the opening parentheses are counted to identify the pair. | |
1103 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1104 See also `tramp-file-name-regexp'." |
45861 | 1105 :group 'tramp |
1106 :type '(list (regexp :tag "File name regexp") | |
1107 (integer :tag "Paren pair for method name") | |
1108 (integer :tag "Paren pair for user name ") | |
1109 (integer :tag "Paren pair for host name ") | |
1110 (integer :tag "Paren pair for file name "))) | |
1111 | |
1112 ;;;###autoload | |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1113 (defconst tramp-file-name-regexp-unified |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1114 "\\`/[^/:]+:" |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1115 "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
|
1116 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1117 Tramp. See `tramp-file-name-structure-unified' for more explanations.") |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1118 |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1119 ;;;###autoload |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1120 (defconst tramp-file-name-regexp-separate |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1121 "\\`/\\[.*\\]" |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1122 "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
|
1123 XEmacs uses a separate filename syntax for Tramp and EFS. |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1124 See `tramp-file-name-structure-separate' for more explanations.") |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1125 |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1126 ;;;###autoload |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1127 (defcustom tramp-file-name-regexp |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1128 (if tramp-unified-filenames |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1129 tramp-file-name-regexp-unified |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1130 tramp-file-name-regexp-separate) |
45861 | 1131 "*Regular expression matching file names handled by tramp. |
1132 This regexp should match tramp file names but no other file names. | |
1133 \(When tramp.el is loaded, this regular expression is prepended to | |
1134 `file-name-handler-alist', and that is searched sequentially. Thus, | |
1135 if the tramp entry appears rather early in the `file-name-handler-alist' | |
1136 and is a bit too general, then some files might be considered tramp | |
1137 files which are not really tramp files. | |
1138 | |
1139 Please note that the entry in `file-name-handler-alist' is made when | |
1140 this file (tramp.el) is loaded. This means that this variable must be set | |
1141 before loading tramp.el. Alternatively, `file-name-handler-alist' can be | |
1142 updated after changing this variable. | |
1143 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1144 Also see `tramp-file-name-structure'." |
45861 | 1145 :group 'tramp |
1146 :type 'regexp) | |
1147 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1148 ;;;###autoload |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1149 (defconst tramp-completion-file-name-regexp-unified |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1150 "^/$\\|^/[^/:][^/]*$" |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1151 "Value for `tramp-completion-file-name-regexp' for unified remoting. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1152 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1153 Tramp. See `tramp-file-name-structure-unified' for more explanations.") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1154 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1155 ;;;###autoload |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1156 (defconst tramp-completion-file-name-regexp-separate |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1157 "^/\\([[][^]]*\\)?$" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1158 "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
|
1159 XEmacs uses a separate filename syntax for Tramp and EFS. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1160 See `tramp-file-name-structure-separate' for more explanations.") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1161 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1162 ;;;###autoload |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1163 (defcustom tramp-completion-file-name-regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1164 (if tramp-unified-filenames |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1165 tramp-completion-file-name-regexp-unified |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1166 tramp-completion-file-name-regexp-separate) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1167 "*Regular expression matching file names handled by tramp completion. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1168 This regexp should match partial tramp file names only. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1169 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1170 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
|
1171 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
|
1172 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
|
1173 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
|
1174 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1175 Also see `tramp-file-name-structure'." |
45861 | 1176 :group 'tramp |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1177 :type 'regexp) |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1178 |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1179 (defcustom tramp-multi-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
|
1180 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1181 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1182 tramp-prefix-regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1183 "\\(" "\\(" tramp-method-regexp "\\)" "\\)?" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1184 "\\(" "\\(" tramp-postfix-multi-hop-regexp "%s" "\\)+" "\\)?" |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1185 tramp-postfix-host-regexp "\\(" tramp-localname-regexp "\\)") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1186 2 3 -1) |
45861 | 1187 "*Describes the file name structure of `multi' files. |
1188 Multi files allow you to contact a remote host in several hops. | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1189 This is a list of four elements (REGEXP METHOD HOP LOCALNAME). |
45861 | 1190 |
1191 The first element, REGEXP, gives a regular expression to match against | |
1192 the file name. In this regular expression, `%s' is replaced with the | |
1193 value of `tramp-multi-file-name-hop-structure'. (Note: in order to | |
1194 allow multiple hops, you normally want to use something like | |
1195 \"\\\\(\\\\(%s\\\\)+\\\\)\" in the regular expression. The outer pair | |
1196 of parentheses is used for the HOP element, see below.) | |
1197 | |
1198 All remaining elements are numbers. METHOD gives the number of the | |
1199 paren pair which matches the method name. HOP gives the number of the | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1200 paren pair which matches the hop sequence. LOCALNAME gives the number of |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1201 the paren pair which matches the localname (pathname) on the remote host. |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1202 |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1203 LOCALNAME can also be negative, which means to count from the end. Ie, a |
45861 | 1204 value of -1 means the last paren pair. |
1205 | |
1206 I think it would be good if the regexp matches the whole of the | |
1207 string, but I haven't actually tried what happens if it doesn't..." | |
1208 :group 'tramp | |
1209 :type '(list (regexp :tag "File name regexp") | |
1210 (integer :tag "Paren pair for method name") | |
1211 (integer :tag "Paren pair for hops") | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1212 (integer :tag "Paren pair to match localname"))) |
45861 | 1213 |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1214 (defcustom tramp-multi-file-name-hop-structure |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1215 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1216 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1217 "\\(" tramp-method-regexp "\\)" tramp-postfix-multi-method-regexp |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1218 "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1219 "\\(" tramp-host-with-port-regexp "\\)") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1220 1 2 3) |
45861 | 1221 "*Describes the structure of a hop in multi files. |
1222 This is a list of four elements (REGEXP METHOD USER HOST). First | |
1223 element REGEXP is used to match against the hop. Pair number METHOD | |
1224 matches the method of one hop, pair number USER matches the user of | |
1225 one hop, pair number HOST matches the host of one hop. | |
1226 | |
1227 This regular expression should match exactly all of one hop." | |
1228 :group 'tramp | |
1229 :type '(list (regexp :tag "Hop regexp") | |
1230 (integer :tag "Paren pair for method name") | |
1231 (integer :tag "Paren pair for user name") | |
1232 (integer :tag "Paren pair for host name"))) | |
1233 | |
1234 (defcustom tramp-make-multi-tramp-file-format | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1235 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1236 (concat tramp-prefix-format "%m") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1237 (concat tramp-postfix-multi-hop-format |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1238 "%m" tramp-postfix-multi-method-format |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1239 "%u" 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
|
1240 "%h") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1241 (concat tramp-postfix-host-format "%p")) |
45861 | 1242 "*Describes how to construct a `multi' file name. |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1243 This is a list of three elements PREFIX, HOP and LOCALNAME. |
45861 | 1244 |
1245 The first element PREFIX says how to construct the prefix, the second | |
1246 element HOP specifies what each hop looks like, and the final element | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1247 LOCALNAME says how to construct the localname (pathname). |
45861 | 1248 |
1249 In PREFIX, `%%' means `%' and `%m' means the method name. | |
1250 | |
1251 In HOP, `%%' means `%' and `%m', `%u', `%h' mean the hop method, hop | |
1252 user and hop host, respectively. | |
1253 | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1254 In LOCALNAME, `%%' means `%' and `%p' means the localname. |
45861 | 1255 |
1256 The resulting file name always contains one copy of PREFIX and one | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1257 copy of LOCALNAME, but there is one copy of HOP for each hop in the file |
45861 | 1258 name. |
1259 | |
1260 Note: the current implementation requires the prefix to contain the | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1261 method name, followed by all the hops, and the localname must come |
45861 | 1262 last." |
1263 :group 'tramp | |
1264 :type '(list string string string)) | |
1265 | |
1266 (defcustom tramp-terminal-type "dumb" | |
1267 "*Value of TERM environment variable for logging in to remote host. | |
1268 Because Tramp wants to parse the output of the remote shell, it is easily | |
1269 confused by ANSI color escape sequences and suchlike. Often, shell init | |
1270 files conditionalize this setup based on the TERM environment variable." | |
1271 :group 'tramp | |
1272 :type 'string) | |
1273 | |
1274 (defcustom tramp-completion-without-shell-p nil | |
1275 "*If nil, use shell wildcards for completion, else rely on Lisp only. | |
1276 Using shell wildcards for completions has the advantage that it can be | |
1277 fast even in large directories, but completion is always | |
1278 case-sensitive. Relying on Lisp only means that case-insensitive | |
1279 completion is possible (subject to the variable `completion-ignore-case'), | |
1280 but it might be slow on large directories." | |
1281 :group 'tramp | |
1282 :type 'boolean) | |
1283 | |
46752 | 1284 (defcustom tramp-actions-before-shell |
1285 '((tramp-password-prompt-regexp tramp-action-password) | |
1286 (tramp-login-prompt-regexp tramp-action-login) | |
1287 (shell-prompt-pattern tramp-action-succeed) | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
1288 (tramp-shell-prompt-pattern tramp-action-succeed) |
46752 | 1289 (tramp-wrong-passwd-regexp tramp-action-permission-denied) |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
1290 (tramp-yesno-prompt-regexp tramp-action-yesno) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1291 (tramp-yn-prompt-regexp tramp-action-yn) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1292 (tramp-terminal-prompt-regexp tramp-action-terminal) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1293 (tramp-process-alive-regexp tramp-action-process-alive)) |
46752 | 1294 "List of pattern/action pairs. |
1295 Whenever a pattern matches, the corresponding action is performed. | |
1296 Each item looks like (PATTERN ACTION). | |
1297 | |
1298 The PATTERN should be a symbol, a variable. The value of this | |
1299 variable gives the regular expression to search for. Note that the | |
1300 regexp must match at the end of the buffer, \"\\'\" is implicitly | |
1301 appended to it. | |
1302 | |
1303 The ACTION should also be a symbol, but a function. When the | |
1304 corresponding PATTERN matches, the ACTION function is called." | |
1305 :group 'tramp | |
1306 :type '(repeat (list variable function))) | |
1307 | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1308 (defcustom tramp-actions-copy-out-of-band |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1309 '((tramp-password-prompt-regexp tramp-action-password) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1310 (tramp-wrong-passwd-regexp tramp-action-permission-denied) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1311 (tramp-process-alive-regexp tramp-action-out-of-band)) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1312 "List of pattern/action pairs. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1313 This list is used for copying/renaming with out-of-band methods. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1314 See `tramp-actions-before-shell' for more info." |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1315 :group 'tramp |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1316 :type '(repeat (list variable function))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1317 |
46752 | 1318 (defcustom tramp-multi-actions |
1319 '((tramp-password-prompt-regexp tramp-multi-action-password) | |
1320 (tramp-login-prompt-regexp tramp-multi-action-login) | |
1321 (shell-prompt-pattern tramp-multi-action-succeed) | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
1322 (tramp-shell-prompt-pattern tramp-multi-action-succeed) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1323 (tramp-wrong-passwd-regexp tramp-multi-action-permission-denied) |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1324 (tramp-process-alive-regexp tramp-multi-action-process-alive)) |
46752 | 1325 "List of pattern/action pairs. |
1326 This list is used for each hop in multi-hop connections. | |
1327 See `tramp-actions-before-shell' for more info." | |
1328 :group 'tramp | |
1329 :type '(repeat (list variable function))) | |
1330 | |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1331 (defcustom tramp-initial-commands |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1332 '("unset HISTORY" |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1333 "unset correct" |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1334 "unset autocorrect") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1335 "List of commands to send to the first remote shell that we see. |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1336 These commands will be sent to any shell, and thus they should be |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1337 designed to work in such circumstances. Also, restrict the commands |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1338 to the bare necessity for getting the remote shell into a state |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1339 where it is possible to execute the Bourne-ish shell. |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1340 |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1341 At the moment, the command to execute the Bourne-ish shell uses strange |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1342 quoting which `tcsh' tries to correct, so we send the command \"unset |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1343 autocorrect\" to the remote host." |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1344 :group 'tramp |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1345 :type '(repeat string)) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1346 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1347 ;; Chunked sending kluge. We set this to 500 for black-listed constellations |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1348 ;; known to have a bug in `process-send-string'; some ssh connections appear |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1349 ;; to drop bytes when data is sent too quickly. |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1350 (defcustom tramp-chunksize |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1351 (when (and (not (featurep 'xemacs)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1352 (memq system-type '(hpux))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1353 500) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1354 "*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
|
1355 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
|
1356 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
|
1357 checked via the following code: |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1358 |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1359 (with-temp-buffer |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1360 (let ((bytes 1000) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1361 (proc (start-process (buffer-name) (current-buffer) \"wc\" \"-c\"))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1362 (process-send-string proc (make-string bytes ?x)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1363 (process-send-eof proc) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1364 (process-send-eof proc) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1365 (accept-process-output proc 1) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1366 (goto-char (point-min)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1367 (re-search-forward \"\\\\w+\") |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1368 (message \"Bytes sent: %s\\tBytes received: %s\" bytes (match-string 0)))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1369 |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1370 In the Emacs normally running Tramp, evaluate the above code. |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1371 You can do this, for example, by pasting it into the `*scratch*' |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1372 buffer and then hitting C-j with the cursor after the last |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1373 closing parenthesis. |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1374 |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1375 If your Emacs is buggy, the sent and received numbers will be |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1376 different. In that case, you'll want to set this variable to |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1377 some number. For those people who have needed it, the value 500 |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1378 seems to have worked well. There is no way to predict what value |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1379 you need; maybe you could just experiment a bit. |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1380 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1381 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
|
1382 this variable to be set as well." |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1383 :group 'tramp |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
1384 :type '(choice (const nil) integer)) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1385 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1386 ;; 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
|
1387 ;; 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
|
1388 ;; 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
|
1389 ;; 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
|
1390 (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
|
1391 "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
|
1392 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
|
1393 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
|
1394 :group 'tramp |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1395 :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
|
1396 |
45861 | 1397 ;;; Internal Variables: |
1398 | |
1399 (defvar tramp-buffer-file-attributes nil | |
1400 "Holds the `ls -ild' output for the current buffer. | |
1401 This variable is local to each buffer. It is not used if the remote | |
1402 machine groks Perl. If it is used, it's used as an emulation for | |
1403 the visited file modtime.") | |
1404 (make-variable-buffer-local 'tramp-buffer-file-attributes) | |
1405 | |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1406 (defvar tramp-md5-function |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1407 (cond ((and (require 'md5) (fboundp 'md5)) 'md5) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1408 ((fboundp 'md5-encode) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1409 (lambda (x) (base64-encode-string |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1410 (funcall (symbol-function 'md5-encode) x)))) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1411 (t (error "Coulnd't find an `md5' function"))) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1412 "Function to call for running the MD5 algorithm.") |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1413 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1414 (defvar tramp-end-of-output |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1415 (concat "///" |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1416 (funcall tramp-md5-function |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1417 (concat |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1418 (prin1-to-string process-environment) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1419 (current-time-string) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1420 ;; (prin1-to-string |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1421 ;; (if (fboundp '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
|
1422 ;; (funcall '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
|
1423 ;; (or (getenv "HOME") |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1424 ;; (tramp-temporary-file-directory))) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1425 ;; (mapcar |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1426 ;; (lambda (x) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1427 ;; (cons x (file-attributes x))) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1428 ;; (directory-files (or (getenv "HOME") |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1429 ;; (tramp-temporary-file-directory)) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1430 ;; t)))) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1431 ))) |
45861 | 1432 "String used to recognize end of output.") |
1433 | |
1434 (defvar tramp-connection-function nil | |
1435 "This internal variable holds a parameter for `tramp-methods'. | |
1436 In the connection buffer, this variable has the value of the like-named | |
1437 method parameter, as specified in `tramp-methods' (which see).") | |
1438 | |
1439 (defvar tramp-remote-sh nil | |
1440 "This internal variable holds a parameter for `tramp-methods'. | |
1441 In the connection buffer, this variable has the value of the like-named | |
1442 method parameter, as specified in `tramp-methods' (which see).") | |
1443 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
1444 (defvar tramp-login-program nil |
45861 | 1445 "This internal variable holds a parameter for `tramp-methods'. |
1446 In the connection buffer, this variable has the value of the like-named | |
1447 method parameter, as specified in `tramp-methods' (which see).") | |
1448 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
1449 (defvar tramp-login-args nil |
45861 | 1450 "This internal variable holds a parameter for `tramp-methods'. |
1451 In the connection buffer, this variable has the value of the like-named | |
1452 method parameter, as specified in `tramp-methods' (which see).") | |
1453 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
1454 (defvar tramp-copy-program nil |
45861 | 1455 "This internal variable holds a parameter for `tramp-methods'. |
1456 In the connection buffer, this variable has the value of the like-named | |
1457 method parameter, as specified in `tramp-methods' (which see).") | |
1458 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
1459 (defvar tramp-copy-args nil |
45861 | 1460 "This internal variable holds a parameter for `tramp-methods'. |
1461 In the connection buffer, this variable has the value of the like-named | |
1462 method parameter, as specified in `tramp-methods' (which see).") | |
1463 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
1464 (defvar tramp-copy-keep-date-arg nil |
45861 | 1465 "This internal variable holds a parameter for `tramp-methods'. |
1466 In the connection buffer, this variable has the value of the like-named | |
1467 method parameter, as specified in `tramp-methods' (which see).") | |
1468 | |
1469 (defvar tramp-encoding-command nil | |
1470 "This internal variable holds a parameter for `tramp-methods'. | |
1471 In the connection buffer, this variable has the value of the like-named | |
1472 method parameter, as specified in `tramp-methods' (which see).") | |
1473 | |
1474 (defvar tramp-decoding-command nil | |
1475 "This internal variable holds a parameter for `tramp-methods'. | |
1476 In the connection buffer, this variable has the value of the like-named | |
1477 method parameter, as specified in `tramp-methods' (which see).") | |
1478 | |
1479 (defvar tramp-encoding-function nil | |
1480 "This internal variable holds a parameter for `tramp-methods'. | |
1481 In the connection buffer, this variable has the value of the like-named | |
1482 method parameter, as specified in `tramp-methods' (which see).") | |
1483 | |
1484 (defvar tramp-decoding-function nil | |
1485 "This internal variable holds a parameter for `tramp-methods'. | |
1486 In the connection buffer, this variable has the value of the like-named | |
1487 method parameter, as specified in `tramp-methods' (which see).") | |
1488 | |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1489 (defvar tramp-password-end-of-line nil |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1490 "This internal variable holds a parameter for `tramp-methods'. |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1491 In the connection buffer, this variable has the value of the like-named |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1492 method parameter, as specified in `tramp-methods' (which see).") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1493 |
45861 | 1494 ;; CCC `local in each buffer'? |
1495 (defvar tramp-ls-command nil | |
1496 "This command is used to get a long listing with numeric user and group ids. | |
1497 This variable is automatically made buffer-local to each rsh process buffer | |
1498 upon opening the connection.") | |
1499 | |
1500 (defvar tramp-current-multi-method nil | |
1501 "Name of `multi' connection method for this *tramp* buffer, or nil if not multi. | |
1502 This variable is automatically made buffer-local to each rsh process buffer | |
1503 upon opening the connection.") | |
1504 | |
1505 (defvar tramp-current-method nil | |
1506 "Connection method for this *tramp* buffer. | |
1507 This variable is automatically made buffer-local to each rsh process buffer | |
1508 upon opening the connection.") | |
1509 | |
1510 (defvar tramp-current-user nil | |
1511 "Remote login name for this *tramp* buffer. | |
1512 This variable is automatically made buffer-local to each rsh process buffer | |
1513 upon opening the connection.") | |
1514 | |
1515 (defvar tramp-current-host nil | |
1516 "Remote host for this *tramp* buffer. | |
1517 This variable is automatically made buffer-local to each rsh process buffer | |
1518 upon opening the connection.") | |
1519 | |
1520 (defvar tramp-test-groks-nt nil | |
1521 "Whether the `test' command groks the `-nt' switch. | |
1522 \(`test A -nt B' tests if file A is newer than file B.) | |
1523 This variable is automatically made buffer-local to each rsh process buffer | |
1524 upon opening the connection.") | |
1525 | |
1526 (defvar tramp-file-exists-command nil | |
1527 "Command to use for checking if a file exists. | |
1528 This variable is automatically made buffer-local to each rsh process buffer | |
1529 upon opening the connection.") | |
1530 | |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1531 (defconst tramp-uudecode "\ |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1532 tramp_uudecode () { |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1533 \(echo begin 600 /tmp/tramp.$$; tail +2) | uudecode |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1534 cat /tmp/tramp.$$ |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1535 rm -f /tmp/tramp.$$ |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1536 }" |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1537 "Shell function to implement `uudecode' to standard output. |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1538 Many systems support `uudecode -o -' for this or `uudecode -p', but |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1539 some systems don't, and for them we have this shell function.") |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1540 |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1541 ;; Perl script to implement `file-attributes' in a Lisp `read'able |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1542 ;; output. If you are hacking on this, note that you get *no* output |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1543 ;; unless this spits out a complete line, including the '\n' at the |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1544 ;; end. |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1545 ;; The device number is returned as "-1", because there will be a virtual |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1546 ;; device number set in `tramp-handle-file-attributes' |
46808
cf225aed7a75
Version 2.0.11 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46802
diff
changeset
|
1547 (defconst tramp-perl-file-attributes "\ |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1548 \($f, $n) = @ARGV; |
45861 | 1549 @s = lstat($f); |
1550 if (($s[2] & 0170000) == 0120000) { $l = readlink($f); $l = \"\\\"$l\\\"\"; } | |
1551 elsif (($s[2] & 0170000) == 040000) { $l = \"t\"; } | |
1552 else { $l = \"nil\" }; | |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1553 $u = ($n eq \"nil\") ? $s[4] : getpwuid($s[4]); |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1554 $g = ($n eq \"nil\") ? $s[5] : getgrgid($s[5]); |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1555 printf(\"(%s %u %s %s (%u %u) (%u %u) (%u %u) %u %u t (%u . %u) -1)\\n\", |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1556 $l, $s[3], $u, $g, $s[8] >> 16 & 0xffff, $s[8] & 0xffff, |
45861 | 1557 $s[9] >> 16 & 0xffff, $s[9] & 0xffff, $s[10] >> 16 & 0xffff, $s[10] & 0xffff, |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1558 $s[7], $s[2], $s[1] >> 16 & 0xffff, $s[1] & 0xffff);" |
45861 | 1559 "Perl script to produce output suitable for use with `file-attributes' |
1560 on the remote file system.") | |
1561 | |
46752 | 1562 ;; ;; These two use uu encoding. |
1563 ;; (defvar tramp-perl-encode "%s -e'\ | |
1564 ;; print qq(begin 644 xxx\n); | |
1565 ;; my $s = q(); | |
1566 ;; my $res = q(); | |
1567 ;; while (read(STDIN, $s, 45)) { | |
1568 ;; print pack(q(u), $s); | |
1569 ;; } | |
1570 ;; print qq(`\n); | |
1571 ;; print qq(end\n); | |
1572 ;; '" | |
1573 ;; "Perl program to use for encoding a file. | |
1574 ;; Escape sequence %s is replaced with name of Perl binary.") | |
1575 | |
1576 ;; (defvar tramp-perl-decode "%s -ne ' | |
1577 ;; print unpack q(u), $_; | |
1578 ;; '" | |
1579 ;; "Perl program to use for decoding a file. | |
1580 ;; Escape sequence %s is replaced with name of Perl binary.") | |
1581 | |
1582 ;; These two use base64 encoding. | |
46790 | 1583 (defvar tramp-perl-encode-with-module |
1584 "perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)'" | |
1585 "Perl program to use for encoding a file. | |
1586 Escape sequence %s is replaced with name of Perl binary. | |
46801
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
1587 This string is passed to `format', so percent characters need to be doubled. |
46790 | 1588 This implementation requires the MIME::Base64 Perl module to be installed |
1589 on the remote host.") | |
1590 | |
1591 (defvar tramp-perl-decode-with-module | |
1592 "perl -MMIME::Base64 -0777 -ne 'print decode_base64($_)'" | |
1593 "Perl program to use for decoding a file. | |
1594 Escape sequence %s is replaced with name of Perl binary. | |
46801
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
1595 This string is passed to `format', so percent characters need to be doubled. |
46790 | 1596 This implementation requires the MIME::Base64 Perl module to be installed |
1597 on the remote host.") | |
1598 | |
46752 | 1599 (defvar tramp-perl-encode |
46790 | 1600 "%s -e ' |
1601 # This script contributed by Juanma Barranquero <lektu@terra.es>. | |
1602 # Copyright (C) 2002 Free Software Foundation, Inc. | |
1603 use strict; | |
1604 | |
46795 | 1605 my %%trans = do { |
46790 | 1606 my $i = 0; |
1607 map {(substr(unpack(q(B8), chr $i++), 2, 6), $_)} | |
1608 split //, q(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/); | |
1609 }; | |
1610 | |
46797 | 1611 binmode(\\*STDIN); |
46790 | 1612 |
1613 # We read in chunks of 54 bytes, to generate output lines | |
1614 # of 72 chars (plus end of line) | |
46797 | 1615 $/ = \\54; |
46790 | 1616 |
1617 while (my $data = <STDIN>) { | |
1618 my $pad = q(); | |
1619 | |
1620 # Only for the last chunk, and only if did not fill the last three-byte packet | |
1621 if (eof) { | |
46795 | 1622 my $mod = length($data) %% 3; |
46790 | 1623 $pad = q(=) x (3 - $mod) if $mod; |
1624 } | |
1625 | |
1626 # Not the fastest method, but it is simple: unpack to binary string, split | |
1627 # by groups of 6 bits and convert back from binary to byte; then map into | |
1628 # the translation table | |
1629 print | |
1630 join q(), | |
1631 map($trans{$_}, | |
1632 (substr(unpack(q(B*), $data) . q(00000), 0, 432) =~ /....../g)), | |
1633 $pad, | |
46797 | 1634 qq(\\n); |
46790 | 1635 } |
1636 '" | |
46752 | 1637 "Perl program to use for encoding a file. |
46795 | 1638 Escape sequence %s is replaced with name of Perl binary. |
46799
c9fab7d532d1
(tramp-perl-encode, tramp-perl-decode): Doc fix.
Andreas Schwab <schwab@suse.de>
parents:
46797
diff
changeset
|
1639 This string is passed to `format', so percent characters need to be doubled.") |
46752 | 1640 |
1641 (defvar tramp-perl-decode | |
46790 | 1642 "%s -e ' |
1643 # This script contributed by Juanma Barranquero <lektu@terra.es>. | |
1644 # Copyright (C) 2002 Free Software Foundation, Inc. | |
1645 use strict; | |
1646 | |
46795 | 1647 my %%trans = do { |
46790 | 1648 my $i = 0; |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1649 map {($_, substr(unpack(q(B8), chr $i++), 2, 6))} |
46790 | 1650 split //, q(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/) |
1651 }; | |
1652 | |
46795 | 1653 my %%bytes = map {(unpack(q(B8), chr $_), chr $_)} 0 .. 255; |
46790 | 1654 |
46797 | 1655 binmode(\\*STDOUT); |
46790 | 1656 |
1657 # We are going to accumulate into $pending to accept any line length | |
1658 # (we do not check they are <= 76 chars as the RFC says) | |
1659 my $pending = q(); | |
1660 | |
1661 while (my $data = <STDIN>) { | |
1662 chomp $data; | |
1663 | |
1664 # If we find one or two =, we have reached the end and | |
1665 # any following data is to be discarded | |
1666 my $finished = $data =~ s/(==?).*/$1/; | |
1667 $pending .= $data; | |
1668 | |
1669 my $len = length($pending); | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1670 my $chunk = substr($pending, 0, $len & ~3); |
46790 | 1671 |
1672 # Easy method: translate from chars to (pregenerated) six-bit packets, join, | |
1673 # split in 8-bit chunks and convert back to char. | |
1674 print join q(), | |
1675 map $bytes{$_}, | |
1676 ((join q(), map {$trans{$_} || q()} split //, $chunk) =~ /......../g); | |
1677 | |
1678 last if $finished; | |
1679 } | |
1680 '" | |
46752 | 1681 "Perl program to use for decoding a file. |
46795 | 1682 Escape sequence %s is replaced with name of Perl binary. |
46799
c9fab7d532d1
(tramp-perl-encode, tramp-perl-decode): Doc fix.
Andreas Schwab <schwab@suse.de>
parents:
46797
diff
changeset
|
1683 This string is passed to `format', so percent characters need to be doubled.") |
45861 | 1684 |
1685 ; These values conform to `file-attributes' from XEmacs 21.2. | |
1686 ; GNU Emacs and other tools not checked. | |
1687 (defconst tramp-file-mode-type-map '((0 . "-") ; Normal file (SVID-v2 and XPG2) | |
1688 (1 . "p") ; fifo | |
1689 (2 . "c") ; character device | |
1690 (3 . "m") ; multiplexed character device (v7) | |
1691 (4 . "d") ; directory | |
1692 (5 . "?") ; Named special file (XENIX) | |
1693 (6 . "b") ; block device | |
1694 (7 . "?") ; multiplexed block device (v7) | |
1695 (8 . "-") ; regular file | |
1696 (9 . "n") ; network special file (HP-UX) | |
1697 (10 . "l") ; symlink | |
1698 (11 . "?") ; ACL shadow inode (Solaris, not userspace) | |
1699 (12 . "s") ; socket | |
1700 (13 . "D") ; door special (Solaris) | |
1701 (14 . "w")) ; whiteout (BSD) | |
1702 "A list of file types returned from the `stat' system call. | |
1703 This is used to map a mode number to a permission string.") | |
1704 | |
1705 (defvar tramp-dos-coding-system | |
1706 (if (and (fboundp 'coding-system-p) | |
1707 (funcall 'coding-system-p '(dos))) | |
1708 'dos | |
1709 'undecided-dos) | |
1710 "Some Emacsen know the `dos' coding system, others need `undecided-dos'.") | |
1711 | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1712 (defvar tramp-last-cmd nil |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1713 "Internal Tramp variable recording the last command sent. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1714 This variable is buffer-local in every buffer.") |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1715 (make-variable-buffer-local 'tramp-last-cmd) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1716 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1717 (defvar tramp-process-echoes nil |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1718 "Whether to process echoes from the remote shell.") |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1719 |
46752 | 1720 (defvar tramp-last-cmd-time nil |
1721 "Internal Tramp variable recording the time when the last cmd was sent. | |
1722 This variable is buffer-local in every buffer.") | |
1723 (make-variable-buffer-local 'tramp-last-cmd-time) | |
45861 | 1724 |
47205
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
1725 ;; This variable does not have the right value in XEmacs. What should |
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
1726 ;; I use instead of find-operation-coding-system in XEmacs? |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
1727 (defvar tramp-feature-write-region-fix |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1728 (when (fboundp 'find-operation-coding-system) |
47205
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
1729 (let ((file-coding-system-alist '(("test" emacs-mule)))) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1730 (funcall (symbol-function 'find-operation-coding-system) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1731 'write-region 0 0 "" nil "test"))) |
47205
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
1732 "Internal variable to say if `write-region' chooses the right coding. |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
1733 Older versions of Emacs chose the coding system for `write-region' based |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
1734 on the FILENAME argument, even if VISIT was a string.") |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
1735 |
45861 | 1736 ;; New handlers should be added here. The following operations can be |
1737 ;; handled using the normal primitives: file-name-as-directory, | |
1738 ;; file-name-directory, file-name-nondirectory, | |
1739 ;; file-name-sans-versions, get-file-buffer. | |
1740 (defconst tramp-file-name-handler-alist | |
1741 '( | |
1742 (load . tramp-handle-load) | |
1743 (make-symbolic-link . tramp-handle-make-symbolic-link) | |
1744 (file-name-directory . tramp-handle-file-name-directory) | |
1745 (file-name-nondirectory . tramp-handle-file-name-nondirectory) | |
1746 (file-truename . tramp-handle-file-truename) | |
1747 (file-exists-p . tramp-handle-file-exists-p) | |
1748 (file-directory-p . tramp-handle-file-directory-p) | |
1749 (file-executable-p . tramp-handle-file-executable-p) | |
1750 (file-accessible-directory-p . tramp-handle-file-accessible-directory-p) | |
1751 (file-readable-p . tramp-handle-file-readable-p) | |
1752 (file-regular-p . tramp-handle-file-regular-p) | |
1753 (file-symlink-p . tramp-handle-file-symlink-p) | |
1754 (file-writable-p . tramp-handle-file-writable-p) | |
1755 (file-ownership-preserved-p . tramp-handle-file-ownership-preserved-p) | |
1756 (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) | |
1757 (file-attributes . tramp-handle-file-attributes) | |
1758 (file-modes . tramp-handle-file-modes) | |
1759 (file-directory-files . tramp-handle-file-directory-files) | |
1760 (directory-files . tramp-handle-directory-files) | |
1761 (file-name-all-completions . tramp-handle-file-name-all-completions) | |
1762 (file-name-completion . tramp-handle-file-name-completion) | |
1763 (add-name-to-file . tramp-handle-add-name-to-file) | |
1764 (copy-file . tramp-handle-copy-file) | |
1765 (rename-file . tramp-handle-rename-file) | |
1766 (set-file-modes . tramp-handle-set-file-modes) | |
1767 (make-directory . tramp-handle-make-directory) | |
1768 (delete-directory . tramp-handle-delete-directory) | |
1769 (delete-file . tramp-handle-delete-file) | |
1770 (directory-file-name . tramp-handle-directory-file-name) | |
1771 (shell-command . tramp-handle-shell-command) | |
1772 (insert-directory . tramp-handle-insert-directory) | |
1773 (expand-file-name . tramp-handle-expand-file-name) | |
1774 (file-local-copy . tramp-handle-file-local-copy) | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1775 (file-remote-p . tramp-handle-file-remote-p) |
45861 | 1776 (insert-file-contents . tramp-handle-insert-file-contents) |
1777 (write-region . tramp-handle-write-region) | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1778 (find-backup-file-name . tramp-handle-find-backup-file-name) |
45861 | 1779 (unhandled-file-name-directory . tramp-handle-unhandled-file-name-directory) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1780 (dired-compress-file . tramp-handle-dired-compress-file) |
45861 | 1781 (dired-call-process . tramp-handle-dired-call-process) |
1782 (dired-recursive-delete-directory | |
1783 . tramp-handle-dired-recursive-delete-directory) | |
1784 (set-visited-file-modtime . tramp-handle-set-visited-file-modtime) | |
1785 (verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime)) | |
1786 "Alist of handler functions. | |
1787 Operations not mentioned here will be handled by the normal Emacs functions.") | |
1788 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1789 ;; Handlers for partial tramp file names. For GNU Emacs just |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1790 ;; `file-name-all-completions' is needed. The other ones are necessary |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1791 ;; for XEmacs. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1792 (defconst tramp-completion-file-name-handler-alist |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1793 '( |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1794 (file-name-directory . tramp-completion-handle-file-name-directory) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1795 (file-name-nondirectory . tramp-completion-handle-file-name-nondirectory) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1796 (file-exists-p . tramp-completion-handle-file-exists-p) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1797 (file-name-all-completions . tramp-completion-handle-file-name-all-completions) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1798 (file-name-completion . tramp-completion-handle-file-name-completion) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1799 (expand-file-name . tramp-completion-handle-expand-file-name)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1800 "Alist of completion handler functions. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1801 Used for file names matching `tramp-file-name-regexp'. Operations not |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1802 mentioned here will be handled by `tramp-file-name-handler-alist' or the |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1803 normal Emacs functions.") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1804 |
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 ;; Handlers for foreign methods, like FTP or SMB, shall be plugged here. |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
1806 (defvar tramp-foreign-file-name-handler-alist |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
1807 ;; (identity . tramp-sh-file-name-handler) should always be the last |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
1808 ;; entry, since `identity' always matches. |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
1809 '((identity . tramp-sh-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
|
1810 "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
|
1811 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
|
1812 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
|
1813 |
45861 | 1814 ;;; Internal functions which must come first. |
1815 | |
1816 (defsubst tramp-message (level fmt-string &rest args) | |
1817 "Emit a message depending on verbosity level. | |
1818 First arg LEVEL says to be quiet if `tramp-verbose' is less than LEVEL. The | |
1819 message is emitted only if `tramp-verbose' is greater than or equal to LEVEL. | |
1820 Calls function `message' with FMT-STRING as control string and the remaining | |
1821 ARGS to actually emit the message (if applicable). | |
1822 | |
1823 This function expects to be called from the tramp buffer only!" | |
1824 (when (<= level tramp-verbose) | |
1825 (apply #'message (concat "tramp: " fmt-string) args) | |
1826 (when tramp-debug-buffer | |
1827 (save-excursion | |
1828 (set-buffer | |
1829 (tramp-get-debug-buffer | |
1830 tramp-current-multi-method tramp-current-method | |
1831 tramp-current-user tramp-current-host)) | |
1832 (goto-char (point-max)) | |
1833 (tramp-insert-with-face | |
1834 'italic | |
1835 (concat "# " (apply #'format fmt-string args) "\n")))))) | |
1836 | |
1837 (defun tramp-message-for-buffer | |
1838 (multi-method method user host level fmt-string &rest args) | |
1839 "Like `tramp-message' but temporarily switches to the tramp buffer. | |
1840 First three args METHOD, USER, and HOST identify the tramp buffer to use, | |
1841 remaining args passed to `tramp-message'." | |
1842 (save-excursion | |
1843 (set-buffer (tramp-get-buffer multi-method method user host)) | |
1844 (apply 'tramp-message level fmt-string args))) | |
1845 | |
1846 (defsubst tramp-line-end-position nil | |
1847 "Return point at end of line. | |
1848 Calls `line-end-position' or `point-at-eol' if defined, else | |
1849 own implementation." | |
1850 (cond | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1851 ((fboundp 'line-end-position) (funcall (symbol-function 'line-end-position))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1852 ((fboundp 'point-at-eol) (funcall (symbol-function 'point-at-eol))) |
45861 | 1853 (t (save-excursion (end-of-line) (point))))) |
1854 | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1855 (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
|
1856 "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
|
1857 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1858 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
|
1859 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
|
1860 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
|
1861 holding the components. For example, if VAR is the symbol `foo', then |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1862 `foo' will be bound to the whole structure, `foo-multi-method' will |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1863 be bound to the multi-method component, and so on for `foo-method', |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1864 `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
|
1865 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1866 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
|
1867 `progn'). |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1868 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1869 If VAR is nil, then we bind `v' to the structure and `multi-method', |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1870 `method', `user', `host', `localname' to the components." |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1871 `(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
|
1872 (,(if var (intern (concat (symbol-name var) "-multi-method")) 'multi-method) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1873 (tramp-file-name-multi-method ,(or var 'v))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1874 (,(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
|
1875 (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
|
1876 (,(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
|
1877 (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
|
1878 (,(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
|
1879 (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
|
1880 (,(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
|
1881 (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
|
1882 ,@body)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1883 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1884 (put 'with-parsed-tramp-file-name 'lisp-indent-function 2) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1885 ;; To be activated for debugging containing this macro |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1886 (def-edebug-spec with-parsed-tramp-file-name t) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1887 |
55864 | 1888 (defmacro tramp-let-maybe (variable value &rest body) |
1889 "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete. | |
1890 BODY is executed whether or not the variable is obsolete. | |
1891 The intent is to protect against `obsolete variable' warnings." | |
1892 `(if (get ',variable 'byte-obsolete-variable) | |
1893 (progn ,@body) | |
1894 (let ((,variable ,value)) | |
1895 ,@body))) | |
1896 (put 'tramp-let-maybe 'lisp-indent-function 2) | |
1897 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1898 ;;; Config Manipulation Functions: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1899 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1900 (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
|
1901 "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
|
1902 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
|
1903 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
|
1904 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
|
1905 Predefined FUNCTIONs are `tramp-parse-rhosts', `tramp-parse-shosts', |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1906 `tramp-parse-sconfig',`tramp-parse-hosts', `tramp-parse-passwd', |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1907 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
|
1908 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1909 Example: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1910 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1911 (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
|
1912 \"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
|
1913 '((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
|
1914 (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
|
1915 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1916 (let ((r function-list) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1917 (v function-list)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1918 (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
|
1919 (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
|
1920 tramp-completion-function-alist)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1921 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1922 (while v |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1923 ;; Remove double entries |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1924 (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
|
1925 (setcdr v (delete (car v) (cdr v)))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1926 ;; Check for function and file |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1927 (unless (and (functionp (nth 0 (car v))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1928 (file-exists-p (nth 1 (car v)))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1929 (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
|
1930 (setq v (cdr v))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1931 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1932 (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
|
1933 (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
|
1934 (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
|
1935 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1936 (defun tramp-get-completion-function (method) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1937 "Returns 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
|
1938 For definition of that list see `tramp-set-completion-function'." |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1939 (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
|
1940 |
45861 | 1941 ;;; File Name Handler Functions: |
1942 | |
1943 (defun tramp-handle-make-symbolic-link | |
1944 (filename linkname &optional ok-if-already-exists) | |
1945 "Like `make-symbolic-link' for tramp files. | |
46307
a2d047d50fb9
(tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46306
diff
changeset
|
1946 If LINKNAME is a non-Tramp file, it is used verbatim as the target of |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1947 the symlink. If LINKNAME is a Tramp file, only the localname component is |
46307
a2d047d50fb9
(tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46306
diff
changeset
|
1948 used as the target of the symlink. |
a2d047d50fb9
(tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46306
diff
changeset
|
1949 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1950 If LINKNAME is a Tramp file and the localname component is relative, then |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1951 it is expanded first, before the localname component is taken. Note that |
46307
a2d047d50fb9
(tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46306
diff
changeset
|
1952 this can give surprising results if the user/host for the source and |
a2d047d50fb9
(tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46306
diff
changeset
|
1953 target of the symlink differ." |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1954 (with-parsed-tramp-file-name linkname l |
46048
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
1955 (let ((ln (tramp-get-remote-ln l-multi-method l-method l-user l-host)) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1956 (cwd (file-name-directory l-localname))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1957 (unless ln |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1958 (signal 'file-error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1959 (list "Making a symbolic link." |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1960 "ln(1) does not exist on the remote host."))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1961 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1962 ;; Do the 'confirm if exists' thing. |
46307
a2d047d50fb9
(tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46306
diff
changeset
|
1963 (when (file-exists-p linkname) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1964 ;; What to do? |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1965 (if (or (null ok-if-already-exists) ; not allowed to exist |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1966 (and (numberp ok-if-already-exists) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1967 (not (yes-or-no-p |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1968 (format |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1969 "File %s already exists; make it a link anyway? " |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1970 l-localname))))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1971 (signal 'file-already-exists (list "File already exists" l-localname)) |
46307
a2d047d50fb9
(tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46306
diff
changeset
|
1972 (delete-file linkname))) |
a2d047d50fb9
(tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46306
diff
changeset
|
1973 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1974 ;; If FILENAME is a Tramp name, use just the localname component. |
46307
a2d047d50fb9
(tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46306
diff
changeset
|
1975 (when (tramp-tramp-file-p filename) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1976 (setq filename (tramp-file-name-localname |
46307
a2d047d50fb9
(tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46306
diff
changeset
|
1977 (tramp-dissect-file-name |
a2d047d50fb9
(tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46306
diff
changeset
|
1978 (expand-file-name filename))))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1979 |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1980 ;; Right, they are on the same host, regardless of user, method, etc. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1981 ;; We now make the link on the remote machine. This will occur as the user |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1982 ;; that FILENAME belongs to. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1983 (zerop |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1984 (tramp-send-command-and-check |
46048
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
1985 l-multi-method l-method l-user l-host |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1986 (format "cd %s && %s -sf %s %s" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1987 cwd ln |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1988 filename |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1989 l-localname) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1990 t))))) |
45861 | 1991 |
1992 | |
1993 (defun tramp-handle-load (file &optional noerror nomessage nosuffix must-suffix) | |
1994 "Like `load' for tramp files. Not implemented!" | |
1995 (unless (file-name-absolute-p file) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1996 (error "Tramp cannot `load' files without absolute file name")) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1997 (with-parsed-tramp-file-name file nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1998 (unless nosuffix |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1999 (cond ((file-exists-p (concat file ".elc")) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2000 (setq file (concat file ".elc"))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2001 ((file-exists-p (concat file ".el")) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2002 (setq file (concat file ".el"))))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2003 (when must-suffix |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2004 ;; The first condition is always true for absolute file names. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2005 ;; Included for safety's sake. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2006 (unless (or (file-name-directory file) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2007 (string-match "\\.elc?\\'" file)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2008 (error "File `%s' does not include a `.el' or `.elc' suffix" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2009 file))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2010 (unless noerror |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2011 (when (not (file-exists-p file)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2012 (error "Cannot load nonexistant file `%s'" file))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2013 (if (not (file-exists-p file)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2014 nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2015 (unless nomessage |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2016 (message "Loading %s..." file)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2017 (let ((local-copy (file-local-copy file))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2018 ;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2019 (load local-copy noerror t t) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2020 (delete-file local-copy)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2021 (unless nomessage |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2022 (message "Loading %s...done" file)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2023 t))) |
45861 | 2024 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2025 ;; Localname manipulation functions that grok TRAMP localnames... |
45861 | 2026 (defun tramp-handle-file-name-directory (file) |
2027 "Like `file-name-directory' but aware of TRAMP files." | |
2028 ;; everything except the last filename thing is the directory | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2029 (with-parsed-tramp-file-name file nil |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
2030 ;; For the following condition, two possibilities should be tried: |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2031 ;; (1) (string= localname "") |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2032 ;; (2) (or (string= localname "") (string= localname "/")) |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
2033 ;; The second variant fails when completing a "/" directory on |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
2034 ;; the remote host, that is a filename which looks like |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
2035 ;; "/user@host:/". But maybe wildcards fail with the first variant. |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
2036 ;; We should do some investigation. |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2037 (if (string= localname "") |
45861 | 2038 ;; For a filename like "/[foo]", we return "/". The `else' |
2039 ;; case would return "/[foo]" unchanged. But if we do that, | |
2040 ;; then `file-expand-wildcards' ceases to work. It's not | |
2041 ;; quite clear to me what's the intuition that tells that this | |
2042 ;; behavior is the right behavior, but oh, well. | |
2043 "/" | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2044 ;; run the command on the localname portion only |
45861 | 2045 ;; CCC: This should take into account the remote machine type, no? |
2046 ;; --daniel <daniel@danann.net> | |
2047 (tramp-make-tramp-file-name multi-method method user host | |
2048 ;; This will not recurse... | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2049 (or (file-name-directory localname) ""))))) |
45861 | 2050 |
2051 (defun tramp-handle-file-name-nondirectory (file) | |
2052 "Like `file-name-nondirectory' but aware of TRAMP files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2053 (with-parsed-tramp-file-name file nil |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2054 (file-name-nondirectory localname))) |
45861 | 2055 |
2056 (defun tramp-handle-file-truename (filename &optional counter prev-dirs) | |
2057 "Like `file-truename' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2058 (with-parsed-tramp-file-name filename nil |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2059 (let* ((steps (tramp-split-string localname "/")) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
2060 (localnamedir (tramp-let-maybe directory-sep-char ?/ ;for XEmacs |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
2061 (file-name-as-directory localname))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2062 (is-dir (string= localname localnamedir)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2063 (thisstep nil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2064 (numchase 0) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2065 ;; Don't make the following value larger than necessary. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2066 ;; People expect an error message in a timely fashion when |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2067 ;; something is wrong; otherwise they might think that Emacs |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2068 ;; is hung. Of course, correctness has to come first. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2069 (numchase-limit 20) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2070 (result nil) ;result steps in reverse order |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2071 symlink-target) |
45861 | 2072 (tramp-message-for-buffer |
2073 multi-method method user host | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2074 10 "Finding true name for `%s'" filename) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2075 (while (and steps (< numchase numchase-limit)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2076 (setq thisstep (pop steps)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2077 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2078 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2079 10 "Check %s" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2080 (mapconcat 'identity |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2081 (append '("") (reverse result) (list thisstep)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2082 "/")) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2083 (setq symlink-target |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
2084 (nth 0 (file-attributes |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2085 (tramp-make-tramp-file-name |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2086 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2087 (mapconcat 'identity |
46790 | 2088 (append '("") |
2089 (reverse result) | |
2090 (list thisstep)) | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2091 "/"))))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2092 (cond ((string= "." thisstep) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2093 (tramp-message-for-buffer multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2094 10 "Ignoring step `.'")) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2095 ((string= ".." thisstep) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2096 (tramp-message-for-buffer multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2097 10 "Processing step `..'") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2098 (pop result)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2099 ((stringp symlink-target) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2100 ;; It's a symlink, follow it. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2101 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2102 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2103 10 "Follow symlink to %s" symlink-target) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2104 (setq numchase (1+ numchase)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2105 (when (file-name-absolute-p symlink-target) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2106 (setq result nil)) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2107 ;; If the symlink was absolute, we'll get a string like |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2108 ;; "/user@host:/some/target"; extract the |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2109 ;; "/some/target" part from it. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2110 (when (tramp-tramp-file-p symlink-target) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2111 (with-parsed-tramp-file-name symlink-target sym |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2112 (unless (equal (list multi-method method user host) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2113 (list sym-multi-method sym-method |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2114 sym-user sym-host)) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2115 (error "Symlink target `%s' on wrong host" |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2116 symlink-target)) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2117 (setq symlink-target localname))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2118 (setq steps |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2119 (append (tramp-split-string symlink-target "/") steps))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2120 (t |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2121 ;; It's a file. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2122 (setq result (cons thisstep result))))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2123 (when (>= numchase numchase-limit) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2124 (error "Maximum number (%d) of symlinks exceeded" numchase-limit)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2125 (setq result (reverse result)) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2126 ;; Combine list to form string. |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2127 (setq result |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2128 (if result |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2129 (mapconcat 'identity (cons "" result) "/") |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2130 "/")) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2131 (when (and is-dir (or (string= "" result) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2132 (not (string= (substring result -1) "/")))) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2133 (setq result (concat result "/"))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2134 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2135 multi-method method user host |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2136 10 "True name of `%s' is `%s'" filename result) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2137 (tramp-make-tramp-file-name |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2138 multi-method method user host result)))) |
45861 | 2139 |
2140 ;; Basic functions. | |
2141 | |
2142 (defun tramp-handle-file-exists-p (filename) | |
2143 "Like `file-exists-p' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2144 (with-parsed-tramp-file-name filename nil |
45861 | 2145 (save-excursion |
2146 (zerop (tramp-send-command-and-check | |
2147 multi-method method user host | |
2148 (format | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2149 (tramp-get-file-exists-command multi-method method user host) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2150 (tramp-shell-quote-argument localname))))))) |
45861 | 2151 |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2152 ;; 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
|
2153 ;; 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
|
2154 ;; 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
|
2155 ;; EFS use device number "-1". In order to be different, we use device number |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2156 ;; (-1 x), whereby "x" is unique for a given (multi-method method user host). |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2157 (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
|
2158 "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
|
2159 |
45861 | 2160 ;; CCC: This should check for an error condition and signal failure |
2161 ;; when something goes wrong. | |
2162 ;; Daniel Pittman <daniel@danann.net> | |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
2163 (defun tramp-handle-file-attributes (filename &optional id-format) |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
2164 "Like `file-attributes' for tramp files." |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
2165 (let ((nonnumeric (and id-format (equal id-format 'string))) |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
2166 result) |
46752 | 2167 (with-parsed-tramp-file-name filename nil |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
2168 (when (file-exists-p filename) |
46752 | 2169 ;; file exists, find out stuff |
2170 (save-excursion | |
45861 | 2171 (if (tramp-get-remote-perl multi-method method user host) |
46752 | 2172 (setq result |
2173 (tramp-handle-file-attributes-with-perl | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2174 multi-method method user host localname nonnumeric)) |
46752 | 2175 (setq result |
2176 (tramp-handle-file-attributes-with-ls | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2177 multi-method method user host localname nonnumeric))) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2178 ;; set virtual device number |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2179 (setcar (nthcdr 11 result) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2180 (tramp-get-device multi-method method user host))))) |
46752 | 2181 result)) |
45861 | 2182 |
2183 (defun tramp-handle-file-attributes-with-ls | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2184 (multi-method method user host localname &optional nonnumeric) |
45861 | 2185 "Implement `file-attributes' for tramp files using the ls(1) command." |
2186 (let (symlinkp dirp | |
2187 res-inode res-filemodes res-numlinks | |
2188 res-uid res-gid res-size res-symlink-target) | |
46752 | 2189 (tramp-message-for-buffer multi-method method user host 10 |
2190 "file attributes with ls: %s" | |
2191 (tramp-make-tramp-file-name | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2192 multi-method method user host localname)) |
45861 | 2193 (tramp-send-command |
2194 multi-method method user host | |
2195 (format "%s %s %s" | |
2196 (tramp-get-ls-command multi-method method user host) | |
2197 (if nonnumeric "-ild" "-ildn") | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2198 (tramp-shell-quote-argument localname))) |
45861 | 2199 (tramp-wait-for-output) |
2200 ;; parse `ls -l' output ... | |
2201 ;; ... inode | |
2202 (setq res-inode | |
2203 (condition-case err | |
2204 (read (current-buffer)) | |
2205 (invalid-read-syntax | |
2206 (when (and (equal (cadr err) | |
2207 "Integer constant overflow in reader") | |
2208 (string-match | |
2209 "^[0-9]+\\([0-9][0-9][0-9][0-9][0-9]\\)\\'" | |
2210 (caddr err))) | |
2211 (let* ((big (read (substring (caddr err) 0 | |
2212 (match-beginning 1)))) | |
2213 (small (read (match-string 1 (caddr err)))) | |
2214 (twiddle (/ small 65536))) | |
2215 (cons (+ big twiddle) | |
2216 (- small (* twiddle 65536)))))))) | |
2217 ;; ... file mode flags | |
2218 (setq res-filemodes (symbol-name (read (current-buffer)))) | |
2219 ;; ... number links | |
2220 (setq res-numlinks (read (current-buffer))) | |
2221 ;; ... uid and gid | |
2222 (setq res-uid (read (current-buffer))) | |
2223 (setq res-gid (read (current-buffer))) | |
2224 (unless nonnumeric | |
2225 (unless (numberp res-uid) (setq res-uid -1)) | |
2226 (unless (numberp res-gid) (setq res-gid -1))) | |
2227 ;; ... size | |
2228 (setq res-size (read (current-buffer))) | |
2229 ;; From the file modes, figure out other stuff. | |
2230 (setq symlinkp (eq ?l (aref res-filemodes 0))) | |
2231 (setq dirp (eq ?d (aref res-filemodes 0))) | |
2232 ;; if symlink, find out file name pointed to | |
2233 (when symlinkp | |
2234 (search-forward "-> ") | |
2235 (setq res-symlink-target | |
2236 (buffer-substring (point) | |
2237 (tramp-line-end-position)))) | |
2238 ;; return data gathered | |
2239 (list | |
2240 ;; 0. t for directory, string (name linked to) for symbolic | |
2241 ;; link, or nil. | |
2242 (or dirp res-symlink-target nil) | |
2243 ;; 1. Number of links to file. | |
2244 res-numlinks | |
2245 ;; 2. File uid. | |
2246 res-uid | |
2247 ;; 3. File gid. | |
2248 res-gid | |
2249 ;; 4. Last access time, as a list of two integers. First | |
2250 ;; integer has high-order 16 bits of time, second has low 16 | |
2251 ;; bits. | |
2252 ;; 5. Last modification time, likewise. | |
2253 ;; 6. Last status change time, likewise. | |
2254 '(0 0) '(0 0) '(0 0) ;CCC how to find out? | |
2255 ;; 7. Size in bytes (-1, if number is out of range). | |
2256 res-size | |
2257 ;; 8. File modes, as a string of ten letters or dashes as in ls -l. | |
2258 res-filemodes | |
2259 ;; 9. t iff file's gid would change if file were deleted and | |
2260 ;; recreated. | |
2261 nil ;hm? | |
2262 ;; 10. inode number. | |
2263 res-inode | |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2264 ;; 11. Device number. Will be replaced by a virtual device number. |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2265 -1 |
45861 | 2266 ))) |
2267 | |
2268 (defun tramp-handle-file-attributes-with-perl | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2269 (multi-method method user host localname &optional nonnumeric) |
45861 | 2270 "Implement `file-attributes' for tramp files using a Perl script. |
2271 | |
2272 The Perl command is sent to the remote machine when the connection | |
2273 is initially created and is kept cached by the remote shell." | |
46752 | 2274 (tramp-message-for-buffer multi-method method user host 10 |
2275 "file attributes with perl: %s" | |
2276 (tramp-make-tramp-file-name | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2277 multi-method method user host localname)) |
45861 | 2278 (tramp-send-command |
2279 multi-method method user host | |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
2280 (format "tramp_file_attributes %s %s" |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
2281 (tramp-shell-quote-argument localname) nonnumeric)) |
45861 | 2282 (tramp-wait-for-output) |
2283 (let ((result (read (current-buffer)))) | |
2284 (setcar (nthcdr 8 result) | |
2285 (tramp-file-mode-from-int (nth 8 result))) | |
2286 result)) | |
2287 | |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2288 (defun tramp-get-device (multi-method method user host) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2289 "Returns the virtual device number. |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2290 If it doesn't exist, generate a new one." |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2291 (let ((string (tramp-make-tramp-file-name multi-method method user host ""))) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2292 (unless (assoc string tramp-devices) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2293 (add-to-list 'tramp-devices |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2294 (list string (length tramp-devices)))) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2295 (list -1 (nth 1 (assoc string tramp-devices))))) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2296 |
45861 | 2297 (defun tramp-handle-set-visited-file-modtime (&optional time-list) |
2298 "Like `set-visited-file-modtime' for tramp files." | |
2299 (unless (buffer-file-name) | |
2300 (error "Can't set-visited-file-modtime: buffer `%s' not visiting a file" | |
2301 (buffer-name))) | |
2302 (when time-list | |
2303 (tramp-run-real-handler 'set-visited-file-modtime (list time-list))) | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2304 (let ((f (buffer-file-name)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2305 (coding-system-used nil)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2306 (with-parsed-tramp-file-name f nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2307 (let* ((attr (file-attributes f)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2308 (modtime (nth 5 attr))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2309 ;; We use '(0 0) as a don't-know value. See also |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2310 ;; `tramp-handle-file-attributes-with-ls'. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2311 (when (boundp 'last-coding-system-used) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2312 (setq coding-system-used last-coding-system-used)) |
45861 | 2313 (if (not (equal modtime '(0 0))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2314 (tramp-run-real-handler 'set-visited-file-modtime (list modtime)) |
45861 | 2315 (save-excursion |
2316 (tramp-send-command | |
2317 multi-method method user host | |
2318 (format "%s -ild %s" | |
2319 (tramp-get-ls-command multi-method method user host) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2320 (tramp-shell-quote-argument localname))) |
45861 | 2321 (tramp-wait-for-output) |
2322 (setq attr (buffer-substring (point) | |
2323 (progn (end-of-line) (point))))) | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2324 (setq tramp-buffer-file-attributes attr)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2325 (when (boundp 'last-coding-system-used) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2326 (setq last-coding-system-used coding-system-used)) |
45861 | 2327 nil)))) |
2328 | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2329 ;; CCC continue here |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2330 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2331 ;; This function makes the same assumption as |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2332 ;; `tramp-handle-set-visited-file-modtime'. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2333 (defun tramp-handle-verify-visited-file-modtime (buf) |
56465
6b42a91e3595
(tramp-handle-verify-visited-file-modtime): New
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56460
diff
changeset
|
2334 "Like `verify-visited-file-modtime' for tramp files. |
6b42a91e3595
(tramp-handle-verify-visited-file-modtime): New
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56460
diff
changeset
|
2335 At the time `verify-visited-file-modtime' calls this function, we |
6b42a91e3595
(tramp-handle-verify-visited-file-modtime): New
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56460
diff
changeset
|
2336 already know that the buffer is visiting a file and that |
6b42a91e3595
(tramp-handle-verify-visited-file-modtime): New
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56460
diff
changeset
|
2337 `visited-file-modtime' does not return 0. Do not call this |
6b42a91e3595
(tramp-handle-verify-visited-file-modtime): New
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56460
diff
changeset
|
2338 function directly, unless those two cases are already taken care |
6b42a91e3595
(tramp-handle-verify-visited-file-modtime): New
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56460
diff
changeset
|
2339 of." |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2340 (with-current-buffer buf |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2341 (let ((f (buffer-file-name))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2342 (with-parsed-tramp-file-name f nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2343 (let* ((attr (file-attributes f)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2344 (modtime (nth 5 attr))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2345 (cond ((and attr (not (equal modtime '(0 0)))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2346 ;; Why does `file-attributes' return a list (HIGH |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2347 ;; LOW), but `visited-file-modtime' returns a cons |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2348 ;; (HIGH . LOW)? |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2349 (let ((mt (visited-file-modtime))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2350 (< (abs (tramp-time-diff |
56424
27e781b70053
(tramp-handle-verify-visited-file-modtime): `visited-file-modtime' now
Luc Teirlinck <teirllm@auburn.edu>
parents:
56261
diff
changeset
|
2351 modtime |
27e781b70053
(tramp-handle-verify-visited-file-modtime): `visited-file-modtime' now
Luc Teirlinck <teirllm@auburn.edu>
parents:
56261
diff
changeset
|
2352 ;; For compatibility, deal with both the old |
27e781b70053
(tramp-handle-verify-visited-file-modtime): `visited-file-modtime' now
Luc Teirlinck <teirllm@auburn.edu>
parents:
56261
diff
changeset
|
2353 ;; (HIGH . LOW) and the new (HIGH LOW) |
27e781b70053
(tramp-handle-verify-visited-file-modtime): `visited-file-modtime' now
Luc Teirlinck <teirllm@auburn.edu>
parents:
56261
diff
changeset
|
2354 ;; return values of `visited-file-modtime'. |
27e781b70053
(tramp-handle-verify-visited-file-modtime): `visited-file-modtime' now
Luc Teirlinck <teirllm@auburn.edu>
parents:
56261
diff
changeset
|
2355 (if (atom (cdr mt)) |
27e781b70053
(tramp-handle-verify-visited-file-modtime): `visited-file-modtime' now
Luc Teirlinck <teirllm@auburn.edu>
parents:
56261
diff
changeset
|
2356 (list (car mt) (cdr mt)) |
27e781b70053
(tramp-handle-verify-visited-file-modtime): `visited-file-modtime' now
Luc Teirlinck <teirllm@auburn.edu>
parents:
56261
diff
changeset
|
2357 mt))) |
27e781b70053
(tramp-handle-verify-visited-file-modtime): `visited-file-modtime' now
Luc Teirlinck <teirllm@auburn.edu>
parents:
56261
diff
changeset
|
2358 2))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2359 (attr |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2360 (save-excursion |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2361 (tramp-send-command |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2362 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2363 (format "%s -ild %s" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2364 (tramp-get-ls-command multi-method method |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2365 user host) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2366 (tramp-shell-quote-argument localname))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2367 (tramp-wait-for-output) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2368 (setq attr (buffer-substring |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2369 (point) (progn (end-of-line) (point))))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2370 (equal tramp-buffer-file-attributes attr)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2371 ;; If file does not exist, say it is not modified. |
46048
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
2372 (t nil))))))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2373 |
45861 | 2374 (defadvice clear-visited-file-modtime (after tramp activate) |
2375 "Set `tramp-buffer-file-attributes' back to nil. | |
2376 Tramp uses this variable as an emulation for the actual modtime of the file, | |
2377 if the remote host can't provide the modtime." | |
2378 (setq tramp-buffer-file-attributes nil)) | |
2379 | |
2380 (defun tramp-handle-set-file-modes (filename mode) | |
2381 "Like `set-file-modes' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2382 (with-parsed-tramp-file-name filename nil |
45861 | 2383 (save-excursion |
2384 (unless (zerop (tramp-send-command-and-check | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2385 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2386 (format "chmod %s %s" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2387 (tramp-decimal-to-octal mode) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2388 (tramp-shell-quote-argument localname)))) |
45861 | 2389 (signal 'file-error |
2390 (list "Doing chmod" | |
2391 ;; FIXME: extract the proper text from chmod's stderr. | |
2392 "error while changing file's mode" | |
2393 filename)))))) | |
2394 | |
2395 ;; Simple functions using the `test' command. | |
2396 | |
2397 (defun tramp-handle-file-executable-p (filename) | |
2398 "Like `file-executable-p' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2399 (with-parsed-tramp-file-name filename nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2400 (zerop (tramp-run-test "-x" filename)))) |
45861 | 2401 |
2402 (defun tramp-handle-file-readable-p (filename) | |
2403 "Like `file-readable-p' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2404 (with-parsed-tramp-file-name filename nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2405 (zerop (tramp-run-test "-r" filename)))) |
45861 | 2406 |
2407 (defun tramp-handle-file-accessible-directory-p (filename) | |
2408 "Like `file-accessible-directory-p' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2409 (with-parsed-tramp-file-name filename nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2410 (and (zerop (tramp-run-test "-d" filename)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2411 (zerop (tramp-run-test "-r" filename)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2412 (zerop (tramp-run-test "-x" filename))))) |
45861 | 2413 |
2414 ;; When the remote shell is started, it looks for a shell which groks | |
2415 ;; tilde expansion. Here, we assume that all shells which grok tilde | |
2416 ;; expansion will also provide a `test' command which groks `-nt' (for | |
2417 ;; newer than). If this breaks, tell me about it and I'll try to do | |
2418 ;; something smarter about it. | |
2419 (defun tramp-handle-file-newer-than-file-p (file1 file2) | |
2420 "Like `file-newer-than-file-p' for tramp files." | |
2421 (cond ((not (file-exists-p file1)) | |
2422 nil) | |
2423 ((not (file-exists-p file2)) | |
2424 t) | |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2425 ;; We are sure both files exist at this point. |
45861 | 2426 (t |
2427 (save-excursion | |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2428 ;; We try to get the mtime of both files. If they are not |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2429 ;; equal to the "dont-know" value, then we subtract the times |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2430 ;; and obtain the result. |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2431 (let ((fa1 (file-attributes file1)) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2432 (fa2 (file-attributes file2))) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2433 (if (and (not (equal (nth 5 fa1) '(0 0))) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2434 (not (equal (nth 5 fa2) '(0 0)))) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
2435 (> 0 (tramp-time-diff (nth 5 fa1) (nth 5 fa2))) |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2436 ;; If one of them is the dont-know value, then we can |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2437 ;; still try to run a shell command on the remote host. |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2438 ;; However, this only works if both files are Tramp |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2439 ;; files and both have the same method, same user, same |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2440 ;; host. |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2441 (unless (and (tramp-tramp-file-p file1) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2442 (tramp-tramp-file-p file2)) |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2443 (signal |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2444 'file-error |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2445 (list |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2446 "Cannot check if Tramp file is newer than non-Tramp file" |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2447 file1 file2))) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2448 (with-parsed-tramp-file-name file1 v1 |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2449 (with-parsed-tramp-file-name file2 v2 |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2450 (unless (and (equal v1-multi-method v2-multi-method) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2451 (equal v1-method v2-method) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2452 (equal v1-user v2-user) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2453 (equal v1-host v2-host)) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2454 (signal 'file-error |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2455 (list "Files must have same method, user, host" |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2456 file1 file2))) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2457 (unless (and (tramp-tramp-file-p file1) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2458 (tramp-tramp-file-p file2)) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2459 (signal 'file-error |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2460 (list "Files must be tramp files on same host" |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2461 file1 file2))) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2462 (if (tramp-get-test-groks-nt |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2463 v1-multi-method v1-method v1-user v1-host) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2464 (zerop (tramp-run-test2 "test" file1 file2 "-nt")) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2465 (zerop (tramp-run-test2 |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2466 "tramp_test_nt" file1 file2))))))))))) |
45861 | 2467 |
2468 ;; Functions implemented using the basic functions above. | |
2469 | |
2470 (defun tramp-handle-file-modes (filename) | |
2471 "Like `file-modes' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2472 (with-parsed-tramp-file-name filename nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2473 (when (file-exists-p filename) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2474 (tramp-mode-string-to-int |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2475 (nth 8 (file-attributes filename)))))) |
45861 | 2476 |
2477 (defun tramp-handle-file-directory-p (filename) | |
2478 "Like `file-directory-p' for tramp files." | |
2479 ;; Care must be taken that this function returns `t' for symlinks | |
2480 ;; pointing to directories. Surely the most obvious implementation | |
2481 ;; would be `test -d', but that returns false for such symlinks. | |
2482 ;; CCC: Stefan Monnier says that `test -d' follows symlinks. And | |
2483 ;; I now think he's right. So we could be using `test -d', couldn't | |
2484 ;; we? | |
2485 ;; | |
2486 ;; Alternatives: `cd %s', `test -d %s' | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2487 (with-parsed-tramp-file-name filename nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2488 (save-excursion |
45861 | 2489 (zerop |
2490 (tramp-send-command-and-check | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2491 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2492 (format "test -d %s" |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2493 (tramp-shell-quote-argument localname)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2494 t))))) ;run command in subshell |
45861 | 2495 |
2496 (defun tramp-handle-file-regular-p (filename) | |
2497 "Like `file-regular-p' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2498 (with-parsed-tramp-file-name filename 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
|
2499 (and (file-exists-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
|
2500 (eq ?- (aref (nth 8 (file-attributes filename)) 0))))) |
45861 | 2501 |
2502 (defun tramp-handle-file-symlink-p (filename) | |
2503 "Like `file-symlink-p' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2504 (with-parsed-tramp-file-name filename nil |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
2505 (let ((x (car (file-attributes filename)))) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2506 (when (stringp x) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2507 ;; When Tramp is running on VMS, then `file-name-absolute-p' |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2508 ;; might do weird things. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2509 (if (file-name-absolute-p x) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2510 (tramp-make-tramp-file-name |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2511 multi-method method user host x) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2512 x))))) |
45861 | 2513 |
2514 (defun tramp-handle-file-writable-p (filename) | |
2515 "Like `file-writable-p' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2516 (with-parsed-tramp-file-name filename nil |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
2517 (if (file-exists-p filename) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2518 ;; Existing files must be writable. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2519 (zerop (tramp-run-test "-w" filename)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2520 ;; If file doesn't exist, check if directory is writable. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2521 (and (zerop (tramp-run-test |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
2522 "-d" (file-name-directory filename))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2523 (zerop (tramp-run-test |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
2524 "-w" (file-name-directory filename))))))) |
45861 | 2525 |
2526 (defun tramp-handle-file-ownership-preserved-p (filename) | |
2527 "Like `file-ownership-preserved-p' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2528 (with-parsed-tramp-file-name filename nil |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
2529 (or (not (file-exists-p filename)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2530 ;; Existing files must be writable. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2531 (zerop (tramp-run-test "-O" filename))))) |
45861 | 2532 |
2533 ;; Other file name ops. | |
2534 | |
50494
5b6aaf393205
Version 2.0.33 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50432
diff
changeset
|
2535 ;; ;; Matthias K,Av(Bppe <mkoeppe@mail.math.uni-magdeburg.de> |
45861 | 2536 ;; (defun tramp-handle-directory-file-name (directory) |
2537 ;; "Like `directory-file-name' for tramp files." | |
2538 ;; (if (and (eq (aref directory (- (length directory) 1)) ?/) | |
2539 ;; (not (eq (aref directory (- (length directory) 2)) ?:))) | |
2540 ;; (substring directory 0 (- (length directory) 1)) | |
2541 ;; directory)) | |
2542 | |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2543 ;; ;; Philippe Troin <phil@fifi.org> |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2544 ;; (defun tramp-handle-directory-file-name (directory) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2545 ;; "Like `directory-file-name' for tramp files." |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2546 ;; (with-parsed-tramp-file-name directory nil |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2547 ;; (let ((directory-length-1 (1- (length directory)))) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2548 ;; (save-match-data |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2549 ;; (if (and (eq (aref directory directory-length-1) ?/) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2550 ;; (eq (string-match tramp-file-name-regexp directory) 0) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2551 ;; (/= (match-end 0) directory-length-1)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2552 ;; (substring directory 0 directory-length-1) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2553 ;; directory))))) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2554 |
45861 | 2555 (defun tramp-handle-directory-file-name (directory) |
2556 "Like `directory-file-name' for tramp files." | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2557 ;; If localname component of filename is "/", leave it unchanged. |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2558 ;; Otherwise, remove any trailing slash from localname component. |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2559 ;; Method, host, etc, are unchanged. Does it make sense to try |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2560 ;; to avoid parsing the filename? |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2561 (with-parsed-tramp-file-name directory nil |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2562 (if (and (not (zerop (length localname))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2563 (eq (aref localname (1- (length localname))) ?/) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2564 (not (string= localname "/"))) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2565 (substring directory 0 -1) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2566 directory))) |
45861 | 2567 |
2568 ;; Directory listings. | |
2569 | |
46752 | 2570 (defun tramp-handle-directory-files (directory |
2571 &optional full match nosort files-only) | |
45861 | 2572 "Like `directory-files' for tramp files." |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2573 (with-parsed-tramp-file-name directory nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2574 (let (result x) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2575 (save-excursion |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2576 (tramp-barf-unless-okay |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2577 multi-method method user host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2578 (concat "cd " (tramp-shell-quote-argument localname)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2579 nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2580 'file-error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2581 "tramp-handle-directory-files: couldn't `cd %s'" |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2582 (tramp-shell-quote-argument localname)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2583 (tramp-send-command |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2584 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2585 (concat (tramp-get-ls-command multi-method method user host) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2586 " -a | cat")) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2587 (tramp-wait-for-output) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2588 (goto-char (point-max)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2589 (while (zerop (forward-line -1)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2590 (setq x (buffer-substring (point) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2591 (tramp-line-end-position))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2592 (when (or (not match) (string-match match x)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2593 (if full |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2594 (push (concat (file-name-as-directory directory) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2595 x) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2596 result) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2597 (push x result)))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2598 (tramp-send-command multi-method method user host "cd") |
46752 | 2599 (tramp-wait-for-output) |
2600 ;; Remove non-files or non-directories if necessary. Using | |
2601 ;; the remote shell for this would probably be way faster. | |
2602 ;; Maybe something could be adapted from | |
2603 ;; tramp-handle-file-name-all-completions. | |
2604 (when files-only | |
2605 (let ((temp (nreverse result)) | |
2606 item) | |
2607 (setq result nil) | |
2608 (if (equal files-only t) | |
2609 ;; files only | |
2610 (while temp | |
2611 (setq item (pop temp)) | |
2612 (when (file-regular-p item) | |
2613 (push item result))) | |
2614 ;; directories only | |
2615 (while temp | |
2616 (setq item (pop temp)) | |
2617 (when (file-directory-p item) | |
2618 (push item result))))))) | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2619 result))) |
45861 | 2620 |
2621 ;; This function should return "foo/" for directories and "bar" for | |
2622 ;; files. We use `ls -ad' to get a list of files (including | |
2623 ;; directories), and `find . -type d \! -name . -prune' to get a list | |
2624 ;; of directories. | |
2625 (defun tramp-handle-file-name-all-completions (filename directory) | |
2626 "Like `file-name-all-completions' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2627 (with-parsed-tramp-file-name directory nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2628 (unless (save-match-data (string-match "/" filename)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2629 (let* ((nowild tramp-completion-without-shell-p) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2630 result) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2631 (save-excursion |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2632 (tramp-barf-unless-okay |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2633 multi-method method user host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2634 (format "cd %s" (tramp-shell-quote-argument localname)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2635 nil 'file-error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2636 "tramp-handle-file-name-all-completions: Couldn't `cd %s'" |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2637 (tramp-shell-quote-argument localname)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2638 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2639 ;; Get a list of directories and files, including reliably |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2640 ;; tagging the directories with a trailing '/'. Because I |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2641 ;; rock. --daniel@danann.net |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2642 (tramp-send-command |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2643 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2644 (format (concat "%s -a %s 2>/dev/null | while read f; do " |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2645 "if test -d \"$f\" 2>/dev/null; " |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2646 "then echo \"$f/\"; else echo \"$f\"; fi; done") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2647 (tramp-get-ls-command multi-method method user host) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2648 (if (or nowild (zerop (length filename))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2649 "" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2650 (format "-d %s*" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2651 (tramp-shell-quote-argument filename))))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2652 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2653 ;; Now grab the output. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2654 (tramp-wait-for-output) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2655 (goto-char (point-max)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2656 (while (zerop (forward-line -1)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2657 (push (buffer-substring (point) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2658 (tramp-line-end-position)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2659 result)) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2660 |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2661 (tramp-send-command multi-method method user host "cd") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2662 (tramp-wait-for-output) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2663 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2664 ;; Return the list. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2665 (if nowild |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2666 (all-completions filename (mapcar 'list result)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2667 result)))))) |
45861 | 2668 |
2669 | |
2670 ;; The following isn't needed for Emacs 20 but for 19.34? | |
2671 (defun tramp-handle-file-name-completion (filename directory) | |
2672 "Like `file-name-completion' for tramp files." | |
2673 (unless (tramp-tramp-file-p directory) | |
2674 (error | |
2675 "tramp-handle-file-name-completion invoked on non-tramp directory `%s'" | |
2676 directory)) | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2677 (with-parsed-tramp-file-name directory nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2678 (try-completion |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2679 filename |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2680 (mapcar (lambda (x) (cons x 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
|
2681 (file-name-all-completions filename directory))))) |
45861 | 2682 |
2683 ;; cp, mv and ln | |
2684 | |
2685 (defun tramp-handle-add-name-to-file | |
2686 (filename newname &optional ok-if-already-exists) | |
2687 "Like `add-name-to-file' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2688 (with-parsed-tramp-file-name filename v1 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2689 (with-parsed-tramp-file-name newname v2 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2690 (let ((ln (when v1 (tramp-get-remote-ln |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2691 v1-multi-method v1-method v1-user v1-host)))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2692 (unless (and v1-method v2-method v1-user v2-user v1-host v2-host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2693 (equal v1-multi-method v2-multi-method) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2694 (equal v1-method v2-method) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2695 (equal v1-user v2-user) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2696 (equal v1-host v2-host)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2697 (error "add-name-to-file: %s" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2698 "only implemented for same method, same user, same host")) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2699 (when (and (not ok-if-already-exists) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2700 (file-exists-p newname) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2701 (not (numberp ok-if-already-exists)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2702 (y-or-n-p |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2703 (format |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2704 "File %s already exists; make it a new name anyway? " |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2705 newname))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2706 (error "add-name-to-file: file %s already exists" newname)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2707 (tramp-barf-unless-okay |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2708 v1-multi-method v1-method v1-user v1-host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2709 (format "%s %s %s" ln (tramp-shell-quote-argument v1-localname) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2710 (tramp-shell-quote-argument v2-localname)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2711 nil 'file-error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2712 "error with add-name-to-file, see buffer `%s' for details" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2713 (buffer-name)))))) |
45861 | 2714 |
2715 (defun tramp-handle-copy-file | |
2716 (filename newname &optional ok-if-already-exists keep-date) | |
2717 "Like `copy-file' for tramp files." | |
2718 ;; Check if both files are local -- invoke normal copy-file. | |
2719 ;; Otherwise, use tramp from local system. | |
2720 (setq filename (expand-file-name filename)) | |
2721 (setq newname (expand-file-name newname)) | |
2722 ;; At least one file a tramp file? | |
2723 (if (or (tramp-tramp-file-p filename) | |
2724 (tramp-tramp-file-p newname)) | |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
2725 (let ((modes (file-modes filename))) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
2726 (tramp-do-copy-or-rename-file |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
2727 'copy filename newname ok-if-already-exists keep-date) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
2728 (set-file-modes newname modes)) |
45861 | 2729 (tramp-run-real-handler |
2730 'copy-file | |
2731 (list filename newname ok-if-already-exists keep-date)))) | |
2732 | |
2733 (defun tramp-handle-rename-file | |
2734 (filename newname &optional ok-if-already-exists) | |
2735 "Like `rename-file' for tramp files." | |
2736 ;; Check if both files are local -- invoke normal rename-file. | |
2737 ;; Otherwise, use tramp from local system. | |
2738 (setq filename (expand-file-name filename)) | |
2739 (setq newname (expand-file-name newname)) | |
2740 ;; At least one file a tramp file? | |
2741 (if (or (tramp-tramp-file-p filename) | |
2742 (tramp-tramp-file-p newname)) | |
2743 (tramp-do-copy-or-rename-file | |
2744 'rename filename newname ok-if-already-exists) | |
2745 (tramp-run-real-handler 'rename-file | |
2746 (list filename newname ok-if-already-exists)))) | |
2747 | |
2748 (defun tramp-do-copy-or-rename-file | |
2749 (op filename newname &optional ok-if-already-exists keep-date) | |
2750 "Copy or rename a remote file. | |
2751 OP must be `copy' or `rename' and indicates the operation to perform. | |
2752 FILENAME specifies the file to copy or rename, NEWNAME is the name of | |
2753 the new file (for copy) or the new name of the file (for rename). | |
2754 OK-IF-ALREADY-EXISTS means don't barf if NEWNAME exists already. | |
2755 KEEP-DATE means to make sure that NEWNAME has the same timestamp | |
2756 as FILENAME. | |
2757 | |
2758 This function is invoked by `tramp-handle-copy-file' and | |
2759 `tramp-handle-rename-file'. It is an error if OP is neither of `copy' | |
2760 and `rename'. FILENAME and NEWNAME must be absolute file names." | |
2761 (unless (memq op '(copy rename)) | |
2762 (error "Unknown operation `%s', must be `copy' or `rename'" op)) | |
2763 (unless ok-if-already-exists | |
2764 (when (file-exists-p newname) | |
2765 (signal 'file-already-exists | |
2766 (list newname)))) | |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2767 (let ((t1 (tramp-tramp-file-p filename)) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2768 (t2 (tramp-tramp-file-p newname)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2769 v1-multi-method v1-method v1-user v1-host v1-localname |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2770 v2-multi-method v2-method v2-user v2-host v2-localname) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2771 |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2772 ;; Check which ones of source and target are Tramp files. |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2773 ;; We cannot invoke `with-parsed-tramp-file-name'; |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2774 ;; it fails if the file isn't a Tramp file name. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2775 (if t1 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2776 (with-parsed-tramp-file-name filename l |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2777 (setq v1-multi-method l-multi-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2778 v1-method l-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2779 v1-user l-user |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2780 v1-host l-host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2781 v1-localname l-localname)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2782 (setq v1-localname filename)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2783 (if t2 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2784 (with-parsed-tramp-file-name newname l |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2785 (setq v2-multi-method l-multi-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2786 v2-method l-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2787 v2-user l-user |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2788 v2-host l-host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2789 v2-localname l-localname)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2790 (setq v2-localname newname)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2791 |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2792 (cond |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2793 ;; Both are Tramp files. |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2794 ((and t1 t2) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2795 (cond |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2796 ;; Shortcut: if method, host, user are the same for both |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2797 ;; files, we invoke `cp' or `mv' on the remote host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2798 ;; directly. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2799 ((and (equal v1-multi-method v2-multi-method) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2800 (equal v1-method v2-method) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2801 (equal v1-user v2-user) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2802 (equal v1-host v2-host)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2803 (tramp-do-copy-or-rename-file-directly |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2804 op v1-multi-method v1-method v1-user v1-host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2805 v1-localname v2-localname keep-date)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2806 ;; If both source and target are Tramp files, |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2807 ;; both are using the same copy-program, then we |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2808 ;; can invoke rcp directly. Note that |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2809 ;; default-directory should point to a local |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2810 ;; directory if we want to invoke rcp. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2811 ((and (not v1-multi-method) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2812 (not v2-multi-method) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2813 (equal v1-method v2-method) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2814 (tramp-method-out-of-band-p |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2815 v1-multi-method v1-method v1-user v1-host) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2816 (not (string-match "\\([^#]*\\)#\\(.*\\)" v1-host)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2817 (not (string-match "\\([^#]*\\)#\\(.*\\)" v2-host))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2818 (tramp-do-copy-or-rename-file-out-of-band |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2819 op filename newname keep-date)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2820 ;; No shortcut was possible. So we copy the |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2821 ;; file first. If the operation was `rename', we go |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2822 ;; back and delete the original file (if the copy was |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2823 ;; successful). The approach is simple-minded: we |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2824 ;; create a new buffer, insert the contents of the |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2825 ;; source file into it, then write out the buffer to |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2826 ;; the target file. The advantage is that it doesn't |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2827 ;; matter which filename handlers are used for the |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2828 ;; source and target file. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2829 (t |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2830 (tramp-do-copy-or-rename-file-via-buffer |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2831 op filename newname keep-date)))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2832 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2833 ;; One file is a Tramp file, the other one is local. |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2834 ((or t1 t2) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2835 ;; If the Tramp file has an out-of-band method, the corresponding |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2836 ;; copy-program can be invoked. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2837 (if (and (not v1-multi-method) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2838 (not v2-multi-method) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2839 (or (tramp-method-out-of-band-p |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2840 v1-multi-method v1-method v1-user v1-host) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2841 (tramp-method-out-of-band-p |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2842 v2-multi-method v2-method v2-user v2-host))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2843 (tramp-do-copy-or-rename-file-out-of-band |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2844 op filename newname keep-date) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2845 ;; Use the generic method via a Tramp buffer. |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2846 (tramp-do-copy-or-rename-file-via-buffer |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2847 op filename newname keep-date))) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2848 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2849 (t |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2850 ;; One of them must be a Tramp file. |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2851 (error "Tramp implementation says this cannot happen"))))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2852 |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2853 (defun tramp-do-copy-or-rename-file-via-buffer (op filename newname keep-date) |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2854 "Use an Emacs buffer to copy or rename a file. |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2855 First arg OP is either `copy' or `rename' and indicates the operation. |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2856 FILENAME is the source file, NEWNAME the target file. |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2857 KEEP-DATE is non-nil if NEWNAME should have the same timestamp as FILENAME." |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2858 (let ((trampbuf (get-buffer-create "*tramp output*")) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2859 (modtime (nth 5 (file-attributes filename)))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2860 (when (and keep-date (or (null modtime) (equal modtime '(0 0)))) |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2861 (tramp-message |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2862 1 (concat "Warning: cannot preserve file time stamp" |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2863 " with inline copying across machines"))) |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2864 (save-excursion |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2865 (set-buffer trampbuf) (erase-buffer) |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2866 (insert-file-contents-literally filename) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
2867 ;; We don't want the target file to be compressed, so we let-bind |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
2868 ;; `jka-compr-inhibit' to t. |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
2869 (let ((coding-system-for-write 'binary) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
2870 (jka-compr-inhibit t)) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2871 (write-region (point-min) (point-max) newname)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2872 ;; KEEP-DATE handling. |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2873 (when keep-date |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2874 (when (and (not (null modtime)) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2875 (not (equal modtime '(0 0)))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2876 (tramp-touch newname modtime)) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2877 (set-file-modes newname (file-modes filename)))) |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2878 ;; If the operation was `rename', delete the original file. |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2879 (unless (eq op 'copy) |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2880 (delete-file filename)))) |
45861 | 2881 |
2882 (defun tramp-do-copy-or-rename-file-directly | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2883 (op multi-method method user host localname1 localname2 keep-date) |
45861 | 2884 "Invokes `cp' or `mv' on the remote system. |
2885 OP must be one of `copy' or `rename', indicating `cp' or `mv', | |
2886 respectively. METHOD, USER, and HOST specify the connection. | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2887 LOCALNAME1 and LOCALNAME2 specify the two arguments of `cp' or `mv'. |
45861 | 2888 If KEEP-DATE is non-nil, preserve the time stamp when copying." |
2889 ;; CCC: What happens to the timestamp when renaming? | |
2890 (let ((cmd (cond ((and (eq op 'copy) keep-date) "cp -f -p") | |
2891 ((eq op 'copy) "cp -f") | |
2892 ((eq op 'rename) "mv -f") | |
2893 (t (error | |
2894 "Unknown operation `%s', must be `copy' or `rename'" | |
2895 op))))) | |
2896 (save-excursion | |
2897 (tramp-barf-unless-okay | |
2898 multi-method method user host | |
2899 (format "%s %s %s" | |
2900 cmd | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2901 (tramp-shell-quote-argument localname1) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2902 (tramp-shell-quote-argument localname2)) |
45861 | 2903 nil 'file-error |
2904 "Copying directly failed, see buffer `%s' for details." | |
2905 (buffer-name))))) | |
2906 | |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2907 (defun tramp-do-copy-or-rename-file-out-of-band (op filename newname keep-date) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2908 "Invoke rcp program to copy. |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2909 One of FILENAME and NEWNAME must be a Tramp name, the other must |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2910 be a local filename. The method used must be an out-of-band method." |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2911 (let ((t1 (tramp-tramp-file-p filename)) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2912 (t2 (tramp-tramp-file-p newname)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2913 v1-multi-method v1-method v1-user v1-host v1-localname |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2914 v2-multi-method v2-method v2-user v2-host v2-localname |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2915 multi-method method user host copy-program copy-args |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2916 source target trampbuf) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2917 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2918 ;; Check which ones of source and target are Tramp files. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2919 ;; We cannot invoke `with-parsed-tramp-file-name'; |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2920 ;; it fails if the file isn't a Tramp file name. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2921 (if t1 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2922 (with-parsed-tramp-file-name filename l |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2923 (setq v1-multi-method l-multi-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2924 v1-method l-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2925 v1-user l-user |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2926 v1-host l-host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2927 v1-localname l-localname |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2928 multi-method l-multi-method |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2929 method (tramp-find-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2930 v1-multi-method v1-method v1-user v1-host) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2931 user l-user |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2932 host l-host |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2933 copy-program (tramp-get-method-parameter |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2934 v1-multi-method method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2935 v1-user v1-host 'tramp-copy-program) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2936 copy-args (tramp-get-method-parameter |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2937 v1-multi-method method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2938 v1-user v1-host 'tramp-copy-args))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2939 (setq v1-localname filename)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2940 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2941 (if t2 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2942 (with-parsed-tramp-file-name newname l |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2943 (setq v2-multi-method l-multi-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2944 v2-method l-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2945 v2-user l-user |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2946 v2-host l-host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2947 v2-localname l-localname |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2948 multi-method l-multi-method |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2949 method (tramp-find-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2950 v2-multi-method v2-method v2-user v2-host) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2951 user l-user |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2952 host l-host |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2953 copy-program (tramp-get-method-parameter |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2954 v2-multi-method method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2955 v2-user v2-host 'tramp-copy-program) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2956 copy-args (tramp-get-method-parameter |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2957 v2-multi-method method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2958 v2-user v2-host 'tramp-copy-args))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2959 (setq v2-localname newname)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2960 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2961 ;; The following should be changed. We need a more general |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2962 ;; mechanism to parse extra host args. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2963 (if (not t1) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2964 (setq source v1-localname) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2965 (when (string-match "\\([^#]*\\)#\\(.*\\)" v1-host) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2966 (setq copy-args (cons "-P" (cons (match-string 2 v1-host) copy-args))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2967 (setq v1-host (match-string 1 v1-host))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2968 (setq source |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2969 (tramp-make-copy-program-file-name |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2970 v1-user v1-host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2971 (tramp-shell-quote-argument v1-localname)))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2972 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2973 (if (not t2) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2974 (setq target v2-localname) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2975 (when (string-match "\\([^#]*\\)#\\(.*\\)" v2-host) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2976 (setq copy-args (cons "-P" (cons (match-string 2 v2-host) copy-args))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2977 (setq v2-host (match-string 1 v2-host))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2978 (setq target |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2979 (tramp-make-copy-program-file-name |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2980 v2-user v2-host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2981 (tramp-shell-quote-argument v2-localname)))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2982 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2983 ;; Handle keep-date argument |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2984 (when keep-date |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2985 (if t1 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2986 (setq copy-args |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2987 (cons (tramp-get-method-parameter |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2988 v1-multi-method method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2989 v1-user v1-host 'tramp-copy-keep-date-arg) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2990 copy-args)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2991 (setq copy-args |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2992 (cons (tramp-get-method-parameter |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2993 v2-multi-method method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2994 v2-user v2-host 'tramp-copy-keep-date-arg) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2995 copy-args)))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2996 |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2997 (setq copy-args (append copy-args (list source target)) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2998 trampbuf (generate-new-buffer |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2999 (tramp-buffer-name multi-method method user host))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3000 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3001 ;; Use an asynchronous process. By this, password can be handled. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3002 (save-excursion |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3003 (set-buffer trampbuf) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3004 (setq tramp-current-multi-method multi-method |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3005 tramp-current-method method |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3006 tramp-current-user user |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3007 tramp-current-host host) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3008 (tramp-message |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3009 5 "Transferring %s to file %s..." filename newname) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3010 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3011 ;; Use rcp-like program for file transfer. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3012 (let ((p (apply 'start-process (buffer-name trampbuf) trampbuf |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3013 copy-program copy-args))) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3014 (tramp-set-process-query-on-exit-flag p nil) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3015 (tramp-process-actions p multi-method method user host |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3016 tramp-actions-copy-out-of-band)) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3017 (kill-buffer trampbuf) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3018 (tramp-message |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3019 5 "Transferring %s to file %s...done" filename newname)) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3020 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3021 ;; If the operation was `rename', delete the original file. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3022 (unless (eq op 'copy) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3023 (delete-file filename)))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3024 |
45861 | 3025 ;; mkdir |
3026 (defun tramp-handle-make-directory (dir &optional parents) | |
3027 "Like `make-directory' for tramp files." | |
46752 | 3028 (setq dir (expand-file-name dir)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3029 (with-parsed-tramp-file-name dir nil |
46790 | 3030 (save-excursion |
3031 (tramp-barf-unless-okay | |
3032 multi-method method user host | |
3033 (format " %s %s" | |
3034 (if parents "mkdir -p" "mkdir") | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3035 (tramp-shell-quote-argument localname)) |
46790 | 3036 nil 'file-error |
3037 "Couldn't make directory %s" dir)))) | |
45861 | 3038 |
3039 ;; CCC error checking? | |
3040 (defun tramp-handle-delete-directory (directory) | |
3041 "Like `delete-directory' for tramp files." | |
46752 | 3042 (setq directory (expand-file-name directory)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3043 (with-parsed-tramp-file-name directory nil |
45861 | 3044 (save-excursion |
3045 (tramp-send-command | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3046 multi-method method user host |
45861 | 3047 (format "rmdir %s ; echo ok" |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3048 (tramp-shell-quote-argument localname))) |
45861 | 3049 (tramp-wait-for-output)))) |
3050 | |
3051 (defun tramp-handle-delete-file (filename) | |
3052 "Like `delete-file' for tramp files." | |
46752 | 3053 (setq filename (expand-file-name filename)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3054 (with-parsed-tramp-file-name filename nil |
46048
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
3055 (save-excursion |
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
3056 (unless (zerop (tramp-send-command-and-check |
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
3057 multi-method method user host |
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
3058 (format "rm -f %s" |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3059 (tramp-shell-quote-argument localname)))) |
46048
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
3060 (signal 'file-error "Couldn't delete Tramp file"))))) |
45861 | 3061 |
3062 ;; Dired. | |
3063 | |
3064 ;; CCC: This does not seem to be enough. Something dies when | |
3065 ;; we try and delete two directories under TRAMP :/ | |
3066 (defun tramp-handle-dired-recursive-delete-directory (filename) | |
3067 "Recursively delete the directory given. | |
3068 This is like `dired-recursive-delete-directory' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3069 (with-parsed-tramp-file-name filename nil |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3070 ;; run a shell command 'rm -r <localname>' |
45861 | 3071 ;; Code shamelessly stolen for the dired implementation and, um, hacked :) |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3072 (or (file-exists-p filename) |
45861 | 3073 (signal |
3074 'file-error | |
3075 (list "Removing old file name" "no such directory" filename))) | |
3076 ;; Which is better, -r or -R? (-r works for me <daniel@danann.net>) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3077 (tramp-send-command multi-method method user host |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3078 (format "rm -r %s" (tramp-shell-quote-argument localname))) |
45861 | 3079 ;; Wait for the remote system to return to us... |
3080 ;; This might take a while, allow it plenty of time. | |
3081 (tramp-wait-for-output 120) | |
3082 ;; Make sure that it worked... | |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3083 (and (file-exists-p filename) |
45861 | 3084 (error "Failed to recusively delete %s" filename)))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3085 |
45861 | 3086 (defun tramp-handle-dired-call-process (program discard &rest arguments) |
3087 "Like `dired-call-process' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3088 (with-parsed-tramp-file-name default-directory nil |
45861 | 3089 (save-excursion |
3090 (tramp-barf-unless-okay | |
3091 multi-method method user host | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3092 (format "cd %s" (tramp-shell-quote-argument localname)) |
45861 | 3093 nil 'file-error |
3094 "tramp-handle-dired-call-process: Couldn't `cd %s'" | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3095 (tramp-shell-quote-argument localname)) |
45861 | 3096 (tramp-send-command |
3097 multi-method method user host | |
3098 (mapconcat #'tramp-shell-quote-argument (cons program arguments) " ")) | |
3099 (tramp-wait-for-output)) | |
3100 (unless discard | |
3101 (insert-buffer (tramp-get-buffer multi-method method user host))) | |
3102 (save-excursion | |
3103 (prog1 | |
3104 (tramp-send-command-and-check multi-method method user host nil) | |
3105 (tramp-send-command multi-method method user host "cd") | |
3106 (tramp-wait-for-output))))) | |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3107 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3108 (defun tramp-handle-dired-compress-file (file &rest ok-flag) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3109 "Like `dired-compress-file' for tramp files." |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3110 ;; OK-FLAG is valid for XEmacs only, but not implemented. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3111 ;; Code stolen mainly from dired-aux.el. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3112 (with-parsed-tramp-file-name file nil |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3113 (save-excursion |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3114 (let ((suffixes |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3115 (if (not (featurep 'xemacs)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3116 ;; Emacs case |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3117 (symbol-value 'dired-compress-file-suffixes) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3118 ;; XEmacs has `dired-compression-method-alist', which is |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3119 ;; transformed into `dired-compress-file-suffixes' structure. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3120 (mapcar |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3121 '(lambda (x) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3122 (list (concat (regexp-quote (nth 1 x)) "\\'") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3123 nil |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3124 (mapconcat 'identity (nth 3 x) " "))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3125 (symbol-value 'dired-compression-method-alist)))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3126 suffix) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3127 ;; See if any suffix rule matches this file name. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3128 (while suffixes |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3129 (let (case-fold-search) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3130 (if (string-match (car (car suffixes)) localname) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3131 (setq suffix (car suffixes) suffixes nil)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3132 (setq suffixes (cdr suffixes)))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3133 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3134 (cond ((file-symlink-p file) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3135 nil) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3136 ((and suffix (nth 2 suffix)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3137 ;; We found an uncompression rule. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3138 (message "Uncompressing %s..." file) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3139 (when (zerop (tramp-send-command-and-check |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3140 multi-method method user host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3141 (concat (nth 2 suffix) " " localname))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3142 (message "Uncompressing %s...done" file) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3143 ;; `dired-remove-file' is not defined in XEmacs |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3144 (funcall (symbol-function 'dired-remove-file) file) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3145 (string-match (car suffix) file) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3146 (concat (substring file 0 (match-beginning 0))))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3147 (t |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3148 ;; We don't recognize the file as compressed, so compress it. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3149 ;; Try gzip. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3150 (message "Compressing %s..." file) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3151 (when (zerop (tramp-send-command-and-check |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3152 multi-method method user host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3153 (concat "gzip -f " localname))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3154 (message "Compressing %s...done" file) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3155 ;; `dired-remove-file' is not defined in XEmacs |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3156 (funcall (symbol-function 'dired-remove-file) file) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3157 (cond ((file-exists-p (concat file ".gz")) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3158 (concat file ".gz")) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3159 ((file-exists-p (concat file ".z")) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3160 (concat file ".z")) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3161 (t nil))))))))) |
45861 | 3162 |
3163 ;; Pacify byte-compiler. The function is needed on XEmacs only. I'm | |
3164 ;; not sure at all that this is the right way to do it, but let's hope | |
3165 ;; it works for now, and wait for a guru to point out the Right Way to | |
3166 ;; achieve this. | |
3167 ;;(eval-when-compile | |
3168 ;; (unless (fboundp 'dired-insert-set-properties) | |
3169 ;; (fset 'dired-insert-set-properties 'ignore))) | |
3170 ;; Gerd suggests this: | |
3171 (eval-when-compile (require 'dired)) | |
3172 ;; Note that dired is required at run-time, too, when it is needed. | |
3173 ;; It is only needed on XEmacs for the function | |
3174 ;; `dired-insert-set-properties'. | |
3175 | |
3176 (defun tramp-handle-insert-directory | |
3177 (filename switches &optional wildcard full-directory-p) | |
3178 "Like `insert-directory' for tramp files." | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3179 ;; For the moment, we assume that the remote "ls" program does not |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3180 ;; grok "--dired". In the future, we should detect this on |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3181 ;; connection setup. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3182 (when (string-match "^--dired\\s-+" switches) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3183 (setq switches (replace-match "" nil t switches))) |
46752 | 3184 (setq filename (expand-file-name filename)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3185 (with-parsed-tramp-file-name filename nil |
45861 | 3186 (tramp-message-for-buffer |
3187 multi-method method user host 10 | |
3188 "Inserting directory `ls %s %s', wildcard %s, fulldir %s" | |
3189 switches filename (if wildcard "yes" "no") | |
3190 (if full-directory-p "yes" "no")) | |
3191 (when wildcard | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3192 (setq wildcard (file-name-nondirectory localname)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3193 (setq localname (file-name-directory localname))) |
45861 | 3194 (when (listp switches) |
3195 (setq switches (mapconcat 'identity switches " "))) | |
3196 (unless full-directory-p | |
3197 (setq switches (concat "-d " switches))) | |
3198 (when wildcard | |
3199 (setq switches (concat switches " " wildcard))) | |
3200 (save-excursion | |
3201 ;; If `full-directory-p', we just say `ls -l FILENAME'. | |
3202 ;; Else we chdir to the parent directory, then say `ls -ld BASENAME'. | |
3203 (if full-directory-p | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3204 (tramp-send-command |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3205 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3206 (format "%s %s %s" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3207 (tramp-get-ls-command multi-method method user host) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3208 switches |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3209 (if wildcard |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3210 localname |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3211 (tramp-shell-quote-argument (concat localname "."))))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3212 (tramp-barf-unless-okay |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3213 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3214 (format "cd %s" (tramp-shell-quote-argument |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3215 (file-name-directory localname))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3216 nil 'file-error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3217 "Couldn't `cd %s'" |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3218 (tramp-shell-quote-argument (file-name-directory localname))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3219 (tramp-send-command |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3220 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3221 (format "%s %s %s" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3222 (tramp-get-ls-command multi-method method user host) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3223 switches |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3224 (if wildcard |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3225 localname |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3226 (tramp-shell-quote-argument |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3227 (file-name-nondirectory localname)))))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3228 (sit-for 1) ;needed for rsh but not ssh? |
45861 | 3229 (tramp-wait-for-output)) |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3230 ;; The following let-binding is used by code that's commented |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3231 ;; out. Let's leave the let-binding in for a while to see |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3232 ;; that the commented-out code is really not needed. Commenting-out |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3233 ;; happened on 2003-03-13. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3234 (let ((old-pos (point))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3235 (insert-buffer-substring |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3236 (tramp-get-buffer multi-method method user host)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3237 ;; On XEmacs, we want to call (exchange-point-and-mark t), but |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3238 ;; that doesn't exist on Emacs, so we use this workaround instead. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3239 ;; Since zmacs-region-stays doesn't exist in Emacs, this ought to |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3240 ;; be safe. Thanks to Daniel Pittman <daniel@danann.net>. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3241 ;; (let ((zmacs-region-stays t)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3242 ;; (exchange-point-and-mark)) |
45861 | 3243 (save-excursion |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3244 (tramp-send-command multi-method method user host "cd") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3245 (tramp-wait-for-output)) |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3246 ;; For the time being, the XEmacs kludge is commented out. |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3247 ;; Please test it on various XEmacs versions to see if it works. |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3248 ;; ;; Another XEmacs specialty follows. What's the right way to do |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3249 ;; ;; it? |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3250 ;; (when (and (featurep 'xemacs) |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3251 ;; (eq major-mode 'dired-mode)) |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3252 ;; (save-excursion |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3253 ;; (require 'dired) |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3254 ;; (dired-insert-set-properties old-pos (point)))) |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3255 ))) |
45861 | 3256 |
3257 ;; Continuation of kluge to pacify byte-compiler. | |
3258 ;;(eval-when-compile | |
3259 ;; (when (eq (symbol-function 'dired-insert-set-properties) 'ignore) | |
3260 ;; (fmakunbound 'dired-insert-set-properties))) | |
3261 | |
3262 ;; CCC is this the right thing to do? | |
3263 (defun tramp-handle-unhandled-file-name-directory (filename) | |
3264 "Like `unhandled-file-name-directory' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3265 (with-parsed-tramp-file-name filename nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3266 (expand-file-name "~/"))) |
45861 | 3267 |
3268 ;; Canonicalization of file names. | |
3269 | |
3270 (defun tramp-drop-volume-letter (name) | |
3271 "Cut off unnecessary drive letter from file NAME. | |
3272 The function `tramp-handle-expand-file-name' calls `expand-file-name' | |
3273 locally on a remote file name. When the local system is a W32 system | |
3274 but the remote system is Unix, this introduces a superfluous drive | |
3275 letter into the file name. This function removes it. | |
3276 | |
3277 Doesn't do anything if the NAME does not start with a drive letter." | |
3278 (if (and (> (length name) 1) | |
3279 (char-equal (aref name 1) ?:) | |
3280 (let ((c1 (aref name 0))) | |
3281 (or (and (>= c1 ?A) (<= c1 ?Z)) | |
3282 (and (>= c1 ?a) (<= c1 ?z))))) | |
3283 (substring name 2) | |
3284 name)) | |
3285 | |
3286 (defun tramp-handle-expand-file-name (name &optional dir) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3287 "Like `expand-file-name' for tramp files. |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3288 If the localname part of the given filename starts with \"/../\" then |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3289 the result will be a local, non-Tramp, filename." |
45861 | 3290 ;; If DIR is not given, use DEFAULT-DIRECTORY or "/". |
3291 (setq dir (or dir default-directory "/")) | |
3292 ;; Unless NAME is absolute, concat DIR and NAME. | |
3293 (unless (file-name-absolute-p name) | |
3294 (setq name (concat (file-name-as-directory dir) name))) | |
3295 ;; If NAME is not a tramp file, run the real handler | |
3296 (if (not (tramp-tramp-file-p name)) | |
3297 (tramp-run-real-handler 'expand-file-name | |
3298 (list name nil)) | |
3299 ;; Dissect NAME. | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3300 (with-parsed-tramp-file-name name nil |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3301 (unless (file-name-absolute-p localname) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3302 (setq localname (concat "~/" localname))) |
45861 | 3303 (save-excursion |
3304 ;; Tilde expansion if necessary. This needs a shell which | |
3305 ;; groks tilde expansion! The function `tramp-find-shell' is | |
3306 ;; supposed to find such a shell on the remote host. Please | |
3307 ;; tell me about it when this doesn't work on your system. | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3308 (when (string-match "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3309 (let ((uname (match-string 1 localname)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3310 (fname (match-string 2 localname))) |
45861 | 3311 ;; CCC fanatic error checking? |
3312 (set-buffer (tramp-get-buffer multi-method method user host)) | |
3313 (erase-buffer) | |
3314 (tramp-send-command | |
3315 multi-method method user host | |
3316 (format "cd %s; pwd" uname) | |
3317 t) | |
3318 (tramp-wait-for-output) | |
3319 (goto-char (point-min)) | |
3320 (setq uname (buffer-substring (point) (tramp-line-end-position))) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3321 (setq localname (concat uname fname)) |
45861 | 3322 (erase-buffer))) |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3323 ;; No tilde characters in file name, do normal |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3324 ;; expand-file-name (this does "/./" and "/../"). We bind |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3325 ;; directory-sep-char here for XEmacs on Windows, which |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3326 ;; would otherwise use backslash. |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3327 (tramp-let-maybe directory-sep-char ?/ |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3328 (tramp-make-tramp-file-name |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
3329 multi-method (or method (tramp-find-default-method user host)) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
3330 user host |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3331 (tramp-drop-volume-letter |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3332 (tramp-run-real-handler 'expand-file-name |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3333 (list localname))))))))) |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3334 |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3335 ;; old version follows. it uses ".." to cross file handler |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3336 ;; boundaries. |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3337 ;; ;; Look if localname starts with "/../" construct. If this is |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3338 ;; ;; the case, then we return a local name instead of a remote name. |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3339 ;; (if (string-match "^/\\.\\./" localname) |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3340 ;; (expand-file-name (substring localname 3)) |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3341 ;; ;; No tilde characters in file name, do normal |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3342 ;; ;; expand-file-name (this does "/./" and "/../"). We bind |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3343 ;; ;; directory-sep-char here for XEmacs on Windows, which |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3344 ;; ;; would otherwise use backslash. |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3345 ;; (let ((directory-sep-char ?/)) |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3346 ;; (tramp-make-tramp-file-name |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3347 ;; multi-method method user host |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3348 ;; (tramp-drop-volume-letter |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3349 ;; (tramp-run-real-handler 'expand-file-name |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3350 ;; (list localname)))))))))) |
45861 | 3351 |
3352 ;; Remote commands. | |
3353 | |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3354 (defvar tramp-async-proc nil |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3355 "Global variable keeping asyncronous process object. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3356 Used in `tramp-handle-shell-command'") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3357 |
45861 | 3358 (defun tramp-handle-shell-command (command &optional output-buffer error-buffer) |
3359 "Like `shell-command' for tramp files. | |
3360 This will break if COMMAND prints a newline, followed by the value of | |
3361 `tramp-end-of-output', followed by another newline." | |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3362 ;; Asynchronous processes are far from being perfect. But it works at least |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3363 ;; for `find-grep-dired' and `find-name-dired' in Emacs 21.4. |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3364 (if (tramp-tramp-file-p default-directory) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3365 (with-parsed-tramp-file-name default-directory nil |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3366 (let ((asynchronous (string-match "[ \t]*&[ \t]*\\'" command)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3367 status) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3368 (unless output-buffer |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3369 (setq output-buffer |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3370 (get-buffer-create |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3371 (if asynchronous |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3372 "*Async Shell Command*" |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3373 "*Shell Command Output*"))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3374 (set-buffer output-buffer) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3375 (erase-buffer)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3376 (unless (bufferp output-buffer) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3377 (setq output-buffer (current-buffer))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3378 (set-buffer output-buffer) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3379 ;; Tramp doesn't handle the asynchronous case by an asynchronous |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3380 ;; process. Instead of, another asynchronous process is opened |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3381 ;; which gets the output of the (synchronous) Tramp process |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3382 ;; via process-filter. ERROR-BUFFER is disabled. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3383 (when asynchronous |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3384 (setq command (substring command 0 (match-beginning 0)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3385 error-buffer nil |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3386 tramp-async-proc (start-process (buffer-name output-buffer) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3387 output-buffer "cat"))) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3388 (save-excursion |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3389 (tramp-barf-unless-okay |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3390 multi-method method user host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3391 (format "cd %s" (tramp-shell-quote-argument localname)) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3392 nil 'file-error |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3393 "tramp-handle-shell-command: Couldn't `cd %s'" |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3394 (tramp-shell-quote-argument localname)) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3395 ;; Define the process filter |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3396 (when asynchronous |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3397 (set-process-filter |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3398 (get-buffer-process |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3399 (tramp-get-buffer multi-method method user host)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3400 '(lambda (process string) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3401 ;; Write the output into the Tramp Process |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3402 (save-current-buffer |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3403 (set-buffer (process-buffer process)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3404 (goto-char (point-max)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3405 (insert string)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3406 ;; Hand-over output to asynchronous process. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3407 (let ((end |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3408 (string-match |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3409 (regexp-quote tramp-end-of-output) string))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3410 (when end |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3411 (setq string |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3412 (substring string 0 (1- (match-beginning 0))))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3413 (process-send-string tramp-async-proc string) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3414 (when end |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3415 (set-process-filter process nil) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3416 (process-send-eof tramp-async-proc)))))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3417 ;; Send the command |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3418 (tramp-send-command |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3419 multi-method method user host |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3420 (if error-buffer |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3421 (format "( %s ) 2>/tmp/tramp.$$.err; tramp_old_status=$?" |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3422 command) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3423 (format "%s; tramp_old_status=$?" command))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3424 (unless asynchronous |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3425 (tramp-wait-for-output))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3426 (unless asynchronous |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3427 (insert-buffer (tramp-get-buffer multi-method method user host))) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3428 (when error-buffer |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3429 (save-excursion |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3430 (unless (bufferp error-buffer) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3431 (setq error-buffer (get-buffer-create error-buffer))) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3432 (tramp-send-command |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3433 multi-method method user host |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3434 "cat /tmp/tramp.$$.err") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3435 (tramp-wait-for-output) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3436 (set-buffer error-buffer) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3437 (insert-buffer (tramp-get-buffer multi-method method user host)) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3438 (tramp-send-command-and-check |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3439 multi-method method user host "rm -f /tmp/tramp.$$.err"))) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3440 (save-excursion |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3441 (tramp-send-command multi-method method user host "cd") |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3442 (unless asynchronous |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3443 (tramp-wait-for-output)) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3444 (tramp-send-command |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3445 multi-method method user host |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3446 (concat "tramp_set_exit_status $tramp_old_status;" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3447 " echo tramp_exit_status $?")) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3448 (unless asynchronous |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3449 (tramp-wait-for-output) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3450 (goto-char (point-max)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3451 (unless (search-backward "tramp_exit_status " nil t) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3452 (error "Couldn't find exit status of `%s'" command)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3453 (skip-chars-forward "^ ") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3454 (setq status (read (current-buffer))))) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3455 (unless (zerop (buffer-size)) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3456 (display-buffer output-buffer)) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3457 status)) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3458 ;; The following is only executed if something strange was |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3459 ;; happening. Emit a helpful message and do it anyway. |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3460 (message "tramp-handle-shell-command called with non-tramp directory: `%s'" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3461 default-directory) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3462 (tramp-run-real-handler 'shell-command |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3463 (list command output-buffer error-buffer)))) |
45861 | 3464 |
3465 ;; File Editing. | |
3466 | |
3467 (defsubst tramp-make-temp-file () | |
3468 (funcall (if (fboundp 'make-temp-file) 'make-temp-file 'make-temp-name) | |
3469 (expand-file-name tramp-temp-name-prefix | |
3470 (tramp-temporary-file-directory)))) | |
3471 | |
3472 (defun tramp-handle-file-local-copy (filename) | |
3473 "Like `file-local-copy' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3474 (with-parsed-tramp-file-name filename nil |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3475 (let ((tramp-buf (tramp-get-buffer multi-method method user host)) |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3476 ;; We used to bind the following as late as possible. |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3477 ;; loc-enc and loc-dec were bound directly before the if |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3478 ;; statement that checks them. But the functions |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3479 ;; tramp-get-* might invoke the "are you awake" check in |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3480 ;; tramp-maybe-open-connection, which is an unfortunate time |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3481 ;; since we rely on the buffer contents at that spot. |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3482 (rem-enc (tramp-get-remote-encoding multi-method method user host)) |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3483 (rem-dec (tramp-get-remote-decoding multi-method method user host)) |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3484 (loc-enc (tramp-get-local-encoding multi-method method user host)) |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3485 (loc-dec (tramp-get-local-decoding multi-method method user host)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3486 tmpfil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3487 (unless (file-exists-p filename) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3488 (error "Cannot make local copy of non-existing file `%s'" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3489 filename)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3490 (setq tmpfil (tramp-make-temp-file)) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3491 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3492 (cond ((tramp-method-out-of-band-p multi-method method user host) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3493 ;; `copy-file' handles out-of-band methods |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3494 (copy-file filename tmpfil t t)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3495 |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3496 ((and rem-enc rem-dec) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3497 ;; Use inline encoding for file transfer. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3498 (save-excursion |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3499 ;; Following line for setting tramp-current-method, |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3500 ;; tramp-current-user, tramp-current-host. |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3501 (set-buffer tramp-buf) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3502 (tramp-message 5 "Encoding remote file %s..." filename) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3503 (tramp-barf-unless-okay |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3504 multi-method method user host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3505 (concat rem-enc " < " (tramp-shell-quote-argument localname)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3506 nil 'file-error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3507 "Encoding remote file failed, see buffer `%s' for details" |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3508 tramp-buf) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3509 ;; Remove trailing status code |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3510 (goto-char (point-max)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3511 (delete-region (point) (progn (forward-line -1) (point))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3512 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3513 (tramp-message 5 "Decoding remote file %s..." filename) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3514 |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3515 ;; Here is where loc-enc and loc-dec used to be let-bound. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3516 (if (and (symbolp loc-dec) (fboundp loc-dec)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3517 ;; If local decoding is a function, we call it. |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3518 (let ((tmpbuf (get-buffer-create " *tramp tmp*"))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3519 (set-buffer tmpbuf) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3520 (erase-buffer) |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3521 (insert-buffer tramp-buf) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3522 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3523 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3524 6 "Decoding remote file %s with function %s..." |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3525 filename loc-dec) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3526 (set-buffer tmpbuf) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3527 ;; Douglas Gray Stephens <DGrayStephens@slb.com> |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3528 ;; says that we need to strip tramp_exit_status |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3529 ;; line from the output here. Go to point-max, |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3530 ;; search backward for tramp_exit_status, delete |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3531 ;; between point and point-max if found. |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3532 (let ((coding-system-for-write 'binary)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3533 (funcall loc-dec (point-min) (point-max)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3534 (write-region (point-min) (point-max) tmpfil)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3535 (kill-buffer tmpbuf)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3536 ;; If tramp-decoding-function is not defined for this |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3537 ;; method, we invoke tramp-decoding-command instead. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3538 (let ((tmpfil2 (tramp-make-temp-file))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3539 (write-region (point-min) (point-max) tmpfil2) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3540 (tramp-message |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3541 6 "Decoding remote file %s with command %s..." |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3542 filename loc-dec) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3543 (tramp-call-local-coding-command |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3544 loc-dec tmpfil2 tmpfil) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3545 (delete-file tmpfil2))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3546 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3547 multi-method method user host |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3548 5 "Decoding remote file %s...done" filename) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3549 ;; Set proper permissions. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3550 (set-file-modes tmpfil (file-modes filename)))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3551 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3552 (t (error "Wrong method specification for `%s'" method))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3553 tmpfil))) |
45861 | 3554 |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3555 (defun tramp-handle-file-remote-p (filename) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3556 "Like `file-remote-p' for tramp files." |
56261
d863bc830907
(tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
55864
diff
changeset
|
3557 (when (tramp-tramp-file-p filename) |
d863bc830907
(tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
55864
diff
changeset
|
3558 (with-parsed-tramp-file-name filename nil |
d863bc830907
(tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
55864
diff
changeset
|
3559 (make-tramp-file-name |
d863bc830907
(tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
55864
diff
changeset
|
3560 :multi-method multi-method |
d863bc830907
(tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
55864
diff
changeset
|
3561 :method method |
d863bc830907
(tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
55864
diff
changeset
|
3562 :user user |
d863bc830907
(tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
55864
diff
changeset
|
3563 :host host |
d863bc830907
(tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
55864
diff
changeset
|
3564 :localname "")))) |
45861 | 3565 |
3566 (defun tramp-handle-insert-file-contents | |
3567 (filename &optional visit beg end replace) | |
3568 "Like `insert-file-contents' for tramp files." | |
3569 (barf-if-buffer-read-only) | |
3570 (setq filename (expand-file-name filename)) | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3571 (with-parsed-tramp-file-name filename 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
|
3572 (if (not (file-exists-p filename)) |
45861 | 3573 (progn |
3574 (when visit | |
3575 (setq buffer-file-name filename) | |
3576 (set-visited-file-modtime) | |
3577 (set-buffer-modified-p nil)) | |
3578 (signal 'file-error | |
3579 (format "File `%s' not found on remote host" filename)) | |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3580 (list (expand-file-name filename) 0)) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3581 ;; `insert-file-contents-literally' takes care to avoid calling |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3582 ;; jka-compr. By let-binding inhibit-file-name-operation, we |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3583 ;; propagate that care to the file-local-copy operation. |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3584 (let ((local-copy |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3585 (let ((inhibit-file-name-operation |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3586 (when (eq inhibit-file-name-operation |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3587 'insert-file-contents) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3588 'file-local-copy))) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3589 (file-local-copy filename))) |
45861 | 3590 (coding-system-used nil) |
3591 (result nil)) | |
3592 (when visit | |
3593 (setq buffer-file-name filename) | |
3594 (set-visited-file-modtime) | |
3595 (set-buffer-modified-p nil)) | |
3596 (tramp-message-for-buffer | |
3597 multi-method method user host | |
3598 9 "Inserting local temp file `%s'..." local-copy) | |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3599 (setq result (insert-file-contents local-copy nil beg end replace)) |
45861 | 3600 ;; Now `last-coding-system-used' has right value. Remember it. |
3601 (when (boundp 'last-coding-system-used) | |
3602 (setq coding-system-used last-coding-system-used)) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3603 (tramp-message-for-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3604 multi-method method user host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3605 9 "Inserting local temp file `%s'...done" local-copy) |
45861 | 3606 (delete-file local-copy) |
3607 (when (boundp 'last-coding-system-used) | |
3608 (setq last-coding-system-used coding-system-used)) | |
3609 (list (expand-file-name filename) | |
3610 (second result)))))) | |
3611 | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3612 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3613 (defun tramp-handle-find-backup-file-name (filename) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3614 "Like `find-backup-file-name' for tramp files." |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3615 (with-parsed-tramp-file-name filename nil |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3616 ;; We set both variables. It doesn't matter whether it is |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3617 ;; Emacs or XEmacs |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3618 (let ((backup-directory-alist |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3619 ;; Emacs case |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3620 (when (boundp 'backup-directory-alist) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3621 (if (boundp 'tramp-backup-directory-alist) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3622 (mapcar |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3623 '(lambda (x) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3624 (cons |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3625 (car x) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3626 (if (and (stringp (cdr x)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3627 (file-name-absolute-p (cdr x)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3628 (not (tramp-file-name-p (cdr x)))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3629 (tramp-make-tramp-file-name |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3630 multi-method method user host (cdr x)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3631 (cdr x)))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3632 (symbol-value 'tramp-backup-directory-alist)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3633 (symbol-value 'backup-directory-alist)))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3634 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3635 (bkup-backup-directory-info |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3636 ;; XEmacs case |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3637 (when (boundp 'bkup-backup-directory-info) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3638 (if (boundp 'tramp-bkup-backup-directory-info) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3639 (mapcar |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3640 '(lambda (x) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3641 (nconc |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3642 (list (car x)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3643 (list |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3644 (if (and (stringp (car (cdr x))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3645 (file-name-absolute-p (car (cdr x))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3646 (not (tramp-file-name-p (car (cdr x))))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3647 (tramp-make-tramp-file-name |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3648 multi-method method user host (car (cdr x))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3649 (car (cdr x)))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3650 (cdr (cdr x)))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3651 (symbol-value 'tramp-bkup-backup-directory-info)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3652 (symbol-value 'bkup-backup-directory-info))))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3653 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3654 (tramp-run-real-handler 'find-backup-file-name (list filename))))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3655 |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3656 |
45861 | 3657 ;; CCC grok APPEND, LOCKNAME, CONFIRM |
3658 (defun tramp-handle-write-region | |
3659 (start end filename &optional append visit lockname confirm) | |
3660 "Like `write-region' for tramp files." | |
3661 (unless (eq append nil) | |
3662 (error "Cannot append to file using tramp (`%s')" filename)) | |
3663 (setq filename (expand-file-name filename)) | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3664 ;; Following part commented out because we don't know what to do about |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3665 ;; file locking, and it does not appear to be a problem to ignore it. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3666 ;; Ange-ftp ignores it, too. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3667 ;; (when (and lockname (stringp lockname)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3668 ;; (setq lockname (expand-file-name lockname))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3669 ;; (unless (or (eq lockname nil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3670 ;; (string= lockname filename)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3671 ;; (error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3672 ;; "tramp-handle-write-region: LOCKNAME must be nil or equal FILENAME")) |
45861 | 3673 ;; XEmacs takes a coding system as the sevent argument, not `confirm' |
3674 (when (and (not (featurep 'xemacs)) | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3675 confirm (file-exists-p filename)) |
45861 | 3676 (unless (y-or-n-p (format "File %s exists; overwrite anyway? " |
3677 filename)) | |
3678 (error "File not overwritten"))) | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3679 (with-parsed-tramp-file-name filename nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3680 (let ((curbuf (current-buffer)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3681 (rem-enc (tramp-get-remote-encoding multi-method method user host)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3682 (rem-dec (tramp-get-remote-decoding multi-method method user host)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3683 (loc-enc (tramp-get-local-encoding multi-method method user host)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3684 (loc-dec (tramp-get-local-decoding multi-method method user host)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3685 (trampbuf (get-buffer-create "*tramp output*")) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3686 (modes (file-modes filename)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3687 ;; We use this to save the value of `last-coding-system-used' |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3688 ;; after writing the tmp file. At the end of the function, |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3689 ;; we set `last-coding-system-used' to this saved value. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3690 ;; This way, any intermediary coding systems used while |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3691 ;; talking to the remote shell or suchlike won't hose this |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3692 ;; variable. This approach was snarfed from ange-ftp.el. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3693 coding-system-used |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3694 tmpfil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3695 ;; Write region into a tmp file. This isn't really needed if we |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3696 ;; use an encoding function, but currently we use it always |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3697 ;; because this makes the logic simpler. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3698 (setq tmpfil (tramp-make-temp-file)) |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3699 ;; Set current buffer. If connection wasn't open, `file-modes' has |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3700 ;; changed it accidently. |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3701 (set-buffer curbuf) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3702 ;; We say `no-message' here because we don't want the visited file |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3703 ;; modtime data to be clobbered from the temp file. We call |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3704 ;; `set-visited-file-modtime' ourselves later on. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3705 (tramp-run-real-handler |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3706 'write-region |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3707 (if confirm ; don't pass this arg unless defined for backward compat. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3708 (list start end tmpfil append 'no-message lockname confirm) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3709 (list start end tmpfil append 'no-message lockname))) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3710 ;; The permissions of the temporary file should be set. If |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3711 ;; filename does not exist (eq modes nil) it has been renamed to |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3712 ;; the backup file. This case `save-buffer' handles |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3713 ;; permissions. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3714 (when modes (set-file-modes tmpfil modes)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3715 ;; Now, `last-coding-system-used' has the right value. Remember it. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3716 (when (boundp 'last-coding-system-used) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3717 (setq coding-system-used last-coding-system-used)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3718 ;; This is a bit lengthy due to the different methods possible for |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3719 ;; file transfer. First, we check whether the method uses an rcp |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3720 ;; program. If so, we call it. Otherwise, both encoding and |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3721 ;; decoding command must be specified. However, if the method |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3722 ;; _also_ specifies an encoding function, then that is used for |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3723 ;; encoding the contents of the tmp file. |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3724 (cond ((tramp-method-out-of-band-p multi-method method user host) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3725 ;; `copy-file' handles out-of-band methods |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3726 (copy-file tmpfil filename t t)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3727 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3728 ((and rem-enc rem-dec) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3729 ;; Use inline file transfer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3730 (let ((tmpbuf (get-buffer-create " *tramp file transfer*"))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3731 (save-excursion |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3732 ;; Encode tmpfil into tmpbuf |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3733 (tramp-message-for-buffer multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3734 5 "Encoding region...") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3735 (set-buffer tmpbuf) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3736 (erase-buffer) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3737 ;; Use encoding function or command. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3738 (if (and (symbolp loc-enc) (fboundp loc-enc)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3739 (progn |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3740 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3741 multi-method method user host |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3742 6 "Encoding region using function `%s'..." |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3743 (symbol-name loc-enc)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3744 (insert-file-contents-literally tmpfil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3745 ;; CCC. The following `let' is a workaround for |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3746 ;; the base64.el that comes with pgnus-0.84. If |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3747 ;; both of the following conditions are |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3748 ;; satisfied, it tries to write to a local file |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3749 ;; in default-directory, but at this point, |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3750 ;; default-directory is remote. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3751 ;; (CALL-PROCESS-REGION can't write to remote |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3752 ;; files, it seems.) The file in question is a |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3753 ;; tmp file anyway. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3754 (let ((default-directory |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3755 (tramp-temporary-file-directory))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3756 (funcall loc-enc (point-min) (point-max))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3757 (goto-char (point-max)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3758 (unless (bolp) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3759 (newline))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3760 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3761 multi-method method user host |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3762 6 "Encoding region using command `%s'..." loc-enc) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3763 (unless (equal 0 (tramp-call-local-coding-command |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3764 loc-enc tmpfil t)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3765 (pop-to-buffer trampbuf) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3766 (error (concat "Cannot write to `%s', local encoding" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3767 " command `%s' failed") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3768 filename loc-enc))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3769 ;; Send tmpbuf into remote decoding command which |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3770 ;; writes to remote file. Because this happens on the |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3771 ;; remote host, we cannot use the function. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3772 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3773 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3774 5 "Decoding region into remote file %s..." filename) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3775 (tramp-send-command |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3776 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3777 (format "%s >%s <<'EOF'" |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3778 rem-dec |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3779 (tramp-shell-quote-argument localname))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3780 (set-buffer tmpbuf) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3781 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3782 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3783 6 "Sending data to remote host...") |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3784 (tramp-send-string multi-method method user host |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3785 (buffer-string)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3786 ;; wait for remote decoding to complete |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3787 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3788 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3789 6 "Sending end of data token...") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3790 (tramp-send-command |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
3791 multi-method method user host "EOF" nil t) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3792 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3793 multi-method method user host 6 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3794 "Waiting for remote host to process data...") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3795 (set-buffer (tramp-get-buffer multi-method method user host)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3796 (tramp-wait-for-output) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3797 (tramp-barf-unless-okay |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3798 multi-method method user host nil nil 'file-error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3799 (concat "Couldn't write region to `%s'," |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3800 " decode using `%s' failed") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3801 filename rem-dec) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3802 (tramp-message 5 "Decoding region into remote file %s...done" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3803 filename) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3804 (kill-buffer tmpbuf)))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3805 (t |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3806 (error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3807 (concat "Method `%s' should specify both encoding and " |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3808 "decoding command or an rcp program") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3809 method))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3810 (delete-file tmpfil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3811 (unless (equal curbuf (current-buffer)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3812 (error "Buffer has changed from `%s' to `%s'" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3813 curbuf (current-buffer))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3814 (when (eq visit t) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3815 (set-visited-file-modtime)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3816 ;; Make `last-coding-system-used' have the right value. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3817 (when (boundp 'last-coding-system-used) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3818 (setq last-coding-system-used coding-system-used)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3819 (when (or (eq visit t) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3820 (eq visit nil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3821 (stringp visit)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3822 (message "Wrote %s" filename))))) |
45861 | 3823 |
3824 ;; Call down to the real handler. | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3825 ;; Because EFS does not play nicely with TRAMP (both systems match a |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3826 ;; TRAMP file name) it is needed to disable efs as well as tramp for the |
45861 | 3827 ;; operation. |
3828 ;; | |
3829 ;; Other than that, this is the canon file-handler code that the doco | |
3830 ;; says should be used here. Which is nice. | |
3831 ;; | |
3832 ;; Under XEmacs current, EFS also hooks in as | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3833 ;; efs-sifn-handler-function to handle any filename with environment |
45861 | 3834 ;; variables. This has two implications: |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3835 ;; 1) That EFS may not be completely dead (yet) for TRAMP filenames |
45861 | 3836 ;; 2) That TRAMP might want to do the same thing. |
3837 ;; Details as they come in. | |
3838 ;; | |
3839 ;; Daniel Pittman <daniel@danann.net> | |
3840 | |
3841 ;; (defun tramp-run-real-handler (operation args) | |
3842 ;; "Invoke normal file name handler for OPERATION. | |
3843 ;; This inhibits EFS and Ange-FTP, too, because they conflict with tramp. | |
3844 ;; First arg specifies the OPERATION, remaining ARGS are passed to the | |
3845 ;; OPERATION." | |
3846 ;; (let ((inhibit-file-name-handlers | |
3847 ;; (list 'tramp-file-name-handler | |
3848 ;; 'efs-file-handler-function | |
3849 ;; 'ange-ftp-hook-function | |
3850 ;; (and (eq inhibit-file-name-operation operation) | |
3851 ;; inhibit-file-name-handlers))) | |
3852 ;; (inhibit-file-name-operation operation)) | |
3853 ;; (apply operation args))) | |
3854 | |
3855 (defun tramp-run-real-handler (operation args) | |
3856 "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
|
3857 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
|
3858 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
|
3859 (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
|
3860 `(tramp-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
|
3861 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
|
3862 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
|
3863 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
|
3864 . |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3865 ,(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
|
3866 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
|
3867 (inhibit-file-name-operation operation)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3868 (apply operation args))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3869 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3870 ;; This function is used from `tramp-completion-file-name-handler' functions |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3871 ;; only, if `tramp-completion-mode' is true. But this cannot be checked here |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3872 ;; because the check is based on a full filename, not available for all |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3873 ;; basic I/O operations. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3874 (defun tramp-completion-run-real-handler (operation args) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3875 "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
|
3876 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
|
3877 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
|
3878 (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
|
3879 `(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
|
3880 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
|
3881 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
|
3882 . |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3883 ,(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
|
3884 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
|
3885 (inhibit-file-name-operation operation)) |
45861 | 3886 (apply operation args))) |
3887 | |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3888 ;; 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
|
3889 ;; name as first parameter; nevertheless we check for them explicitly |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3890 ;; in order to be signalled 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
|
3891 ;; 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
|
3892 ;; 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
|
3893 ;; 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
|
3894 ;; 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
|
3895 (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
|
3896 "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
|
3897 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
|
3898 (cond |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3899 ; FILE resp DIRECTORY |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3900 ((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
|
3901 (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
|
3902 '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
|
3903 '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
|
3904 '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
|
3905 '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
|
3906 '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
|
3907 '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
|
3908 '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
|
3909 '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
|
3910 '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
|
3911 '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
|
3912 '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
|
3913 '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
|
3914 'load 'make-directory 'make-directory-internal |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3915 '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
|
3916 'unhandled-file-name-directory 'vc-registered |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3917 ; XEmacs only |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3918 '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
|
3919 '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
|
3920 '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
|
3921 'dired-shell-unhandle-file-name 'dired-uucode-file |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3922 'insert-file-contents-literally 'recover-file |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3923 '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
|
3924 (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
|
3925 (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
|
3926 (expand-file-name (nth 0 args)))) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3927 ; FILE DIRECTORY resp FILE1 FILE2 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3928 ((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
|
3929 (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
|
3930 '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
|
3931 'file-newer-than-file-p 'make-symbolic-link 'rename-file |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3932 ; XEmacs only |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3933 '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
|
3934 '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
|
3935 (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
|
3936 (cond |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3937 ((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
|
3938 ((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
|
3939 (t (buffer-file-name (current-buffer)))))) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3940 ; START END FILE |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3941 ((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
|
3942 (nth 2 args)) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3943 ; BUF |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3944 ((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
|
3945 (list 'set-visited-file-modtime 'verify-visited-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
|
3946 ; XEmacs only |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3947 '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
|
3948 (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
|
3949 (if (bufferp (nth 0 args)) (nth 0 args) (current-buffer)))) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3950 ; COMMAND |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3951 ((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
|
3952 (list 'dired-call-process 'shell-command |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3953 ; XEmacs only |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3954 'dired-print-file 'dired-shell-call-process)) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3955 default-directory) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3956 ; unknown 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
|
3957 (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
|
3958 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3959 (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
|
3960 "Return foreign file name handler if exists." |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
3961 (when (tramp-tramp-file-p filename) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3962 (let (elt |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3963 res |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3964 (handler-alist tramp-foreign-file-name-handler-alist)) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3965 (while handler-alist |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3966 (setq elt (car handler-alist) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3967 handler-alist (cdr handler-alist)) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
3968 (when (funcall (car elt) filename) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3969 (setq handler-alist 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
|
3970 (setq res (cdr elt)))) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
3971 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
|
3972 |
45861 | 3973 ;; Main function. |
3974 ;;;###autoload | |
3975 (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
|
3976 "Invoke Tramp file name handler. |
45861 | 3977 Falls back to normal file name handler if no tramp file name handler exists." |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3978 (save-match-data |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3979 (let* ((filename (apply 'tramp-file-name-for-operation operation args)) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3980 (foreign (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
|
3981 (cond |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3982 (foreign (apply foreign operation args)) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
3983 (t (tramp-run-real-handler operation args)))))) |
45861 | 3984 |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3985 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3986 ;; 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
|
3987 ;; 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
|
3988 ;; 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
|
3989 ;; 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
|
3990 ;; 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
|
3991 ;; 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
|
3992 ;; 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
|
3993 ;; `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
|
3994 ;; (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
|
3995 ;; 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
|
3996 ;; 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
|
3997 ;; -- 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
|
3998 ;; 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
|
3999 ;; 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
|
4000 ;; 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
|
4001 ;; 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
|
4002 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4003 (defvar tramp-locked nil |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4004 "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
|
4005 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
|
4006 preventing reentrant calls of Tramp.") |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4007 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4008 (defvar tramp-locker nil |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4009 "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
|
4010 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
|
4011 preventing reentrant calls of Tramp.") |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4012 |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
4013 (defun tramp-sh-file-name-handler (operation &rest args) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
4014 "Invoke remote-shell Tramp file name handler. |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
4015 Fall back to normal file name handler if no Tramp handler exists." |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4016 (when (and tramp-locked (not tramp-locker)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4017 (signal 'file-error "Forbidden reentrant call of Tramp")) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4018 (let ((tl tramp-locked)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4019 (unwind-protect |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4020 (progn |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4021 (setq tramp-locked t) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4022 (let ((tramp-locker t)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4023 (save-match-data |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4024 (let ((fn (assoc operation tramp-file-name-handler-alist))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4025 (if fn |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4026 (apply (cdr fn) args) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4027 (tramp-run-real-handler operation args)))))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4028 (setq tramp-locked tl)))) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
4029 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4030 ;;;###autoload |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4031 (defun tramp-completion-file-name-handler (operation &rest args) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4032 "Invoke tramp file name completion handler. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4033 Falls back to normal file name handler if no tramp file name handler exists." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4034 ;; (setq tramp-debug-buffer t) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4035 ;; (tramp-message 1 "%s %s" operation args) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4036 ;; (tramp-message 1 "%s %s\n%s" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4037 ;; operation args (with-output-to-string (backtrace))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4038 (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4039 (if fn |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4040 (save-match-data (apply (cdr fn) args)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4041 (tramp-completion-run-real-handler operation args)))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4042 |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
4043 ;;;###autoload |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
4044 (put 'tramp-completion-file-name-handler 'safe-magic t) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
4045 |
45861 | 4046 ;; Register in file name handler alist |
4047 ;;;###autoload | |
4048 (add-to-list 'file-name-handler-alist | |
4049 (cons tramp-file-name-regexp 'tramp-file-name-handler)) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4050 (add-to-list 'file-name-handler-alist |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4051 (cons tramp-completion-file-name-regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4052 'tramp-completion-file-name-handler)) |
45861 | 4053 |
46048
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
4054 (defun tramp-repair-jka-compr () |
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
4055 "If jka-compr is already loaded, move it to the front of |
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
4056 `file-name-handler-alist'. On Emacs 21.4 or so this will not be |
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
4057 necessary anymore." |
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
4058 (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist))) |
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
4059 (when jka |
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
4060 (setq file-name-handler-alist |
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
4061 (cons jka (delete jka file-name-handler-alist)))))) |
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
4062 (tramp-repair-jka-compr) |
45861 | 4063 |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4064 |
45861 | 4065 ;;; Interactions with other packages: |
4066 | |
4067 ;; -- complete.el -- | |
4068 | |
4069 ;; This function contributed by Ed Sabol | |
4070 (defun tramp-handle-expand-many-files (name) | |
4071 "Like `PC-expand-many-files' for tramp files." | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4072 (with-parsed-tramp-file-name name nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4073 (save-match-data |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4074 (if (or (string-match "\\*" name) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4075 (string-match "\\?" name) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4076 (string-match "\\[.*\\]" name)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4077 (save-excursion |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4078 (let (bufstr) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4079 ;; CCC: To do it right, we should quote certain characters |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4080 ;; in the file name, but since the echo command is going to |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4081 ;; break anyway when there are spaces in the file names, we |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4082 ;; don't bother. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4083 ;;-(let ((comint-file-name-quote-list |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4084 ;;- (set-difference tramp-file-name-quote-list |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4085 ;;- '(?\* ?\? ?[ ?])))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4086 ;;- (tramp-send-command |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4087 ;;- multi-method method user host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4088 ;;- (format "echo %s" (comint-quote-filename localname))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4089 ;;- (tramp-wait-for-output)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4090 (tramp-send-command multi-method method user host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4091 (format "echo %s" localname)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4092 (tramp-wait-for-output) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4093 (setq bufstr (buffer-substring (point-min) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4094 (tramp-line-end-position))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4095 (goto-char (point-min)) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4096 (if (string-equal localname bufstr) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4097 nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4098 (insert "(\"") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4099 (while (search-forward " " nil t) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4100 (delete-backward-char 1) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4101 (insert "\" \"")) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4102 (goto-char (point-max)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4103 (delete-backward-char 1) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4104 (insert "\")") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4105 (goto-char (point-min)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4106 (mapcar |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4107 (function (lambda (x) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4108 (tramp-make-tramp-file-name multi-method method |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4109 user host x))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4110 (read (current-buffer)))))) |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4111 (list (expand-file-name name)))))) |
45861 | 4112 |
4113 ;; Check for complete.el and override PC-expand-many-files if appropriate. | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4114 (eval-and-compile |
45861 | 4115 (defun tramp-save-PC-expand-many-files (name))); avoid compiler warning |
4116 | |
4117 (defun tramp-setup-complete () | |
4118 (fset 'tramp-save-PC-expand-many-files | |
4119 (symbol-function 'PC-expand-many-files)) | |
4120 (defun PC-expand-many-files (name) | |
4121 (if (tramp-tramp-file-p name) | |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4122 (expand-many-files name) |
45861 | 4123 (tramp-save-PC-expand-many-files name)))) |
4124 | |
4125 ;; Why isn't eval-after-load sufficient? | |
4126 (if (fboundp 'PC-expand-many-files) | |
4127 (tramp-setup-complete) | |
4128 (eval-after-load "complete" '(tramp-setup-complete))) | |
4129 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4130 ;;; File name handler functions for completion mode |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4131 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4132 ;; Necessary because `tramp-file-name-regexp-unified' and |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4133 ;; `tramp-completion-file-name-regexp-unified' aren't different. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4134 ;; If nil, `tramp-completion-run-real-handler' is called (i.e. forwarding to |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4135 ;; `tramp-file-name-handler'). Otherwise, it takes `tramp-run-real-handler'. |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4136 ;; Using `last-input-event' is a little bit risky, because completing a file |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4137 ;; might require loading other files, like "~/.netrc", and for them it |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4138 ;; shouldn't be decided based on that variable. On the other hand, those files |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4139 ;; shouldn't have partial tramp file name syntax. Maybe another variable should |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4140 ;; be introduced overwriting this check in such cases. Or we change tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4141 ;; file name syntax in order to avoid ambiguities, like in XEmacs ... |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4142 ;; In case of non unified file names it can be always true (and wouldn't be |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4143 ;; necessary, because there are different regexp). |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4144 (defun tramp-completion-mode (file) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4145 "Checks whether method / user name / host name completion is active." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4146 (cond |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4147 ((not tramp-unified-filenames) t) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4148 ((string-match "^/.*:.*:$" file) nil) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4149 ((string-match |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
4150 (concat tramp-prefix-regexp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
4151 "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp "$") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4152 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
|
4153 (member (match-string 1 file) (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
|
4154 ((or (equal last-input-event 'tab) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4155 ;; Emacs |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4156 (and (integerp last-input-event) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4157 (not (event-modifiers last-input-event)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4158 (or (char-equal last-input-event ?\?) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4159 (char-equal last-input-event ?\t) ; handled by 'tab already? |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4160 (char-equal last-input-event ?\ ))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4161 ;; XEmacs |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4162 (and (featurep 'xemacs) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4163 (not (event-modifiers last-input-event)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4164 (or (char-equal |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4165 (funcall (symbol-function 'event-to-character) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4166 last-input-event) ?\?) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4167 (char-equal |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4168 (funcall (symbol-function 'event-to-character) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4169 last-input-event) ?\t) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4170 (char-equal |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4171 (funcall (symbol-function 'event-to-character) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4172 last-input-event) ?\ )))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4173 t))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4174 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4175 (defun tramp-completion-handle-file-exists-p (filename) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4176 "Like `file-exists-p' for tramp files." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4177 (if (tramp-completion-mode filename) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4178 (tramp-run-real-handler |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4179 'file-exists-p (list filename)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4180 (tramp-completion-run-real-handler |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4181 'file-exists-p (list filename)))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4182 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4183 ;; Localname manipulation in case of partial TRAMP file names. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4184 (defun tramp-completion-handle-file-name-directory (file) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4185 "Like `file-name-directory' but aware of TRAMP files." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4186 (if (tramp-completion-mode file) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4187 "/" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4188 (tramp-completion-run-real-handler |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4189 'file-name-directory (list file)))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4190 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4191 ;; Localname manipulation in case of partial TRAMP file names. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4192 (defun tramp-completion-handle-file-name-nondirectory (file) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4193 "Like `file-name-nondirectory' but aware of TRAMP files." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4194 (substring |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4195 file (length (tramp-completion-handle-file-name-directory file)))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4196 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4197 ;; 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
|
4198 ;; `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
|
4199 ;; tramp-file-name structures. For all of them we return possible completions. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4200 (defun tramp-completion-handle-file-name-all-completions (filename directory) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4201 "Like `file-name-all-completions' for partial tramp files." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4202 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4203 (let* |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4204 ((fullname (concat directory filename)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4205 ;; local files |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4206 (result |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4207 (if (tramp-completion-mode fullname) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4208 (tramp-run-real-handler |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4209 'file-name-all-completions (list filename directory)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4210 (tramp-completion-run-real-handler |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4211 'file-name-all-completions (list filename directory)))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4212 ;; possible completion structures |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4213 (v (tramp-completion-dissect-file-name fullname))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4214 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4215 (while v |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4216 (let* ((car (car v)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4217 (multi-method (tramp-file-name-multi-method car)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4218 (method (tramp-file-name-method car)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4219 (user (tramp-file-name-user car)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4220 (host (tramp-file-name-host car)) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4221 (localname (tramp-file-name-localname car)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4222 (m (tramp-find-method multi-method 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
|
4223 (tramp-current-user user) ; see `tramp-parse-passwd' |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4224 all-user-hosts) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4225 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4226 (unless (or multi-method ;; Not handled (yet). |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4227 localname) ;; Nothing to complete |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4228 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4229 (if (or user host) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4230 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4231 ;; Method dependent user / host combinations |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4232 (progn |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4233 (mapcar |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4234 (lambda (x) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4235 (setq all-user-hosts |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4236 (append all-user-hosts |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4237 (funcall (nth 0 x) (nth 1 x))))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4238 (tramp-get-completion-function m)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4239 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4240 (setq result (append result |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4241 (mapcar |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4242 (lambda (x) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4243 (tramp-get-completion-user-host |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4244 method user host (nth 0 x) (nth 1 x))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4245 (delq nil all-user-hosts))))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4246 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4247 ;; Possible methods |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4248 (setq result |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4249 (append result (tramp-get-completion-methods m))))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4250 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4251 (setq v (delq car v)))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4252 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4253 ;;; unify list, remove nil elements |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4254 (let (result1) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4255 (while result |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4256 (let ((car (car result))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4257 (when car (add-to-list 'result1 car)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4258 (setq result (delq car result)))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4259 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4260 result1))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4261 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4262 ;; Method, host name and user name completion for a file. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4263 (defun tramp-completion-handle-file-name-completion (filename directory) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4264 "Like `file-name-completion' for tramp files." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4265 (try-completion filename |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4266 (mapcar 'list (file-name-all-completions filename directory)))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4267 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4268 ;; 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
|
4269 ;; 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
|
4270 ;; Return value is a list of tramp-file-name structures according to possible |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4271 ;; completions. If "multi-method" or "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
|
4272 ;; 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
|
4273 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4274 ;; Expected results: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4275 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4276 ;; "/x" "/[x" "/x@" "/[x@" "/x@y" "/[x@y" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4277 ;; [nil nil nil "x" nil] [nil nil "x" nil nil] [nil nil "x" "y" nil] |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4278 ;; [nil nil "x" nil nil] |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4279 ;; [nil "x" nil nil nil] |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4280 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4281 ;; "/x:" "/x:y" "/x:y:" |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4282 ;; [nil nil nil "x" ""] [nil nil nil "x" "y"] [nil "x" nil "y" ""] |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4283 ;; "/[x/" "/[x/y" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4284 ;; [nil "x" nil "" nil] [nil "x" nil "y" nil] |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4285 ;; [nil "x" "" nil nil] [nil "x" "y" nil nil] |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4286 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4287 ;; "/x:y@" "/x:y@z" "/x:y@z:" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4288 ;; [nil nil nil "x" "y@"] [nil nil nil "x" "y@z"] [nil "x" "y" "z" ""] |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4289 ;; "/[x/y@" "/[x/y@z" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4290 ;; [nil "x" nil "y" nil] [nil "x" "y" "z" nil] |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4291 (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
|
4292 "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
|
4293 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
|
4294 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4295 (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
|
4296 (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
|
4297 ;; "/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
|
4298 (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
|
4299 (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
|
4300 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
|
4301 ;; "/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
|
4302 (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
|
4303 (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
|
4304 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
|
4305 ;; "/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
|
4306 (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
|
4307 (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
|
4308 nil nil 1 nil)) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4309 ;; "/user@host" "/[user@host" |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4310 (tramp-completion-file-name-structure4 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4311 (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
|
4312 "\\(" 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
|
4313 "\\(" 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
|
4314 nil 1 2 nil)) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4315 ;; "/method:user" "/[method/user" |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4316 (tramp-completion-file-name-structure5 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4317 (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
|
4318 "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4319 "\\(" 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
|
4320 1 2 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
|
4321 ;; "/method:host" "/[method/host" |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4322 (tramp-completion-file-name-structure6 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4323 (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
|
4324 "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4325 "\\(" 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
|
4326 1 nil 2 nil)) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4327 ;; "/method:user@host" "/[method/user@host" |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4328 (tramp-completion-file-name-structure7 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4329 (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
|
4330 "\\(" tramp-method-regexp "\\)" tramp-postfix-single-method-regexp |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4331 "\\(" 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
|
4332 "\\(" 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
|
4333 1 2 3 nil))) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4334 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4335 (mapcar (lambda (regexp) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4336 (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
|
4337 (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
|
4338 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4339 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
|
4340 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
|
4341 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
|
4342 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
|
4343 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
|
4344 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
|
4345 tramp-completion-file-name-structure7 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4346 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
|
4347 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4348 (delq nil result))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4349 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4350 (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
|
4351 "Returns a `tramp-file-name' structure matching STRUCTURE. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4352 The structure consists of multi-method, remote method, remote user, |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4353 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
|
4354 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4355 (let (method) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4356 (save-match-data |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4357 (when (string-match (nth 0 structure) name) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4358 (setq method (and (nth 1 structure) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4359 (match-string (nth 1 structure) name))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4360 (if (and method (member method tramp-multi-methods)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4361 ;; Not handled (yet). |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4362 (make-tramp-file-name |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4363 :multi-method method |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4364 :method nil |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4365 :user nil |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4366 :host nil |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4367 :localname 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
|
4368 (let ((user (and (nth 2 structure) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4369 (match-string (nth 2 structure) name))) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4370 (host (and (nth 3 structure) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4371 (match-string (nth 3 structure) name))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4372 (localname (and (nth 4 structure) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4373 (match-string (nth 4 structure) name)))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4374 (make-tramp-file-name |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4375 :multi-method nil |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4376 :method method |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4377 :user user |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4378 :host host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4379 :localname localname))))))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4380 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4381 ;; 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
|
4382 ;; trailing method delimeter. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4383 (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
|
4384 "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
|
4385 (mapcar |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4386 (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
|
4387 (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
|
4388 (string-match (concat "^" (regexp-quote partial-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
|
4389 ;; we must remove leading "/". |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4390 (substring (tramp-make-tramp-file-name nil method nil nil nil) 1))) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4391 (delete "multi" (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
|
4392 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4393 ;; 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
|
4394 (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
|
4395 "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
|
4396 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
|
4397 (cond |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4398 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4399 ((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
|
4400 (if (and host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4401 (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
|
4402 (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
|
4403 (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
|
4404 (setq user nil |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4405 host nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4406 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4407 (partial-user |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4408 (setq host nil) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4409 (unless |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4410 (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
|
4411 (setq user nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4412 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4413 (partial-host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4414 (setq user nil) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4415 (unless |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4416 (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
|
4417 (setq host nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4418 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4419 (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
|
4420 host nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4421 |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4422 (unless (zerop (+ (length user) (length host))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4423 ;; we must remove leading "/". |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4424 (substring (tramp-make-tramp-file-name nil method user host nil) 1))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4425 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4426 (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
|
4427 "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
|
4428 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
|
4429 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4430 (let (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
|
4431 (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
|
4432 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4433 (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
|
4434 (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
|
4435 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4436 (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
|
4437 res)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4438 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4439 ;; Taken from gnus/netrc.el |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4440 (eval-and-compile |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4441 (defalias 'tramp-point-at-eol |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4442 (if (fboundp 'point-at-eol) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4443 'point-at-eol |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4444 'line-end-position))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4445 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4446 (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
|
4447 "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
|
4448 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
|
4449 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4450 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4451 (regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4452 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4453 "^\\(" tramp-host-regexp "\\)" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4454 "\\([ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?"))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4455 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4456 (narrow-to-region (point) (tramp-point-at-eol)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4457 (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
|
4458 (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
|
4459 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4460 (forward-line 1) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4461 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4462 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4463 (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
|
4464 "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
|
4465 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
|
4466 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4467 (let (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
|
4468 (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
|
4469 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4470 (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
|
4471 (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
|
4472 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4473 (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
|
4474 res)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4475 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4476 (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
|
4477 "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
|
4478 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
|
4479 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4480 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4481 (regexp (concat "^\\(" tramp-host-regexp "\\)"))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4482 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4483 (narrow-to-region (point) (tramp-point-at-eol)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4484 (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
|
4485 (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
|
4486 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4487 (or |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4488 (> (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
|
4489 (forward-line 1)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4490 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4491 |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4492 (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
|
4493 "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
|
4494 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
|
4495 |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4496 (let (res) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4497 (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
|
4498 (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
|
4499 (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
|
4500 (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
|
4501 (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
|
4502 (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
|
4503 res)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4504 |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4505 (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
|
4506 "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
|
4507 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
|
4508 |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4509 (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
|
4510 (regexp (concat "^[ \t]*Host[ \t]+" "\\(" tramp-host-regexp "\\)"))) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4511 |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4512 (narrow-to-region (point) (tramp-point-at-eol)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4513 (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
|
4514 (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
|
4515 (widen) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4516 (or |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4517 (> (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
|
4518 (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
|
4519 result)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4520 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4521 (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
|
4522 "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
|
4523 User is always nil." |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4524 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4525 (let ((regexp (concat "^key_[0-9]+_\\(" tramp-host-regexp "\\)\\.pub$")) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4526 (files (when (file-directory-p dirname) (directory-files dirname))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4527 result) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4528 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4529 (while files |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4530 (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
|
4531 (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
|
4532 (setq files (cdr files))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4533 result)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4534 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4535 (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
|
4536 "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
|
4537 User is always nil." |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4538 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4539 (let ((regexp (concat "^\\(" tramp-host-regexp |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4540 "\\)\\.ssh-\\(dss\\|rsa\\)\\.pub$")) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4541 (files (when (file-directory-p dirname) (directory-files dirname))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4542 result) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4543 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4544 (while files |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4545 (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
|
4546 (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
|
4547 (setq files (cdr files))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4548 result)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4549 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4550 (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
|
4551 "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
|
4552 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
|
4553 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4554 (let (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
|
4555 (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
|
4556 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4557 (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
|
4558 (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
|
4559 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4560 (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
|
4561 res)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4562 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4563 (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
|
4564 "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
|
4565 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
|
4566 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4567 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4568 (regexp (concat "^\\(" tramp-host-regexp "\\)"))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4569 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4570 (narrow-to-region (point) (tramp-point-at-eol)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4571 (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
|
4572 (unless (char-equal (or (char-after) ?\n) ?:) ; no IPv6 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4573 (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
|
4574 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4575 (or |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4576 (> (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
|
4577 (forward-line 1)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4578 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4579 |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4580 ;; 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
|
4581 ;; as default. Unfortunately, we have no information whether any user name |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4582 ;; has been typed already. So we (mis-)use tramp-current-user as indication, |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4583 ;; 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
|
4584 (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
|
4585 "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
|
4586 Host is always \"localhost\"." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4587 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4588 (let (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
|
4589 (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
|
4590 '(("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
|
4591 (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
|
4592 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4593 (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
|
4594 (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
|
4595 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4596 (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
|
4597 res))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4598 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4599 (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
|
4600 "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
|
4601 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
|
4602 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4603 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4604 (regexp (concat "^\\(" tramp-user-regexp "\\):"))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4605 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4606 (narrow-to-region (point) (tramp-point-at-eol)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4607 (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
|
4608 (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
|
4609 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4610 (forward-line 1) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4611 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4612 |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4613 (defun tramp-parse-netrc (filename) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4614 "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
|
4615 User may be nil." |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4616 |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4617 (let (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
|
4618 (when (file-readable-p filename) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4619 (with-temp-buffer |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4620 (insert-file-contents filename) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4621 (goto-char (point-min)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4622 (while (not (eobp)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4623 (push (tramp-parse-netrc-group) res)))) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4624 res)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4625 |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4626 (defun tramp-parse-netrc-group () |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4627 "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
|
4628 User may be nil." |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4629 |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4630 (let ((result) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4631 (regexp |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4632 (concat |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4633 "^[ \t]*machine[ \t]+" "\\(" tramp-host-regexp "\\)" |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4634 "\\([ \t]+login[ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?"))) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4635 |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4636 (narrow-to-region (point) (tramp-point-at-eol)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4637 (when (re-search-forward regexp nil t) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4638 (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
|
4639 (widen) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4640 (forward-line 1) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4641 result)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4642 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4643 (defun tramp-completion-handle-expand-file-name (name &optional dir) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4644 "Like `expand-file-name' for tramp files." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4645 (let ((fullname (concat (or dir default-directory) name))) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4646 (tramp-drop-volume-letter |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4647 (if (tramp-completion-mode fullname) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4648 (tramp-run-real-handler |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4649 'expand-file-name (list name dir)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4650 (tramp-completion-run-real-handler |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4651 'expand-file-name (list name dir)))))) |
45861 | 4652 |
4653 ;;; Internal Functions: | |
4654 | |
4655 (defun tramp-set-auto-save () | |
4656 (when (and (buffer-file-name) | |
4657 (tramp-tramp-file-p (buffer-file-name)) | |
4658 auto-save-default) | |
4659 (auto-save-mode 1))) | |
4660 (add-hook 'find-file-hooks 'tramp-set-auto-save t) | |
4661 | |
4662 (defun tramp-run-test (switch filename) | |
4663 "Run `test' on the remote system, given a SWITCH and a FILENAME. | |
4664 Returns the exit code of the `test' program." | |
4665 (let ((v (tramp-dissect-file-name filename))) | |
4666 (save-excursion | |
4667 (tramp-send-command-and-check | |
4668 (tramp-file-name-multi-method v) (tramp-file-name-method v) | |
4669 (tramp-file-name-user v) (tramp-file-name-host v) | |
4670 (format "test %s %s" switch | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4671 (tramp-shell-quote-argument (tramp-file-name-localname v))))))) |
45861 | 4672 |
4673 (defun tramp-run-test2 (program file1 file2 &optional switch) | |
4674 "Run `test'-like PROGRAM on the remote system, given FILE1, FILE2. | |
4675 The optional SWITCH is inserted between the two files. | |
4676 Returns the exit code of the `test' PROGRAM. Barfs if the methods, | |
4677 hosts, or files, disagree." | |
4678 (let* ((v1 (tramp-dissect-file-name file1)) | |
4679 (v2 (tramp-dissect-file-name file2)) | |
4680 (mmethod1 (tramp-file-name-multi-method v1)) | |
4681 (mmethod2 (tramp-file-name-multi-method v2)) | |
4682 (method1 (tramp-file-name-method v1)) | |
4683 (method2 (tramp-file-name-method v2)) | |
4684 (user1 (tramp-file-name-user v1)) | |
4685 (user2 (tramp-file-name-user v2)) | |
4686 (host1 (tramp-file-name-host v1)) | |
4687 (host2 (tramp-file-name-host v2)) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4688 (localname1 (tramp-file-name-localname v1)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4689 (localname2 (tramp-file-name-localname v2))) |
45861 | 4690 (unless (and method1 method2 host1 host2 |
4691 (equal mmethod1 mmethod2) | |
4692 (equal method1 method2) | |
4693 (equal user1 user2) | |
4694 (equal host1 host2)) | |
4695 (error "tramp-run-test2: %s" | |
4696 "only implemented for same method, same user, same host")) | |
4697 (save-excursion | |
4698 (tramp-send-command-and-check | |
4699 mmethod1 method1 user1 host1 | |
4700 (format "%s %s %s %s" | |
4701 program | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4702 (tramp-shell-quote-argument localname1) |
45861 | 4703 (or switch "") |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4704 (tramp-shell-quote-argument localname2)))))) |
45861 | 4705 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4706 (defun tramp-touch (file time) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4707 "Set the last-modified timestamp of the given file. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4708 TIME is an Emacs internal time value as returned by `current-time'." |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4709 (let ((touch-time (format-time-string "%Y%m%d%H%M.%S" time))) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4710 (if (tramp-tramp-file-p file) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4711 (with-parsed-tramp-file-name file nil |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4712 (let ((buf (tramp-get-buffer multi-method method user host))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4713 (unless (zerop (tramp-send-command-and-check |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4714 multi-method method user host |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4715 (format "touch -t %s %s" |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4716 touch-time |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4717 localname))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4718 (pop-to-buffer buf) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4719 (error "tramp-touch: touch failed, see buffer `%s' for details" |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4720 buf)))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4721 ;; It's a local file |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4722 (with-temp-buffer |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4723 (unless (zerop (call-process |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4724 "touch" nil (current-buffer) nil "-t" touch-time file)) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4725 (pop-to-buffer (current-buffer)) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4726 (error "tramp-touch: touch failed")))))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
4727 |
45861 | 4728 (defun tramp-buffer-name (multi-method method user host) |
4729 "A name for the connection buffer for USER at HOST using METHOD." | |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
4730 (if multi-method |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
4731 (tramp-buffer-name-multi-method "tramp" multi-method method user host) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
4732 (let ((method (tramp-find-method multi-method method user host))) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
4733 (if user |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4734 (format "*tramp/%s %s@%s*" method user host) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4735 (format "*tramp/%s %s*" method host))))) |
45861 | 4736 |
4737 (defun tramp-buffer-name-multi-method (prefix multi-method method user host) | |
4738 "A name for the multi method connection buffer. | |
4739 MULTI-METHOD gives the multi method, METHOD the array of methods, | |
4740 USER the array of user names, HOST the array of host names." | |
4741 (unless (and (= (length method) (length user)) | |
4742 (= (length method) (length host))) | |
4743 (error "Syntax error in multi method (implementation error)")) | |
4744 (let ((len (length method)) | |
4745 (i 0) | |
4746 string-list) | |
4747 (while (< i len) | |
4748 (setq string-list | |
4749 (cons (if (aref user i) | |
4750 (format "%s#%s@%s:" (aref method i) | |
4751 (aref user i) (aref host i)) | |
4752 (format "%s@%s:" (aref method i) (aref host i))) | |
4753 string-list)) | |
4754 (incf i)) | |
4755 (format "*%s/%s %s*" | |
4756 prefix multi-method | |
4757 (apply 'concat (reverse string-list))))) | |
4758 | |
4759 (defun tramp-get-buffer (multi-method method user host) | |
4760 "Get the connection buffer to be used for USER at HOST using METHOD." | |
4761 (get-buffer-create (tramp-buffer-name multi-method method user host))) | |
4762 | |
4763 (defun tramp-debug-buffer-name (multi-method method user host) | |
4764 "A name for the debug buffer for USER at HOST using METHOD." | |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
4765 (if multi-method |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
4766 (tramp-buffer-name-multi-method "debug tramp" |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
4767 multi-method method user host) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
4768 (let ((method (tramp-find-method multi-method method user host))) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
4769 (if user |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
4770 (format "*debug tramp/%s %s@%s*" method user host) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
4771 (format "*debug tramp/%s %s*" method host))))) |
45861 | 4772 |
4773 (defun tramp-get-debug-buffer (multi-method method user host) | |
4774 "Get the debug buffer for USER at HOST using METHOD." | |
4775 (get-buffer-create (tramp-debug-buffer-name multi-method method user host))) | |
4776 | |
4777 (defun tramp-find-executable (multi-method method user host | |
4778 progname dirlist ignore-tilde) | |
4779 "Searches for PROGNAME in all directories mentioned in DIRLIST. | |
4780 First args METHOD, USER and HOST specify the connection, PROGNAME | |
4781 is the program to search for, and DIRLIST gives the list of directories | |
4782 to search. If IGNORE-TILDE is non-nil, directory names starting | |
4783 with `~' will be ignored. | |
4784 | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4785 Returns the absolute file name of PROGNAME, if found, and nil otherwise. |
45861 | 4786 |
4787 This function expects to be in the right *tramp* buffer." | |
4788 (let (result) | |
4789 (when ignore-tilde | |
4790 ;; Remove all ~/foo directories from dirlist. In Emacs 20, | |
4791 ;; `remove' is in CL, and we want to avoid CL dependencies. | |
4792 (let (newdl d) | |
4793 (while dirlist | |
4794 (setq d (car dirlist)) | |
4795 (setq dirlist (cdr dirlist)) | |
4796 (unless (char-equal ?~ (aref d 0)) | |
4797 (setq newdl (cons d newdl)))) | |
4798 (setq dirlist (nreverse newdl)))) | |
4799 (tramp-send-command | |
4800 multi-method method user host | |
4801 (format (concat "while read d; " | |
4802 "do if test -x $d/%s -a -f $d/%s; " | |
4803 "then echo tramp_executable $d/%s; " | |
4804 "break; fi; done <<'EOF'") | |
4805 progname progname progname)) | |
4806 (mapcar (lambda (d) | |
4807 (tramp-send-command multi-method method user host d)) | |
4808 dirlist) | |
4809 (tramp-send-command multi-method method user host "EOF") | |
4810 (tramp-wait-for-output) | |
4811 (goto-char (point-max)) | |
4812 (when (search-backward "tramp_executable " nil t) | |
4813 (skip-chars-forward "^ ") | |
4814 (skip-chars-forward " ") | |
4815 (buffer-substring (point) (tramp-line-end-position))))) | |
4816 | |
4817 (defun tramp-set-remote-path (multi-method method user host var dirlist) | |
4818 "Sets the remote environment VAR to existing directories from DIRLIST. | |
4819 I.e., for each directory in DIRLIST, it is tested whether it exists and if | |
4820 so, it is added to the environment variable VAR." | |
4821 (let ((existing-dirs | |
4822 (mapcar | |
4823 (lambda (x) | |
4824 (when (and | |
4825 (file-exists-p | |
4826 (tramp-make-tramp-file-name multi-method method user host x)) | |
4827 (file-directory-p | |
4828 (tramp-make-tramp-file-name multi-method method user host x))) | |
4829 x)) | |
4830 dirlist))) | |
4831 (tramp-send-command | |
4832 multi-method method user host | |
4833 (concat var "=" | |
4834 (mapconcat 'identity (delq nil existing-dirs) ":") | |
4835 "; export " var)) | |
4836 (tramp-wait-for-output))) | |
4837 | |
4838 ;; -- communication with external shell -- | |
4839 | |
4840 (defun tramp-find-file-exists-command (multi-method method user host) | |
4841 "Find a command on the remote host for checking if a file exists. | |
4842 Here, we are looking for a command which has zero exit status if the | |
4843 file exists and nonzero exit status otherwise." | |
4844 (make-local-variable 'tramp-file-exists-command) | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
4845 (tramp-message 9 "Finding command to check if file exists") |
45861 | 4846 (let ((existing |
4847 (tramp-make-tramp-file-name | |
4848 multi-method method user host | |
4849 "/")) ;assume this file always exists | |
4850 (nonexisting | |
4851 (tramp-make-tramp-file-name | |
4852 multi-method method user host | |
4853 "/ this file does not exist "))) ;assume this never exists | |
4854 ;; The algorithm is as follows: we try a list of several commands. | |
4855 ;; For each command, we first run `$cmd /' -- this should return | |
4856 ;; true, as the root directory always exists. And then we run | |
4857 ;; `$cmd /this\ file\ does\ not\ exist', hoping that the file indeed | |
4858 ;; does not exist. This should return false. We use the first | |
4859 ;; command we find that seems to work. | |
4860 ;; The list of commands to try is as follows: | |
4861 ;; `ls -d' This works on most systems, but NetBSD 1.4 | |
4862 ;; has a bug: `ls' always returns zero exit | |
4863 ;; status, even for files which don't exist. | |
4864 ;; `test -e' Some Bourne shells have a `test' builtin | |
4865 ;; which does not know the `-e' option. | |
4866 ;; `/bin/test -e' For those, the `test' binary on disk normally | |
4867 ;; provides the option. Alas, the binary | |
4868 ;; is sometimes `/bin/test' and sometimes it's | |
4869 ;; `/usr/bin/test'. | |
4870 ;; `/usr/bin/test -e' In case `/bin/test' does not exist. | |
4871 (unless (or | |
4872 (and (setq tramp-file-exists-command "test -e %s") | |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4873 (file-exists-p existing) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4874 (not (file-exists-p nonexisting))) |
45861 | 4875 (and (setq tramp-file-exists-command "/bin/test -e %s") |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4876 (file-exists-p existing) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4877 (not (file-exists-p nonexisting))) |
45861 | 4878 (and (setq tramp-file-exists-command "/usr/bin/test -e %s") |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4879 (file-exists-p existing) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4880 (not (file-exists-p nonexisting))) |
46808
cf225aed7a75
Version 2.0.11 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46802
diff
changeset
|
4881 (and (setq tramp-file-exists-command "ls -d %s") |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4882 (file-exists-p existing) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4883 (not (file-exists-p nonexisting)))) |
45861 | 4884 (error "Couldn't find command to check if file exists.")))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4885 |
45861 | 4886 |
4887 ;; CCC test ksh or bash found for tilde expansion? | |
4888 (defun tramp-find-shell (multi-method method user host) | |
4889 "Find a shell on the remote host which groks tilde expansion." | |
4890 (let ((shell nil)) | |
4891 (tramp-send-command multi-method method user host "echo ~root") | |
4892 (tramp-wait-for-output) | |
4893 (cond | |
4894 ((string-match "^~root$" (buffer-string)) | |
4895 (setq shell | |
4896 (or (tramp-find-executable multi-method method user host | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4897 "bash" tramp-remote-path t) |
45861 | 4898 (tramp-find-executable multi-method method user host |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4899 "ksh" tramp-remote-path t))) |
45861 | 4900 (unless shell |
4901 (error "Couldn't find a shell which groks tilde expansion")) | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4902 ;; Find arguments for this shell. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4903 (let ((alist tramp-sh-extra-args) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4904 item extra-args) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4905 (while (and alist (null extra-args)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4906 (setq item (pop alist)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4907 (when (string-match (car item) shell) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4908 (setq extra-args (cdr item)))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4909 (when extra-args (setq shell (concat shell " " extra-args)))) |
45861 | 4910 (tramp-message |
4911 5 "Starting remote shell `%s' for tilde expansion..." shell) | |
4912 (tramp-send-command | |
4913 multi-method method user host | |
46801
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
4914 (concat "PS1='$ ' exec " shell)) ; |
45861 | 4915 (unless (tramp-wait-for-regexp |
4916 (get-buffer-process (current-buffer)) | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
4917 60 (format "\\(\\(%s\\)\\|\\(%s\\)\\)\\'" |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
4918 tramp-shell-prompt-pattern shell-prompt-pattern)) |
45861 | 4919 (pop-to-buffer (buffer-name)) |
4920 (error "Couldn't find remote `%s' prompt." shell)) | |
46801
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
4921 (tramp-message |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
4922 9 "Setting remote shell prompt...") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4923 ;; Douglas Gray Stephens <DGrayStephens@slb.com> says that we |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4924 ;; must use "\n" here, not tramp-rsh-end-of-line. Kai left the |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4925 ;; last tramp-rsh-end-of-line, Douglas wanted to replace that, |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4926 ;; as well. |
45861 | 4927 (process-send-string nil (format "PS1='%s%s%s'; PS2=''; PS3=''%s" |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4928 tramp-rsh-end-of-line |
45861 | 4929 tramp-end-of-output |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4930 tramp-rsh-end-of-line |
45861 | 4931 tramp-rsh-end-of-line)) |
4932 (tramp-wait-for-output) | |
46801
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
4933 (tramp-message |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
4934 9 "Setting remote shell prompt...done") |
46835
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
4935 ) |
45861 | 4936 (t (tramp-message 5 "Remote `%s' groks tilde expansion, good" |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
4937 (tramp-get-method-parameter |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
4938 multi-method method user host 'tramp-remote-sh)))))) |
45861 | 4939 |
4940 (defun tramp-check-ls-command (multi-method method user host cmd) | |
4941 "Checks whether the given `ls' executable groks `-n'. | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4942 METHOD, USER and HOST specify the connection, CMD (the absolute file name of) |
45861 | 4943 the `ls' executable. Returns t if CMD supports the `-n' option, nil |
4944 otherwise." | |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4945 (tramp-message 9 "Checking remote `%s' command for `-n' option" cmd) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4946 (when (file-executable-p |
45861 | 4947 (tramp-make-tramp-file-name multi-method method user host cmd)) |
4948 (let ((result nil)) | |
4949 (tramp-message 7 "Testing remote command `%s' for -n..." cmd) | |
4950 (setq result | |
4951 (tramp-send-command-and-check | |
4952 multi-method method user host | |
4953 (format "%s -lnd / >/dev/null" | |
4954 cmd))) | |
4955 (tramp-message 7 "Testing remote command `%s' for -n...%s" | |
4956 cmd | |
4957 (if (zerop result) "okay" "failed")) | |
4958 (zerop result)))) | |
4959 | |
4960 (defun tramp-check-ls-commands (multi-method method user host cmd dirlist) | |
4961 "Checks whether the given `ls' executable in one of the dirs groks `-n'. | |
4962 Returns nil if none was found, else the command is returned." | |
4963 (let ((dl dirlist) | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
4964 (result nil)) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
4965 (tramp-let-maybe directory-sep-char ?/ ;for XEmacs |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
4966 ;; It would be better to use the CL function `find', but |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
4967 ;; we don't want run-time dependencies on CL. |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
4968 (while (and dl (not result)) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
4969 (let ((x (concat (file-name-as-directory (car dl)) cmd))) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
4970 (when (tramp-check-ls-command multi-method method user host x) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
4971 (setq result x))) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
4972 (setq dl (cdr dl))) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
4973 result))) |
45861 | 4974 |
4975 (defun tramp-find-ls-command (multi-method method user host) | |
4976 "Finds an `ls' command which groks the `-n' option, returning nil if failed. | |
4977 \(This option prints numeric user and group ids in a long listing.)" | |
4978 (tramp-message 9 "Finding a suitable `ls' command") | |
4979 (or | |
4980 (tramp-check-ls-commands multi-method method user host "ls" tramp-remote-path) | |
4981 (tramp-check-ls-commands multi-method method user host "gnuls" tramp-remote-path) | |
4982 (tramp-check-ls-commands multi-method method user host "gls" tramp-remote-path))) | |
4983 | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4984 ;; ------------------------------------------------------------ |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4985 ;; -- Functions for establishing connection -- |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4986 ;; ------------------------------------------------------------ |
45861 | 4987 |
46752 | 4988 ;; The following functions are actions to be taken when seeing certain |
4989 ;; prompts from the remote host. See the variable | |
4990 ;; `tramp-actions-before-shell' for usage of these functions. | |
4991 | |
4992 (defun tramp-action-login (p multi-method method user host) | |
4993 "Send the login name." | |
4994 (tramp-message 9 "Sending login name `%s'" | |
4995 (or user (user-login-name))) | |
4996 (erase-buffer) | |
4997 (process-send-string nil (concat (or user (user-login-name)) | |
4998 tramp-rsh-end-of-line))) | |
4999 | |
5000 (defun tramp-action-password (p multi-method method user host) | |
5001 "Query the user for a password." | |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
5002 (let ((pw-prompt (match-string 0))) |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
5003 (tramp-message 9 "Sending password") |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5004 (tramp-enter-password p pw-prompt user host))) |
46752 | 5005 |
5006 (defun tramp-action-succeed (p multi-method method user host) | |
5007 "Signal success in finding shell prompt." | |
5008 (tramp-message 9 "Found remote shell prompt.") | |
5009 (erase-buffer) | |
5010 (throw 'tramp-action 'ok)) | |
5011 | |
5012 (defun tramp-action-permission-denied (p multi-method method user host) | |
5013 "Signal permission denied." | |
46790 | 5014 (pop-to-buffer (tramp-get-buffer multi-method method user host)) |
46752 | 5015 (tramp-message 9 "Permission denied by remote host.") |
5016 (kill-process p) | |
5017 (throw 'tramp-action 'permission-denied)) | |
5018 | |
5019 (defun tramp-action-yesno (p multi-method method user host) | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
5020 "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
|
5021 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
|
5022 See also `tramp-action-yn'." |
46752 | 5023 (save-window-excursion |
5024 (pop-to-buffer (tramp-get-buffer multi-method method user host)) | |
5025 (unless (yes-or-no-p (match-string 0)) | |
5026 (kill-process p) | |
5027 (erase-buffer) | |
5028 (throw 'tramp-action 'permission-denied)) | |
5029 (process-send-string p (concat "yes" tramp-rsh-end-of-line)) | |
5030 (erase-buffer))) | |
5031 | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
5032 (defun tramp-action-yn (p multi-method method user host) |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
5033 "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
|
5034 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
|
5035 See also `tramp-action-yesno'." |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
5036 (save-window-excursion |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
5037 (pop-to-buffer (tramp-get-buffer multi-method method user host)) |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
5038 (unless (y-or-n-p (match-string 0)) |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
5039 (kill-process p) |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
5040 (throw 'tramp-action 'permission-denied)) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
5041 (erase-buffer) |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
5042 (process-send-string p (concat "y" tramp-rsh-end-of-line)))) |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
5043 |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
5044 (defun tramp-action-terminal (p multi-method method user host) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
5045 "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
|
5046 The terminal type can be configured with `tramp-terminal-type'." |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
5047 (tramp-message 9 "Setting `%s' as terminal type." |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
5048 tramp-terminal-type) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
5049 (erase-buffer) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
5050 (process-send-string nil (concat tramp-terminal-type |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
5051 tramp-rsh-end-of-line))) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
5052 |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5053 (defun tramp-action-process-alive (p multi-method method user host) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5054 "Check whether a process has finished." |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5055 (unless (memq (process-status p) '(run open)) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5056 (throw 'tramp-action 'process-died))) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5057 |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5058 (defun tramp-action-out-of-band (p multi-method method user host) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5059 "Check whether an out-of-band copy has finished." |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5060 (cond ((and (memq (process-status p) '(stop exit)) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5061 (zerop (process-exit-status p))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5062 (tramp-message 9 "Process has finished.") |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5063 (throw 'tramp-action 'ok)) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5064 ((or (and (memq (process-status p) '(stop exit)) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5065 (not (zerop (process-exit-status p)))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5066 (memq (process-status p) '(signal))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5067 (tramp-message 9 "Process has died.") |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5068 (throw 'tramp-action 'process-died)) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5069 (t nil))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5070 |
46752 | 5071 ;; The following functions are specifically for multi connections. |
5072 | |
5073 (defun tramp-multi-action-login (p method user host) | |
5074 "Send the login name." | |
5075 (tramp-message 9 "Sending login name `%s'" user) | |
5076 (erase-buffer) | |
5077 (process-send-string p (concat user tramp-rsh-end-of-line))) | |
5078 | |
5079 (defun tramp-multi-action-password (p method user host) | |
5080 "Query the user for a password." | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5081 (tramp-message 9 "Sending password") |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5082 (tramp-enter-password p (match-string 0) user host)) |
46752 | 5083 |
5084 (defun tramp-multi-action-succeed (p method user host) | |
5085 "Signal success in finding shell prompt." | |
5086 (tramp-message 9 "Found shell prompt on `%s'" host) | |
5087 (erase-buffer) | |
5088 (throw 'tramp-action 'ok)) | |
5089 | |
5090 (defun tramp-multi-action-permission-denied (p method user host) | |
5091 "Signal permission denied." | |
5092 (tramp-message 9 "Permission denied by remote host `%s'" host) | |
5093 (kill-process p) | |
5094 (erase-buffer) | |
5095 (throw 'tramp-action 'permission-denied)) | |
5096 | |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5097 (defun tramp-multi-action-process-alive (p method user host) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5098 "Check whether a process has finished." |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5099 (unless (memq (process-status p) '(run open)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5100 (throw 'tramp-action 'process-died))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5101 |
46752 | 5102 ;; Functions for processing the actions. |
5103 | |
5104 (defun tramp-process-one-action (p multi-method method user host actions) | |
5105 "Wait for output from the shell and perform one action." | |
5106 (let (found item pattern action todo) | |
5107 (erase-buffer) | |
5108 (tramp-message 9 "Waiting 60s for prompt from remote shell") | |
5109 (with-timeout (60 (throw 'tramp-action 'timeout)) | |
5110 (while (not found) | |
5111 (accept-process-output p 1) | |
5112 (goto-char (point-min)) | |
5113 (setq todo actions) | |
5114 (while todo | |
5115 (goto-char (point-min)) | |
5116 (setq item (pop todo)) | |
5117 (setq pattern (symbol-value (nth 0 item))) | |
5118 (setq action (nth 1 item)) | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5119 (tramp-message 10 "Looking for regexp \"%s\" from remote shell" |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5120 pattern) |
46752 | 5121 (when (re-search-forward (concat pattern "\\'") nil t) |
5122 (setq found (funcall action p multi-method method user host))))) | |
5123 found))) | |
5124 | |
5125 (defun tramp-process-actions (p multi-method method user host actions) | |
5126 "Perform actions until success." | |
5127 (let (exit) | |
5128 (while (not exit) | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5129 (tramp-message 9 "Waiting for prompts from remote shell") |
46752 | 5130 (setq exit |
5131 (catch 'tramp-action | |
5132 (tramp-process-one-action | |
5133 p multi-method method user host actions) | |
5134 nil))) | |
5135 (unless (eq exit 'ok) | |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
5136 (tramp-clear-passwd user host) |
46752 | 5137 (error "Login failed")))) |
5138 | |
5139 ;; For multi-actions. | |
5140 | |
5141 (defun tramp-process-one-multi-action (p method user host actions) | |
5142 "Wait for output from the shell and perform one action." | |
5143 (let (found item pattern action todo) | |
5144 (erase-buffer) | |
5145 (tramp-message 9 "Waiting 60s for prompt from remote shell") | |
5146 (with-timeout (60 (throw 'tramp-action 'timeout)) | |
5147 (while (not found) | |
5148 (accept-process-output p 1) | |
5149 (setq todo actions) | |
5150 (goto-char (point-min)) | |
5151 (while todo | |
5152 (goto-char (point-min)) | |
5153 (setq item (pop todo)) | |
5154 (setq pattern (symbol-value (nth 0 item))) | |
5155 (setq action (nth 1 item)) | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5156 (tramp-message 10 "Looking for regexp \"%s\" from remote shell" |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5157 pattern) |
46752 | 5158 (when (re-search-forward (concat pattern "\\'") nil t) |
5159 (setq found (funcall action p method user host))))) | |
5160 found))) | |
5161 | |
5162 (defun tramp-process-multi-actions (p method user host actions) | |
5163 "Perform actions until success." | |
5164 (let (exit) | |
5165 (while (not exit) | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5166 (tramp-message 9 "Waiting for prompts from remote shell") |
46752 | 5167 (setq exit |
5168 (catch 'tramp-action | |
5169 (tramp-process-one-multi-action p method user host actions) | |
5170 nil))) | |
5171 (unless (eq exit 'ok) | |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
5172 (tramp-clear-passwd user host) |
46752 | 5173 (error "Login failed")))) |
5174 | |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5175 ;; Functions to execute when we have seen the remote shell prompt but |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5176 ;; before we exec the Bourne-ish shell. Note that these commands |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5177 ;; might be sent to any shell, not just a Bourne-ish shell. This |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5178 ;; means that the commands need to work in all shells. (It is also |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5179 ;; okay for some commands to just fail with an error message, but |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5180 ;; please make sure that they at least don't crash the odd shell people |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5181 ;; might be running...) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5182 (defun tramp-process-initial-commands (p |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5183 multi-method method user host |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5184 commands) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5185 "Send list of commands to remote host, in order." |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5186 (let (cmd) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5187 (while commands |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5188 (setq cmd (pop commands)) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5189 (erase-buffer) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5190 (tramp-message 10 "Sending command to remote shell: %s" |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5191 cmd) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5192 (tramp-send-command multi-method method user host cmd nil t) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5193 (tramp-barf-if-no-shell-prompt |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5194 p 60 "Remote shell command failed: %s" cmd)) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5195 (erase-buffer))) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5196 |
46752 | 5197 ;; The actual functions for opening connections. |
45861 | 5198 |
5199 (defun tramp-open-connection-telnet (multi-method method user host) | |
5200 "Open a connection using a telnet METHOD. | |
5201 This starts the command `telnet HOST ARGS'[*], then waits for a remote | |
5202 login prompt, then sends the user name USER, then waits for a remote | |
5203 password prompt. It queries the user for the password, then sends the | |
5204 password to the remote host. | |
5205 | |
5206 If USER is nil, uses value returned by `(user-login-name)' instead. | |
5207 | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5208 Recognition of the remote shell prompt is based on the variables |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5209 `shell-prompt-pattern' and `tramp-shell-prompt-pattern' which must be |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5210 set up correctly. |
45861 | 5211 |
5212 Please note that it is NOT possible to use this connection method | |
5213 together with an out-of-band transfer method! You must use an inline | |
5214 transfer method. | |
5215 | |
5216 Maybe the different regular expressions need to be tuned. | |
5217 | |
5218 * Actually, the telnet program as well as the args to be used can be | |
5219 specified in the method parameters, see the variable `tramp-methods'." | |
5220 (save-match-data | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5221 (when (tramp-method-out-of-band-p multi-method method user host) |
45861 | 5222 (error "Cannot use out-of-band method `%s' with telnet connection method" |
5223 method)) | |
5224 (when multi-method | |
5225 (error "Cannot multi-connect using telnet connection method")) | |
5226 (tramp-pre-connection multi-method method user host) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5227 (tramp-message 7 "Opening connection for %s@%s using %s..." |
45861 | 5228 (or user (user-login-name)) host method) |
5229 (let ((process-environment (copy-sequence process-environment))) | |
5230 (setenv "TERM" tramp-terminal-type) | |
5231 (let* ((default-directory (tramp-temporary-file-directory)) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5232 ;; If we omit the conditional here, then we would use |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5233 ;; `undecided-dos' in some cases. With the conditional, |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5234 ;; we use nil in these cases. Which one is right? |
45861 | 5235 (coding-system-for-read (unless (and (not (featurep 'xemacs)) |
5236 (> emacs-major-version 20)) | |
5237 tramp-dos-coding-system)) | |
5238 (p (apply 'start-process | |
5239 (tramp-buffer-name multi-method method user host) | |
5240 (tramp-get-buffer multi-method method user host) | |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5241 (tramp-get-method-parameter |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5242 multi-method |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
5243 (tramp-find-method multi-method method user host) |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5244 user host 'tramp-login-program) |
45861 | 5245 host |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5246 (tramp-get-method-parameter |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5247 multi-method |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
5248 (tramp-find-method multi-method method user host) |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5249 user host 'tramp-login-args))) |
45861 | 5250 (found nil) |
5251 (pw nil)) | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5252 (tramp-set-process-query-on-exit-flag p nil) |
46752 | 5253 (set-buffer (tramp-get-buffer multi-method method user host)) |
5254 (erase-buffer) | |
5255 (tramp-process-actions p multi-method method user host | |
5256 tramp-actions-before-shell) | |
45861 | 5257 (tramp-open-connection-setup-interactive-shell |
5258 p multi-method method user host) | |
5259 (tramp-post-connection multi-method method user host))))) | |
5260 | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5261 |
45861 | 5262 (defun tramp-open-connection-rsh (multi-method method user host) |
5263 "Open a connection using an rsh METHOD. | |
5264 This starts the command `rsh HOST -l USER'[*], then waits for a remote | |
5265 password or shell prompt. If a password prompt is seen, the user is | |
5266 queried for a password, this function sends the password to the remote | |
5267 host and waits for a shell prompt. | |
5268 | |
5269 If USER is nil, start the command `rsh HOST'[*] instead | |
5270 | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5271 Recognition of the remote shell prompt is based on the variables |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5272 `shell-prompt-pattern' and `tramp-shell-prompt-pattern' which must be |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5273 set up correctly. |
45861 | 5274 |
46010
d07b0e5f80b9
(tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46009
diff
changeset
|
5275 Kludgy feature: if HOST has the form \"xx#yy\", then yy is assumed to |
d07b0e5f80b9
(tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46009
diff
changeset
|
5276 be a port number for ssh, and \"-p yy\" will be added to the list of |
d07b0e5f80b9
(tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46009
diff
changeset
|
5277 arguments, and xx will be used as the host name to connect to. |
d07b0e5f80b9
(tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46009
diff
changeset
|
5278 |
45861 | 5279 * Actually, the rsh program to be used can be specified in the |
5280 method parameters, see the variable `tramp-methods'." | |
5281 (save-match-data | |
5282 (when multi-method | |
5283 (error "Cannot multi-connect using rsh connection method")) | |
5284 (tramp-pre-connection multi-method method user host) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5285 (if (and user (not (string= user ""))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5286 (tramp-message 7 "Opening connection for %s@%s using %s..." |
45861 | 5287 user host method) |
5288 (tramp-message 7 "Opening connection at %s using %s..." host method)) | |
46010
d07b0e5f80b9
(tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46009
diff
changeset
|
5289 (let ((process-environment (copy-sequence process-environment)) |
d07b0e5f80b9
(tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46009
diff
changeset
|
5290 (bufnam (tramp-buffer-name multi-method method user host)) |
d07b0e5f80b9
(tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46009
diff
changeset
|
5291 (buf (tramp-get-buffer multi-method method user host)) |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5292 (login-program (tramp-get-method-parameter |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5293 multi-method |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
5294 (tramp-find-method multi-method method user host) |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5295 user host 'tramp-login-program)) |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5296 (login-args (tramp-get-method-parameter |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5297 multi-method |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
5298 (tramp-find-method multi-method method user host) |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5299 user host 'tramp-login-args)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5300 (real-host host)) |
46010
d07b0e5f80b9
(tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46009
diff
changeset
|
5301 ;; The following should be changed. We need a more general |
d07b0e5f80b9
(tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46009
diff
changeset
|
5302 ;; mechanism to parse extra host args. |
d07b0e5f80b9
(tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46009
diff
changeset
|
5303 (when (string-match "\\([^#]*\\)#\\(.*\\)" host) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
5304 (setq login-args (cons "-p" (cons (match-string 2 host) login-args))) |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5305 (setq real-host (match-string 1 host))) |
45861 | 5306 (setenv "TERM" tramp-terminal-type) |
5307 (let* ((default-directory (tramp-temporary-file-directory)) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5308 ;; If we omit the conditional, we would use |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5309 ;; `undecided-dos' in some cases. With the conditional, |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5310 ;; we use nil in these cases. Which one is right? |
45861 | 5311 (coding-system-for-read (unless (and (not (featurep 'xemacs)) |
5312 (> emacs-major-version 20)) | |
5313 tramp-dos-coding-system)) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5314 (p (if (and user (not (string= user ""))) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5315 (apply #'start-process bufnam buf login-program |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5316 real-host "-l" user login-args) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5317 (apply #'start-process bufnam buf login-program |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5318 real-host login-args))) |
45861 | 5319 (found nil)) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5320 (tramp-set-process-query-on-exit-flag p nil) |
46752 | 5321 |
5322 (set-buffer buf) | |
5323 (tramp-process-actions p multi-method method user host | |
5324 tramp-actions-before-shell) | |
45861 | 5325 (tramp-message 7 "Initializing remote shell") |
5326 (tramp-open-connection-setup-interactive-shell | |
5327 p multi-method method user host) | |
5328 (tramp-post-connection multi-method method user host))))) | |
5329 | |
5330 (defun tramp-open-connection-su (multi-method method user host) | |
5331 "Open a connection using the `su' program with METHOD. | |
5332 This starts `su - USER', then waits for a password prompt. The HOST | |
5333 name must be equal to the local host name or to `localhost'. | |
5334 | |
5335 If USER is nil, uses value returned by user-login-name instead. | |
5336 | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5337 Recognition of the remote shell prompt is based on the variables |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5338 `shell-prompt-pattern' and `tramp-shell-prompt-pattern' which must be |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5339 set up correctly. Note that the other user may have a different shell |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5340 prompt than you do, so it is not at all unlikely that the variable |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5341 `shell-prompt-pattern' is set up wrongly!" |
45861 | 5342 (save-match-data |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5343 (when (tramp-method-out-of-band-p multi-method method user host) |
45861 | 5344 (error "Cannot use out-of-band method `%s' with `su' connection method" |
5345 method)) | |
5346 (unless (or (string-match (concat "^" (regexp-quote host)) | |
5347 (system-name)) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5348 (string= "localhost" host) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5349 (string= "" host)) |
45861 | 5350 (error |
5351 "Cannot connect to different host `%s' with `su' connection method" | |
5352 host)) | |
5353 (tramp-pre-connection multi-method method user host) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5354 (tramp-message 7 "Opening connection for `%s' using `%s'..." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5355 (or user "<root>") method) |
45861 | 5356 (let ((process-environment (copy-sequence process-environment))) |
5357 (setenv "TERM" tramp-terminal-type) | |
5358 (let* ((default-directory (tramp-temporary-file-directory)) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5359 ;; If we omit the conditional, we use `undecided-dos' in |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5360 ;; some cases. With the conditional, we use nil in these |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5361 ;; cases. What's the difference? Which one is right? |
45861 | 5362 (coding-system-for-read (unless (and (not (featurep 'xemacs)) |
5363 (> emacs-major-version 20)) | |
5364 tramp-dos-coding-system)) | |
5365 (p (apply 'start-process | |
46752 | 5366 (tramp-buffer-name multi-method method user host) |
5367 (tramp-get-buffer multi-method method user host) | |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5368 (tramp-get-method-parameter |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5369 multi-method |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
5370 (tramp-find-method multi-method method user host) |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5371 user host 'tramp-login-program) |
45861 | 5372 (mapcar |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
5373 (lambda (x) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
5374 (format-spec x `((?u . ,(or user "root"))))) |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5375 (tramp-get-method-parameter |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5376 multi-method |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
5377 (tramp-find-method multi-method method user host) |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5378 user host 'tramp-login-args)))) |
45861 | 5379 (found nil) |
5380 (pw nil)) | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5381 (tramp-set-process-query-on-exit-flag p nil) |
46752 | 5382 (set-buffer (tramp-get-buffer multi-method method user host)) |
5383 (tramp-process-actions p multi-method method user host | |
5384 tramp-actions-before-shell) | |
45861 | 5385 (tramp-open-connection-setup-interactive-shell |
5386 p multi-method method user host) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5387 (tramp-post-connection multi-method method |
45861 | 5388 user host))))) |
5389 | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5390 ;; HHH: Not Changed. Multi method. It is not clear to me how this can |
45861 | 5391 ;; handle not giving a user name in the "file name". |
5392 ;; | |
5393 ;; This is more difficult than for the single-hop method. In the | |
5394 ;; multi-hop-method, the desired behaviour should be that the | |
5395 ;; user must specify names for the telnet hops of which the user | |
5396 ;; name is different than the "original" name (or different from | |
5397 ;; the previous hop. | |
5398 (defun tramp-open-connection-multi (multi-method method user host) | |
5399 "Open a multi-hop connection using METHOD. | |
5400 This uses a slightly changed file name syntax. The idea is to say | |
5401 [multi/telnet:u1@h1/rsh:u2@h2]/path/to/file | |
5402 This will use telnet to log in as u1 to h1, then use rsh from there to | |
5403 log in as u2 to h2." | |
5404 (save-match-data | |
5405 (unless multi-method | |
5406 (error "Multi-hop open connection function called on non-multi method")) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5407 (when (tramp-method-out-of-band-p multi-method method user host) |
45861 | 5408 (error "No out of band multi-hop connections")) |
5409 (unless (and (arrayp method) (not (stringp method))) | |
5410 (error "METHOD must be an array of strings for multi methods")) | |
5411 (unless (and (arrayp user) (not (stringp user))) | |
5412 (error "USER must be an array of strings for multi methods")) | |
5413 (unless (and (arrayp host) (not (stringp host))) | |
5414 (error "HOST must be an array of strings for multi methods")) | |
5415 (unless (and (= (length method) (length user)) | |
5416 (= (length method) (length host))) | |
5417 (error "Arrays METHOD, USER, HOST must have equal length")) | |
5418 (tramp-pre-connection multi-method method user host) | |
5419 (tramp-message 7 "Opening `%s' connection..." multi-method) | |
5420 (let ((process-environment (copy-sequence process-environment))) | |
5421 (setenv "TERM" tramp-terminal-type) | |
5422 (let* ((default-directory (tramp-temporary-file-directory)) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5423 ;; If we omit the conditional, we use `undecided-dos' in |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5424 ;; some cases. With the conditional, we use nil in these |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5425 ;; cases. What's the difference? Which one is right? |
45861 | 5426 (coding-system-for-read (unless (and (not (featurep 'xemacs)) |
5427 (> emacs-major-version 20)) | |
5428 tramp-dos-coding-system)) | |
5429 (p (start-process (tramp-buffer-name multi-method method user host) | |
5430 (tramp-get-buffer multi-method method user host) | |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
5431 tramp-multi-sh-program)) |
45861 | 5432 (num-hops (length method)) |
5433 (i 0)) | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5434 (tramp-set-process-query-on-exit-flag p nil) |
45861 | 5435 (tramp-message 9 "Waiting 60s for local shell to come up...") |
5436 (unless (tramp-wait-for-regexp | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5437 p 60 (format "\\(%s\\)\\'\\|\\(%s\\)\\'" |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5438 shell-prompt-pattern tramp-shell-prompt-pattern)) |
45861 | 5439 (pop-to-buffer (buffer-name)) |
5440 (kill-process p) | |
5441 (error "Couldn't find local shell prompt")) | |
5442 ;; Now do all the connections as specified. | |
5443 (while (< i num-hops) | |
5444 (let* ((m (aref method i)) | |
5445 (u (aref user i)) | |
5446 (h (aref host i)) | |
5447 (entry (assoc m tramp-multi-connection-function-alist)) | |
5448 (multi-func (nth 1 entry)) | |
5449 (command (nth 2 entry))) | |
47205
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
5450 ;; The multi-funcs don't need to do save-match-data, as that |
45861 | 5451 ;; is done here. |
5452 (funcall multi-func p m u h command) | |
5453 (erase-buffer) | |
5454 (incf i))) | |
5455 (tramp-open-connection-setup-interactive-shell | |
5456 p multi-method method user host) | |
5457 (tramp-post-connection multi-method method user host))))) | |
5458 | |
5459 ;; HHH: Changed. Multi method. Don't know how to handle this in the case | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5460 ;; of no user name provided. Hack to make it work as it did before: |
45861 | 5461 ;; changed `user' to `(or user (user-login-name))' in the places where |
5462 ;; the value is actually used. | |
5463 (defun tramp-multi-connect-telnet (p method user host command) | |
5464 "Issue `telnet' command. | |
5465 Uses shell COMMAND to issue a `telnet' command to log in as USER to | |
5466 HOST. You can use percent escapes in COMMAND: `%h' is replaced with | |
5467 the host name, and `%n' is replaced with an end of line character, as | |
5468 set in `tramp-rsh-end-of-line'. Use `%%' if you want a literal percent | |
5469 character. | |
5470 | |
5471 If USER is nil, uses the return value of (user-login-name) instead." | |
46752 | 5472 (let ((cmd (format-spec command |
5473 `((?h . ,host) (?n . ,tramp-rsh-end-of-line)))) | |
5474 (cmd1 (format-spec command `((?h . ,host) (?n . "")))) | |
45861 | 5475 found pw) |
5476 (erase-buffer) | |
5477 (tramp-message 9 "Sending telnet command `%s'" cmd1) | |
5478 (process-send-string p cmd) | |
46752 | 5479 (tramp-process-multi-actions p method user host |
47205
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
5480 tramp-multi-actions))) |
45861 | 5481 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5482 ;; HHH: Changed. Multi method. Don't know how to handle this in the case |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5483 ;; of no user name provided. Hack to make it work as it did before: |
45861 | 5484 ;; changed `user' to `(or user (user-login-name))' in the places where |
5485 ;; the value is actually used. | |
5486 (defun tramp-multi-connect-rlogin (p method user host command) | |
5487 "Issue `rlogin' command. | |
5488 Uses shell COMMAND to issue an `rlogin' command to log in as USER to | |
5489 HOST. You can use percent escapes in COMMAND. `%u' will be replaced | |
5490 with the user name, `%h' will be replaced with the host name, and `%n' | |
5491 will be replaced with the value of `tramp-rsh-end-of-line'. You can use | |
5492 `%%' if you want to use a literal percent character. | |
5493 | |
5494 If USER is nil, uses the return value of (user-login-name) instead." | |
46752 | 5495 (let ((cmd (format-spec command `((?h . ,host) |
5496 (?u . ,(or user (user-login-name))) | |
5497 (?n . ,tramp-rsh-end-of-line)))) | |
5498 (cmd1 (format-spec command `((?h . ,host) | |
5499 (?u . ,(or user (user-login-name))) | |
5500 (?n . "")))) | |
45861 | 5501 found) |
5502 (erase-buffer) | |
5503 (tramp-message 9 "Sending rlogin command `%s'" cmd1) | |
5504 (process-send-string p cmd) | |
46752 | 5505 (tramp-process-multi-actions p method user host |
47205
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
5506 tramp-multi-actions))) |
45861 | 5507 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5508 ;; HHH: Changed. Multi method. Don't know how to handle this in the case |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5509 ;; of no user name provided. Hack to make it work as it did before: |
45861 | 5510 ;; changed `user' to `(or user (user-login-name))' in the places where |
5511 ;; the value is actually used. | |
5512 (defun tramp-multi-connect-su (p method user host command) | |
5513 "Issue `su' command. | |
5514 Uses shell COMMAND to issue a `su' command to log in as USER on | |
5515 HOST. The HOST name is ignored, this just changes the user id on the | |
5516 host currently logged in to. | |
5517 | |
5518 If USER is nil, uses the return value of (user-login-name) instead. | |
5519 | |
5520 You can use percent escapes in the COMMAND. `%u' is replaced with the | |
5521 user name, and `%n' is replaced with the value of | |
5522 `tramp-rsh-end-of-line'. Use `%%' if you want a literal percent | |
5523 character." | |
46752 | 5524 (let ((cmd (format-spec command `((?u . ,(or user (user-login-name))) |
5525 (?n . ,tramp-rsh-end-of-line)))) | |
5526 (cmd1 (format-spec command `((?u . ,(or user (user-login-name))) | |
5527 (?n . "")))) | |
45861 | 5528 found) |
5529 (erase-buffer) | |
5530 (tramp-message 9 "Sending su command `%s'" cmd1) | |
5531 (process-send-string p cmd) | |
46752 | 5532 (tramp-process-multi-actions p method user host |
47205
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
5533 tramp-multi-actions))) |
45861 | 5534 |
5535 ;; Utility functions. | |
5536 | |
5537 (defun tramp-wait-for-regexp (proc timeout regexp) | |
5538 "Wait for a REGEXP to appear from process PROC within TIMEOUT seconds. | |
5539 Expects the output of PROC to be sent to the current buffer. Returns | |
5540 the string that matched, or nil. Waits indefinitely if TIMEOUT is | |
5541 nil." | |
5542 (let ((found nil) | |
5543 (start-time (current-time))) | |
5544 (cond (timeout | |
5545 ;; Work around a bug in XEmacs 21, where the timeout | |
5546 ;; expires faster than it should. This degenerates | |
5547 ;; to polling for buggy XEmacsen, but oh, well. | |
5548 (while (and (not found) | |
5549 (< (tramp-time-diff (current-time) start-time) | |
5550 timeout)) | |
5551 (with-timeout (timeout) | |
5552 (while (not found) | |
5553 (accept-process-output proc 1) | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5554 (unless (memq (process-status proc) '(run open)) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5555 (error "Process has died")) |
45861 | 5556 (goto-char (point-min)) |
5557 (setq found (when (re-search-forward regexp nil t) | |
5558 (tramp-match-string-list))))))) | |
5559 (t | |
5560 (while (not found) | |
5561 (accept-process-output proc 1) | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5562 (unless (memq (process-status proc) '(run open)) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5563 (error "Process has died")) |
45861 | 5564 (goto-char (point-min)) |
5565 (setq found (when (re-search-forward regexp nil t) | |
5566 (tramp-match-string-list)))))) | |
5567 (when tramp-debug-buffer | |
5568 (append-to-buffer | |
5569 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method | |
5570 tramp-current-user tramp-current-host) | |
5571 (point-min) (point-max)) | |
5572 (when (not found) | |
5573 (save-excursion | |
5574 (set-buffer | |
5575 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method | |
5576 tramp-current-user tramp-current-host)) | |
5577 (goto-char (point-max)) | |
5578 (insert "[[Regexp `" regexp "' not found" | |
46048
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
5579 (if timeout (format " in %d secs" timeout) "") |
45861 | 5580 "]]")))) |
5581 found)) | |
5582 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5583 (defun tramp-wait-for-shell-prompt (proc timeout) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5584 "Wait for the shell prompt to appear from process PROC within TIMEOUT seconds. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5585 See `tramp-wait-for-regexp' for more details. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5586 Shell prompt pattern is determined by variables `shell-prompt-pattern' |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5587 and `tramp-shell-prompt-pattern'." |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5588 (tramp-wait-for-regexp |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5589 proc timeout |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5590 (format "\\(%s\\|%s\\)\\'" |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5591 shell-prompt-pattern tramp-shell-prompt-pattern))) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5592 |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5593 (defun tramp-barf-if-no-shell-prompt (proc timeout &rest error-args) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5594 "Wait for shell prompt and barf if none appears. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5595 Looks at process PROC to see if a shell prompt appears in TIMEOUT |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5596 seconds. If not, it produces an error message with the given ERROR-ARGS." |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5597 (unless (tramp-wait-for-shell-prompt proc timeout) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5598 (pop-to-buffer (buffer-name)) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5599 (apply 'error error-args))) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5600 |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5601 (defun tramp-enter-password (p prompt user host) |
45861 | 5602 "Prompt for a password and send it to the remote end. |
5603 Uses PROMPT as a prompt and sends the password to process P." | |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5604 (let ((pw (tramp-read-passwd user host prompt))) |
46752 | 5605 (erase-buffer) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5606 (process-send-string |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5607 p (concat pw |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5608 (or (tramp-get-method-parameter |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5609 tramp-current-multi-method |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5610 tramp-current-method |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5611 tramp-current-user |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5612 tramp-current-host |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5613 'tramp-password-end-of-line) |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5614 tramp-default-password-end-of-line))))) |
45861 | 5615 |
5616 ;; HHH: Not Changed. This might handle the case where USER is not | |
5617 ;; given in the "File name" very poorly. Then, the local | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5618 ;; variable tramp-current-user will be set to nil. |
45861 | 5619 (defun tramp-pre-connection (multi-method method user host) |
5620 "Do some setup before actually logging in. | |
5621 METHOD, USER and HOST specify the connection." | |
5622 (set-buffer (tramp-get-buffer multi-method method user host)) | |
5623 (set (make-local-variable 'tramp-current-multi-method) multi-method) | |
5624 (set (make-local-variable 'tramp-current-method) method) | |
5625 (set (make-local-variable 'tramp-current-user) user) | |
5626 (set (make-local-variable 'tramp-current-host) host) | |
5627 (set (make-local-variable 'inhibit-eol-conversion) nil) | |
5628 (erase-buffer)) | |
5629 | |
5630 (defun tramp-open-connection-setup-interactive-shell | |
5631 (p multi-method method user host) | |
5632 "Set up an interactive shell. | |
5633 Mainly sets the prompt and the echo correctly. P is the shell process | |
5634 to set up. METHOD, USER and HOST specify the connection." | |
5635 ;; Wait a bit in case the remote end feels like sending a little | |
5636 ;; junk first. It seems that fencepost.gnu.org does this when doing | |
5637 ;; a Kerberos login. | |
5638 (sit-for 1) | |
5639 (tramp-discard-garbage-erase-buffer p multi-method method user host) | |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5640 (tramp-process-initial-commands p multi-method method user host |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5641 tramp-initial-commands) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5642 ;; It is useful to set the prompt in the following command because |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5643 ;; some people have a setting for $PS1 which /bin/sh doesn't know |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5644 ;; about and thus /bin/sh will display a strange prompt. For |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5645 ;; example, if $PS1 has "${CWD}" in the value, then ksh will display |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5646 ;; the current working directory but /bin/sh will display a dollar |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5647 ;; sign. The following command line sets $PS1 to a sane value, and |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5648 ;; works under Bourne-ish shells as well as csh-like shells. Daniel |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5649 ;; Pittman reports that the unusual positioning of the single quotes |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5650 ;; makes it work under `rc', too. We also unset the variable $ENV |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5651 ;; because that is read by some sh implementations (eg, bash when |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5652 ;; called as sh) on startup; this way, we avoid the startup file |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5653 ;; clobbering $PS1. |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5654 (tramp-send-command-internal |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5655 multi-method method user host |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5656 (format "exec env 'ENV=' 'PS1=$ ' %s" |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5657 (tramp-get-method-parameter |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5658 multi-method method user host 'tramp-remote-sh)) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5659 (format "remote `%s' to come up" |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5660 (tramp-get-method-parameter |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5661 multi-method method user host 'tramp-remote-sh))) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5662 (tramp-barf-if-no-shell-prompt |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5663 p 30 |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5664 "Remote `%s' didn't come up. See buffer `%s' for details" |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5665 (tramp-get-method-parameter multi-method method user host 'tramp-remote-sh) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5666 (buffer-name)) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5667 (tramp-message 8 "Setting up remote shell environment") |
45861 | 5668 (tramp-discard-garbage-erase-buffer p multi-method method user host) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5669 (tramp-send-command-internal multi-method method user host |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5670 "stty -inlcr -echo kill '^U'") |
45861 | 5671 (erase-buffer) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5672 ;; Ignore garbage after stty command. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5673 (tramp-send-command-internal multi-method method user host |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5674 "echo foo") |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5675 (erase-buffer) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5676 (tramp-send-command-internal multi-method method user host |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5677 "TERM=dumb; export TERM") |
45861 | 5678 ;; Try to set up the coding system correctly. |
5679 ;; CCC this can't be the right way to do it. Hm. | |
5680 (save-excursion | |
5681 (erase-buffer) | |
5682 (tramp-message 9 "Determining coding system") | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5683 (tramp-send-command-internal multi-method method user host |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5684 "echo foo ; echo bar") |
45861 | 5685 (goto-char (point-min)) |
5686 (if (featurep 'mule) | |
5687 ;; Use MULE to select the right EOL convention for communicating | |
5688 ;; with the process. | |
5689 (let* ((cs (or (process-coding-system p) (cons 'undecided 'undecided))) | |
5690 cs-decode cs-encode) | |
5691 (when (symbolp cs) (setq cs (cons cs cs))) | |
5692 (setq cs-decode (car cs)) | |
5693 (setq cs-encode (cdr cs)) | |
5694 (unless cs-decode (setq cs-decode 'undecided)) | |
5695 (unless cs-encode (setq cs-encode 'undecided)) | |
5696 (setq cs-encode (tramp-coding-system-change-eol-conversion | |
5697 cs-encode 'unix)) | |
5698 (when (search-forward "\r" nil t) | |
5699 (setq cs-decode (tramp-coding-system-change-eol-conversion | |
5700 cs-decode 'dos))) | |
5701 (set-buffer-process-coding-system cs-decode cs-encode)) | |
5702 ;; Look for ^M and do something useful if found. | |
5703 (when (search-forward "\r" nil t) | |
5704 ;; We have found a ^M but cannot frob the process coding system | |
5705 ;; because we're running on a non-MULE Emacs. Let's try | |
5706 ;; stty, instead. | |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5707 (erase-buffer) |
45861 | 5708 (tramp-message 9 "Trying `stty -onlcr'") |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5709 (tramp-send-command-internal multi-method method user host |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5710 "stty -onlcr")))) |
45861 | 5711 (erase-buffer) |
5712 (tramp-message | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5713 9 "Waiting 30s for `HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE'") |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5714 (tramp-send-command-internal |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5715 multi-method method user host |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5716 "HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE") |
45861 | 5717 (erase-buffer) |
5718 (tramp-message 9 "Waiting 30s for `set +o vi +o emacs'") | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5719 (tramp-send-command-internal multi-method method user host |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5720 "set +o vi +o emacs") |
45861 | 5721 (erase-buffer) |
5722 (tramp-message 9 "Waiting 30s for `unset MAIL MAILCHECK MAILPATH'") | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5723 (tramp-send-command-internal |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5724 multi-method method user host |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5725 "unset MAIL MAILCHECK MAILPATH 1>/dev/null 2>/dev/null") |
45861 | 5726 (erase-buffer) |
5727 (tramp-message 9 "Waiting 30s for `unset CDPATH'") | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5728 (tramp-send-command-internal multi-method method user host |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5729 "unset CDPATH") |
45861 | 5730 (erase-buffer) |
5731 (tramp-message 9 "Setting shell prompt") | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5732 ;; Douglas Gray Stephens <DGrayStephens@slb.com> says that we must |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
5733 ;; use "\n" here, not tramp-rsh-end-of-line. We also manually frob |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
5734 ;; the last time we sent a command, to avoid tramp-send-command to send |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
5735 ;; "echo are you awake". |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
5736 (setq tramp-last-cmd-time (current-time)) |
45861 | 5737 (tramp-send-command |
5738 multi-method method user host | |
5739 (format "PS1='%s%s%s'; PS2=''; PS3=''" | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5740 tramp-rsh-end-of-line |
45861 | 5741 tramp-end-of-output |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5742 tramp-rsh-end-of-line)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5743 (tramp-wait-for-output)) |
45861 | 5744 |
5745 (defun tramp-post-connection (multi-method method user host) | |
5746 "Prepare a remote shell before being able to work on it. | |
5747 METHOD, USER and HOST specify the connection. | |
5748 Among other things, this finds a shell which groks tilde expansion, | |
5749 tries to find an `ls' command which groks the `-n' option, sets the | |
5750 locale to C and sets up the remote shell search path." | |
5751 ;; Search for a good shell before searching for a command which | |
5752 ;; checks if a file exists. This is done because Tramp wants to use | |
5753 ;; "test foo; echo $?" to check if various conditions hold, and | |
5754 ;; there are buggy /bin/sh implementations which don't execute the | |
5755 ;; "echo $?" part if the "test" part has an error. In particular, | |
5756 ;; the Solaris /bin/sh is a problem. I'm betting that all systems | |
5757 ;; with buggy /bin/sh implementations will have a working bash or | |
5758 ;; ksh. Whee... | |
5759 (tramp-find-shell multi-method method user host) | |
5760 ;; Without (sit-for 0.1) at least, my machine will almost always blow | |
5761 ;; up on 'not numberp /root' - a race that causes the 'echo ~root' | |
5762 ;; output of (tramp-find-shell) to show up along with the output of | |
5763 ;; (tramp-find-ls-command) testing. | |
5764 ;; | |
5765 ;; I can't work out why this is a problem though. The (tramp-wait-for-output) | |
5766 ;; call in (tramp-find-shell) *should* make this not happen, I thought. | |
5767 ;; | |
5768 ;; After much debugging I couldn't find any problem with the implementation | |
5769 ;; of that function though. The workaround stays for me at least. :/ | |
5770 ;; | |
5771 ;; Daniel Pittman <daniel@danann.net> | |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
5772 (sleep-for 1) |
46808
cf225aed7a75
Version 2.0.11 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46802
diff
changeset
|
5773 (erase-buffer) |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
5774 (tramp-find-file-exists-command multi-method method user host) |
45861 | 5775 (make-local-variable 'tramp-ls-command) |
5776 (setq tramp-ls-command (tramp-find-ls-command multi-method method user host)) | |
5777 (unless tramp-ls-command | |
5778 (tramp-message | |
5779 1 | |
5780 "Danger! Couldn't find ls which groks -n. Muddling through anyway") | |
5781 (setq tramp-ls-command | |
5782 (tramp-find-executable multi-method method user host | |
5783 "ls" tramp-remote-path nil))) | |
5784 (unless tramp-ls-command | |
5785 (error "Fatal error: Couldn't find remote executable `ls'")) | |
5786 (tramp-message 5 "Using remote command `%s' for getting directory listings" | |
5787 tramp-ls-command) | |
5788 (tramp-send-command multi-method method user host | |
5789 (concat "tramp_set_exit_status () {" tramp-rsh-end-of-line | |
5790 "return $1" tramp-rsh-end-of-line | |
5791 "}")) | |
5792 (tramp-wait-for-output) | |
5793 ;; Set remote PATH variable. | |
5794 (tramp-set-remote-path multi-method method user host "PATH" tramp-remote-path) | |
5795 ;; Tell remote shell to use standard time format, needed for | |
5796 ;; parsing `ls -l' output. | |
5797 (tramp-send-command multi-method method user host | |
5798 "LC_TIME=C; export LC_TIME; echo huhu") | |
5799 (tramp-wait-for-output) | |
5800 (tramp-send-command multi-method method user host | |
5801 "mesg n; echo huhu") | |
5802 (tramp-wait-for-output) | |
5803 (tramp-send-command multi-method method user host | |
5804 "biff n ; echo huhu") | |
5805 (tramp-wait-for-output) | |
5806 ;; Unalias ls(1) to work around issues with those silly people who make it | |
5807 ;; spit out ANSI escapes or whatever. | |
5808 (tramp-send-command multi-method method user host | |
5809 "unalias ls; echo huhu") | |
5810 (tramp-wait-for-output) | |
5811 ;; Does `test A -nt B' work? Use abominable `find' construct if it | |
5812 ;; doesn't. BSD/OS 4.0 wants the parentheses around the command, | |
5813 ;; for otherwise the shell crashes. | |
5814 (erase-buffer) | |
5815 (make-local-variable 'tramp-test-groks-nt) | |
5816 (tramp-send-command multi-method method user host | |
5817 "( test / -nt / )") | |
5818 (tramp-wait-for-output) | |
5819 (goto-char (point-min)) | |
5820 (setq tramp-test-groks-nt | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5821 (looking-at (format "\n%s\r?\n" (regexp-quote tramp-end-of-output)))) |
45861 | 5822 (unless tramp-test-groks-nt |
5823 (tramp-send-command | |
5824 multi-method method user host | |
5825 (concat "tramp_test_nt () {" tramp-rsh-end-of-line | |
5826 "test -n \"`find $1 -prune -newer $2 -print`\"" tramp-rsh-end-of-line | |
5827 "}"))) | |
5828 (tramp-wait-for-output) | |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
5829 ;; Send the fallback `uudecode' script. |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
5830 (erase-buffer) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5831 (tramp-send-string multi-method method user host tramp-uudecode) |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
5832 (tramp-wait-for-output) |
45861 | 5833 ;; Find a `perl'. |
5834 (erase-buffer) | |
5835 (let ((tramp-remote-perl | |
5836 (or (tramp-find-executable multi-method method user host | |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
5837 "perl5" tramp-remote-path nil) |
45861 | 5838 (tramp-find-executable multi-method method user host |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
5839 "perl" tramp-remote-path nil)))) |
45861 | 5840 (when tramp-remote-perl |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
5841 (tramp-set-connection-property "perl" tramp-remote-perl |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
5842 multi-method method user host) |
45861 | 5843 ;; Set up stat in Perl if we can. |
5844 (when tramp-remote-perl | |
5845 (tramp-message 5 "Sending the Perl `file-attributes' implementation.") | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5846 (tramp-send-string |
45861 | 5847 multi-method method user host |
5848 (concat "tramp_file_attributes () {\n" | |
5849 tramp-remote-perl | |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5850 " -e '" tramp-perl-file-attributes "' $1 $2 2>/dev/null\n" |
45861 | 5851 "}")) |
5852 (tramp-wait-for-output) | |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
5853 (unless (tramp-method-out-of-band-p multi-method method user host) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5854 (tramp-message 5 "Sending the Perl `mime-encode' implementations.") |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5855 (tramp-send-string |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5856 multi-method method user host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5857 (concat "tramp_encode () {\n" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5858 (format tramp-perl-encode tramp-remote-perl) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5859 " 2>/dev/null" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5860 "\n}")) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5861 (tramp-wait-for-output) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5862 (tramp-send-string |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5863 multi-method method user host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5864 (concat "tramp_encode_with_module () {\n" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5865 (format tramp-perl-encode-with-module tramp-remote-perl) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5866 " 2>/dev/null" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5867 "\n}")) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5868 (tramp-wait-for-output) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5869 (tramp-message 5 "Sending the Perl `mime-decode' implementations.") |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5870 (tramp-send-string |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5871 multi-method method user host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5872 (concat "tramp_decode () {\n" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5873 (format tramp-perl-decode tramp-remote-perl) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5874 " 2>/dev/null" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5875 "\n}")) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5876 (tramp-wait-for-output) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5877 (tramp-send-string |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5878 multi-method method user host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5879 (concat "tramp_decode_with_module () {\n" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5880 (format tramp-perl-decode-with-module tramp-remote-perl) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5881 " 2>/dev/null" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5882 "\n}")) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5883 (tramp-wait-for-output))))) |
45861 | 5884 ;; Find ln(1) |
5885 (erase-buffer) | |
5886 (let ((ln (tramp-find-executable multi-method method user host | |
5887 "ln" tramp-remote-path nil))) | |
5888 (when ln | |
5889 (tramp-set-connection-property "ln" ln multi-method method user host))) | |
5890 (erase-buffer) | |
46752 | 5891 ;; Find the right encoding/decoding commands to use. |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
5892 (unless (tramp-method-out-of-band-p multi-method method user host) |
46752 | 5893 (tramp-find-inline-encoding multi-method method user host)) |
45861 | 5894 ;; If encoding/decoding command are given, test to see if they work. |
5895 ;; CCC: Maybe it would be useful to run the encoder both locally and | |
5896 ;; remotely to see if they produce the same result. | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5897 (let ((rem-enc (tramp-get-remote-encoding multi-method method user host)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5898 (rem-dec (tramp-get-remote-decoding multi-method method user host)) |
45861 | 5899 (magic-string "xyzzy")) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5900 (when (and (or rem-dec rem-enc) (not (and rem-dec rem-enc))) |
45861 | 5901 (tramp-kill-process multi-method method user host) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5902 ;; Improve error message and/or error check. |
45861 | 5903 (error |
5904 "Must give both decoding and encoding command in method definition")) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5905 (when (and rem-enc rem-dec) |
45861 | 5906 (tramp-message |
5907 5 | |
5908 "Checking to see if encoding/decoding commands work on remote host...") | |
5909 (tramp-send-command | |
5910 multi-method method user host | |
5911 (format "echo %s | %s | %s" | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5912 (tramp-shell-quote-argument magic-string) rem-enc rem-dec)) |
45861 | 5913 (tramp-wait-for-output) |
5914 (unless (looking-at (regexp-quote magic-string)) | |
5915 (tramp-kill-process multi-method method user host) | |
5916 (error "Remote host cannot execute de/encoding commands. See buffer `%s' for details" | |
5917 (buffer-name))) | |
5918 (erase-buffer) | |
5919 (tramp-message | |
5920 5 "Checking to see if encoding/decoding commands work on remote host...done")))) | |
5921 | |
46752 | 5922 ;; CCC: We should either implement a Perl version of base64 encoding |
5923 ;; and decoding. Then we just use that in the last item. The other | |
5924 ;; alternative is to use the Perl version of UU encoding. But then | |
5925 ;; we need a Lisp version of uuencode. | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5926 ;; |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5927 ;; Old text from documentation of tramp-methods: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5928 ;; Using a uuencode/uudecode inline method is discouraged, please use one |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5929 ;; of the base64 methods instead since base64 encoding is much more |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5930 ;; reliable and the commands are more standardized between the different |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5931 ;; Unix versions. But if you can't use base64 for some reason, please |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5932 ;; note that the default uudecode command does not work well for some |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5933 ;; Unices, in particular AIX and Irix. For AIX, you might want to use |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5934 ;; the following command for uudecode: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5935 ;; |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5936 ;; sed '/^begin/d;/^[` ]$/d;/^end/d' | iconv -f uucode -t ISO8859-1 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5937 ;; |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5938 ;; For Irix, no solution is known yet. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5939 |
46752 | 5940 (defvar tramp-coding-commands |
5941 '(("mimencode -b" "mimencode -u -b" | |
5942 base64-encode-region base64-decode-region) | |
5943 ("mmencode -b" "mmencode -u -b" | |
5944 base64-encode-region base64-decode-region) | |
5945 ("recode data..base64" "recode base64..data" | |
5946 base64-encode-region base64-decode-region) | |
5947 ("uuencode xxx" "uudecode -o -" | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5948 tramp-uuencode-region uudecode-decode-region) |
46752 | 5949 ("uuencode xxx" "uudecode -p" |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5950 tramp-uuencode-region uudecode-decode-region) |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
5951 ("uuencode xxx" "tramp_uudecode" |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5952 tramp-uuencode-region uudecode-decode-region) |
46790 | 5953 ("tramp_encode_with_module" "tramp_decode_with_module" |
5954 base64-encode-region base64-decode-region) | |
46752 | 5955 ("tramp_encode" "tramp_decode" |
5956 base64-encode-region base64-decode-region)) | |
5957 "List of coding commands for inline transfer. | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5958 Each item is a list that looks like this: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5959 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5960 \(REMOTE-ENCODING REMOTE-DECODING LOCAL-ENCODING LOCAL-DECODING) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5961 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5962 The REMOTE-ENCODING should be a string, giving a command accepting a |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5963 plain file on standard input and writing the encoded file to standard |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5964 output. The REMOTE-DECODING should also be a string, giving a command |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5965 accepting an encoded file on standard input and writing the decoded |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5966 file to standard output. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5967 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5968 LOCAL-ENCODING and LOCAL-DECODING can be strings, giving commands, or |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5969 symbols, giving functions. If they are strings, then they can contain |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5970 the \"%s\" format specifier. If that specifier is present, the input |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5971 filename will be put into the command line at that spot. If the |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5972 specifier is not present, the input should be read from standard |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5973 input. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5974 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5975 If they are functions, they will be called with two arguments, start |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5976 and end of region, and are expected to replace the region contents |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5977 with the encoded or decoded results, respectively.") |
46752 | 5978 |
5979 (defun tramp-find-inline-encoding (multi-method method user host) | |
5980 "Find an inline transfer encoding that works. | |
5981 Goes through the list `tramp-coding-commands'." | |
5982 (let ((commands tramp-coding-commands) | |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
5983 (magic "xyzzy") |
46752 | 5984 item found) |
5985 (while (and commands (null found)) | |
5986 (setq item (pop commands)) | |
5987 (catch 'wont-work | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5988 (let ((rem-enc (nth 0 item)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5989 (rem-dec (nth 1 item)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5990 (loc-enc (nth 2 item)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5991 (loc-dec (nth 3 item))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5992 ;; Check if remote encoding and decoding commands can be |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5993 ;; called remotely with null input and output. This makes |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5994 ;; sure there are no syntax errors and the command is really |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
5995 ;; found. Note that we do not redirect stdout to /dev/null, |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
5996 ;; for two reaons: when checking the decoding command, we |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
5997 ;; actually check the output it gives. And also, when |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
5998 ;; redirecting "mimencode" output to /dev/null, then as root |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
5999 ;; it might change the permissions of /dev/null! |
46752 | 6000 (tramp-message-for-buffer |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
6001 multi-method method user host 9 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6002 "Checking remote encoding command `%s' for sanity" rem-enc) |
46752 | 6003 (unless (zerop (tramp-send-command-and-check |
6004 multi-method method user host | |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6005 (format "%s </dev/null" rem-enc) t)) |
46752 | 6006 (throw 'wont-work nil)) |
6007 (tramp-message-for-buffer | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
6008 multi-method method user host 9 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6009 "Checking remote decoding command `%s' for sanity" rem-dec) |
46752 | 6010 (unless (zerop (tramp-send-command-and-check |
6011 multi-method method user host | |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6012 (format "echo %s | %s | %s" |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6013 magic rem-enc rem-dec) t)) |
46752 | 6014 (throw 'wont-work nil)) |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6015 (save-excursion |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6016 (goto-char (point-min)) |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6017 (unless (looking-at (regexp-quote magic)) |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6018 (throw 'wont-work nil))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6019 ;; If the local encoder or decoder is a string, the |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6020 ;; corresponding command has to work locally. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6021 (when (stringp loc-enc) |
46752 | 6022 (tramp-message-for-buffer |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
6023 multi-method method user host 9 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6024 "Checking local encoding command `%s' for sanity" loc-enc) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6025 (unless (zerop (tramp-call-local-coding-command |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6026 loc-enc nil nil)) |
46752 | 6027 (throw 'wont-work nil))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6028 (when (stringp loc-dec) |
46752 | 6029 (tramp-message-for-buffer |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
6030 multi-method method user host 9 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6031 "Checking local decoding command `%s' for sanity" loc-dec) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6032 (unless (zerop (tramp-call-local-coding-command |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6033 loc-dec nil nil)) |
46752 | 6034 (throw 'wont-work nil))) |
6035 ;; CCC: At this point, maybe we should check that the output | |
6036 ;; of the commands is correct. But for the moment we will | |
6037 ;; assume that commands working on empty input will also | |
6038 ;; work in practice. | |
6039 (setq found item)))) | |
6040 ;; Did we find something? If not, issue error. If so, | |
6041 ;; set connection properties. | |
6042 (unless found | |
6043 (error "Couldn't find an inline transfer encoding")) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6044 (let ((rem-enc (nth 0 found)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6045 (rem-dec (nth 1 found)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6046 (loc-enc (nth 2 found)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6047 (loc-dec (nth 3 found))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6048 (tramp-message 10 "Using remote encoding %s" rem-enc) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6049 (tramp-set-remote-encoding multi-method method user host rem-enc) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6050 (tramp-message 10 "Using remote decoding %s" rem-dec) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6051 (tramp-set-remote-decoding multi-method method user host rem-dec) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6052 (tramp-message 10 "Using local encoding %s" loc-enc) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6053 (tramp-set-local-encoding multi-method method user host loc-enc) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6054 (tramp-message 10 "Using local decoding %s" loc-dec) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6055 (tramp-set-local-decoding multi-method method user host loc-dec)))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6056 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6057 (defun tramp-call-local-coding-command (cmd input output) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6058 "Call the local encoding or decoding command. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6059 If CMD contains \"%s\", provide input file INPUT there in command. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6060 Otherwise, INPUT is passed via standard input. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6061 INPUT can also be nil which means `/dev/null'. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6062 OUTPUT can be a string (which specifies a filename), or t (which |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6063 means standard output and thus the current buffer), or nil (which |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6064 means discard it)." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6065 (call-process |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6066 tramp-encoding-shell ;program |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6067 (when (and input (not (string-match "%s" cmd))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6068 input) ;input |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6069 (if (eq output t) t nil) ;output |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6070 nil ;redisplay |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6071 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
|
6072 ;; actual shell command |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6073 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6074 (if (string-match "%s" cmd) (format cmd input) cmd) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6075 (if (stringp output) (concat "> " output) "")))) |
45861 | 6076 |
6077 (defun tramp-maybe-open-connection (multi-method method user host) | |
6078 "Maybe open a connection to HOST, logging in as USER, using METHOD. | |
6079 Does not do anything if a connection is already open, but re-opens the | |
6080 connection if a previous connection has died for some reason." | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6081 (let ((p (get-buffer-process |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6082 (tramp-get-buffer multi-method method user host))) |
46752 | 6083 last-cmd-time) |
6084 ;; If too much time has passed since last command was sent, look | |
6085 ;; whether process is still alive. If it isn't, kill it. When | |
6086 ;; using ssh, it can sometimes happen that the remote end has hung | |
6087 ;; up but the local ssh client doesn't recognize this until it | |
6088 ;; tries to send some data to the remote end. So that's why we | |
6089 ;; try to send a command from time to time, then look again | |
6090 ;; whether the process is really alive. | |
6091 (save-excursion | |
6092 (set-buffer (tramp-get-buffer multi-method method user host)) | |
6093 (when (and tramp-last-cmd-time | |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6094 (> (tramp-time-diff (current-time) tramp-last-cmd-time) 60) |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6095 p (processp p) (memq (process-status p) '(run open))) |
46835
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
6096 (tramp-send-command |
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
6097 multi-method method user host "echo are you awake" nil t) |
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
6098 (unless (tramp-wait-for-output 10) |
46752 | 6099 (delete-process p) |
6100 (setq p nil)) | |
6101 (erase-buffer))) | |
6102 (unless (and p (processp p) (memq (process-status p) '(run open))) | |
45861 | 6103 (when (and p (processp p)) |
6104 (delete-process p)) | |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6105 (let ((process-connection-type tramp-process-connection-type)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6106 (funcall (tramp-get-method-parameter |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6107 multi-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6108 (tramp-find-method multi-method method user host) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6109 user host 'tramp-connection-function) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6110 multi-method method user host))))) |
45861 | 6111 |
6112 (defun tramp-send-command | |
46835
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
6113 (multi-method method user host command &optional noerase neveropen) |
45861 | 6114 "Send the COMMAND to USER at HOST (logged in using METHOD). |
6115 Erases temporary buffer before sending the command (unless NOERASE | |
46835
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
6116 is true). |
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
6117 If optional seventh arg NEVEROPEN is non-nil, never try to open the |
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
6118 connection. This is meant to be used from |
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
6119 `tramp-maybe-open-connection' only." |
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
6120 (or neveropen |
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
6121 (tramp-maybe-open-connection multi-method method user host)) |
46752 | 6122 (setq tramp-last-cmd-time (current-time)) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6123 (setq tramp-last-cmd command) |
45861 | 6124 (when tramp-debug-buffer |
6125 (save-excursion | |
6126 (set-buffer (tramp-get-debug-buffer multi-method method user host)) | |
6127 (goto-char (point-max)) | |
6128 (tramp-insert-with-face 'bold (format "$ %s\n" command)))) | |
6129 (let ((proc nil)) | |
6130 (set-buffer (tramp-get-buffer multi-method method user host)) | |
6131 (unless noerase (erase-buffer)) | |
6132 (setq proc (get-buffer-process (current-buffer))) | |
6133 (process-send-string proc | |
6134 (concat command tramp-rsh-end-of-line)))) | |
6135 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6136 (defun tramp-send-command-internal |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6137 (multi-method method user host command &optional msg) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6138 "Send command to remote host and wait for success. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6139 Sends COMMAND, then waits 30 seconds for shell prompt." |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6140 (tramp-send-command multi-method method user host command t t) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6141 (when msg |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6142 (tramp-message 9 "Waiting 30s for %s..." msg)) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6143 (tramp-barf-if-no-shell-prompt |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6144 nil 30 |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6145 "Couldn't `%s', see buffer `%s'" command (buffer-name))) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6146 |
45861 | 6147 (defun tramp-wait-for-output (&optional timeout) |
6148 "Wait for output from remote rsh command." | |
6149 (let ((proc (get-buffer-process (current-buffer))) | |
6150 (found nil) | |
6151 (start-time (current-time)) | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6152 (start-point (point)) |
45861 | 6153 (end-of-output (concat "^" |
6154 (regexp-quote tramp-end-of-output) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6155 "\r?$"))) |
45861 | 6156 ;; Algorithm: get waiting output. See if last line contains |
6157 ;; end-of-output sentinel. If not, wait a bit and again get | |
6158 ;; waiting output. Repeat until timeout expires or end-of-output | |
6159 ;; sentinel is seen. Will hang if timeout is nil and | |
6160 ;; end-of-output sentinel never appears. | |
6161 (save-match-data | |
6162 (cond (timeout | |
6163 ;; Work around an XEmacs bug, where the timeout expires | |
6164 ;; faster than it should. This degenerates into polling | |
6165 ;; for buggy XEmacsen, but oh, well. | |
6166 (while (and (not found) | |
6167 (< (tramp-time-diff (current-time) start-time) | |
6168 timeout)) | |
6169 (with-timeout (timeout) | |
6170 (while (not found) | |
6171 (accept-process-output proc 1) | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6172 (unless (memq (process-status proc) '(run open)) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6173 (error "Process has died")) |
45861 | 6174 (goto-char (point-max)) |
6175 (forward-line -1) | |
6176 (setq found (looking-at end-of-output)))))) | |
6177 (t | |
6178 (while (not found) | |
6179 (accept-process-output proc 1) | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6180 (unless (memq (process-status proc) '(run open)) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6181 (error "Process has died")) |
45861 | 6182 (goto-char (point-max)) |
6183 (forward-line -1) | |
6184 (setq found (looking-at end-of-output)))))) | |
6185 ;; At this point, either the timeout has expired or we have found | |
6186 ;; the end-of-output sentinel. | |
6187 (when found | |
6188 (goto-char (point-max)) | |
6189 (forward-line -2) | |
6190 (delete-region (point) (point-max))) | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6191 ;; If processing echoes, look for it in the first line and delete. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6192 (when tramp-process-echoes |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6193 (save-excursion |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6194 (goto-char start-point) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6195 (when (looking-at (regexp-quote tramp-last-cmd)) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6196 (delete-region (point) (forward-line 1))))) |
45861 | 6197 ;; Add output to debug buffer if appropriate. |
6198 (when tramp-debug-buffer | |
6199 (append-to-buffer | |
6200 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method | |
6201 tramp-current-user tramp-current-host) | |
6202 (point-min) (point-max)) | |
6203 (when (not found) | |
6204 (save-excursion | |
6205 (set-buffer | |
6206 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method | |
6207 tramp-current-user tramp-current-host)) | |
6208 (goto-char (point-max)) | |
6209 (insert "[[Remote prompt `" end-of-output "' not found" | |
46048
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
6210 (if timeout (format " in %d secs" timeout) "") |
45861 | 6211 "]]")))) |
6212 (goto-char (point-min)) | |
6213 ;; Return value is whether end-of-output sentinel was found. | |
6214 found)) | |
6215 | |
6216 (defun tramp-match-string-list (&optional string) | |
6217 "Returns list of all match strings. | |
6218 That is, (list (match-string 0) (match-string 1) ...), according to the | |
6219 number of matches." | |
6220 (let* ((nmatches (/ (length (match-data)) 2)) | |
6221 (i (- nmatches 1)) | |
6222 (res nil)) | |
6223 (while (>= i 0) | |
6224 (setq res (cons (match-string i string) res)) | |
6225 (setq i (- i 1))) | |
6226 res)) | |
6227 | |
6228 (defun tramp-send-command-and-check (multi-method method user host command | |
6229 &optional subshell) | |
6230 "Run COMMAND and check its exit status. | |
6231 MULTI-METHOD and METHOD specify how to log in (as USER) to the remote HOST. | |
6232 Sends `echo $?' along with the COMMAND for checking the exit status. If | |
6233 COMMAND is nil, just sends `echo $?'. Returns the exit status found. | |
6234 | |
6235 If the optional argument SUBSHELL is non-nil, the command is executed in | |
6236 a subshell, ie surrounded by parentheses." | |
6237 (tramp-send-command multi-method method user host | |
6238 (concat (if subshell "( " "") | |
6239 command | |
6240 (if command " 2>/dev/null; " "") | |
6241 "echo tramp_exit_status $?" | |
6242 (if subshell " )" " "))) | |
6243 (tramp-wait-for-output) | |
6244 (goto-char (point-max)) | |
6245 (unless (search-backward "tramp_exit_status " nil t) | |
6246 (error "Couldn't find exit status of `%s'" command)) | |
6247 (skip-chars-forward "^ ") | |
6248 (read (current-buffer))) | |
6249 | |
6250 (defun tramp-barf-unless-okay (multi-method method user host command subshell | |
6251 signal fmt &rest args) | |
6252 "Run COMMAND, check exit status, throw error if exit status not okay. | |
6253 Similar to `tramp-send-command-and-check' but accepts two more arguments | |
6254 FMT and ARGS which are passed to `error'." | |
6255 (unless (zerop (tramp-send-command-and-check | |
6256 multi-method method user host command subshell)) | |
6257 ;; CCC: really pop-to-buffer? Maybe it's appropriate to be more | |
6258 ;; silent. | |
6259 (pop-to-buffer (current-buffer)) | |
6260 (funcall 'signal signal (apply 'format fmt args)))) | |
6261 | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6262 ;; 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
|
6263 ;; 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
|
6264 ;; `file-attributes' implementation, for instance.) Therefore, we |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6265 ;; have this function which waits a bit at each line. |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6266 (defun tramp-send-string |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6267 (multi-method method user host string) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6268 "Send the STRING to USER at HOST using METHOD. |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6269 |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6270 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
|
6271 the remote host use line-endings as defined in the variable |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6272 `tramp-rsh-end-of-line'." |
45861 | 6273 (let ((proc (get-buffer-process |
6274 (tramp-get-buffer multi-method method user host)))) | |
6275 (unless proc | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6276 (error "Can't send string to remote host -- not logged in")) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6277 ;; debug message |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6278 (when tramp-debug-buffer |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6279 (save-excursion |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6280 (set-buffer (tramp-get-debug-buffer multi-method method user host)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6281 (goto-char (point-max)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6282 (tramp-insert-with-face 'bold (format "$ %s\n" string)))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6283 ;; replace "\n" by `tramp-rsh-end-of-line' |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6284 (setq string |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6285 (mapconcat 'identity |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6286 (split-string string "\n") |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6287 tramp-rsh-end-of-line)) |
50432
7d56636afc9c
(tramp-send-string): Handle empty string.
Andreas Schwab <schwab@suse.de>
parents:
50338
diff
changeset
|
6288 (unless (or (string= string "") |
7d56636afc9c
(tramp-send-string): Handle empty string.
Andreas Schwab <schwab@suse.de>
parents:
50338
diff
changeset
|
6289 (string-equal (substring string -1) tramp-rsh-end-of-line)) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6290 (setq string (concat string tramp-rsh-end-of-line))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6291 ;; send the string |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
6292 (if (and tramp-chunksize (not (zerop tramp-chunksize))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6293 (let ((pos 0) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6294 (end (length string))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6295 (while (< pos end) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6296 (tramp-message-for-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6297 multi-method method user host 10 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6298 "Sending chunk from %s to %s" |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6299 pos (min (+ pos tramp-chunksize) end)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6300 (process-send-string |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6301 proc (substring string pos (min (+ pos tramp-chunksize) end))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6302 (setq pos (+ pos tramp-chunksize)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6303 (sleep-for 0.1))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6304 (process-send-string proc string)))) |
45861 | 6305 |
6306 (defun tramp-send-eof (multi-method method user host) | |
6307 "Send EOF to the remote end. | |
46151
eff75835ac2e
(tramp-send-eof): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
46060
diff
changeset
|
6308 METHOD, HOST and USER specify the connection." |
45861 | 6309 (let ((proc (get-buffer-process |
6310 (tramp-get-buffer multi-method method user host)))) | |
6311 (unless proc | |
6312 (error "Can't send EOF to remote host -- not logged in")) | |
6313 (process-send-eof proc))) | |
6314 ; (process-send-string proc "\^D"))) | |
6315 | |
6316 (defun tramp-kill-process (multi-method method user host) | |
6317 "Kill the connection process used by Tramp. | |
46151
eff75835ac2e
(tramp-send-eof): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
46060
diff
changeset
|
6318 MULTI-METHOD, METHOD, USER, and HOST specify the connection." |
45861 | 6319 (let ((proc (get-buffer-process |
6320 (tramp-get-buffer multi-method method user host)))) | |
6321 (kill-process proc))) | |
6322 | |
6323 (defun tramp-discard-garbage-erase-buffer (p multi-method method user host) | |
6324 "Erase buffer, then discard subsequent garbage. | |
6325 If `tramp-discard-garbage' is nil, just erase buffer." | |
6326 (if (not tramp-discard-garbage) | |
6327 (erase-buffer) | |
6328 (while (prog1 (erase-buffer) (accept-process-output p 0.25)) | |
6329 (when tramp-debug-buffer | |
6330 (save-excursion | |
6331 (set-buffer (tramp-get-debug-buffer multi-method method user host)) | |
6332 (goto-char (point-max)) | |
6333 (tramp-insert-with-face | |
6334 'bold (format "Additional characters detected\n"))))))) | |
6335 | |
6336 (defun tramp-mode-string-to-int (mode-string) | |
6337 "Converts a ten-letter `drwxrwxrwx'-style mode string into mode bits." | |
6338 (let* ((mode-chars (string-to-vector mode-string)) | |
6339 (owner-read (aref mode-chars 1)) | |
6340 (owner-write (aref mode-chars 2)) | |
6341 (owner-execute-or-setid (aref mode-chars 3)) | |
6342 (group-read (aref mode-chars 4)) | |
6343 (group-write (aref mode-chars 5)) | |
6344 (group-execute-or-setid (aref mode-chars 6)) | |
6345 (other-read (aref mode-chars 7)) | |
6346 (other-write (aref mode-chars 8)) | |
6347 (other-execute-or-sticky (aref mode-chars 9))) | |
6348 (save-match-data | |
6349 (logior | |
6350 (case owner-read | |
6351 (?r (tramp-octal-to-decimal "00400")) (?- 0) | |
6352 (t (error "Second char `%c' must be one of `r-'" owner-read))) | |
6353 (case owner-write | |
6354 (?w (tramp-octal-to-decimal "00200")) (?- 0) | |
6355 (t (error "Third char `%c' must be one of `w-'" owner-write))) | |
6356 (case owner-execute-or-setid | |
6357 (?x (tramp-octal-to-decimal "00100")) | |
6358 (?S (tramp-octal-to-decimal "04000")) | |
6359 (?s (tramp-octal-to-decimal "04100")) | |
6360 (?- 0) | |
6361 (t (error "Fourth char `%c' must be one of `xsS-'" | |
6362 owner-execute-or-setid))) | |
6363 (case group-read | |
6364 (?r (tramp-octal-to-decimal "00040")) (?- 0) | |
6365 (t (error "Fifth char `%c' must be one of `r-'" group-read))) | |
6366 (case group-write | |
6367 (?w (tramp-octal-to-decimal "00020")) (?- 0) | |
6368 (t (error "Sixth char `%c' must be one of `w-'" group-write))) | |
6369 (case group-execute-or-setid | |
6370 (?x (tramp-octal-to-decimal "00010")) | |
6371 (?S (tramp-octal-to-decimal "02000")) | |
6372 (?s (tramp-octal-to-decimal "02010")) | |
6373 (?- 0) | |
6374 (t (error "Seventh char `%c' must be one of `xsS-'" | |
6375 group-execute-or-setid))) | |
6376 (case other-read | |
6377 (?r (tramp-octal-to-decimal "00004")) (?- 0) | |
6378 (t (error "Eighth char `%c' must be one of `r-'" other-read))) | |
6379 (case other-write | |
6380 (?w (tramp-octal-to-decimal "00002")) (?- 0) | |
6381 (t (error "Nineth char `%c' must be one of `w-'" other-write))) | |
6382 (case other-execute-or-sticky | |
6383 (?x (tramp-octal-to-decimal "00001")) | |
6384 (?T (tramp-octal-to-decimal "01000")) | |
6385 (?t (tramp-octal-to-decimal "01001")) | |
6386 (?- 0) | |
6387 (t (error "Tenth char `%c' must be one of `xtT-'" | |
6388 other-execute-or-sticky))))))) | |
6389 | |
6390 | |
6391 (defun tramp-file-mode-from-int (mode) | |
6392 "Turn an integer representing a file mode into an ls(1)-like string." | |
6393 (let ((type (cdr (assoc (logand (lsh mode -12) 15) tramp-file-mode-type-map))) | |
6394 (user (logand (lsh mode -6) 7)) | |
6395 (group (logand (lsh mode -3) 7)) | |
6396 (other (logand (lsh mode -0) 7)) | |
6397 (suid (> (logand (lsh mode -9) 4) 0)) | |
6398 (sgid (> (logand (lsh mode -9) 2) 0)) | |
6399 (sticky (> (logand (lsh mode -9) 1) 0))) | |
6400 (setq user (tramp-file-mode-permissions user suid "s")) | |
6401 (setq group (tramp-file-mode-permissions group sgid "s")) | |
6402 (setq other (tramp-file-mode-permissions other sticky "t")) | |
6403 (concat type user group other))) | |
6404 | |
6405 | |
6406 (defun tramp-file-mode-permissions (perm suid suid-text) | |
6407 "Convert a permission bitset into a string. | |
6408 This is used internally by `tramp-file-mode-from-int'." | |
6409 (let ((r (> (logand perm 4) 0)) | |
6410 (w (> (logand perm 2) 0)) | |
6411 (x (> (logand perm 1) 0))) | |
6412 (concat (or (and r "r") "-") | |
6413 (or (and w "w") "-") | |
6414 (or (and suid x suid-text) ; suid, execute | |
6415 (and suid (upcase suid-text)) ; suid, !execute | |
6416 (and x "x") "-")))) ; !suid | |
6417 | |
6418 | |
6419 (defun tramp-decimal-to-octal (i) | |
6420 "Return a string consisting of the octal digits of I. | |
6421 Not actually used. Use `(format \"%o\" i)' instead?" | |
6422 (cond ((< i 0) (error "Cannot convert negative number to octal")) | |
6423 ((not (integerp i)) (error "Cannot convert non-integer to octal")) | |
6424 ((zerop i) "0") | |
6425 (t (concat (tramp-decimal-to-octal (/ i 8)) | |
6426 (number-to-string (% i 8)))))) | |
6427 | |
6428 | |
6429 ;;(defun tramp-octal-to-decimal (ostr) | |
6430 ;; "Given a string of octal digits, return a decimal number." | |
6431 ;; (cond ((null ostr) 0) | |
6432 ;; ((string= "" ostr) 0) | |
6433 ;; (t (let ((last (aref ostr (1- (length ostr)))) | |
6434 ;; (rest (substring ostr 0 (1- (length ostr))))) | |
6435 ;; (unless (and (>= last ?0) | |
6436 ;; (<= last ?7)) | |
6437 ;; (error "Not an octal digit: %c" last)) | |
6438 ;; (+ (- last ?0) (* 8 (tramp-octal-to-decimal rest))))))) | |
6439 ;; Kudos to Gerd Moellmann for this suggestion. | |
6440 (defun tramp-octal-to-decimal (ostr) | |
6441 "Given a string of octal digits, return a decimal number." | |
6442 (let ((x (or ostr ""))) | |
6443 ;; `save-match' is in `tramp-mode-string-to-int' which calls this. | |
6444 (unless (string-match "\\`[0-7]*\\'" x) | |
6445 (error "Non-octal junk in string `%s'" x)) | |
6446 (string-to-number ostr 8))) | |
6447 | |
6448 (defun tramp-shell-case-fold (string) | |
6449 "Converts STRING to shell glob pattern which ignores case." | |
6450 (mapconcat | |
6451 (lambda (c) | |
6452 (if (equal (downcase c) (upcase c)) | |
6453 (vector c) | |
6454 (format "[%c%c]" (downcase c) (upcase c)))) | |
6455 string | |
6456 "")) | |
6457 | |
6458 | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6459 ;; ------------------------------------------------------------ |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6460 ;; -- TRAMP file names -- |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6461 ;; ------------------------------------------------------------ |
45861 | 6462 ;; Conversion functions between external representation and |
6463 ;; internal data structure. Convenience functions for internal | |
6464 ;; data structure. | |
6465 | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6466 (defstruct tramp-file-name multi-method method user host localname) |
45861 | 6467 |
6468 (defun tramp-tramp-file-p (name) | |
6469 "Return t iff NAME is a tramp file." | |
6470 (save-match-data | |
6471 (string-match tramp-file-name-regexp name))) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6472 |
45861 | 6473 ;; HHH: Changed. Used to assign the return value of (user-login-name) |
6474 ;; to the `user' part of the structure if a user name was not | |
6475 ;; provided, now it assigns nil. | |
6476 (defun tramp-dissect-file-name (name) | |
6477 "Return an `tramp-file-name' structure. | |
6478 The structure consists of remote method, remote user, remote host and | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6479 localname (file name on remote host)." |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
6480 (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
|
6481 (let* ((match (string-match (nth 0 tramp-file-name-structure) name)) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
6482 (method |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
6483 ; single-hop |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
6484 (if match (match-string (nth 1 tramp-file-name-structure) name) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
6485 ; maybe multi-hop |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
6486 (string-match |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
6487 (format (nth 0 tramp-multi-file-name-structure) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
6488 (nth 0 tramp-multi-file-name-hop-structure)) name) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
6489 (match-string (nth 1 tramp-multi-file-name-structure) name)))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6490 (if (and method (member method tramp-multi-methods)) |
45861 | 6491 ;; If it's a multi method, the file name structure contains |
6492 ;; arrays of method, user and host. | |
6493 (tramp-dissect-multi-file-name name) | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6494 ;; Normal method. First, find out default 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
|
6495 (unless match (error "Not a tramp file name: %s" name)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6496 (let ((user (match-string (nth 2 tramp-file-name-structure) name)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6497 (host (match-string (nth 3 tramp-file-name-structure) name)) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6498 (localname (match-string (nth 4 tramp-file-name-structure) name))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6499 (make-tramp-file-name |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6500 :multi-method nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6501 :method method |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6502 :user (or user nil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6503 :host host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6504 :localname localname)))))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6505 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6506 (defun tramp-find-default-method (user host) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6507 "Look up the right method to use in `tramp-default-method-alist'." |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6508 (let ((choices tramp-default-method-alist) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6509 (method tramp-default-method) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6510 item) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6511 (while choices |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6512 (setq item (pop choices)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6513 (when (and (string-match (nth 0 item) (or host "")) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6514 (string-match (nth 1 item) (or user ""))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6515 (setq method (nth 2 item)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6516 (setq choices nil))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6517 method)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6518 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6519 (defun tramp-find-method (multi-method method user host) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6520 "Return the right method string to use. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6521 This is MULTI-METHOD, if non-nil. Otherwise, it is METHOD, if non-nil. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6522 If both MULTI-METHOD and METHOD are nil, do a lookup in |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6523 `tramp-default-method-alist'." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6524 (or multi-method method (tramp-find-default-method user host))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6525 |
45861 | 6526 ;; HHH: Not Changed. Multi method. Will probably not handle the case where |
6527 ;; a user name is not provided in the "file name" very well. | |
6528 (defun tramp-dissect-multi-file-name (name) | |
6529 "Not implemented yet." | |
6530 (let ((regexp (nth 0 tramp-multi-file-name-structure)) | |
6531 (method-index (nth 1 tramp-multi-file-name-structure)) | |
6532 (hops-index (nth 2 tramp-multi-file-name-structure)) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6533 (localname-index (nth 3 tramp-multi-file-name-structure)) |
45861 | 6534 (hop-regexp (nth 0 tramp-multi-file-name-hop-structure)) |
6535 (hop-method-index (nth 1 tramp-multi-file-name-hop-structure)) | |
6536 (hop-user-index (nth 2 tramp-multi-file-name-hop-structure)) | |
6537 (hop-host-index (nth 3 tramp-multi-file-name-hop-structure)) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6538 method hops len hop-methods hop-users hop-hosts localname) |
45861 | 6539 (unless (string-match (format regexp hop-regexp) name) |
6540 (error "Not a multi tramp file name: %s" name)) | |
6541 (setq method (match-string method-index name)) | |
6542 (setq hops (match-string hops-index name)) | |
6543 (setq len (/ (length (match-data t)) 2)) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6544 (when (< localname-index 0) (incf localname-index len)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6545 (setq localname (match-string localname-index name)) |
45861 | 6546 (let ((index 0)) |
6547 (while (string-match hop-regexp hops index) | |
6548 (setq index (match-end 0)) | |
6549 (setq hop-methods | |
6550 (cons (match-string hop-method-index hops) hop-methods)) | |
6551 (setq hop-users | |
6552 (cons (match-string hop-user-index hops) hop-users)) | |
6553 (setq hop-hosts | |
6554 (cons (match-string hop-host-index hops) hop-hosts)))) | |
6555 (make-tramp-file-name | |
6556 :multi-method method | |
6557 :method (apply 'vector (reverse hop-methods)) | |
6558 :user (apply 'vector (reverse hop-users)) | |
6559 :host (apply 'vector (reverse hop-hosts)) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6560 :localname localname))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6561 |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6562 (defun tramp-make-tramp-file-name (multi-method method user host localname) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6563 "Constructs a tramp file name from METHOD, USER, HOST and LOCALNAME." |
45861 | 6564 (if multi-method |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6565 (tramp-make-tramp-multi-file-name multi-method 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
|
6566 (format-spec |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6567 (concat tramp-prefix-format |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6568 (when method (concat "%m" tramp-postfix-single-method-format)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6569 (when user (concat "%u" 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
|
6570 (when host (concat "%h" tramp-postfix-host-format)) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6571 (when localname (concat "%p"))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6572 `((?m . ,method) (?u . ,user) (?h . ,host) (?p . ,localname))))) |
45861 | 6573 |
6574 ;; CCC: Henrik Holm: Not Changed. Multi Method. What should be done | |
6575 ;; with this when USER is nil? | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6576 (defun tramp-make-tramp-multi-file-name (multi-method method user host localname) |
45861 | 6577 "Constructs a tramp file name for a multi-hop method." |
6578 (unless tramp-make-multi-tramp-file-format | |
6579 (error "`tramp-make-multi-tramp-file-format' is nil")) | |
6580 (let* ((prefix-format (nth 0 tramp-make-multi-tramp-file-format)) | |
6581 (hop-format (nth 1 tramp-make-multi-tramp-file-format)) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6582 (localname-format (nth 2 tramp-make-multi-tramp-file-format)) |
46752 | 6583 (prefix (format-spec prefix-format `((?m . ,multi-method)))) |
45861 | 6584 (hops "") |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6585 (localname (format-spec localname-format `((?p . ,localname)))) |
45861 | 6586 (i 0) |
6587 (len (length method))) | |
6588 (while (< i len) | |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
6589 (let ((m (aref method i)) (u (aref user i)) (h (aref host i))) |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
6590 (setq hops (concat hops (format-spec hop-format |
46752 | 6591 `((?m . ,m) (?u . ,u) (?h . ,h))))) |
45861 | 6592 (incf i))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6593 (concat prefix hops localname))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6594 |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6595 (defun tramp-make-copy-program-file-name (user host localname) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6596 "Create a file name suitable to be passed to `rcp' and workalikes." |
45861 | 6597 (if user |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6598 (format "%s@%s:%s" user host localname) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6599 (format "%s:%s" host localname))) |
45861 | 6600 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6601 (defun tramp-method-out-of-band-p (multi-method method user host) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6602 "Return t if this is an out-of-band method, nil otherwise." |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
6603 (tramp-get-method-parameter |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6604 multi-method |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
6605 (tramp-find-method multi-method method user host) |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
6606 user host 'tramp-copy-program)) |
45861 | 6607 |
6608 ;; Variables local to connection. | |
6609 | |
6610 (defun tramp-get-ls-command (multi-method method user host) | |
6611 (save-excursion | |
6612 (tramp-maybe-open-connection multi-method method user host) | |
6613 (set-buffer (tramp-get-buffer multi-method method user host)) | |
6614 tramp-ls-command)) | |
6615 | |
6616 (defun tramp-get-test-groks-nt (multi-method method user host) | |
6617 (save-excursion | |
6618 (tramp-maybe-open-connection multi-method method user host) | |
6619 (set-buffer (tramp-get-buffer multi-method method user host)) | |
6620 tramp-test-groks-nt)) | |
6621 | |
6622 (defun tramp-get-file-exists-command (multi-method method user host) | |
6623 (save-excursion | |
6624 (tramp-maybe-open-connection multi-method method user host) | |
6625 (set-buffer (tramp-get-buffer multi-method method user host)) | |
6626 tramp-file-exists-command)) | |
6627 | |
6628 (defun tramp-get-remote-perl (multi-method method user host) | |
6629 (tramp-get-connection-property "perl" nil multi-method method user host)) | |
6630 | |
6631 (defun tramp-get-remote-ln (multi-method method user host) | |
6632 (tramp-get-connection-property "ln" nil multi-method method user host)) | |
6633 | |
6634 ;; Get a property of a TRAMP connection. | |
46752 | 6635 (defun tramp-get-connection-property |
6636 (property default multi-method method user host) | |
45861 | 6637 "Get the named property for the connection. |
6638 If the value is not set for the connection, return `default'" | |
6639 (tramp-maybe-open-connection multi-method method user host) | |
6640 (with-current-buffer (tramp-get-buffer multi-method method user host) | |
6641 (let (error) | |
6642 (condition-case nil | |
6643 (symbol-value (intern (concat "tramp-connection-property-" property))) | |
6644 (error default))))) | |
6645 | |
6646 ;; Set a property of a TRAMP connection. | |
46752 | 6647 (defun tramp-set-connection-property |
6648 (property value multi-method method user host) | |
45861 | 6649 "Set the named property of a TRAMP connection." |
6650 (tramp-maybe-open-connection multi-method method user host) | |
6651 (with-current-buffer (tramp-get-buffer multi-method method user host) | |
6652 (set (make-local-variable | |
6653 (intern (concat "tramp-connection-property-" property))) | |
6654 value))) | |
6655 | |
46752 | 6656 ;; Some predefined connection properties. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6657 (defun tramp-set-remote-encoding (multi-method method user host rem-enc) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6658 (tramp-set-connection-property "remote-encoding" rem-enc |
46752 | 6659 multi-method method user host)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6660 (defun tramp-get-remote-encoding (multi-method method user host) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6661 (tramp-get-connection-property "remote-encoding" nil |
46752 | 6662 multi-method method user host)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6663 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6664 (defun tramp-set-remote-decoding (multi-method method user host rem-dec) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6665 (tramp-set-connection-property "remote-decoding" rem-dec |
46752 | 6666 multi-method method user host)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6667 (defun tramp-get-remote-decoding (multi-method method user host) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6668 (tramp-get-connection-property "remote-decoding" nil |
46752 | 6669 multi-method method user host)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6670 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6671 (defun tramp-set-local-encoding (multi-method method user host loc-enc) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6672 (tramp-set-connection-property "local-encoding" loc-enc |
46752 | 6673 multi-method method user host)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6674 (defun tramp-get-local-encoding (multi-method method user host) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6675 (tramp-get-connection-property "local-encoding" nil |
46752 | 6676 multi-method method user host)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6677 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6678 (defun tramp-set-local-decoding (multi-method method user host loc-dec) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6679 (tramp-set-connection-property "local-decoding" loc-dec |
46752 | 6680 multi-method method user host)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6681 (defun tramp-get-local-decoding (multi-method method user host) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6682 (tramp-get-connection-property "local-decoding" nil |
46752 | 6683 multi-method method user host)) |
45861 | 6684 |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
6685 (defun tramp-get-method-parameter (multi-method method user host param) |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
6686 "Return the method parameter PARAM. |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
6687 If the `tramp-methods' entry does not exist, use the variable PARAM |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
6688 as default." |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
6689 (unless (boundp param) |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
6690 (error "Non-existing method parameter `%s'" param)) |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
6691 (let ((entry (assoc param |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
6692 (assoc (tramp-find-method multi-method method user host) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
6693 tramp-methods)))) |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
6694 (if entry |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
6695 (second entry) |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
6696 (symbol-value param)))) |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
6697 |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
6698 |
45861 | 6699 ;; Auto saving to a special directory. |
6700 | |
6701 (defun tramp-make-auto-save-file-name (fn) | |
6702 "Returns a file name in `tramp-auto-save-directory' for autosaving this file." | |
6703 (when tramp-auto-save-directory | |
6704 (unless (file-exists-p tramp-auto-save-directory) | |
6705 (make-directory tramp-auto-save-directory t))) | |
6706 ;; jka-compr doesn't like auto-saving, so by appending "~" to the | |
6707 ;; file name we make sure that jka-compr isn't used for the | |
6708 ;; auto-save file. | |
6709 (let ((buffer-file-name (expand-file-name | |
6710 (tramp-subst-strs-in-string '(("_" . "|") | |
6711 ("/" . "_a") | |
6712 (":" . "_b") | |
6713 ("|" . "__") | |
6714 ("[" . "_l") | |
6715 ("]" . "_r")) | |
6716 fn) | |
6717 tramp-auto-save-directory))) | |
6718 (make-auto-save-file-name))) | |
6719 | |
6720 (defadvice make-auto-save-file-name | |
6721 (around tramp-advice-make-auto-save-file-name () activate) | |
6722 "Invoke `tramp-make-auto-save-file-name' for tramp files." | |
6723 (if (and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name)) | |
6724 tramp-auto-save-directory) | |
6725 (setq ad-return-value | |
6726 (tramp-make-auto-save-file-name (buffer-file-name))) | |
6727 ad-do-it)) | |
6728 | |
6729 (defun tramp-subst-strs-in-string (alist string) | |
6730 "Replace all occurrences of the string FROM with TO in STRING. | |
6731 ALIST is of the form ((FROM . TO) ...)." | |
6732 (save-match-data | |
6733 (while alist | |
6734 (let* ((pr (car alist)) | |
6735 (from (car pr)) | |
6736 (to (cdr pr))) | |
6737 (while (string-match (regexp-quote from) string) | |
6738 (setq string (replace-match to t t string))) | |
6739 (setq alist (cdr alist)))) | |
6740 string)) | |
6741 | |
6742 (defun tramp-insert-with-face (face string) | |
6743 "Insert text with a specific face." | |
6744 (let ((start (point))) | |
6745 (insert string) | |
6746 (add-text-properties start (point) (list 'face face)))) | |
6747 | |
6748 ;; ------------------------------------------------------------ | |
6749 ;; -- Compatibility functions section -- | |
6750 ;; ------------------------------------------------------------ | |
6751 | |
6752 (defun tramp-temporary-file-directory () | |
6753 "Return name of directory for temporary files (compat function). | |
6754 For Emacs, this is the variable `temporary-file-directory', for XEmacs | |
6755 this is the function `temp-directory'." | |
6756 (cond ((boundp 'temporary-file-directory) | |
6757 (symbol-value 'temporary-file-directory)) | |
6758 ((fboundp 'temp-directory) | |
6759 (funcall (symbol-function 'temp-directory))) ;pacify byte-compiler | |
6760 ((let ((d (getenv "TEMP"))) (and d (file-directory-p d))) | |
6761 (file-name-as-directory (getenv "TEMP"))) | |
6762 ((let ((d (getenv "TMP"))) (and d (file-directory-p d))) | |
6763 (file-name-as-directory (getenv "TMP"))) | |
6764 ((let ((d (getenv "TMPDIR"))) (and d (file-directory-p d))) | |
6765 (file-name-as-directory (getenv "TMPDIR"))) | |
6766 ((file-exists-p "c:/temp") (file-name-as-directory "c:/temp")) | |
6767 (t (message (concat "Neither `temporary-file-directory' nor " | |
6768 "`temp-directory' is defined -- using /tmp.")) | |
6769 (file-name-as-directory "/tmp")))) | |
6770 | |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
6771 (defun tramp-read-passwd (user host prompt) |
45861 | 6772 "Read a password from user (compat function). |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6773 Invokes `password-read' if available, `read-passwd' else." |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6774 (if (functionp 'password-read) |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
6775 (let* ((key (concat (or user (user-login-name)) "@" host)) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6776 (password (apply #'password-read (list prompt key)))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6777 (apply #'password-cache-add (list key password)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6778 password) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6779 (read-passwd prompt))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6780 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6781 (defun tramp-clear-passwd (&optional user host) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6782 "Clear password cache for connection related to current-buffer." |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6783 (interactive) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6784 (let ((filename (or buffer-file-name list-buffers-directory ""))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6785 (when (and (functionp 'password-cache-remove) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6786 (or (and user host) (tramp-tramp-file-p filename))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6787 (let* ((v (when (tramp-tramp-file-p filename) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6788 (tramp-dissect-file-name filename))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6789 (luser (or user (tramp-file-name-user v) (user-login-name))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6790 (lhost (or host (tramp-file-name-host v) (system-name))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6791 (key (concat luser "@" lhost))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6792 (apply #'password-cache-remove (list key)))))) |
45861 | 6793 |
6794 (defun tramp-time-diff (t1 t2) | |
6795 "Return the difference between the two times, in seconds. | |
6796 T1 and T2 are time values (as returned by `current-time' for example). | |
6797 | |
6798 NOTE: This function will fail if the time difference is too large to | |
6799 fit in an integer." | |
6800 ;; Pacify byte-compiler with `symbol-function'. | |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
6801 (cond ((and (fboundp 'subtract-time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
6802 (fboundp 'float-time)) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
6803 (funcall (symbol-function 'float-time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
6804 (funcall (symbol-function 'subtract-time) t1 t2))) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
6805 ((and (fboundp 'subtract-time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
6806 (fboundp 'time-to-seconds)) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
6807 (funcall (symbol-function 'time-to-seconds) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
6808 (funcall (symbol-function 'subtract-time) t1 t2))) |
45861 | 6809 ((fboundp 'itimer-time-difference) |
6810 (floor (funcall | |
6811 (symbol-function 'itimer-time-difference) | |
6812 (if (< (length t1) 3) (append t1 '(0)) t1) | |
6813 (if (< (length t2) 3) (append t2 '(0)) t2)))) | |
6814 (t | |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
6815 ;; snarfed from Emacs 21 time-date.el; combining |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
6816 ;; time-to-seconds and subtract-time |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
6817 (let ((time (let ((borrow (< (cadr t1) (cadr t2)))) |
45861 | 6818 (list (- (car t1) (car t2) (if borrow 1 0)) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
6819 (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2)))))) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
6820 (+ (* (car time) 65536.0) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
6821 (cadr time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
6822 (/ (or (nth 2 time) 0) 1000000.0)))))) |
45861 | 6823 |
6824 (defun tramp-coding-system-change-eol-conversion (coding-system eol-type) | |
6825 "Return a coding system like CODING-SYSTEM but with given EOL-TYPE. | |
6826 EOL-TYPE can be one of `dos', `unix', or `mac'." | |
6827 (cond ((fboundp 'coding-system-change-eol-conversion) | |
6828 (apply #'coding-system-change-eol-conversion | |
6829 (list coding-system eol-type))) | |
6830 ((fboundp 'subsidiary-coding-system) | |
6831 (apply | |
6832 #'subsidiary-coding-system | |
6833 (list coding-system | |
6834 (cond ((eq eol-type 'dos) 'crlf) | |
6835 ((eq eol-type 'unix) 'lf) | |
6836 ((eq eol-type 'mac) 'cr) | |
6837 (t | |
6838 (error "Unknown EOL-TYPE `%s', must be %s" | |
6839 eol-type | |
6840 "`dos', `unix', or `mac'")))))) | |
6841 (t (error "Can't change EOL conversion -- is MULE missing?")))) | |
6842 | |
6843 (defun tramp-split-string (string pattern) | |
6844 "Like `split-string' but omit empty strings. | |
6845 In Emacs, (split-string \"/foo/bar\" \"/\") returns (\"foo\" \"bar\"). | |
6846 This is, the first, empty, element is omitted. In XEmacs, the first | |
6847 element is not omitted. | |
6848 | |
6849 Note: this function has been written for `tramp-handle-file-truename'. | |
6850 If you want to use it for something else, you'll have to check whether | |
6851 it does the right thing." | |
6852 (delete "" (split-string string pattern))) | |
6853 | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6854 (defun tramp-set-process-query-on-exit-flag (process flag) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6855 "Specify if query is needed for process when Emacs is exited. |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6856 If the second argument flag is non-nil, Emacs will query the user before |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6857 exiting if process is running." |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6858 (if (fboundp 'set-process-query-on-exit-flag) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6859 (set-process-query-on-exit-flag process flag) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6860 (funcall (symbol-function 'process-kill-without-query) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6861 process flag))) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6862 |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6863 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6864 ;; ------------------------------------------------------------ |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6865 ;; -- Kludges section -- |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6866 ;; ------------------------------------------------------------ |
45861 | 6867 |
6868 ;; Currently (as of Emacs 20.5), the function `shell-quote-argument' | |
6869 ;; does not deal well with newline characters. Newline is replaced by | |
6870 ;; backslash newline. But if, say, the string `a backslash newline b' | |
6871 ;; is passed to a shell, the shell will expand this into "ab", | |
6872 ;; completely omitting the newline. This is not what was intended. | |
6873 ;; It does not appear to be possible to make the function | |
6874 ;; `shell-quote-argument' work with newlines without making it | |
6875 ;; dependent on the shell used. But within this package, we know that | |
6876 ;; we will always use a Bourne-like shell, so we use an approach which | |
6877 ;; groks newlines. | |
6878 ;; | |
6879 ;; The approach is simple: we call `shell-quote-argument', then | |
6880 ;; massage the newline part of the result. | |
6881 ;; | |
6882 ;; This function should produce a string which is grokked by a Unix | |
6883 ;; shell, even if the Emacs is running on Windows. Since this is the | |
6884 ;; kludges section, we bind `system-type' in such a way that | |
6885 ;; `shell-quote-arguments' behaves as if on Unix. | |
6886 ;; | |
6887 ;; Thanks to Mario DeWeerd for the hint that it is sufficient for this | |
6888 ;; function to work with Bourne-like shells. | |
6889 ;; | |
6890 ;; CCC: This function should be rewritten so that | |
6891 ;; `shell-quote-argument' is not used. This way, we are safe from | |
6892 ;; changes in `shell-quote-argument'. | |
6893 (defun tramp-shell-quote-argument (s) | |
6894 "Similar to `shell-quote-argument', but groks newlines. | |
6895 Only works for Bourne-like shells." | |
6896 (let ((system-type 'not-windows)) | |
6897 (save-match-data | |
6898 (let ((result (shell-quote-argument s)) | |
6899 (nl (regexp-quote (format "\\%s" tramp-rsh-end-of-line)))) | |
6900 (when (and (>= (length result) 2) | |
6901 (string= (substring result 0 2) "\\~")) | |
6902 (setq result (substring result 1))) | |
6903 (while (string-match nl result) | |
6904 (setq result (replace-match (format "'%s'" tramp-rsh-end-of-line) | |
6905 t t result))) | |
6906 result)))) | |
6907 | |
6908 ;; ;; EFS hooks itself into the file name handling stuff in more places | |
6909 ;; ;; than just `file-name-handler-alist'. The following tells EFS to stay | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6910 ;; ;; away from tramp.el file names. |
45861 | 6911 ;; ;; |
6912 ;; ;; This is needed because EFS installs (efs-dired-before-readin) into | |
6913 ;; ;; 'dired-before-readin-hook'. This prevents EFS from opening an FTP | |
6914 ;; ;; connection to help it's dired process. Not that I have any real | |
6915 ;; ;; idea *why* this is helpful to dired. | |
6916 ;; ;; | |
6917 ;; ;; Anyway, this advice fixes the problem (with a sledgehammer :) | |
6918 ;; ;; | |
6919 ;; ;; Daniel Pittman <daniel@danann.net> | |
6920 ;; ;; | |
6921 ;; ;; CCC: when the other defadvice calls have disappeared, make sure | |
6922 ;; ;; not to call defadvice unless it's necessary. How do we find out whether | |
6923 ;; ;; it is necessary? (featurep 'efs) is surely the wrong way -- | |
6924 ;; ;; EFS might nicht be loaded yet. | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6925 ;; (defadvice efs-ftp-path (around dont-match-tramp-localname activate protect) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6926 ;; "Cause efs-ftp-path to fail when the path is a TRAMP localname." |
45861 | 6927 ;; (if (tramp-tramp-file-p (ad-get-arg 0)) |
6928 ;; nil | |
6929 ;; ad-do-it)) | |
6930 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6931 ;; We currently (sometimes) use "[" and "]" in the filename format. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6932 ;; This means that Emacs wants to expand wildcards if |
45861 | 6933 ;; `find-file-wildcards' is non-nil, and then barfs because no |
6934 ;; expansion could be found. We detect this situation and do | |
6935 ;; something really awful: we have `file-expand-wildcards' return the | |
6936 ;; original filename if it can't expand anything. Let's just hope | |
6937 ;; that this doesn't break anything else. | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6938 ;; CCC: This check is now also really awful; we should search all |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6939 ;; of the filename format, not just the prefix. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6940 (when (string-match "\\[" tramp-prefix-format) |
45861 | 6941 (defadvice file-expand-wildcards (around tramp-fix activate) |
6942 (let ((name (ad-get-arg 0))) | |
6943 (if (tramp-tramp-file-p name) | |
6944 ;; If it's a Tramp file, dissect it and look if wildcards | |
6945 ;; need to be expanded at all. | |
6946 (let ((v (tramp-dissect-file-name name))) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6947 (if (string-match "[[*?]" (tramp-file-name-localname v)) |
45861 | 6948 (let ((res ad-do-it)) |
6949 (setq ad-return-value (or res (list name)))) | |
6950 (setq ad-return-value (list name)))) | |
6951 ;; If it is not a Tramp file, just run the original function. | |
6952 (let ((res ad-do-it)) | |
6953 (setq ad-return-value (or res (list name))))))) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6954 ) |
45861 | 6955 |
46752 | 6956 ;; Tramp version is useful in a number of situations. |
6957 | |
6958 (defun tramp-version (arg) | |
6959 "Print version number of tramp.el in minibuffer or current buffer." | |
6960 (interactive "P") | |
6961 (if arg (insert tramp-version) (message tramp-version))) | |
6962 | |
45861 | 6963 ;; Make the `reporter` functionality available for making bug reports about |
6964 ;; the package. A most useful piece of code. | |
6965 | |
6966 (unless (fboundp 'reporter-submit-bug-report) | |
6967 (autoload 'reporter-submit-bug-report "reporter")) | |
6968 | |
6969 (defun tramp-bug () | |
6970 "Submit a bug report to the TRAMP developers." | |
6971 (interactive) | |
6972 (require 'reporter) | |
6973 (let ((reporter-prompt-for-summary-p t)) | |
6974 (reporter-submit-bug-report | |
6975 tramp-bug-report-address ; to-address | |
6976 (format "tramp (%s)" tramp-version) ; package name and version | |
6977 `(;; Current state | |
6978 tramp-ls-command | |
6979 tramp-test-groks-nt | |
6980 tramp-file-exists-command | |
6981 tramp-current-multi-method | |
6982 tramp-current-method | |
6983 tramp-current-user | |
6984 tramp-current-host | |
6985 | |
6986 ;; System defaults | |
6987 tramp-auto-save-directory ; vars to dump | |
6988 tramp-default-method | |
6989 tramp-rsh-end-of-line | |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
6990 tramp-default-password-end-of-line |
45861 | 6991 tramp-remote-path |
6992 tramp-login-prompt-regexp | |
6993 tramp-password-prompt-regexp | |
6994 tramp-wrong-passwd-regexp | |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
6995 tramp-yesno-prompt-regexp |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
6996 tramp-yn-prompt-regexp |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6997 tramp-terminal-prompt-regexp |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6998 tramp-out-of-band-prompt-regexp |
45861 | 6999 tramp-temp-name-prefix |
7000 tramp-file-name-structure | |
7001 tramp-file-name-regexp | |
7002 tramp-multi-file-name-structure | |
7003 tramp-multi-file-name-hop-structure | |
7004 tramp-multi-methods | |
7005 tramp-multi-connection-function-alist | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7006 tramp-methods |
45861 | 7007 tramp-end-of-output |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
7008 tramp-coding-commands |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
7009 tramp-actions-before-shell |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
7010 tramp-actions-copy-out-of-band |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
7011 tramp-multi-actions |
46835
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
7012 tramp-terminal-type |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
7013 tramp-shell-prompt-pattern |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
7014 tramp-chunksize |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
7015 ,(when (boundp 'tramp-backup-directory-alist) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
7016 'tramp-backup-directory-alist) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
7017 ,(when (boundp 'tramp-bkup-backup-directory-info) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
7018 'tramp-bkup-backup-directory-info) |
45861 | 7019 |
7020 ;; Non-tramp variables of interest | |
7021 shell-prompt-pattern | |
7022 backup-by-copying | |
7023 backup-by-copying-when-linked | |
7024 backup-by-copying-when-mismatch | |
7025 ,(when (boundp 'backup-by-copying-when-privileged-mismatch) | |
7026 'backup-by-copying-when-privileged-mismatch) | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
7027 ,(when (boundp 'password-cache) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
7028 'password-cache) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
7029 ,(when (boundp 'password-cache-expiry) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
7030 'password-cache-expiry) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
7031 ,(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
|
7032 'backup-directory-alist) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
7033 ,(when (boundp 'bkup-backup-directory-info) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
7034 'bkup-backup-directory-info) |
45861 | 7035 file-name-handler-alist) |
7036 nil ; pre-hook | |
7037 nil ; post-hook | |
7038 "\ | |
7039 Enter your bug report in this message, including as much detail as you | |
7040 possibly can about the problem, what you did to cause it and what the | |
7041 local and remote machines are. | |
7042 | |
7043 If you can give a simple set of instructions to make this bug happen | |
7044 reliably, please include those. Thank you for helping kill bugs in | |
7045 TRAMP. | |
46801
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
7046 |
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
7047 Another useful thing to do is to put (setq tramp-debug-buffer t) in |
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
7048 the ~/.emacs file and to repeat the bug. Then, include the contents |
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
7049 of the *tramp/foo* buffer and the *debug tramp/foo* buffer in your bug |
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
7050 report. |
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
7051 |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
7052 --bug report follows this line-- |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
7053 "))) |
45861 | 7054 |
7055 (defalias 'tramp-submit-bug 'tramp-bug) | |
7056 | |
7057 (provide 'tramp) | |
7058 | |
7059 ;; Make sure that we get integration with the VC package. | |
7060 ;; When it is loaded, we need to pull in the integration module. | |
7061 ;; This must come after (provide 'tramp) because tramp-vc.el | |
7062 ;; requires tramp. | |
7063 (eval-after-load "vc" | |
7064 '(require 'tramp-vc)) | |
7065 | |
7066 ;;; TODO: | |
7067 | |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
7068 ;; * Allow putting passwords in the filename. |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
7069 ;; This should be implemented via a general mechanism to add |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
7070 ;; parameters in filenames. There is currently a kludge for |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
7071 ;; putting the port number into the filename for ssh and ftp |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
7072 ;; files. This could be subsumed by the new mechanism as well. |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
7073 ;; Another approach is to read a netrc file like ~/.authinfo |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
7074 ;; from Gnus. |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
7075 ;; * Handle nonlocal exits such as C-g. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7076 ;; * Autodetect if remote `ls' groks the "--dired" switch. |
46790 | 7077 ;; * Add fallback for inline encodings. This should be used |
7078 ;; if the remote end doesn't support mimencode or a similar program. | |
7079 ;; For reading files from the remote host, we can just parse the output | |
7080 ;; of `od -b'. For writing files to the remote host, we construct | |
7081 ;; a shell program which contains only "safe" ascii characters | |
7082 ;; and which writes the right bytes to the file. We can use printf(1) | |
7083 ;; or "echo -e" or the printf function in awk and use octal escapes | |
7084 ;; for the "dangerous" characters. The null byte might be a problem. | |
7085 ;; On some systems, the octal escape doesn't work. So we try the following | |
7086 ;; two commands to write a null byte: | |
7087 ;; dd if=/dev/zero bs=1 count=1 | |
7088 ;; echo | tr '\n' '\000' | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7089 ;; * Separate local `tramp-coding-commands' from remote ones. Connect |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7090 ;; the two via a format which can be `uu' or `b64'. Then we can search |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7091 ;; for the right local commands and the right remote commands separately. |
45861 | 7092 ;; * Cooperate with PCL-CVS. It uses start-process, which doesn't |
7093 ;; work for remote files. | |
7094 ;; * Rewrite `tramp-shell-quote-argument' to abstain from using | |
46790 | 7095 ;; `shell-quote-argument'. |
45861 | 7096 ;; * Completion gets confused when you leave out the method name. |
7097 ;; * In Emacs 21, `insert-directory' shows total number of bytes used | |
7098 ;; by the files in that directory. Add this here. | |
7099 ;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman) | |
7100 ;; * Make ffap.el grok Tramp filenames. (Eli Tziperman) | |
7101 ;; * When logging in, keep looking for questions according to an alist | |
7102 ;; and then invoke the right function. | |
7103 ;; * Case-insensitive filename completion. (Norbert Goevert.) | |
7104 ;; * Running CVS remotely doesn't appear to work right. It thinks | |
7105 ;; files are locked by somebody else even if I'm the locking user. | |
7106 ;; Sometimes, one gets `No CVSROOT specified' errors from CVS. | |
7107 ;; (Skip Montanaro) | |
7108 ;; * Don't use globbing for directories with many files, as this is | |
7109 ;; likely to produce long command lines, and some shells choke on | |
7110 ;; long command lines. | |
7111 ;; * Find out about the new auto-save mechanism in Emacs 21 and | |
7112 ;; do the right thing. | |
7113 ;; * `vc-directory' does not work. It never displays any files, even | |
7114 ;; if it does show files when run locally. | |
7115 ;; * Allow correction of passwords, if the remote end allows this. | |
7116 ;; (Mark Hershberger) | |
7117 ;; * How to deal with MULE in `insert-file-contents' and `write-region'? | |
7118 ;; * Do asynchronous `shell-command's. | |
7119 ;; * Grok `append' parameter for `write-region'. | |
7120 ;; * Test remote ksh or bash for tilde expansion in `tramp-find-shell'? | |
7121 ;; * abbreviate-file-name | |
7122 ;; * grok ~ in tramp-remote-path (Henrik Holm <henrikh@tele.ntnu.no>) | |
7123 ;; * Also allow to omit user names when doing multi-hop. Not sure yet | |
7124 ;; what the user names should default to, though. | |
7125 ;; * better error checking. At least whenever we see something | |
7126 ;; strange when doing zerop, we should kill the process and start | |
7127 ;; again. (Greg Stark) | |
7128 ;; * Add caching for filename completion. (Greg Stark) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
7129 ;; Of course, this has issues with usability (stale cache bites) |
45861 | 7130 ;; -- <daniel@danann.net> |
7131 ;; * Provide a local cache of old versions of remote files for the rsync | |
7132 ;; transfer method to use. (Greg Stark) | |
7133 ;; * Remove unneeded parameters from methods. | |
7134 ;; * Invoke rsync once for copying a whole directory hierarchy. | |
50494
5b6aaf393205
Version 2.0.33 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50432
diff
changeset
|
7135 ;; (Francesco Potort,Al(B) |
45861 | 7136 ;; * Should we set PATH ourselves or should we rely on the remote end |
7137 ;; to do it? | |
7138 ;; * Make it work for XEmacs 20, which is missing `with-timeout'. | |
7139 ;; * Make it work for different encodings, and for different file name | |
7140 ;; encodings, too. (Daniel Pittman) | |
7141 ;; * Change applicable functions to pass a struct tramp-file-name rather | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
7142 ;; than the individual items MULTI-METHOD, METHOD, USER, HOST, LOCALNAME. |
45861 | 7143 ;; * Implement asynchronous shell commands. |
7144 ;; * Clean up unused *tramp/foo* buffers after a while. (Pete Forman) | |
7145 ;; * Progress reports while copying files. (Michael Kifer) | |
7146 ;; * `Smart' connection method that uses inline for small and out of | |
7147 ;; band for large files. (Michael Kifer) | |
7148 ;; * Don't search for perl5 and perl. Instead, only search for perl and | |
7149 ;; then look if it's the right version (with `perl -v'). | |
7150 ;; * When editing a remote CVS controlled file as a different user, VC | |
7151 ;; gets confused about the file locking status. Try to find out why | |
7152 ;; the workaround doesn't work. | |
7153 ;; * Change `copy-file' to grok the case where the filename handler | |
7154 ;; for the source and the target file are different. Right now, | |
7155 ;; it looks at the source file and then calls that handler, if | |
7156 ;; there is one. But since ange-ftp, for instance, does not know | |
7157 ;; about Tramp, it does not do the right thing if the target file | |
7158 ;; name is a Tramp name. | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
7159 ;; * Username and hostname completion. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7160 ;; ** If `partial-completion-mode' isn't loaded, "/foo:bla" tries to |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7161 ;; connect to host "blabla" already if that host is unique. No idea |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7162 ;; how to suppress. Maybe not an essential problem. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7163 ;; ** Try to avoid usage of `last-input-event' in `tramp-completion-mode'. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7164 ;; ** Extend `tramp-get-completion-su' for NIS and shadow passwords. |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
7165 ;; ** 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
|
7166 ;; Code is nearly identical. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7167 ;; ** Decide whiche files to take for searching user/host names depending on |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7168 ;; operating system (windows-nt) in `tramp-completion-function-alist'. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7169 ;; ** Enhance variables for debug. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7170 ;; ** Implement "/multi:" completion. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7171 ;; ** Add a learning mode for completion. Make results persistent. |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
7172 ;; * Allow out-of-band methods as _last_ multi-hop. |
45861 | 7173 |
7174 ;; Functions for file-name-handler-alist: | |
7175 ;; diff-latest-backup-file -- in diff.el | |
7176 ;; dired-uncache -- this will be needed when we do insert-directory caching | |
7177 ;; file-name-as-directory -- use primitive? | |
7178 ;; file-name-sans-versions -- use primitive? | |
7179 ;; get-file-buffer -- use primitive | |
7180 ;; vc-registered | |
7181 | |
52401 | 7182 ;;; arch-tag: 3a21a994-182b-48fa-b0cd-c1d9fede424a |
45861 | 7183 ;;; tramp.el ends here |