Mercurial > emacs
annotate lisp/net/tramp.el @ 90439:fb253905e9c3
* font.c (Qiso8859_1, Qiso10646_1, Qunicode_bmp): Moved from
ftfont.c.
(font_unparse_xlfd): Fix argument type declaration. Append "*" if
registry doesn't specify encoding part.
(font_find_for_lface): Pay attention to LFACE_FONT_INDEX.
(font_open_by_name): At first try parsing the name.
(syms_of_font): Declare Qiso8859_1, Qiso10646_1, and Qunicode_bmp
as Lisp symbols.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 09 Jun 2006 02:14:31 +0000 |
parents | 146cd8369025 |
children | 138027c8c982 |
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 |
64701
34bd8e434dd7
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64559
diff
changeset
|
4 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
5 ;; 2005, 2006 Free Software Foundation, Inc. |
45861 | 6 |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7 ;; Author: Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
8 ;; Michael Albinus <michael.albinus@gmx.de> |
45861 | 9 ;; Keywords: comm, processes |
10 | |
11 ;; This file is part of GNU Emacs. | |
12 | |
13 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
14 ;; it under the terms of the GNU General Public License as published by | |
15 ;; the Free Software Foundation; either version 2, or (at your option) | |
16 ;; any later version. | |
17 | |
18 ;; GNU Emacs is distributed in the hope that it will be useful, | |
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 ;; GNU General Public License for more details. | |
22 | |
23 ;; You should have received a copy of the GNU General Public License | |
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
64085 | 25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
26 ;; Boston, MA 02110-1301, USA. | |
45861 | 27 |
28 ;;; Commentary: | |
29 | |
30 ;; This package provides remote file editing, similar to ange-ftp. | |
31 ;; The difference is that ange-ftp uses FTP to transfer files between | |
32 ;; the local and the remote host, whereas tramp.el uses a combination | |
33 ;; of rsh and rcp or other work-alike programs, such as ssh/scp. | |
34 ;; | |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
35 ;; For more detailed instructions, please see the info file. |
45861 | 36 ;; |
37 ;; Notes: | |
38 ;; ----- | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
39 ;; |
45861 | 40 ;; This package only works for Emacs 20 and higher, and for XEmacs 21 |
41 ;; and higher. (XEmacs 20 is missing the `with-timeout' macro. Emacs | |
42 ;; 19 is reported to have other problems. For XEmacs 21, you need the | |
43 ;; package `fsf-compat' for the `with-timeout' macro.) | |
44 ;; | |
45 ;; This version might not work with pre-Emacs 21 VC unless VC is | |
46 ;; loaded before tramp.el. Could you please test this and tell me about | |
47 ;; the result? Thanks. | |
48 ;; | |
49 ;; Also see the todo list at the bottom of this file. | |
50 ;; | |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
51 ;; The current version of Tramp can be retrieved from the following URL: |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
52 ;; http://ftp.gnu.org/gnu/tramp/ |
45861 | 53 ;; |
54 ;; There's a mailing list for this, as well. Its name is: | |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
55 ;; tramp-devel@gnu.org |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
56 ;; You can use the Web to subscribe, under the following URL: |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
57 ;; http://lists.gnu.org/mailman/listinfo/tramp-devel |
45861 | 58 ;; |
59 ;; For the adventurous, the current development sources are available | |
60 ;; 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
|
61 ;; http://savannah.gnu.org/projects/tramp/ |
45861 | 62 ;; Click on "CVS" in the navigation bar near the top. |
63 ;; | |
64 ;; Don't forget to put on your asbestos longjohns, first! | |
65 | |
66 ;;; Code: | |
67 | |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
68 ;; 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
|
69 (require 'trampver) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
70 (add-hook 'tramp-unload-hook |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
71 '(lambda () |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
72 (when (featurep 'trampver) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
73 (unload-feature 'trampver 'force)))) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
74 |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
75 (if (featurep 'xemacs) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
76 (require 'timer-funcs) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
77 (require 'timer)) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
78 |
45861 | 79 (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
|
80 ;; 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
|
81 ;; be mandatory |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
82 (if (featurep 'xemacs) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
83 (load "password" 'noerror) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
84 (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
|
85 |
47205
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
86 ;; 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
|
87 ;; 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
|
88 ;; in XEmacs. |
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
89 (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
|
90 (fboundp 'base64-decode-region)) |
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
91 (require 'base64)) ;for the mimencode methods |
45861 | 92 (require 'shell) |
93 (require 'advice) | |
94 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
95 (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
|
96 "Implementation of `uuencode' in Lisp.") |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
97 (add-hook 'tramp-unload-hook |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
98 '(lambda () |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
99 (when (featurep 'tramp-uu) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
100 (unload-feature 'tramp-uu 'force)))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
101 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
102 (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
|
103 (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
|
104 |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
105 ;; 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
|
106 ;; 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
|
107 ;; 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
|
108 ;; 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
|
109 ;; 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
|
110 ;; 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
|
111 ;; 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
|
112 ;; the other places. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
113 ;;;###autoload |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
114 (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
|
115 "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
|
116 Nil means to use a separate filename syntax for Tramp.") |
45861 | 117 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
118 ;; 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
|
119 ;; 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
|
120 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
121 ;; 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
|
122 (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
|
123 (eval-after-load "tramp" |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
124 '(progn |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
125 (require 'tramp-ftp) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
126 (add-hook 'tramp-unload-hook |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
127 '(lambda () |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
128 (when (featurep 'tramp-ftp) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
129 (unload-feature 'tramp-ftp 'force))))))) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
130 (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
|
131 (eval-after-load "tramp" |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
132 '(progn |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
133 (require 'tramp-efs) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
134 (add-hook 'tramp-unload-hook |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
135 '(lambda () |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
136 (when (featurep 'tramp-efs) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
137 (unload-feature 'tramp-efs 'force))))))) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
138 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
139 ;; 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
|
140 ;; 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
|
141 ;; "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
|
142 ;; 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
|
143 (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
|
144 (eval-after-load "tramp" |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
145 '(progn |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
146 (require 'tramp-smb) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
147 (add-hook 'tramp-unload-hook |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
148 '(lambda () |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
149 (when (featurep 'tramp-smb) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
150 (unload-feature 'tramp-smb 'force))))))) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
151 |
45861 | 152 (eval-when-compile |
153 (require 'cl) | |
154 (require 'custom) | |
155 ;; Emacs 19.34 compatibility hack -- is this needed? | |
156 (or (>= emacs-major-version 20) | |
157 (load "cl-seq"))) | |
158 | |
159 (unless (boundp 'custom-print-functions) | |
160 (defvar custom-print-functions nil)) ; not autoloaded before Emacs 20.4 | |
161 | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
162 ;; 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
|
163 ;; 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
|
164 (eval-when-compile |
65792
8c8e6f2eea3c
Pacify byte compiler warnings in pacification code.
Richard M. Stallman <rms@gnu.org>
parents:
65605
diff
changeset
|
165 (when (featurep 'xemacs) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
166 (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
|
167 (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
|
168 (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
|
169 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
170 ;; `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
|
171 ;; 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
|
172 ;; 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
|
173 (eval-when-compile |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
174 (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
|
175 (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
|
176 |
45861 | 177 ;;; User Customizable Internal Variables: |
178 | |
179 (defgroup tramp nil | |
180 "Edit remote files with a combination of rsh and rcp or similar programs." | |
58005
f15a720d0f24
(tramp group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents:
57995
diff
changeset
|
181 :group 'files |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
182 :version "22.1") |
45861 | 183 |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
184 (defcustom tramp-verbose 9 |
45861 | 185 "*Verbosity level for tramp.el. 0 means be silent, 10 is most verbose." |
186 :group 'tramp | |
187 :type 'integer) | |
188 | |
189 (defcustom tramp-debug-buffer nil | |
190 "*Whether to send all commands and responses to a debug buffer." | |
191 :group 'tramp | |
192 :type 'boolean) | |
193 | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
194 ;; Emacs case |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
195 (eval-and-compile |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
196 (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
|
197 (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
|
198 "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
|
199 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
|
200 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
|
201 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
|
202 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
|
203 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
204 \(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
|
205 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
206 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
|
207 policy for local files." |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
208 :group 'tramp |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
209 :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
|
210 (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
|
211 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
212 ;; 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
|
213 ;; 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
|
214 (eval-and-compile |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
215 (when (featurep 'xemacs) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
216 (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
|
217 "*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
|
218 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
|
219 `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
|
220 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
|
221 \(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
|
222 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
223 \(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
|
224 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
225 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
|
226 policy for local files." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
227 :type '(repeat |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
228 (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
|
229 (string :tag "Backup Dir") |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
230 (set :inline t |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
231 (const ok-create) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
232 (const full-path) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
233 (const prepend-name) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
234 (const search-upward)))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
235 :group 'tramp))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
236 |
45861 | 237 (defcustom tramp-auto-save-directory nil |
238 "*Put auto-save files in this directory, if set. | |
239 The idea is to use a local directory so that auto-saving is faster." | |
240 :group 'tramp | |
241 :type '(choice (const nil) | |
242 string)) | |
243 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
244 (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
|
245 (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
|
246 (getenv "COMSPEC") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
247 "/bin/sh") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
248 "*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
|
249 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
|
250 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
|
251 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
|
252 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
|
253 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
254 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
|
255 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
256 /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
|
257 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
258 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
|
259 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
|
260 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
|
261 standard input or a file. |
45861 | 262 |
263 Note that this variable is not used for remote commands. There are | |
264 mechanisms in tramp.el which automatically determine the right shell to | |
265 use for the remote host." | |
266 :group 'tramp | |
267 :type '(file :must-match t)) | |
268 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
269 (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
|
270 (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
|
271 "/c" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
272 "-c") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
273 "*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
|
274 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
|
275 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
276 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
277 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
278 (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
|
279 "*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
|
280 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
|
281 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
282 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
|
283 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
284 :type 'boolean) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
285 |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
286 (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
|
287 tramp-encoding-shell |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
288 "*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
|
289 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
|
290 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
|
291 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
|
292 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
|
293 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
|
294 |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
295 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
|
296 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
|
297 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
298 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
|
299 :group 'tramp |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
300 :type '(file :must-match t)) |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
301 |
45861 | 302 ;; CCC I have changed all occurrences of comint-quote-filename with |
303 ;; tramp-shell-quote-argument, except in tramp-handle-expand-many-files. | |
304 ;; There, comint-quote-filename was removed altogether. If it turns | |
305 ;; out to be necessary there, something will need to be done. | |
306 ;;-(defcustom tramp-file-name-quote-list | |
307 ;;- '(?] ?[ ?\| ?& ?< ?> ?\( ?\) ?\; ?\ ?\* ?\? ?\! ?\" ?\' ?\` ?# ?\@ ?\+ ) | |
308 ;;- "*Protect these characters from the remote shell. | |
309 ;;-Any character in this list is quoted (preceded with a backslash) | |
310 ;;-because it means something special to the shell. This takes effect | |
311 ;;-when sending file and directory names to the remote shell. | |
312 ;;- | |
313 ;;-See `comint-file-name-quote-list' for details." | |
314 ;;- :group 'tramp | |
315 ;;- :type '(repeat character)) | |
316 | |
317 (defcustom tramp-methods | |
318 '( ("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
|
319 (tramp-login-program "rsh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
320 (tramp-copy-program "rcp") |
45861 | 321 (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
|
322 (tramp-login-args nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
323 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
324 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
325 (tramp-password-end-of-line nil)) |
45861 | 326 ("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
|
327 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
328 (tramp-copy-program "scp") |
45861 | 329 (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
|
330 (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
|
331 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
332 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
333 (tramp-password-end-of-line nil)) |
45861 | 334 ("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
|
335 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
336 (tramp-copy-program "scp") |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
337 (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
|
338 (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
|
339 (tramp-copy-args ("-1")) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
340 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
341 (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
|
342 ("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
|
343 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
344 (tramp-copy-program "scp") |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
345 (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
|
346 (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
|
347 (tramp-copy-args ("-2")) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
348 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
349 (tramp-password-end-of-line nil)) |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
350 ("scp1_old" |
46752 | 351 (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
|
352 (tramp-login-program "ssh1") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
353 (tramp-copy-program "scp1") |
45861 | 354 (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
|
355 (tramp-login-args ("-e" "none")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
356 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
357 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
358 (tramp-password-end-of-line nil)) |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
359 ("scp2_old" |
46752 | 360 (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
|
361 (tramp-login-program "ssh2") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
362 (tramp-copy-program "scp2") |
45861 | 363 (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
|
364 (tramp-login-args ("-e" "none")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
365 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
366 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
367 (tramp-password-end-of-line nil)) |
45861 | 368 ("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
|
369 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
370 (tramp-copy-program "rsync") |
45861 | 371 (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
|
372 (tramp-login-args ("-e" "none")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
373 (tramp-copy-args ("-e" "ssh")) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
374 (tramp-copy-keep-date-arg "-t") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
375 (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
|
376 ("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
|
377 (tramp-login-program "remsh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
378 (tramp-copy-program "rcp") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
379 (tramp-remote-sh "/bin/sh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
380 (tramp-login-args nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
381 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
382 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
383 (tramp-password-end-of-line nil)) |
46752 | 384 ("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
|
385 (tramp-login-program "rsh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
386 (tramp-copy-program nil) |
45861 | 387 (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
|
388 (tramp-login-args nil) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
389 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
390 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
391 (tramp-password-end-of-line nil)) |
46752 | 392 ("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
|
393 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
394 (tramp-copy-program nil) |
45861 | 395 (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
|
396 (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
|
397 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
398 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
399 (tramp-password-end-of-line nil)) |
46752 | 400 ("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
|
401 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
402 (tramp-copy-program nil) |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
403 (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
|
404 (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
|
405 (tramp-copy-args ("-1")) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
406 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
407 (tramp-password-end-of-line nil)) |
46752 | 408 ("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
|
409 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
410 (tramp-copy-program nil) |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
411 (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
|
412 (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
|
413 (tramp-copy-args ("-2")) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
414 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
415 (tramp-password-end-of-line nil)) |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
416 ("ssh1_old" |
46752 | 417 (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
|
418 (tramp-login-program "ssh1") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
419 (tramp-copy-program nil) |
45861 | 420 (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
|
421 (tramp-login-args ("-e" "none")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
422 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
423 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
424 (tramp-password-end-of-line nil)) |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
425 ("ssh2_old" |
46752 | 426 (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
|
427 (tramp-login-program "ssh2") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
428 (tramp-copy-program nil) |
45861 | 429 (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
|
430 (tramp-login-args ("-e" "none")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
431 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
432 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
433 (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
|
434 ("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
|
435 (tramp-login-program "remsh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
436 (tramp-copy-program nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
437 (tramp-remote-sh "/bin/sh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
438 (tramp-login-args nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
439 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
440 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
441 (tramp-password-end-of-line nil)) |
46752 | 442 ("telnet" |
443 (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
|
444 (tramp-login-program "telnet") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
445 (tramp-copy-program nil) |
45861 | 446 (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
|
447 (tramp-login-args nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
448 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
449 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
450 (tramp-password-end-of-line nil)) |
46752 | 451 ("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
|
452 (tramp-login-program "su") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
453 (tramp-copy-program nil) |
45861 | 454 (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
|
455 (tramp-login-args ("-" "%u")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
456 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
457 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
458 (tramp-password-end-of-line nil)) |
46752 | 459 ("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
|
460 (tramp-login-program "sudo") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
461 (tramp-copy-program nil) |
45861 | 462 (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
|
463 (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
|
464 "-p" "Password:")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
465 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
466 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
467 (tramp-password-end-of-line nil)) |
45861 | 468 ("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
|
469 (tramp-login-program nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
470 (tramp-copy-program nil) |
45861 | 471 (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
|
472 (tramp-login-args nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
473 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
474 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
475 (tramp-password-end-of-line nil)) |
45861 | 476 ("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
|
477 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
478 (tramp-copy-program "scp") |
45861 | 479 (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
|
480 (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
|
481 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
482 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
483 (tramp-password-end-of-line nil)) |
46752 | 484 ("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
|
485 (tramp-login-program "ssh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
486 (tramp-copy-program nil) |
45861 | 487 (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
|
488 (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
|
489 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
490 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
491 (tramp-password-end-of-line nil)) |
46752 | 492 ("krlogin" |
45861 | 493 (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
|
494 (tramp-login-program "krlogin") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
495 (tramp-copy-program nil) |
45861 | 496 (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
|
497 (tramp-login-args ("-x")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
498 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
499 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
500 (tramp-password-end-of-line nil)) |
46752 | 501 ("plink" |
45861 | 502 (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
|
503 (tramp-login-program "plink") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
504 (tramp-copy-program nil) |
45861 | 505 (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
|
506 (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
|
507 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
508 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
509 (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
|
510 ("plink1" |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
511 (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
|
512 (tramp-login-program "plink") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
513 (tramp-copy-program nil) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
514 (tramp-remote-sh "/bin/sh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
515 (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
|
516 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
517 (tramp-copy-keep-date-arg nil) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
518 (tramp-password-end-of-line "xy")) ;see docstring for "xy" |
45861 | 519 ("pscp" |
520 (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
|
521 (tramp-login-program "plink") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
522 (tramp-copy-program "pscp") |
45861 | 523 (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
|
524 (tramp-login-args ("-ssh")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
525 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
526 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
527 (tramp-password-end-of-line "xy")) ;see docstring for "xy" |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
528 ("fcp" |
45861 | 529 (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
|
530 (tramp-login-program "fsh") |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
531 (tramp-copy-program "fcp") |
45861 | 532 (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
|
533 (tramp-login-args ("sh" "-i")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
534 (tramp-copy-args nil) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
535 (tramp-copy-keep-date-arg "-p") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
536 (tramp-password-end-of-line nil)) |
45861 | 537 ) |
538 "*Alist of methods for remote files. | |
539 This is a list of entries of the form (NAME PARAM1 PARAM2 ...). | |
540 Each NAME stands for a remote access method. Each PARAM is a | |
541 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
|
542 * `tramp-connection-function' |
45861 | 543 This specifies the function to use to connect to the remote host. |
544 Currently, `tramp-open-connection-rsh', `tramp-open-connection-telnet' | |
545 and `tramp-open-connection-su' are defined. See the documentation | |
546 of these functions for more details. | |
547 * `tramp-remote-sh' | |
548 This specifies the Bourne shell to use on the remote host. This | |
549 MUST be a Bourne-like shell. It is normally not necessary to set | |
550 this to any value other than \"/bin/sh\": tramp wants to use a shell | |
551 which groks tilde expansion, but it can search for it. Also note | |
552 that \"/bin/sh\" exists on all Unixen, this might not be true for | |
553 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
|
554 * `tramp-login-program' |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
555 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
|
556 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
|
557 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
|
558 `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
|
559 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
|
560 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
|
561 * `tramp-login-args' |
45861 | 562 This specifies the list of arguments to pass to the above |
563 mentioned program. Please note that this is a list of arguments, | |
564 that is, normally you don't want to put \"-a -b\" or \"-f foo\" | |
565 here. Instead, you want two list elements, one for \"-a\" and one | |
566 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
|
567 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
|
568 \"%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
|
569 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
|
570 * `tramp-copy-program' |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
571 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
|
572 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
|
573 a workalike program. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
574 * `tramp-copy-args' |
45861 | 575 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
|
576 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
|
577 * `tramp-copy-keep-date-arg' |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
578 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
|
579 timestamp of the original file should be kept. For `rcp', use `-p', for |
45861 | 580 `rsync', use `-t'. |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
581 * `tramp-password-end-of-line' |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
582 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
|
583 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
|
584 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
|
585 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
|
586 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
|
587 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
|
588 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
|
589 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
|
590 |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
591 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
|
592 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
|
593 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
|
594 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
|
595 to do this, set `tramp-copy-program' in the method. |
45861 | 596 |
597 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
|
598 file is passed through the same buffer used by `tramp-login-program'. In |
45861 | 599 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
|
600 `tramp-login-program' might use escape codes or the connection might not |
45861 | 601 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
|
602 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
|
603 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
604 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
|
605 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
|
606 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
|
607 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
|
608 the associated arguments (for example, the login program if you chose |
45861 | 609 `tramp-open-connection-telnet'). |
610 | |
611 Notes: | |
612 | |
613 When using `tramp-open-connection-su' the phrase `open connection to a | |
614 remote host' sounds strange, but it is used nevertheless, for | |
615 consistency. No connection is opened to a remote host, but `su' is | |
616 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
|
617 host other than `localhost' or the name of the local host." |
45861 | 618 :group 'tramp |
619 :type '(repeat | |
620 (cons string | |
621 (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
|
622 (list (const tramp-login-program) |
45861 | 623 (choice (const nil) string)) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
624 (list (const tramp-copy-program) |
45861 | 625 (choice (const nil) string)) |
626 (list (const tramp-remote-sh) | |
627 (choice (const nil) string)) | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
628 (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
|
629 (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
|
630 (list (const tramp-copy-keep-date-arg) |
45861 | 631 (choice (const nil) string)) |
632 (list (const tramp-encoding-command) | |
633 (choice (const nil) string)) | |
634 (list (const tramp-decoding-command) | |
635 (choice (const nil) string)) | |
636 (list (const tramp-encoding-function) | |
637 (choice (const nil) function)) | |
638 (list (const tramp-decoding-function) | |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
639 (choice (const nil) function)) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
640 (list (const tramp-password-end-of-line) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
641 (choice (const nil) string)))))) |
45861 | 642 |
643 (defcustom tramp-multi-methods '("multi" "multiu") | |
644 "*List of multi-hop methods. | |
645 Each entry in this list should be a method name as mentioned in the | |
646 variable `tramp-methods'." | |
647 :group 'tramp | |
648 :type '(repeat string)) | |
649 | |
650 (defcustom tramp-multi-connection-function-alist | |
651 '(("telnet" tramp-multi-connect-telnet "telnet %h%n") | |
652 ("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
|
653 ("remsh" tramp-multi-connect-rlogin "remsh %h -l %u%n") |
45861 | 654 ("ssh" tramp-multi-connect-rlogin "ssh %h -l %u%n") |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
655 ("ssht" tramp-multi-connect-rlogin "ssh %h -e none -t -t -l %u%n") |
45861 | 656 ("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
|
657 ("sudo" tramp-multi-connect-su "sudo -u %u -s -p Password:%n")) |
45861 | 658 "*List of connection functions for multi-hop methods. |
659 Each list item is a list of three items (METHOD FUNCTION COMMAND), | |
660 where METHOD is the name as used in the file name, FUNCTION is the | |
661 function to be executed, and COMMAND is the shell command used for | |
662 connecting. | |
663 | |
664 COMMAND may contain percent escapes. `%u' will be replaced with the | |
665 user name, `%h' will be replaced with the host name, and `%n' will be | |
666 replaced with an end-of-line character, as specified in the variable | |
667 `tramp-rsh-end-of-line'. Use `%%' for a literal percent character. | |
668 Note that the interpretation of the percent escapes also depends on | |
669 the FUNCTION. For example, the `%u' escape is forbidden with the | |
670 function `tramp-multi-connect-telnet'. See the documentation of the | |
671 various functions for details." | |
672 :group 'tramp | |
673 :type '(repeat (list string function string))) | |
674 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
675 (defcustom tramp-default-method |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
676 (if (and (fboundp 'executable-find) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
677 (executable-find "plink")) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
678 "plink" |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
679 "ssh") |
45861 | 680 "*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
|
681 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
|
682 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
|
683 :group 'tramp |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
684 :type 'string) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
685 |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
686 (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
|
687 '(("\\`localhost\\'" "\\`root\\'" "su")) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
688 "*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
|
689 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
|
690 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
|
691 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
|
692 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
|
693 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
|
694 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
695 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
|
696 empty string for the user name. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
697 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
698 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
|
699 :group 'tramp |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
700 :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
|
701 (regexp :tag "User regexp") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
702 (string :tag "Method")))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
703 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
704 ;; 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
|
705 (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
|
706 (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
|
707 '((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
|
708 (tramp-parse-rhosts "~/.rhosts"))) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
709 "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
|
710 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
711 ;; 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
|
712 (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
|
713 (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
|
714 '((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
|
715 (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
|
716 (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
|
717 (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
|
718 (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
|
719 (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
|
720 (tramp-parse-rhosts "~/.rhosts") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
721 (tramp-parse-rhosts "~/.shosts") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
722 (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
|
723 (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
|
724 (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
|
725 (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
|
726 "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
|
727 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
728 ;; 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
|
729 (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
|
730 (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
|
731 '((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
|
732 "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
|
733 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
734 ;; 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
|
735 (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
|
736 (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
|
737 '((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
|
738 "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
|
739 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
740 (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
|
741 "*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
|
742 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
|
743 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
|
744 \(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
|
745 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
|
746 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
747 * `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
|
748 * `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
|
749 * `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
|
750 * `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
|
751 * `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
|
752 * `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
|
753 * `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
|
754 * `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
|
755 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
756 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
|
757 the info pages.") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
758 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
759 (eval-after-load "tramp" |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
760 '(progn |
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 "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
|
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 "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
|
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 "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
|
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 "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
|
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 "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
|
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 "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
|
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 "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
|
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 "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
|
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 "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
|
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 "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
|
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 "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
|
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 "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
|
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 "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
|
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 "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
|
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 "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
|
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 "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
|
793 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
794 "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
|
795 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
796 "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
|
797 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
798 "multi" nil) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
799 (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
|
800 "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
|
801 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
802 "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
|
803 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
804 "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
|
805 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
806 "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
|
807 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
808 "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
|
809 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
810 "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
|
811 (tramp-set-completion-function |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
812 "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
|
813 |
45861 | 814 (defcustom tramp-rsh-end-of-line "\n" |
815 "*String used for end of line in rsh connections. | |
816 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
|
817 if you need to change this. |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
818 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
|
819 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
|
820 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
821 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
822 |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
823 (defcustom tramp-default-password-end-of-line |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
824 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
|
825 "*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
|
826 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
|
827 `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
|
828 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
829 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
|
830 \"\\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
|
831 \"\\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
|
832 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
|
833 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
834 The default value is to use the same value as `tramp-rsh-end-of-line'." |
45861 | 835 :group 'tramp |
836 :type 'string) | |
837 | |
838 (defcustom tramp-remote-path | |
68820
3a5ea93ff8b4
* net/tramp.el (tramp-remote-path): Add "/usr/xpg4/bin" on top,
Michael Albinus <michael.albinus@gmx.de>
parents:
68726
diff
changeset
|
839 ;; "/usr/xpg4/bin" has been placed first, because on Solaris a POSIX |
3a5ea93ff8b4
* net/tramp.el (tramp-remote-path): Add "/usr/xpg4/bin" on top,
Michael Albinus <michael.albinus@gmx.de>
parents:
68726
diff
changeset
|
840 ;; compatible "id" is needed. |
3a5ea93ff8b4
* net/tramp.el (tramp-remote-path): Add "/usr/xpg4/bin" on top,
Michael Albinus <michael.albinus@gmx.de>
parents:
68726
diff
changeset
|
841 '("/usr/xpg4/bin" "/bin" "/usr/bin" "/usr/sbin" "/usr/local/bin" |
3a5ea93ff8b4
* net/tramp.el (tramp-remote-path): Add "/usr/xpg4/bin" on top,
Michael Albinus <michael.albinus@gmx.de>
parents:
68726
diff
changeset
|
842 "/usr/ccs/bin" "/local/bin" "/local/freeware/bin" "/local/gnu/bin" |
45861 | 843 "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin") |
844 "*List of directories to search for executables on remote host. | |
845 Please notify me about other semi-standard directories to include here. | |
846 | |
847 You can use `~' in this list, but when searching for a shell which groks | |
848 tilde expansion, all directory names starting with `~' will be ignored." | |
849 :group 'tramp | |
850 :type '(repeat string)) | |
851 | |
852 (defcustom tramp-login-prompt-regexp | |
65605
efa862a76bc2
* net/tramp.el (tramp-login-prompt-regexp): Expand regexp in order to
Michael Albinus <michael.albinus@gmx.de>
parents:
65359
diff
changeset
|
853 ".*ogin\\( .*\\)?: *" |
45861 | 854 "*Regexp matching login-like prompts. |
65605
efa862a76bc2
* net/tramp.el (tramp-login-prompt-regexp): Expand regexp in order to
Michael Albinus <michael.albinus@gmx.de>
parents:
65359
diff
changeset
|
855 The regexp should match at end of buffer. |
efa862a76bc2
* net/tramp.el (tramp-login-prompt-regexp): Expand regexp in order to
Michael Albinus <michael.albinus@gmx.de>
parents:
65359
diff
changeset
|
856 |
efa862a76bc2
* net/tramp.el (tramp-login-prompt-regexp): Expand regexp in order to
Michael Albinus <michael.albinus@gmx.de>
parents:
65359
diff
changeset
|
857 Sometimes the prompt is reported to look like \"login as:\"." |
45861 | 858 :group 'tramp |
859 :type 'regexp) | |
860 | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
861 (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
|
862 "^[^#$%>\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
|
863 "Regexp to match prompts from remote shell. |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
864 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
|
865 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
|
866 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
|
867 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
|
868 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
|
869 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
|
870 which should work well in many cases." |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
871 :group 'tramp |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
872 :type 'regexp) |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
873 |
45861 | 874 (defcustom tramp-password-prompt-regexp |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
875 "^.*\\([pP]assword\\|passphrase\\).*:\^@? *" |
45861 | 876 "*Regexp matching password-like prompts. |
46752 | 877 The regexp should match at end of buffer. |
45861 | 878 |
879 The `sudo' program appears to insert a `^@' character into the prompt." | |
880 :group 'tramp | |
881 :type 'regexp) | |
882 | |
883 (defcustom tramp-wrong-passwd-regexp | |
46790 | 884 (concat "^.*" |
885 ;; These strings should be on the last line | |
886 (regexp-opt '("Permission denied." | |
887 "Login incorrect" | |
888 "Login Incorrect" | |
889 "Connection refused" | |
890 "Connection closed" | |
891 "Sorry, try again." | |
892 "Name or service not known" | |
893 "Host key verification failed.") t) | |
894 ".*" | |
895 "\\|" | |
896 "^.*\\(" | |
897 ;; Here comes a list of regexes, separated by \\| | |
898 "Received signal [0-9]+" | |
899 "\\).*") | |
45861 | 900 "*Regexp matching a `login failed' message. |
46752 | 901 The regexp should match at end of buffer." |
902 :group 'tramp | |
903 :type 'regexp) | |
904 | |
905 (defcustom tramp-yesno-prompt-regexp | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
906 (concat |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
907 (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
|
908 "\\s-*") |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
909 "Regular expression matching all yes/no queries which need to be confirmed. |
46752 | 910 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
|
911 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
|
912 See also `tramp-yn-prompt-regexp'." |
45861 | 913 :group 'tramp |
914 :type 'regexp) | |
915 | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
916 (defcustom tramp-yn-prompt-regexp |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
917 (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
|
918 "\\s-*") |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
919 "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
|
920 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
|
921 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
|
922 See also `tramp-yesno-prompt-regexp'." |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
923 :group 'tramp |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
924 :type 'regexp) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
925 |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
926 (defcustom tramp-terminal-prompt-regexp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
927 (concat "\\(" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
928 "TERM = (.*)" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
929 "\\|" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
930 "Terminal type\\? \\[.*\\]" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
931 "\\)\\s-*") |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
932 "Regular expression matching all terminal setting prompts. |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
933 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
|
934 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
|
935 :group 'tramp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
936 :type 'regexp) |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
937 |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
938 (defcustom tramp-operation-not-permitted-regexp |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
939 (concat "\\(" "preserving times.*" "\\|" "set mode" "\\)" ":\\s-*" |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
940 (regexp-opt '("Operation not permitted") t)) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
941 "Regular expression matching keep-date problems in (s)cp operations. |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
942 Copying has been performed successfully already, so this message can |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
943 be ignored safely." |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
944 :group 'tramp |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
945 :type 'regexp) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
946 |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
947 (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
|
948 "" |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
949 "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
|
950 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
|
951 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
|
952 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
|
953 `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
|
954 :group 'tramp |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
955 :type 'regexp) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
956 |
45861 | 957 (defcustom tramp-temp-name-prefix "tramp." |
958 "*Prefix to use for temporary files. | |
959 If this is a relative file name (such as \"tramp.\"), it is considered | |
960 relative to the directory name returned by the function | |
961 `tramp-temporary-file-directory' (which see). It may also be an | |
962 absolute file name; don't forget to include a prefix for the filename | |
963 part, though." | |
964 :group 'tramp | |
965 :type 'string) | |
966 | |
967 (defcustom tramp-discard-garbage nil | |
968 "*If non-nil, try to discard garbage sent by remote shell. | |
969 Some shells send such garbage upon connection setup." | |
970 :group 'tramp | |
971 :type 'boolean) | |
972 | |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
973 (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
|
974 "*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
|
975 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
|
976 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
|
977 arguments. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
978 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
979 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
|
980 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
|
981 shell from reading its init file." |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
982 :group 'tramp |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
983 ;; 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
|
984 ;; `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
|
985 :type (if (get 'alist 'widget-type) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
986 '(alist :key-type string :value-type string) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
987 '(repeat (cons string string)))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
988 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
989 (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
|
990 (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
|
991 "*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
|
992 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
|
993 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
994 :type 'string) |
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 (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
|
997 (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
|
998 "*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
|
999 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
|
1000 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1001 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1002 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1003 (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
|
1004 "[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
|
1005 "*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
|
1006 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1007 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1008 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1009 ;; 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
|
1010 ;; 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
|
1011 (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
|
1012 (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
|
1013 "*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
|
1014 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
|
1015 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
|
1016 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1017 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1018 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1019 (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
|
1020 (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
|
1021 "*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
|
1022 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
|
1023 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
|
1024 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1025 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1026 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1027 (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
|
1028 ":" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1029 "*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
|
1030 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
|
1031 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
|
1032 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1033 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1034 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1035 (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
|
1036 (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
|
1037 "*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
|
1038 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
|
1039 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
|
1040 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1041 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1042 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1043 (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
|
1044 (if tramp-unified-filenames ":" "/") |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1045 "*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
|
1046 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
|
1047 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
|
1048 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1049 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1050 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1051 (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
|
1052 (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
|
1053 "*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
|
1054 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
|
1055 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
|
1056 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1057 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1058 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1059 (defcustom tramp-user-regexp |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
1060 "[^:/ \t]*" |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1061 "*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
|
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 'regexp) |
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-user-format |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1066 "@" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1067 "*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
|
1068 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
|
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 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1071 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1072 (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
|
1073 (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
|
1074 "*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
|
1075 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
|
1076 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1077 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1078 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1079 (defcustom tramp-host-regexp |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1080 "[a-zA-Z0-9_.-]*" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1081 "*Regexp matching host names." |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1082 :group 'tramp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1083 :type 'regexp) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1084 |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1085 (defcustom tramp-host-with-port-regexp |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
1086 "[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
|
1087 "*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
|
1088 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1089 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1090 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1091 (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
|
1092 (if tramp-unified-filenames ":" "]") |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1093 "*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
|
1094 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
|
1095 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1096 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1097 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1098 (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
|
1099 (regexp-quote tramp-postfix-host-format) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1100 "*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
|
1101 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
|
1102 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1103 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1104 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1105 (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
|
1106 ".*$" |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1107 "*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
|
1108 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1109 :type 'regexp) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1110 |
45861 | 1111 ;; File name format. |
1112 | |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1113 (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
|
1114 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1115 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1116 tramp-prefix-regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1117 "\\(" "\\(" 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
|
1118 "\\(" "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp "\\)?" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1119 "\\(" 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
|
1120 "\\(" 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
|
1121 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
|
1122 |
45861 | 1123 "*List of five elements (REGEXP METHOD USER HOST FILE), detailing \ |
1124 the tramp file name structure. | |
1125 | |
1126 The first element REGEXP is a regular expression matching a tramp file | |
1127 name. The regex should contain parentheses around the method name, | |
1128 the user name, the host name, and the file name parts. | |
1129 | |
1130 The second element METHOD is a number, saying which pair of | |
1131 parentheses matches the method name. The third element USER is | |
1132 similar, but for the user name. The fourth element HOST is similar, | |
1133 but for the host name. The fifth element FILE is for the file name. | |
1134 These numbers are passed directly to `match-string', which see. That | |
1135 means the opening parentheses are counted to identify the pair. | |
1136 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1137 See also `tramp-file-name-regexp'." |
45861 | 1138 :group 'tramp |
1139 :type '(list (regexp :tag "File name regexp") | |
1140 (integer :tag "Paren pair for method name") | |
1141 (integer :tag "Paren pair for user name ") | |
1142 (integer :tag "Paren pair for host name ") | |
1143 (integer :tag "Paren pair for file name "))) | |
1144 | |
1145 ;;;###autoload | |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1146 (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
|
1147 "\\`/[^/:]+:" |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1148 "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
|
1149 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
|
1150 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
|
1151 |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1152 ;;;###autoload |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1153 (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
|
1154 "\\`/\\[.*\\]" |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1155 "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
|
1156 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
|
1157 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
|
1158 |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1159 ;;;###autoload |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1160 (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
|
1161 (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
|
1162 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
|
1163 tramp-file-name-regexp-separate) |
45861 | 1164 "*Regular expression matching file names handled by tramp. |
1165 This regexp should match tramp file names but no other file names. | |
1166 \(When tramp.el is loaded, this regular expression is prepended to | |
1167 `file-name-handler-alist', and that is searched sequentially. Thus, | |
1168 if the tramp entry appears rather early in the `file-name-handler-alist' | |
1169 and is a bit too general, then some files might be considered tramp | |
1170 files which are not really tramp files. | |
1171 | |
1172 Please note that the entry in `file-name-handler-alist' is made when | |
1173 this file (tramp.el) is loaded. This means that this variable must be set | |
1174 before loading tramp.el. Alternatively, `file-name-handler-alist' can be | |
1175 updated after changing this variable. | |
1176 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1177 Also see `tramp-file-name-structure'." |
45861 | 1178 :group 'tramp |
1179 :type 'regexp) | |
1180 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1181 ;;;###autoload |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1182 (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
|
1183 "^/$\\|^/[^/:][^/]*$" |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1184 "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
|
1185 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
|
1186 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
|
1187 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1188 ;;;###autoload |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1189 (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
|
1190 "^/\\([[][^]]*\\)?$" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1191 "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
|
1192 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
|
1193 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
|
1194 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1195 ;;;###autoload |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1196 (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
|
1197 (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
|
1198 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
|
1199 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
|
1200 "*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
|
1201 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
|
1202 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1203 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
|
1204 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
|
1205 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
|
1206 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
|
1207 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1208 Also see `tramp-file-name-structure'." |
45861 | 1209 :group 'tramp |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1210 :type 'regexp) |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1211 |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1212 (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
|
1213 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1214 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1215 tramp-prefix-regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1216 "\\(" "\\(" tramp-method-regexp "\\)" "\\)?" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1217 "\\(" "\\(" tramp-postfix-multi-hop-regexp "%s" "\\)+" "\\)?" |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1218 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
|
1219 2 3 -1) |
45861 | 1220 "*Describes the file name structure of `multi' files. |
1221 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
|
1222 This is a list of four elements (REGEXP METHOD HOP LOCALNAME). |
45861 | 1223 |
1224 The first element, REGEXP, gives a regular expression to match against | |
1225 the file name. In this regular expression, `%s' is replaced with the | |
1226 value of `tramp-multi-file-name-hop-structure'. (Note: in order to | |
1227 allow multiple hops, you normally want to use something like | |
1228 \"\\\\(\\\\(%s\\\\)+\\\\)\" in the regular expression. The outer pair | |
1229 of parentheses is used for the HOP element, see below.) | |
1230 | |
1231 All remaining elements are numbers. METHOD gives the number of the | |
1232 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
|
1233 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
|
1234 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
|
1235 |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1236 LOCALNAME can also be negative, which means to count from the end. Ie, a |
45861 | 1237 value of -1 means the last paren pair. |
1238 | |
1239 I think it would be good if the regexp matches the whole of the | |
1240 string, but I haven't actually tried what happens if it doesn't..." | |
1241 :group 'tramp | |
1242 :type '(list (regexp :tag "File name regexp") | |
1243 (integer :tag "Paren pair for method name") | |
1244 (integer :tag "Paren pair for hops") | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1245 (integer :tag "Paren pair to match localname"))) |
45861 | 1246 |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
1247 (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
|
1248 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1249 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1250 "\\(" 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
|
1251 "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
1252 "\\(" 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
|
1253 1 2 3) |
45861 | 1254 "*Describes the structure of a hop in multi files. |
1255 This is a list of four elements (REGEXP METHOD USER HOST). First | |
1256 element REGEXP is used to match against the hop. Pair number METHOD | |
1257 matches the method of one hop, pair number USER matches the user of | |
1258 one hop, pair number HOST matches the host of one hop. | |
1259 | |
1260 This regular expression should match exactly all of one hop." | |
1261 :group 'tramp | |
1262 :type '(list (regexp :tag "Hop regexp") | |
1263 (integer :tag "Paren pair for method name") | |
1264 (integer :tag "Paren pair for user name") | |
1265 (integer :tag "Paren pair for host name"))) | |
1266 | |
1267 (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
|
1268 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1269 (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
|
1270 (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
|
1271 "%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
|
1272 "%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
|
1273 "%h") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1274 (concat tramp-postfix-host-format "%p")) |
45861 | 1275 "*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
|
1276 This is a list of three elements PREFIX, HOP and LOCALNAME. |
45861 | 1277 |
1278 The first element PREFIX says how to construct the prefix, the second | |
1279 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
|
1280 LOCALNAME says how to construct the localname (pathname). |
45861 | 1281 |
1282 In PREFIX, `%%' means `%' and `%m' means the method name. | |
1283 | |
1284 In HOP, `%%' means `%' and `%m', `%u', `%h' mean the hop method, hop | |
1285 user and hop host, respectively. | |
1286 | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1287 In LOCALNAME, `%%' means `%' and `%p' means the localname. |
45861 | 1288 |
1289 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
|
1290 copy of LOCALNAME, but there is one copy of HOP for each hop in the file |
45861 | 1291 name. |
1292 | |
1293 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
|
1294 method name, followed by all the hops, and the localname must come |
45861 | 1295 last." |
1296 :group 'tramp | |
1297 :type '(list string string string)) | |
1298 | |
1299 (defcustom tramp-terminal-type "dumb" | |
1300 "*Value of TERM environment variable for logging in to remote host. | |
1301 Because Tramp wants to parse the output of the remote shell, it is easily | |
1302 confused by ANSI color escape sequences and suchlike. Often, shell init | |
1303 files conditionalize this setup based on the TERM environment variable." | |
1304 :group 'tramp | |
1305 :type 'string) | |
1306 | |
1307 (defcustom tramp-completion-without-shell-p nil | |
1308 "*If nil, use shell wildcards for completion, else rely on Lisp only. | |
1309 Using shell wildcards for completions has the advantage that it can be | |
1310 fast even in large directories, but completion is always | |
1311 case-sensitive. Relying on Lisp only means that case-insensitive | |
1312 completion is possible (subject to the variable `completion-ignore-case'), | |
1313 but it might be slow on large directories." | |
1314 :group 'tramp | |
1315 :type 'boolean) | |
1316 | |
46752 | 1317 (defcustom tramp-actions-before-shell |
1318 '((tramp-password-prompt-regexp tramp-action-password) | |
1319 (tramp-login-prompt-regexp tramp-action-login) | |
1320 (shell-prompt-pattern tramp-action-succeed) | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
1321 (tramp-shell-prompt-pattern tramp-action-succeed) |
46752 | 1322 (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
|
1323 (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
|
1324 (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
|
1325 (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
|
1326 (tramp-process-alive-regexp tramp-action-process-alive)) |
46752 | 1327 "List of pattern/action pairs. |
1328 Whenever a pattern matches, the corresponding action is performed. | |
1329 Each item looks like (PATTERN ACTION). | |
1330 | |
1331 The PATTERN should be a symbol, a variable. The value of this | |
1332 variable gives the regular expression to search for. Note that the | |
1333 regexp must match at the end of the buffer, \"\\'\" is implicitly | |
1334 appended to it. | |
1335 | |
1336 The ACTION should also be a symbol, but a function. When the | |
1337 corresponding PATTERN matches, the ACTION function is called." | |
1338 :group 'tramp | |
1339 :type '(repeat (list variable function))) | |
1340 | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1341 (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
|
1342 '((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
|
1343 (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
|
1344 (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
|
1345 "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
|
1346 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
|
1347 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
|
1348 :group 'tramp |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1349 :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
|
1350 |
46752 | 1351 (defcustom tramp-multi-actions |
1352 '((tramp-password-prompt-regexp tramp-multi-action-password) | |
1353 (tramp-login-prompt-regexp tramp-multi-action-login) | |
1354 (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
|
1355 (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
|
1356 (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
|
1357 (tramp-process-alive-regexp tramp-multi-action-process-alive)) |
46752 | 1358 "List of pattern/action pairs. |
1359 This list is used for each hop in multi-hop connections. | |
1360 See `tramp-actions-before-shell' for more info." | |
1361 :group 'tramp | |
1362 :type '(repeat (list variable function))) | |
1363 | |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1364 (defcustom tramp-initial-commands |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1365 '("unset HISTORY" |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1366 "unset correct" |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1367 "unset autocorrect") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1368 "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
|
1369 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
|
1370 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
|
1371 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
|
1372 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
|
1373 |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1374 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
|
1375 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
|
1376 autocorrect\" to the remote host." |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1377 :group 'tramp |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1378 :type '(repeat string)) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1379 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1380 ;; 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
|
1381 ;; known to have a bug in `process-send-string'; some ssh connections appear |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
1382 ;; to drop bytes when data is sent too quickly. There is also a connection |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
1383 ;; buffer local variable, which is computed depending on remote host properties |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
1384 ;; when `tramp-chunksize' is zero or nil. |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1385 (defcustom tramp-chunksize |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1386 (when (and (not (featurep 'xemacs)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1387 (memq system-type '(hpux))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1388 500) |
66561
742e40a6bf3c
* net/tramp.el (tramp-chunksize): Escape parentheses in docstring
Michael Albinus <michael.albinus@gmx.de>
parents:
66496
diff
changeset
|
1389 ;; Parentheses in docstring starting at beginning of line are escaped. |
742e40a6bf3c
* net/tramp.el (tramp-chunksize): Escape parentheses in docstring
Michael Albinus <michael.albinus@gmx.de>
parents:
66496
diff
changeset
|
1390 ;; Fontification is messed up when |
742e40a6bf3c
* net/tramp.el (tramp-chunksize): Escape parentheses in docstring
Michael Albinus <michael.albinus@gmx.de>
parents:
66496
diff
changeset
|
1391 ;; `open-paren-in-column-0-is-defun-start' set to t. |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1392 "*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
|
1393 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
|
1394 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
|
1395 checked via the following code: |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1396 |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1397 (with-temp-buffer |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1398 (let* ((user \"xxx\") (host \"yyy\") |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1399 (init 0) (step 50) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1400 (sent init) (received init)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1401 (while (= sent received) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1402 (setq sent (+ sent step)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1403 (erase-buffer) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1404 (let ((proc (start-process (buffer-name) (current-buffer) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1405 \"ssh\" \"-l\" user host \"wc\" \"-c\"))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1406 (when (memq (process-status proc) '(run open)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1407 (process-send-string proc (make-string sent ?\\ )) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1408 (process-send-eof proc) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1409 (process-send-eof proc)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1410 (while (not (progn (goto-char (point-min)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1411 (re-search-forward \"\\\\w+\" (point-max) t))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1412 (accept-process-output proc 1)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1413 (when (memq (process-status proc) '(run open)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1414 (setq received (string-to-number (match-string 0))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1415 (delete-process proc) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1416 (message \"Bytes sent: %s\\tBytes received: %s\" sent received) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1417 (sit-for 0)))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1418 (if (> sent (+ init step)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1419 (message \"You should set `tramp-chunksize' to a maximum of %s\" |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1420 (- sent step)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1421 (message \"Test does not work\") |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1422 (display-buffer (current-buffer)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1423 (sit-for 30)))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1424 |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1425 In the Emacs normally running Tramp, evaluate the above code |
66561
742e40a6bf3c
* net/tramp.el (tramp-chunksize): Escape parentheses in docstring
Michael Albinus <michael.albinus@gmx.de>
parents:
66496
diff
changeset
|
1426 \(replace \"xxx\" and \"yyy\" by the remote user and host name, |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1427 respectively). You can do this, for example, by pasting it into |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1428 the `*scratch*' buffer and then hitting C-j with the cursor after the |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1429 last closing parenthesis. Note that it works only if you have configured |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1430 \"ssh\" to run without password query, see ssh-agent(1). |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1431 |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1432 You will see the number of bytes sent successfully to the remote host. |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1433 If that number exceeds 1000, you can stop the execution by hitting |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1434 C-g, because your Emacs is likely clean. |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1435 |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1436 If your Emacs is buggy, the code stops and gives you an indication |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1437 about the value `tramp-chunksize' should be set. Maybe you could just |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1438 experiment a bit, e.g. changing the values of `init' and `step' |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1439 in the third line of the code. |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1440 |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1441 When it is necessary to set `tramp-chunksize', you might consider to |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1442 use an out-of-the-band method (like \"scp\") instead of an internal one |
66561
742e40a6bf3c
* net/tramp.el (tramp-chunksize): Escape parentheses in docstring
Michael Albinus <michael.albinus@gmx.de>
parents:
66496
diff
changeset
|
1443 \(like \"ssh\"), because setting `tramp-chunksize' to non-nil decreases |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
1444 performance. |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
1445 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1446 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
|
1447 this variable to be set as well." |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1448 :group 'tramp |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
1449 :type '(choice (const nil) integer)) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
1450 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1451 ;; 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
|
1452 ;; 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
|
1453 ;; 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
|
1454 ;; 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
|
1455 (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
|
1456 "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
|
1457 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
|
1458 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
|
1459 :group 'tramp |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1460 :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
|
1461 |
45861 | 1462 ;;; Internal Variables: |
1463 | |
1464 (defvar tramp-buffer-file-attributes nil | |
1465 "Holds the `ls -ild' output for the current buffer. | |
1466 This variable is local to each buffer. It is not used if the remote | |
1467 machine groks Perl. If it is used, it's used as an emulation for | |
1468 the visited file modtime.") | |
1469 (make-variable-buffer-local 'tramp-buffer-file-attributes) | |
1470 | |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1471 (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
|
1472 (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
|
1473 ((fboundp 'md5-encode) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1474 (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
|
1475 (funcall (symbol-function 'md5-encode) x)))) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1476 (t (error "Couldn't find an `md5' function"))) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1477 "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
|
1478 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1479 (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
|
1480 (concat "///" |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1481 (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
|
1482 (concat |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1483 (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
|
1484 (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
|
1485 ;; (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
|
1486 ;; (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
|
1487 ;; (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
|
1488 ;; (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
|
1489 ;; (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
|
1490 ;; (mapcar |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1491 ;; (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
|
1492 ;; (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
|
1493 ;; (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
|
1494 ;; (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
|
1495 ;; t)))) |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1496 ))) |
45861 | 1497 "String used to recognize end of output.") |
1498 | |
1499 (defvar tramp-connection-function nil | |
1500 "This internal variable holds a parameter for `tramp-methods'. | |
1501 In the connection buffer, this variable has the value of the like-named | |
1502 method parameter, as specified in `tramp-methods' (which see).") | |
1503 | |
1504 (defvar tramp-remote-sh nil | |
1505 "This internal variable holds a parameter for `tramp-methods'. | |
1506 In the connection buffer, this variable has the value of the like-named | |
1507 method parameter, as specified in `tramp-methods' (which see).") | |
1508 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
1509 (defvar tramp-login-program nil |
45861 | 1510 "This internal variable holds a parameter for `tramp-methods'. |
1511 In the connection buffer, this variable has the value of the like-named | |
1512 method parameter, as specified in `tramp-methods' (which see).") | |
1513 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
1514 (defvar tramp-login-args nil |
45861 | 1515 "This internal variable holds a parameter for `tramp-methods'. |
1516 In the connection buffer, this variable has the value of the like-named | |
1517 method parameter, as specified in `tramp-methods' (which see).") | |
1518 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
1519 (defvar tramp-copy-program nil |
45861 | 1520 "This internal variable holds a parameter for `tramp-methods'. |
1521 In the connection buffer, this variable has the value of the like-named | |
1522 method parameter, as specified in `tramp-methods' (which see).") | |
1523 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
1524 (defvar tramp-copy-args nil |
45861 | 1525 "This internal variable holds a parameter for `tramp-methods'. |
1526 In the connection buffer, this variable has the value of the like-named | |
1527 method parameter, as specified in `tramp-methods' (which see).") | |
1528 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
1529 (defvar tramp-copy-keep-date-arg nil |
45861 | 1530 "This internal variable holds a parameter for `tramp-methods'. |
1531 In the connection buffer, this variable has the value of the like-named | |
1532 method parameter, as specified in `tramp-methods' (which see).") | |
1533 | |
1534 (defvar tramp-encoding-command nil | |
1535 "This internal variable holds a parameter for `tramp-methods'. | |
1536 In the connection buffer, this variable has the value of the like-named | |
1537 method parameter, as specified in `tramp-methods' (which see).") | |
1538 | |
1539 (defvar tramp-decoding-command nil | |
1540 "This internal variable holds a parameter for `tramp-methods'. | |
1541 In the connection buffer, this variable has the value of the like-named | |
1542 method parameter, as specified in `tramp-methods' (which see).") | |
1543 | |
1544 (defvar tramp-encoding-function nil | |
1545 "This internal variable holds a parameter for `tramp-methods'. | |
1546 In the connection buffer, this variable has the value of the like-named | |
1547 method parameter, as specified in `tramp-methods' (which see).") | |
1548 | |
1549 (defvar tramp-decoding-function nil | |
1550 "This internal variable holds a parameter for `tramp-methods'. | |
1551 In the connection buffer, this variable has the value of the like-named | |
1552 method parameter, as specified in `tramp-methods' (which see).") | |
1553 | |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1554 (defvar tramp-password-end-of-line nil |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
1555 "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
|
1556 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
|
1557 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
|
1558 |
45861 | 1559 ;; CCC `local in each buffer'? |
1560 (defvar tramp-ls-command nil | |
1561 "This command is used to get a long listing with numeric user and group ids. | |
1562 This variable is automatically made buffer-local to each rsh process buffer | |
1563 upon opening the connection.") | |
1564 | |
1565 (defvar tramp-current-multi-method nil | |
1566 "Name of `multi' connection method for this *tramp* buffer, or nil if not multi. | |
1567 This variable is automatically made buffer-local to each rsh process buffer | |
1568 upon opening the connection.") | |
1569 | |
1570 (defvar tramp-current-method nil | |
1571 "Connection method for this *tramp* buffer. | |
1572 This variable is automatically made buffer-local to each rsh process buffer | |
1573 upon opening the connection.") | |
1574 | |
1575 (defvar tramp-current-user nil | |
1576 "Remote login name for this *tramp* buffer. | |
1577 This variable is automatically made buffer-local to each rsh process buffer | |
1578 upon opening the connection.") | |
1579 | |
1580 (defvar tramp-current-host nil | |
1581 "Remote host for this *tramp* buffer. | |
1582 This variable is automatically made buffer-local to each rsh process buffer | |
1583 upon opening the connection.") | |
1584 | |
1585 (defvar tramp-test-groks-nt nil | |
1586 "Whether the `test' command groks the `-nt' switch. | |
1587 \(`test A -nt B' tests if file A is newer than file B.) | |
1588 This variable is automatically made buffer-local to each rsh process buffer | |
1589 upon opening the connection.") | |
1590 | |
1591 (defvar tramp-file-exists-command nil | |
1592 "Command to use for checking if a file exists. | |
1593 This variable is automatically made buffer-local to each rsh process buffer | |
1594 upon opening the connection.") | |
1595 | |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1596 (defconst tramp-uudecode "\ |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1597 tramp_uudecode () { |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1598 \(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
|
1599 cat /tmp/tramp.$$ |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1600 rm -f /tmp/tramp.$$ |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1601 }" |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1602 "Shell function to implement `uudecode' to standard output. |
59031
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
1603 Many systems support `uudecode -o /dev/stdout' or `uudecode -o -' |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
1604 for this or `uudecode -p', but some systems don't, and for them |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
1605 we have this shell function.") |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1606 |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
1607 ;; 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
|
1608 ;; 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
|
1609 ;; 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
|
1610 ;; 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
|
1611 ;; 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
|
1612 ;; 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
|
1613 (defconst tramp-perl-file-attributes "\ |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1614 @stat = lstat($ARGV[0]); |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1615 if (($stat[2] & 0170000) == 0120000) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1616 { |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1617 $type = readlink($ARGV[0]); |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1618 $type = \"\\\"$type\\\"\"; |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1619 } |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1620 elsif (($stat[2] & 0170000) == 040000) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1621 { |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1622 $type = \"t\"; |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1623 } |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1624 else |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1625 { |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1626 $type = \"nil\" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1627 }; |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1628 $uid = ($ARGV[1] eq \"integer\") ? $stat[4] : \"\\\"\" . getpwuid($stat[4]) . \"\\\"\"; |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1629 $gid = ($ARGV[1] eq \"integer\") ? $stat[5] : \"\\\"\" . getgrgid($stat[5]) . \"\\\"\"; |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1630 printf( |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1631 \"(%s %u %s %s (%u %u) (%u %u) (%u %u) %u %u t (%u . %u) -1)\\n\", |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1632 $type, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1633 $stat[3], |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1634 $uid, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1635 $gid, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1636 $stat[8] >> 16 & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1637 $stat[8] & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1638 $stat[9] >> 16 & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1639 $stat[9] & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1640 $stat[10] >> 16 & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1641 $stat[10] & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1642 $stat[7], |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1643 $stat[2], |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1644 $stat[1] >> 16 & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1645 $stat[1] & 0xffff |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1646 );" |
45861 | 1647 "Perl script to produce output suitable for use with `file-attributes' |
1648 on the remote file system.") | |
1649 | |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1650 (defconst tramp-perl-directory-files-and-attributes "\ |
65926
e465f3508fd5
(tramp-perl-directory-files-and-attributes): Add error handling.
Lars Hansen <larsh@soem.dk>
parents:
65925
diff
changeset
|
1651 chdir($ARGV[0]) or printf(\"\\\"Cannot change to $ARGV[0]: $''!''\\\"\\n\"), exit(); |
e465f3508fd5
(tramp-perl-directory-files-and-attributes): Add error handling.
Lars Hansen <larsh@soem.dk>
parents:
65925
diff
changeset
|
1652 opendir(DIR,\".\") or printf(\"\\\"Cannot open directory $ARGV[0]: $''!''\\\"\\n\"), exit(); |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1653 @list = readdir(DIR); |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1654 closedir(DIR); |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1655 $n = scalar(@list); |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1656 printf(\"(\\n\"); |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1657 for($i = 0; $i < $n; $i++) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1658 { |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1659 $filename = $list[$i]; |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1660 @stat = lstat($filename); |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1661 if (($stat[2] & 0170000) == 0120000) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1662 { |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1663 $type = readlink($filename); |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1664 $type = \"\\\"$type\\\"\"; |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1665 } |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1666 elsif (($stat[2] & 0170000) == 040000) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1667 { |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1668 $type = \"t\"; |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1669 } |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1670 else |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1671 { |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1672 $type = \"nil\" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1673 }; |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1674 $uid = ($ARGV[1] eq \"integer\") ? $stat[4] : \"\\\"\" . getpwuid($stat[4]) . \"\\\"\"; |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1675 $gid = ($ARGV[1] eq \"integer\") ? $stat[5] : \"\\\"\" . getgrgid($stat[5]) . \"\\\"\"; |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1676 printf( |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1677 \"(\\\"%s\\\" %s %u %s %s (%u %u) (%u %u) (%u %u) %u %u t (%u . %u) (%u %u))\\n\", |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1678 $filename, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1679 $type, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1680 $stat[3], |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1681 $uid, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1682 $gid, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1683 $stat[8] >> 16 & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1684 $stat[8] & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1685 $stat[9] >> 16 & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1686 $stat[9] & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1687 $stat[10] >> 16 & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1688 $stat[10] & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1689 $stat[7], |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1690 $stat[2], |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1691 $stat[1] >> 16 & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1692 $stat[1] & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1693 $stat[0] >> 16 & 0xffff, |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1694 $stat[0] & 0xffff); |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1695 } |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1696 printf(\")\\n\");" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1697 "Perl script implementing `directory-files-attributes' as Lisp `read'able |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1698 output.") |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1699 |
46752 | 1700 ;; ;; These two use uu encoding. |
1701 ;; (defvar tramp-perl-encode "%s -e'\ | |
1702 ;; print qq(begin 644 xxx\n); | |
1703 ;; my $s = q(); | |
1704 ;; my $res = q(); | |
1705 ;; while (read(STDIN, $s, 45)) { | |
1706 ;; print pack(q(u), $s); | |
1707 ;; } | |
1708 ;; print qq(`\n); | |
1709 ;; print qq(end\n); | |
1710 ;; '" | |
1711 ;; "Perl program to use for encoding a file. | |
1712 ;; Escape sequence %s is replaced with name of Perl binary.") | |
1713 | |
1714 ;; (defvar tramp-perl-decode "%s -ne ' | |
1715 ;; print unpack q(u), $_; | |
1716 ;; '" | |
1717 ;; "Perl program to use for decoding a file. | |
1718 ;; Escape sequence %s is replaced with name of Perl binary.") | |
1719 | |
1720 ;; These two use base64 encoding. | |
46790 | 1721 (defvar tramp-perl-encode-with-module |
1722 "perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)'" | |
1723 "Perl program to use for encoding a file. | |
1724 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
|
1725 This string is passed to `format', so percent characters need to be doubled. |
46790 | 1726 This implementation requires the MIME::Base64 Perl module to be installed |
1727 on the remote host.") | |
1728 | |
1729 (defvar tramp-perl-decode-with-module | |
1730 "perl -MMIME::Base64 -0777 -ne 'print decode_base64($_)'" | |
1731 "Perl program to use for decoding a file. | |
1732 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
|
1733 This string is passed to `format', so percent characters need to be doubled. |
46790 | 1734 This implementation requires the MIME::Base64 Perl module to be installed |
1735 on the remote host.") | |
1736 | |
46752 | 1737 (defvar tramp-perl-encode |
46790 | 1738 "%s -e ' |
1739 # This script contributed by Juanma Barranquero <lektu@terra.es>. | |
68820
3a5ea93ff8b4
* net/tramp.el (tramp-remote-path): Add "/usr/xpg4/bin" on top,
Michael Albinus <michael.albinus@gmx.de>
parents:
68726
diff
changeset
|
1740 # Copyright (C) 2002, 2006 Free Software Foundation, Inc. |
46790 | 1741 use strict; |
1742 | |
46795 | 1743 my %%trans = do { |
46790 | 1744 my $i = 0; |
1745 map {(substr(unpack(q(B8), chr $i++), 2, 6), $_)} | |
1746 split //, q(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/); | |
1747 }; | |
1748 | |
46797 | 1749 binmode(\\*STDIN); |
46790 | 1750 |
1751 # We read in chunks of 54 bytes, to generate output lines | |
1752 # of 72 chars (plus end of line) | |
46797 | 1753 $/ = \\54; |
46790 | 1754 |
1755 while (my $data = <STDIN>) { | |
1756 my $pad = q(); | |
1757 | |
1758 # Only for the last chunk, and only if did not fill the last three-byte packet | |
1759 if (eof) { | |
46795 | 1760 my $mod = length($data) %% 3; |
46790 | 1761 $pad = q(=) x (3 - $mod) if $mod; |
1762 } | |
1763 | |
1764 # Not the fastest method, but it is simple: unpack to binary string, split | |
1765 # by groups of 6 bits and convert back from binary to byte; then map into | |
1766 # the translation table | |
1767 print | |
1768 join q(), | |
1769 map($trans{$_}, | |
1770 (substr(unpack(q(B*), $data) . q(00000), 0, 432) =~ /....../g)), | |
1771 $pad, | |
46797 | 1772 qq(\\n); |
46790 | 1773 } |
1774 '" | |
46752 | 1775 "Perl program to use for encoding a file. |
46795 | 1776 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
|
1777 This string is passed to `format', so percent characters need to be doubled.") |
46752 | 1778 |
1779 (defvar tramp-perl-decode | |
46790 | 1780 "%s -e ' |
1781 # This script contributed by Juanma Barranquero <lektu@terra.es>. | |
68820
3a5ea93ff8b4
* net/tramp.el (tramp-remote-path): Add "/usr/xpg4/bin" on top,
Michael Albinus <michael.albinus@gmx.de>
parents:
68726
diff
changeset
|
1782 # Copyright (C) 2002, 2006 Free Software Foundation, Inc. |
46790 | 1783 use strict; |
1784 | |
46795 | 1785 my %%trans = do { |
46790 | 1786 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
|
1787 map {($_, substr(unpack(q(B8), chr $i++), 2, 6))} |
46790 | 1788 split //, q(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/) |
1789 }; | |
1790 | |
46795 | 1791 my %%bytes = map {(unpack(q(B8), chr $_), chr $_)} 0 .. 255; |
46790 | 1792 |
46797 | 1793 binmode(\\*STDOUT); |
46790 | 1794 |
1795 # We are going to accumulate into $pending to accept any line length | |
1796 # (we do not check they are <= 76 chars as the RFC says) | |
1797 my $pending = q(); | |
1798 | |
1799 while (my $data = <STDIN>) { | |
1800 chomp $data; | |
1801 | |
1802 # If we find one or two =, we have reached the end and | |
1803 # any following data is to be discarded | |
1804 my $finished = $data =~ s/(==?).*/$1/; | |
1805 $pending .= $data; | |
1806 | |
1807 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
|
1808 my $chunk = substr($pending, 0, $len & ~3); |
57463
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
1809 $pending = substr($pending, $len & ~3 + 1); |
46790 | 1810 |
1811 # Easy method: translate from chars to (pregenerated) six-bit packets, join, | |
1812 # split in 8-bit chunks and convert back to char. | |
1813 print join q(), | |
1814 map $bytes{$_}, | |
1815 ((join q(), map {$trans{$_} || q()} split //, $chunk) =~ /......../g); | |
1816 | |
1817 last if $finished; | |
1818 } | |
1819 '" | |
46752 | 1820 "Perl program to use for decoding a file. |
46795 | 1821 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
|
1822 This string is passed to `format', so percent characters need to be doubled.") |
45861 | 1823 |
1824 (defconst tramp-file-mode-type-map '((0 . "-") ; Normal file (SVID-v2 and XPG2) | |
1825 (1 . "p") ; fifo | |
1826 (2 . "c") ; character device | |
1827 (3 . "m") ; multiplexed character device (v7) | |
1828 (4 . "d") ; directory | |
1829 (5 . "?") ; Named special file (XENIX) | |
1830 (6 . "b") ; block device | |
1831 (7 . "?") ; multiplexed block device (v7) | |
1832 (8 . "-") ; regular file | |
1833 (9 . "n") ; network special file (HP-UX) | |
1834 (10 . "l") ; symlink | |
1835 (11 . "?") ; ACL shadow inode (Solaris, not userspace) | |
1836 (12 . "s") ; socket | |
1837 (13 . "D") ; door special (Solaris) | |
1838 (14 . "w")) ; whiteout (BSD) | |
1839 "A list of file types returned from the `stat' system call. | |
1840 This is used to map a mode number to a permission string.") | |
1841 | |
1842 (defvar tramp-dos-coding-system | |
1843 (if (and (fboundp 'coding-system-p) | |
1844 (funcall 'coding-system-p '(dos))) | |
1845 'dos | |
1846 'undecided-dos) | |
1847 "Some Emacsen know the `dos' coding system, others need `undecided-dos'.") | |
1848 | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1849 (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
|
1850 "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
|
1851 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
|
1852 (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
|
1853 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1854 (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
|
1855 "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
|
1856 |
46752 | 1857 (defvar tramp-last-cmd-time nil |
1858 "Internal Tramp variable recording the time when the last cmd was sent. | |
1859 This variable is buffer-local in every buffer.") | |
1860 (make-variable-buffer-local 'tramp-last-cmd-time) | |
45861 | 1861 |
47205
8a2bf9dded0f
* net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46998
diff
changeset
|
1862 ;; 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
|
1863 ;; 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
|
1864 (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
|
1865 (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
|
1866 (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
|
1867 (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
|
1868 '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
|
1869 "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
|
1870 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
|
1871 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
|
1872 |
45861 | 1873 ;; New handlers should be added here. The following operations can be |
1874 ;; handled using the normal primitives: file-name-as-directory, | |
1875 ;; file-name-directory, file-name-nondirectory, | |
1876 ;; file-name-sans-versions, get-file-buffer. | |
1877 (defconst tramp-file-name-handler-alist | |
1878 '( | |
1879 (load . tramp-handle-load) | |
1880 (make-symbolic-link . tramp-handle-make-symbolic-link) | |
1881 (file-name-directory . tramp-handle-file-name-directory) | |
1882 (file-name-nondirectory . tramp-handle-file-name-nondirectory) | |
1883 (file-truename . tramp-handle-file-truename) | |
1884 (file-exists-p . tramp-handle-file-exists-p) | |
1885 (file-directory-p . tramp-handle-file-directory-p) | |
1886 (file-executable-p . tramp-handle-file-executable-p) | |
1887 (file-accessible-directory-p . tramp-handle-file-accessible-directory-p) | |
1888 (file-readable-p . tramp-handle-file-readable-p) | |
1889 (file-regular-p . tramp-handle-file-regular-p) | |
1890 (file-symlink-p . tramp-handle-file-symlink-p) | |
1891 (file-writable-p . tramp-handle-file-writable-p) | |
1892 (file-ownership-preserved-p . tramp-handle-file-ownership-preserved-p) | |
1893 (file-newer-than-file-p . tramp-handle-file-newer-than-file-p) | |
1894 (file-attributes . tramp-handle-file-attributes) | |
1895 (file-modes . tramp-handle-file-modes) | |
1896 (directory-files . tramp-handle-directory-files) | |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
1897 (directory-files-and-attributes . tramp-handle-directory-files-and-attributes) |
45861 | 1898 (file-name-all-completions . tramp-handle-file-name-all-completions) |
1899 (file-name-completion . tramp-handle-file-name-completion) | |
1900 (add-name-to-file . tramp-handle-add-name-to-file) | |
1901 (copy-file . tramp-handle-copy-file) | |
1902 (rename-file . tramp-handle-rename-file) | |
1903 (set-file-modes . tramp-handle-set-file-modes) | |
1904 (make-directory . tramp-handle-make-directory) | |
1905 (delete-directory . tramp-handle-delete-directory) | |
1906 (delete-file . tramp-handle-delete-file) | |
1907 (directory-file-name . tramp-handle-directory-file-name) | |
1908 (shell-command . tramp-handle-shell-command) | |
57653
b324ca4df07c
* simple.el (process-file): New function, similar to call-process
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
57559
diff
changeset
|
1909 (process-file . tramp-handle-process-file) |
45861 | 1910 (insert-directory . tramp-handle-insert-directory) |
1911 (expand-file-name . tramp-handle-expand-file-name) | |
1912 (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
|
1913 (file-remote-p . tramp-handle-file-remote-p) |
45861 | 1914 (insert-file-contents . tramp-handle-insert-file-contents) |
1915 (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
|
1916 (find-backup-file-name . tramp-handle-find-backup-file-name) |
65248
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
1917 (make-auto-save-file-name . tramp-handle-make-auto-save-file-name) |
45861 | 1918 (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
|
1919 (dired-compress-file . tramp-handle-dired-compress-file) |
45861 | 1920 (dired-call-process . tramp-handle-dired-call-process) |
1921 (dired-recursive-delete-directory | |
1922 . tramp-handle-dired-recursive-delete-directory) | |
1923 (set-visited-file-modtime . tramp-handle-set-visited-file-modtime) | |
1924 (verify-visited-file-modtime . tramp-handle-verify-visited-file-modtime)) | |
65248
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
1925 "Alist of handler functions. |
45861 | 1926 Operations not mentioned here will be handled by the normal Emacs functions.") |
1927 | |
70276
32b384911b4f
tramp-file-name-handler-alist): Delete expand-file-name and other
Richard M. Stallman <rms@gnu.org>
parents:
70255
diff
changeset
|
1928 ;; Handlers for partial tramp file names. For Emacs just |
32b384911b4f
tramp-file-name-handler-alist): Delete expand-file-name and other
Richard M. Stallman <rms@gnu.org>
parents:
70255
diff
changeset
|
1929 ;; `file-name-all-completions' is needed. |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1930 ;;;###autoload |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1931 (defconst tramp-completion-file-name-handler-alist |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1932 '((file-name-all-completions . tramp-completion-handle-file-name-all-completions) |
70276
32b384911b4f
tramp-file-name-handler-alist): Delete expand-file-name and other
Richard M. Stallman <rms@gnu.org>
parents:
70255
diff
changeset
|
1933 (file-name-completion . tramp-completion-handle-file-name-completion)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1934 "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
|
1935 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
|
1936 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
|
1937 normal Emacs functions.") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1938 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1939 ;; 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
|
1940 (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
|
1941 ;; (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
|
1942 ;; entry, since `identity' always matches. |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
1943 '((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
|
1944 "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
|
1945 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
|
1946 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
|
1947 |
45861 | 1948 ;;; Internal functions which must come first. |
1949 | |
1950 (defsubst tramp-message (level fmt-string &rest args) | |
1951 "Emit a message depending on verbosity level. | |
1952 First arg LEVEL says to be quiet if `tramp-verbose' is less than LEVEL. The | |
1953 message is emitted only if `tramp-verbose' is greater than or equal to LEVEL. | |
1954 Calls function `message' with FMT-STRING as control string and the remaining | |
1955 ARGS to actually emit the message (if applicable). | |
1956 | |
1957 This function expects to be called from the tramp buffer only!" | |
1958 (when (<= level tramp-verbose) | |
1959 (apply #'message (concat "tramp: " fmt-string) args) | |
1960 (when tramp-debug-buffer | |
1961 (save-excursion | |
1962 (set-buffer | |
1963 (tramp-get-debug-buffer | |
1964 tramp-current-multi-method tramp-current-method | |
1965 tramp-current-user tramp-current-host)) | |
1966 (goto-char (point-max)) | |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
1967 (unless (bolp) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
1968 (insert "\n")) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
1969 (tramp-insert-with-face |
45861 | 1970 'italic |
1971 (concat "# " (apply #'format fmt-string args) "\n")))))) | |
1972 | |
1973 (defun tramp-message-for-buffer | |
1974 (multi-method method user host level fmt-string &rest args) | |
1975 "Like `tramp-message' but temporarily switches to the tramp buffer. | |
1976 First three args METHOD, USER, and HOST identify the tramp buffer to use, | |
1977 remaining args passed to `tramp-message'." | |
1978 (save-excursion | |
1979 (set-buffer (tramp-get-buffer multi-method method user host)) | |
1980 (apply 'tramp-message level fmt-string args))) | |
1981 | |
1982 (defsubst tramp-line-end-position nil | |
1983 "Return point at end of line. | |
1984 Calls `line-end-position' or `point-at-eol' if defined, else | |
1985 own implementation." | |
1986 (cond | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
1987 ((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
|
1988 ((fboundp 'point-at-eol) (funcall (symbol-function 'point-at-eol))) |
45861 | 1989 (t (save-excursion (end-of-line) (point))))) |
1990 | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1991 (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
|
1992 "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
|
1993 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1994 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
|
1995 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
|
1996 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
|
1997 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
|
1998 `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
|
1999 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
|
2000 `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
|
2001 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2002 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
|
2003 `progn'). |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2004 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2005 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
|
2006 `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
|
2007 `(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
|
2008 (,(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
|
2009 (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
|
2010 (,(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
|
2011 (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
|
2012 (,(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
|
2013 (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
|
2014 (,(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
|
2015 (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
|
2016 (,(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
|
2017 (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
|
2018 ,@body)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2019 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2020 (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
|
2021 ;; To be activated for debugging containing this macro |
57463
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
2022 ;; It works only when VAR is nil. Otherwise, it can be deactivated by |
59031
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
2023 ;; (put 'with-parsed-tramp-file-name 'edebug-form-spec 0) |
57463
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
2024 ;; I'm too stupid to write a precise SPEC for it. |
59031
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
2025 (put 'with-parsed-tramp-file-name 'edebug-form-spec t) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2026 |
55864 | 2027 (defmacro tramp-let-maybe (variable value &rest body) |
2028 "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete. | |
2029 BODY is executed whether or not the variable is obsolete. | |
2030 The intent is to protect against `obsolete variable' warnings." | |
2031 `(if (get ',variable 'byte-obsolete-variable) | |
2032 (progn ,@body) | |
2033 (let ((,variable ,value)) | |
2034 ,@body))) | |
2035 (put 'tramp-let-maybe 'lisp-indent-function 2) | |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2036 (put 'tramp-let-maybe 'edebug-form-spec t) |
55864 | 2037 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2038 ;;; Config Manipulation Functions: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2039 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2040 (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
|
2041 "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
|
2042 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
|
2043 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
|
2044 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
|
2045 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
|
2046 `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
|
2047 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
|
2048 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2049 Example: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2050 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2051 (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
|
2052 \"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
|
2053 '((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
|
2054 (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
|
2055 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2056 (let ((r function-list) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2057 (v function-list)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2058 (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
|
2059 (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
|
2060 tramp-completion-function-alist)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2061 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2062 (while v |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2063 ;; Remove double entries |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2064 (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
|
2065 (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
|
2066 ;; 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
|
2067 (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
|
2068 (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
|
2069 (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
|
2070 (setq v (cdr v))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2071 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2072 (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
|
2073 (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
|
2074 (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
|
2075 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2076 (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
|
2077 "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
|
2078 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
|
2079 (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
|
2080 |
45861 | 2081 ;;; File Name Handler Functions: |
2082 | |
2083 (defun tramp-handle-make-symbolic-link | |
2084 (filename linkname &optional ok-if-already-exists) | |
2085 "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
|
2086 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
|
2087 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
|
2088 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
|
2089 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2090 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
|
2091 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
|
2092 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
|
2093 target of the symlink differ." |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2094 (with-parsed-tramp-file-name linkname l |
46048
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
2095 (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
|
2096 (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
|
2097 (unless ln |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2098 (signal 'file-error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2099 (list "Making a symbolic link." |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2100 "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
|
2101 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2102 ;; 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
|
2103 (when (file-exists-p linkname) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2104 ;; What to do? |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2105 (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
|
2106 (and (numberp ok-if-already-exists) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2107 (not (yes-or-no-p |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2108 (format |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2109 "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
|
2110 l-localname))))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2111 (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
|
2112 (delete-file linkname))) |
a2d047d50fb9
(tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46306
diff
changeset
|
2113 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2114 ;; 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
|
2115 (when (tramp-tramp-file-p filename) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2116 (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
|
2117 (tramp-dissect-file-name |
a2d047d50fb9
(tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46306
diff
changeset
|
2118 (expand-file-name filename))))) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
2119 |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2120 ;; 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
|
2121 ;; 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
|
2122 ;; that FILENAME belongs to. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2123 (zerop |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2124 (tramp-send-command-and-check |
46048
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
2125 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
|
2126 (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
|
2127 cwd ln |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
2128 filename |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2129 l-localname) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2130 t))))) |
45861 | 2131 |
2132 | |
2133 (defun tramp-handle-load (file &optional noerror nomessage nosuffix must-suffix) | |
2134 "Like `load' for tramp files. Not implemented!" | |
2135 (unless (file-name-absolute-p file) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2136 (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
|
2137 (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
|
2138 (unless nosuffix |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2139 (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
|
2140 (setq file (concat file ".elc"))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2141 ((file-exists-p (concat file ".el")) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2142 (setq file (concat file ".el"))))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2143 (when must-suffix |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2144 ;; 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
|
2145 ;; Included for safety's sake. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2146 (unless (or (file-name-directory file) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2147 (string-match "\\.elc?\\'" file)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2148 (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
|
2149 file))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2150 (unless noerror |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2151 (when (not (file-exists-p file)) |
64559
4c5dd75702fd
(tramp-handle-load): Fix typo in error message.
Juanma Barranquero <lekktu@gmail.com>
parents:
64085
diff
changeset
|
2152 (error "Cannot load nonexistent file `%s'" file))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2153 (if (not (file-exists-p file)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2154 nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2155 (unless nomessage |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2156 (message "Loading %s..." file)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2157 (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
|
2158 ;; 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
|
2159 (load local-copy noerror t t) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2160 (delete-file local-copy)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2161 (unless nomessage |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2162 (message "Loading %s...done" file)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2163 t))) |
45861 | 2164 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2165 ;; Localname manipulation functions that grok TRAMP localnames... |
45861 | 2166 (defun tramp-handle-file-name-directory (file) |
2167 "Like `file-name-directory' but aware of TRAMP files." | |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
2168 ;; 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
|
2169 (with-parsed-tramp-file-name file nil |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
2170 ;; Run the command on the localname portion only. |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
2171 (tramp-make-tramp-file-name |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
2172 multi-method method user host (file-name-directory (or localname ""))))) |
45861 | 2173 |
2174 (defun tramp-handle-file-name-nondirectory (file) | |
2175 "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
|
2176 (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
|
2177 (file-name-nondirectory localname))) |
45861 | 2178 |
2179 (defun tramp-handle-file-truename (filename &optional counter prev-dirs) | |
2180 "Like `file-truename' for tramp files." | |
56644
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2181 (with-parsed-tramp-file-name (expand-file-name filename) nil |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2182 (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
|
2183 (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
|
2184 (file-name-as-directory localname))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2185 (is-dir (string= localname localnamedir)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2186 (thisstep nil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2187 (numchase 0) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2188 ;; 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
|
2189 ;; 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
|
2190 ;; 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
|
2191 ;; 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
|
2192 (numchase-limit 20) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2193 (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
|
2194 symlink-target) |
45861 | 2195 (tramp-message-for-buffer |
2196 multi-method method user host | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2197 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
|
2198 (while (and steps (< numchase numchase-limit)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2199 (setq thisstep (pop steps)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2200 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2201 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2202 10 "Check %s" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2203 (mapconcat 'identity |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2204 (append '("") (reverse result) (list thisstep)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2205 "/")) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2206 (setq symlink-target |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
2207 (nth 0 (file-attributes |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2208 (tramp-make-tramp-file-name |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2209 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2210 (mapconcat 'identity |
46790 | 2211 (append '("") |
2212 (reverse result) | |
2213 (list thisstep)) | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2214 "/"))))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2215 (cond ((string= "." thisstep) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2216 (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
|
2217 10 "Ignoring step `.'")) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2218 ((string= ".." thisstep) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2219 (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
|
2220 10 "Processing step `..'") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2221 (pop result)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2222 ((stringp symlink-target) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2223 ;; It's a symlink, follow it. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2224 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2225 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2226 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
|
2227 (setq numchase (1+ numchase)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2228 (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
|
2229 (setq result nil)) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2230 ;; 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
|
2231 ;; "/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
|
2232 ;; "/some/target" part from it. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2233 (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
|
2234 (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
|
2235 (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
|
2236 (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
|
2237 sym-user sym-host)) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2238 (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
|
2239 symlink-target)) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2240 (setq symlink-target localname))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2241 (setq steps |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2242 (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
|
2243 (t |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2244 ;; It's a file. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2245 (setq result (cons thisstep result))))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2246 (when (>= numchase numchase-limit) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2247 (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
|
2248 (setq result (reverse result)) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2249 ;; Combine list to form string. |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2250 (setq result |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2251 (if result |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2252 (mapconcat 'identity (cons "" result) "/") |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2253 "/")) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2254 (when (and is-dir (or (string= "" result) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2255 (not (string= (substring result -1) "/")))) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2256 (setq result (concat result "/"))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2257 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2258 multi-method method user host |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2259 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
|
2260 (tramp-make-tramp-file-name |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2261 multi-method method user host result)))) |
45861 | 2262 |
2263 ;; Basic functions. | |
2264 | |
2265 (defun tramp-handle-file-exists-p (filename) | |
2266 "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
|
2267 (with-parsed-tramp-file-name filename nil |
45861 | 2268 (save-excursion |
2269 (zerop (tramp-send-command-and-check | |
2270 multi-method method user host | |
2271 (format | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2272 (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
|
2273 (tramp-shell-quote-argument localname))))))) |
45861 | 2274 |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2275 ;; 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
|
2276 ;; 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
|
2277 ;; 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
|
2278 ;; 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
|
2279 ;; (-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
|
2280 (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
|
2281 "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
|
2282 |
45861 | 2283 ;; CCC: This should check for an error condition and signal failure |
2284 ;; when something goes wrong. | |
2285 ;; Daniel Pittman <daniel@danann.net> | |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
2286 (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
|
2287 "Like `file-attributes' for tramp files." |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2288 (when (file-exists-p filename) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2289 ;; file exists, find out stuff |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2290 (unless id-format (setq id-format 'integer)) |
46752 | 2291 (with-parsed-tramp-file-name filename nil |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2292 (save-excursion |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2293 (tramp-convert-file-attributes |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2294 multi-method method user host |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2295 (if (tramp-get-remote-perl multi-method method user host) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2296 (tramp-handle-file-attributes-with-perl multi-method method user host |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2297 localname id-format) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2298 (tramp-handle-file-attributes-with-ls multi-method method user host |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2299 localname id-format))))))) |
45861 | 2300 |
2301 (defun tramp-handle-file-attributes-with-ls | |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2302 (multi-method method user host localname &optional id-format) |
45861 | 2303 "Implement `file-attributes' for tramp files using the ls(1) command." |
2304 (let (symlinkp dirp | |
2305 res-inode res-filemodes res-numlinks | |
2306 res-uid res-gid res-size res-symlink-target) | |
46752 | 2307 (tramp-message-for-buffer multi-method method user host 10 |
2308 "file attributes with ls: %s" | |
2309 (tramp-make-tramp-file-name | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2310 multi-method method user host localname)) |
45861 | 2311 (tramp-send-command |
2312 multi-method method user host | |
2313 (format "%s %s %s" | |
2314 (tramp-get-ls-command multi-method method user host) | |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2315 (if (eq id-format 'integer) "-ildn" "-ild") |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2316 (tramp-shell-quote-argument localname))) |
45861 | 2317 (tramp-wait-for-output) |
2318 ;; parse `ls -l' output ... | |
2319 ;; ... inode | |
2320 (setq res-inode | |
2321 (condition-case err | |
2322 (read (current-buffer)) | |
2323 (invalid-read-syntax | |
2324 (when (and (equal (cadr err) | |
2325 "Integer constant overflow in reader") | |
2326 (string-match | |
2327 "^[0-9]+\\([0-9][0-9][0-9][0-9][0-9]\\)\\'" | |
2328 (caddr err))) | |
2329 (let* ((big (read (substring (caddr err) 0 | |
2330 (match-beginning 1)))) | |
2331 (small (read (match-string 1 (caddr err)))) | |
2332 (twiddle (/ small 65536))) | |
2333 (cons (+ big twiddle) | |
2334 (- small (* twiddle 65536)))))))) | |
2335 ;; ... file mode flags | |
2336 (setq res-filemodes (symbol-name (read (current-buffer)))) | |
2337 ;; ... number links | |
2338 (setq res-numlinks (read (current-buffer))) | |
2339 ;; ... uid and gid | |
2340 (setq res-uid (read (current-buffer))) | |
2341 (setq res-gid (read (current-buffer))) | |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2342 (when (eq id-format 'integer) |
45861 | 2343 (unless (numberp res-uid) (setq res-uid -1)) |
2344 (unless (numberp res-gid) (setq res-gid -1))) | |
2345 ;; ... size | |
2346 (setq res-size (read (current-buffer))) | |
2347 ;; From the file modes, figure out other stuff. | |
2348 (setq symlinkp (eq ?l (aref res-filemodes 0))) | |
2349 (setq dirp (eq ?d (aref res-filemodes 0))) | |
2350 ;; if symlink, find out file name pointed to | |
2351 (when symlinkp | |
2352 (search-forward "-> ") | |
2353 (setq res-symlink-target | |
2354 (buffer-substring (point) | |
2355 (tramp-line-end-position)))) | |
2356 ;; return data gathered | |
2357 (list | |
2358 ;; 0. t for directory, string (name linked to) for symbolic | |
2359 ;; link, or nil. | |
2360 (or dirp res-symlink-target nil) | |
2361 ;; 1. Number of links to file. | |
2362 res-numlinks | |
2363 ;; 2. File uid. | |
2364 res-uid | |
2365 ;; 3. File gid. | |
2366 res-gid | |
2367 ;; 4. Last access time, as a list of two integers. First | |
2368 ;; integer has high-order 16 bits of time, second has low 16 | |
2369 ;; bits. | |
2370 ;; 5. Last modification time, likewise. | |
2371 ;; 6. Last status change time, likewise. | |
2372 '(0 0) '(0 0) '(0 0) ;CCC how to find out? | |
2373 ;; 7. Size in bytes (-1, if number is out of range). | |
2374 res-size | |
2375 ;; 8. File modes, as a string of ten letters or dashes as in ls -l. | |
2376 res-filemodes | |
2377 ;; 9. t iff file's gid would change if file were deleted and | |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2378 ;; recreated. Will be set in `tramp-convert-file-attributes' |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2379 t |
45861 | 2380 ;; 10. inode number. |
2381 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
|
2382 ;; 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
|
2383 -1 |
45861 | 2384 ))) |
2385 | |
2386 (defun tramp-handle-file-attributes-with-perl | |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2387 (multi-method method user host localname &optional id-format) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2388 "Implement `file-attributes' for tramp files using a Perl script." |
46752 | 2389 (tramp-message-for-buffer multi-method method user host 10 |
2390 "file attributes with perl: %s" | |
2391 (tramp-make-tramp-file-name | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2392 multi-method method user host localname)) |
59031
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
2393 (tramp-maybe-send-perl-script multi-method method user host |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
2394 tramp-perl-file-attributes |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
2395 "tramp_file_attributes") |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2396 (tramp-send-command multi-method method user host |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2397 (format "tramp_file_attributes %s %s" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2398 (tramp-shell-quote-argument localname) id-format)) |
45861 | 2399 (tramp-wait-for-output) |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2400 (read (current-buffer))) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2401 |
45861 | 2402 (defun tramp-handle-set-visited-file-modtime (&optional time-list) |
2403 "Like `set-visited-file-modtime' for tramp files." | |
2404 (unless (buffer-file-name) | |
2405 (error "Can't set-visited-file-modtime: buffer `%s' not visiting a file" | |
2406 (buffer-name))) | |
56644
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2407 (if time-list |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2408 (tramp-run-real-handler 'set-visited-file-modtime (list time-list)) |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
2409 (let ((f (buffer-file-name)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
2410 coding-system-used) |
56644
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2411 (with-parsed-tramp-file-name f nil |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2412 (let* ((attr (file-attributes f)) |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2413 ;; '(-1 65535) means file doesn't exists yet. |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2414 (modtime (or (nth 5 attr) '(-1 65535)))) |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
2415 (when (boundp 'last-coding-system-used) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
2416 (setq coding-system-used (symbol-value 'last-coding-system-used))) |
56644
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2417 ;; We use '(0 0) as a don't-know value. See also |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2418 ;; `tramp-handle-file-attributes-with-ls'. |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2419 (if (not (equal modtime '(0 0))) |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2420 (tramp-run-real-handler 'set-visited-file-modtime (list modtime)) |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2421 (save-excursion |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2422 (tramp-send-command |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2423 multi-method method user host |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2424 (format "%s -ild %s" |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2425 (tramp-get-ls-command multi-method method user host) |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2426 (tramp-shell-quote-argument localname))) |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2427 (tramp-wait-for-output) |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2428 (setq attr (buffer-substring (point) |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2429 (progn (end-of-line) (point))))) |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
2430 (setq tramp-buffer-file-attributes attr)) |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
2431 (when (boundp 'last-coding-system-used) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
2432 (set 'last-coding-system-used coding-system-used)) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
2433 nil))))) |
45861 | 2434 |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2435 ;; CCC continue here |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2436 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2437 ;; 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
|
2438 ;; `tramp-handle-set-visited-file-modtime'. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2439 (defun tramp-handle-verify-visited-file-modtime (buf) |
59031
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
2440 "Like `verify-visited-file-modtime' for tramp files. |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
2441 At the time `verify-visited-file-modtime' calls this function, we |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
2442 already know that the buffer is visiting a file and that |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
2443 `visited-file-modtime' does not return 0. Do not call this |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
2444 function directly, unless those two cases are already taken care |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
2445 of." |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2446 (with-current-buffer buf |
57559
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2447 ;; There is no file visiting the buffer, or the buffer has no |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2448 ;; recorded last modification time. |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2449 (if (or (not (buffer-file-name)) |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2450 (eq (visited-file-modtime) 0)) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
2451 t |
57559
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2452 (let ((f (buffer-file-name))) |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2453 (with-parsed-tramp-file-name f nil |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2454 (let* ((attr (file-attributes f)) |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2455 (modtime (nth 5 attr)) |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2456 (mt (visited-file-modtime))) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
2457 |
57559
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2458 (cond |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2459 ;; file exists, and has a known modtime. |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2460 ((and attr (not (equal modtime '(0 0)))) |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2461 (< (abs (tramp-time-diff |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2462 modtime |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2463 ;; For compatibility, deal with both the old |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2464 ;; (HIGH . LOW) and the new (HIGH LOW) |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2465 ;; return values of `visited-file-modtime'. |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2466 (if (atom (cdr mt)) |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2467 (list (car mt) (cdr mt)) |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2468 mt))) |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2469 2)) |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2470 ;; modtime has the don't know value. |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2471 (attr |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2472 (save-excursion |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2473 (tramp-send-command |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2474 multi-method method user host |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2475 (format "%s -ild %s" |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2476 (tramp-get-ls-command multi-method method user host) |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2477 (tramp-shell-quote-argument localname))) |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2478 (tramp-wait-for-output) |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2479 (setq attr (buffer-substring |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2480 (point) (progn (end-of-line) (point))))) |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2481 (equal tramp-buffer-file-attributes attr)) |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2482 ;; If file does not exist, say it is not modified |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2483 ;; if and only if that agrees with the buffer's record. |
07791c7d465b
* net/tramp.el: Redo sync with Tramp 2.0.45. Last commit did not
Michael Albinus <michael.albinus@gmx.de>
parents:
57463
diff
changeset
|
2484 (t (equal mt '(-1 65535)))))))))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2485 |
45861 | 2486 (defun tramp-handle-set-file-modes (filename mode) |
2487 "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
|
2488 (with-parsed-tramp-file-name filename nil |
45861 | 2489 (save-excursion |
2490 (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
|
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 "chmod %s %s" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2493 (tramp-decimal-to-octal mode) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2494 (tramp-shell-quote-argument localname)))) |
45861 | 2495 (signal 'file-error |
2496 (list "Doing chmod" | |
2497 ;; FIXME: extract the proper text from chmod's stderr. | |
2498 "error while changing file's mode" | |
2499 filename)))))) | |
2500 | |
2501 ;; Simple functions using the `test' command. | |
2502 | |
2503 (defun tramp-handle-file-executable-p (filename) | |
2504 "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
|
2505 (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
|
2506 (zerop (tramp-run-test "-x" filename)))) |
45861 | 2507 |
2508 (defun tramp-handle-file-readable-p (filename) | |
2509 "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
|
2510 (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
|
2511 (zerop (tramp-run-test "-r" filename)))) |
45861 | 2512 |
2513 (defun tramp-handle-file-accessible-directory-p (filename) | |
2514 "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
|
2515 (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
|
2516 (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
|
2517 (zerop (tramp-run-test "-r" filename)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2518 (zerop (tramp-run-test "-x" filename))))) |
45861 | 2519 |
2520 ;; When the remote shell is started, it looks for a shell which groks | |
2521 ;; tilde expansion. Here, we assume that all shells which grok tilde | |
2522 ;; expansion will also provide a `test' command which groks `-nt' (for | |
2523 ;; newer than). If this breaks, tell me about it and I'll try to do | |
2524 ;; something smarter about it. | |
2525 (defun tramp-handle-file-newer-than-file-p (file1 file2) | |
2526 "Like `file-newer-than-file-p' for tramp files." | |
2527 (cond ((not (file-exists-p file1)) | |
2528 nil) | |
2529 ((not (file-exists-p file2)) | |
2530 t) | |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2531 ;; We are sure both files exist at this point. |
45861 | 2532 (t |
2533 (save-excursion | |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2534 ;; 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
|
2535 ;; 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
|
2536 ;; and obtain the result. |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2537 (let ((fa1 (file-attributes file1)) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2538 (fa2 (file-attributes file2))) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2539 (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
|
2540 (not (equal (nth 5 fa2) '(0 0)))) |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
2541 (> 0 (tramp-time-diff (nth 5 fa2) (nth 5 fa1))) |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2542 ;; 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
|
2543 ;; 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
|
2544 ;; 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
|
2545 ;; 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
|
2546 ;; host. |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2547 (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
|
2548 (tramp-tramp-file-p file2)) |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2549 (signal |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2550 'file-error |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2551 (list |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2552 "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
|
2553 file1 file2))) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2554 (with-parsed-tramp-file-name file1 v1 |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2555 (with-parsed-tramp-file-name file2 v2 |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2556 (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
|
2557 (equal v1-method v2-method) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2558 (equal v1-user v2-user) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2559 (equal v1-host v2-host)) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2560 (signal 'file-error |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2561 (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
|
2562 file1 file2))) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2563 (unless (and (tramp-tramp-file-p file1) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2564 (tramp-tramp-file-p file2)) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2565 (signal 'file-error |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2566 (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
|
2567 file1 file2))) |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2568 (if (tramp-get-test-groks-nt |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2569 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
|
2570 (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
|
2571 (zerop (tramp-run-test2 |
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
2572 "tramp_test_nt" file1 file2))))))))))) |
45861 | 2573 |
2574 ;; Functions implemented using the basic functions above. | |
2575 | |
2576 (defun tramp-handle-file-modes (filename) | |
2577 "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
|
2578 (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
|
2579 (when (file-exists-p filename) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2580 (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
|
2581 (nth 8 (file-attributes filename)))))) |
45861 | 2582 |
2583 (defun tramp-handle-file-directory-p (filename) | |
2584 "Like `file-directory-p' for tramp files." | |
2585 ;; Care must be taken that this function returns `t' for symlinks | |
2586 ;; pointing to directories. Surely the most obvious implementation | |
2587 ;; would be `test -d', but that returns false for such symlinks. | |
2588 ;; CCC: Stefan Monnier says that `test -d' follows symlinks. And | |
2589 ;; I now think he's right. So we could be using `test -d', couldn't | |
2590 ;; we? | |
2591 ;; | |
2592 ;; 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
|
2593 (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
|
2594 (save-excursion |
45861 | 2595 (zerop |
2596 (tramp-send-command-and-check | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2597 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2598 (format "test -d %s" |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2599 (tramp-shell-quote-argument localname)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2600 t))))) ;run command in subshell |
45861 | 2601 |
2602 (defun tramp-handle-file-regular-p (filename) | |
2603 "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
|
2604 (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
|
2605 (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
|
2606 (eq ?- (aref (nth 8 (file-attributes filename)) 0))))) |
45861 | 2607 |
2608 (defun tramp-handle-file-symlink-p (filename) | |
2609 "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
|
2610 (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
|
2611 (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
|
2612 (when (stringp x) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2613 ;; 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
|
2614 ;; might do weird things. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2615 (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
|
2616 (tramp-make-tramp-file-name |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2617 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
|
2618 x))))) |
45861 | 2619 |
2620 (defun tramp-handle-file-writable-p (filename) | |
2621 "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
|
2622 (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
|
2623 (if (file-exists-p filename) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2624 ;; Existing files must be writable. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2625 (zerop (tramp-run-test "-w" filename)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2626 ;; 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
|
2627 (and (zerop (tramp-run-test |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
2628 "-d" (file-name-directory filename))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2629 (zerop (tramp-run-test |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
2630 "-w" (file-name-directory filename))))))) |
45861 | 2631 |
2632 (defun tramp-handle-file-ownership-preserved-p (filename) | |
2633 "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
|
2634 (with-parsed-tramp-file-name filename nil |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2635 (let ((attributes (file-attributes filename))) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2636 ;; Return t if the file doesn't exist, since it's true that no |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2637 ;; information would be lost by an (attempted) delete and create. |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2638 (or (null attributes) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2639 (= (nth 2 attributes) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2640 (tramp-get-remote-uid multi-method method user host)))))) |
45861 | 2641 |
2642 ;; Other file name ops. | |
2643 | |
50494
5b6aaf393205
Version 2.0.33 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50432
diff
changeset
|
2644 ;; ;; Matthias K,Av(Bppe <mkoeppe@mail.math.uni-magdeburg.de> |
45861 | 2645 ;; (defun tramp-handle-directory-file-name (directory) |
2646 ;; "Like `directory-file-name' for tramp files." | |
2647 ;; (if (and (eq (aref directory (- (length directory) 1)) ?/) | |
2648 ;; (not (eq (aref directory (- (length directory) 2)) ?:))) | |
2649 ;; (substring directory 0 (- (length directory) 1)) | |
2650 ;; directory)) | |
2651 | |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2652 ;; ;; 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
|
2653 ;; (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
|
2654 ;; "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
|
2655 ;; (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
|
2656 ;; (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
|
2657 ;; (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
|
2658 ;; (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
|
2659 ;; (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
|
2660 ;; (/= (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
|
2661 ;; (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
|
2662 ;; directory))))) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2663 |
45861 | 2664 (defun tramp-handle-directory-file-name (directory) |
2665 "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
|
2666 ;; 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
|
2667 ;; 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
|
2668 ;; 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
|
2669 ;; to avoid parsing the filename? |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2670 (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
|
2671 (if (and (not (zerop (length localname))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2672 (eq (aref localname (1- (length localname))) ?/) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2673 (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
|
2674 (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
|
2675 directory))) |
45861 | 2676 |
2677 ;; Directory listings. | |
2678 | |
46752 | 2679 (defun tramp-handle-directory-files (directory |
2680 &optional full match nosort files-only) | |
45861 | 2681 "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
|
2682 (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
|
2683 (let (result x) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2684 (save-excursion |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2685 (tramp-barf-unless-okay |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2686 multi-method method user host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2687 (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
|
2688 nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2689 'file-error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2690 "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
|
2691 (tramp-shell-quote-argument localname)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2692 (tramp-send-command |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2693 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2694 (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
|
2695 " -a | cat")) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2696 (tramp-wait-for-output) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2697 (goto-char (point-max)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2698 (while (zerop (forward-line -1)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2699 (setq x (buffer-substring (point) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2700 (tramp-line-end-position))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2701 (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
|
2702 (if full |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2703 (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
|
2704 x) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2705 result) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2706 (push x result)))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2707 (tramp-send-command multi-method method user host "cd") |
46752 | 2708 (tramp-wait-for-output) |
2709 ;; Remove non-files or non-directories if necessary. Using | |
2710 ;; the remote shell for this would probably be way faster. | |
2711 ;; Maybe something could be adapted from | |
2712 ;; tramp-handle-file-name-all-completions. | |
2713 (when files-only | |
2714 (let ((temp (nreverse result)) | |
2715 item) | |
2716 (setq result nil) | |
2717 (if (equal files-only t) | |
2718 ;; files only | |
2719 (while temp | |
2720 (setq item (pop temp)) | |
2721 (when (file-regular-p item) | |
2722 (push item result))) | |
2723 ;; directories only | |
2724 (while temp | |
2725 (setq item (pop temp)) | |
2726 (when (file-directory-p item) | |
2727 (push item result))))))) | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2728 result))) |
45861 | 2729 |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2730 (defun tramp-handle-directory-files-and-attributes |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2731 (directory &optional full match nosort id-format) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2732 "Like `directory-files-and-attributes' for tramp files." |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2733 (when (tramp-handle-file-exists-p directory) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2734 (save-excursion |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2735 (setq directory (tramp-handle-expand-file-name directory)) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2736 (with-parsed-tramp-file-name directory nil |
59031
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
2737 (tramp-maybe-send-perl-script multi-method method user host |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
2738 tramp-perl-directory-files-and-attributes |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
2739 "tramp_directory_files_and_attributes") |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2740 (tramp-send-command multi-method method user host |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2741 (format "tramp_directory_files_and_attributes %s %s" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2742 (tramp-shell-quote-argument localname) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2743 (or id-format 'integer))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2744 (tramp-wait-for-output) |
65926
e465f3508fd5
(tramp-perl-directory-files-and-attributes): Add error handling.
Lars Hansen <larsh@soem.dk>
parents:
65925
diff
changeset
|
2745 (let* ((root (cons nil (let ((object (read (current-buffer)))) |
e465f3508fd5
(tramp-perl-directory-files-and-attributes): Add error handling.
Lars Hansen <larsh@soem.dk>
parents:
65925
diff
changeset
|
2746 (when (stringp object) |
e465f3508fd5
(tramp-perl-directory-files-and-attributes): Add error handling.
Lars Hansen <larsh@soem.dk>
parents:
65925
diff
changeset
|
2747 (error object)) |
e465f3508fd5
(tramp-perl-directory-files-and-attributes): Add error handling.
Lars Hansen <larsh@soem.dk>
parents:
65925
diff
changeset
|
2748 object))) |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2749 (cell root)) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2750 (while (cdr cell) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2751 (if (and match (not (string-match match (caadr cell)))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2752 ;; Remove from list |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2753 (setcdr cell (cddr cell)) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2754 ;; Include in list |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2755 (setq cell (cdr cell)) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2756 (let ((l (car cell))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2757 (tramp-convert-file-attributes multi-method method user host |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2758 (cdr l)) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2759 ;; If FULL, make file name absolute |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2760 (when full (setcar l (concat directory "/" (car l))))))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2761 (if nosort |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2762 (cdr root) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2763 (sort (cdr root) (lambda (x y) (string< (car x) (car y)))))))))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2764 |
45861 | 2765 ;; This function should return "foo/" for directories and "bar" for |
2766 ;; files. We use `ls -ad' to get a list of files (including | |
2767 ;; directories), and `find . -type d \! -name . -prune' to get a list | |
2768 ;; of directories. | |
2769 (defun tramp-handle-file-name-all-completions (filename directory) | |
2770 "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
|
2771 (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
|
2772 (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
|
2773 (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
|
2774 result) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2775 (save-excursion |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2776 (tramp-barf-unless-okay |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2777 multi-method method user host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2778 (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
|
2779 nil 'file-error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2780 "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
|
2781 (tramp-shell-quote-argument localname)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2782 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2783 ;; 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
|
2784 ;; 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
|
2785 ;; rock. --daniel@danann.net |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2786 (tramp-send-command |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2787 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2788 (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
|
2789 "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
|
2790 "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
|
2791 (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
|
2792 (if (or nowild (zerop (length filename))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2793 "" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2794 (format "-d %s*" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2795 (tramp-shell-quote-argument filename))))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2796 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2797 ;; Now grab the output. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2798 (tramp-wait-for-output) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2799 (goto-char (point-max)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2800 (while (zerop (forward-line -1)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2801 (push (buffer-substring (point) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2802 (tramp-line-end-position)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2803 result)) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
2804 |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2805 (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
|
2806 (tramp-wait-for-output) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2807 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2808 ;; Return the list. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2809 (if nowild |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2810 (all-completions filename (mapcar 'list result)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2811 result)))))) |
45861 | 2812 |
2813 | |
2814 ;; The following isn't needed for Emacs 20 but for 19.34? | |
2815 (defun tramp-handle-file-name-completion (filename directory) | |
2816 "Like `file-name-completion' for tramp files." | |
2817 (unless (tramp-tramp-file-p directory) | |
2818 (error | |
2819 "tramp-handle-file-name-completion invoked on non-tramp directory `%s'" | |
2820 directory)) | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2821 (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
|
2822 (try-completion |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2823 filename |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2824 (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
|
2825 (file-name-all-completions filename directory))))) |
45861 | 2826 |
2827 ;; cp, mv and ln | |
2828 | |
2829 (defun tramp-handle-add-name-to-file | |
2830 (filename newname &optional ok-if-already-exists) | |
2831 "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
|
2832 (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
|
2833 (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
|
2834 (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
|
2835 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
|
2836 (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
|
2837 (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
|
2838 (equal v1-method v2-method) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2839 (equal v1-user v2-user) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2840 (equal v1-host v2-host)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2841 (error "add-name-to-file: %s" |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2842 "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
|
2843 (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
|
2844 (file-exists-p newname) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2845 (not (numberp ok-if-already-exists)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2846 (y-or-n-p |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2847 (format |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2848 "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
|
2849 newname))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2850 (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
|
2851 (tramp-barf-unless-okay |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2852 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
|
2853 (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
|
2854 (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
|
2855 nil 'file-error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
2856 "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
|
2857 (buffer-name)))))) |
45861 | 2858 |
2859 (defun tramp-handle-copy-file | |
2860 (filename newname &optional ok-if-already-exists keep-date) | |
2861 "Like `copy-file' for tramp files." | |
2862 ;; Check if both files are local -- invoke normal copy-file. | |
2863 ;; Otherwise, use tramp from local system. | |
2864 (setq filename (expand-file-name filename)) | |
2865 (setq newname (expand-file-name newname)) | |
2866 ;; At least one file a tramp file? | |
2867 (if (or (tramp-tramp-file-p filename) | |
2868 (tramp-tramp-file-p newname)) | |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
2869 (tramp-do-copy-or-rename-file |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
2870 'copy filename newname ok-if-already-exists keep-date) |
45861 | 2871 (tramp-run-real-handler |
2872 'copy-file | |
2873 (list filename newname ok-if-already-exists keep-date)))) | |
2874 | |
2875 (defun tramp-handle-rename-file | |
2876 (filename newname &optional ok-if-already-exists) | |
2877 "Like `rename-file' for tramp files." | |
2878 ;; Check if both files are local -- invoke normal rename-file. | |
2879 ;; Otherwise, use tramp from local system. | |
2880 (setq filename (expand-file-name filename)) | |
2881 (setq newname (expand-file-name newname)) | |
2882 ;; At least one file a tramp file? | |
2883 (if (or (tramp-tramp-file-p filename) | |
2884 (tramp-tramp-file-p newname)) | |
2885 (tramp-do-copy-or-rename-file | |
2886 'rename filename newname ok-if-already-exists) | |
2887 (tramp-run-real-handler 'rename-file | |
2888 (list filename newname ok-if-already-exists)))) | |
2889 | |
2890 (defun tramp-do-copy-or-rename-file | |
2891 (op filename newname &optional ok-if-already-exists keep-date) | |
2892 "Copy or rename a remote file. | |
2893 OP must be `copy' or `rename' and indicates the operation to perform. | |
2894 FILENAME specifies the file to copy or rename, NEWNAME is the name of | |
2895 the new file (for copy) or the new name of the file (for rename). | |
2896 OK-IF-ALREADY-EXISTS means don't barf if NEWNAME exists already. | |
2897 KEEP-DATE means to make sure that NEWNAME has the same timestamp | |
2898 as FILENAME. | |
2899 | |
2900 This function is invoked by `tramp-handle-copy-file' and | |
2901 `tramp-handle-rename-file'. It is an error if OP is neither of `copy' | |
2902 and `rename'. FILENAME and NEWNAME must be absolute file names." | |
2903 (unless (memq op '(copy rename)) | |
2904 (error "Unknown operation `%s', must be `copy' or `rename'" op)) | |
2905 (unless ok-if-already-exists | |
2906 (when (file-exists-p newname) | |
2907 (signal 'file-already-exists | |
2908 (list newname)))) | |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2909 (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
|
2910 (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
|
2911 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
|
2912 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
|
2913 |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2914 ;; 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
|
2915 ;; 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
|
2916 ;; 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
|
2917 (if t1 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2918 (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
|
2919 (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
|
2920 v1-method l-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2921 v1-user l-user |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2922 v1-host l-host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2923 v1-localname l-localname)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2924 (setq v1-localname filename)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2925 (if t2 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2926 (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
|
2927 (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
|
2928 v2-method l-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2929 v2-user l-user |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2930 v2-host l-host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2931 v2-localname l-localname)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2932 (setq v2-localname newname)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2933 |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2934 (cond |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2935 ;; Both are Tramp files. |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
2936 ((and t1 t2) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2937 (cond |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2938 ;; 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
|
2939 ;; 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
|
2940 ;; directly. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2941 ((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
|
2942 (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
|
2943 (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
|
2944 (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
|
2945 (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
|
2946 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
|
2947 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
|
2948 ;; 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
|
2949 ;; 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
|
2950 ;; 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
|
2951 ;; 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
|
2952 ;; 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
|
2953 ((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
|
2954 (not v2-multi-method) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2955 (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
|
2956 (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
|
2957 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
|
2958 (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
|
2959 (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
|
2960 (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
|
2961 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
|
2962 ;; 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
|
2963 ;; 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
|
2964 ;; 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
|
2965 ;; 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
|
2966 ;; 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
|
2967 ;; 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
|
2968 ;; 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
|
2969 ;; 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
|
2970 ;; source and target file. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2971 (t |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2972 (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
|
2973 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
|
2974 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2975 ;; 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
|
2976 ((or t1 t2) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2977 ;; 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
|
2978 ;; 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
|
2979 (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
|
2980 (not v2-multi-method) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2981 (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
|
2982 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
|
2983 (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
|
2984 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
|
2985 (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
|
2986 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
|
2987 ;; 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
|
2988 (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
|
2989 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
|
2990 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2991 (t |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2992 ;; 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
|
2993 (error "Tramp implementation says this cannot happen"))))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2994 |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2995 (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
|
2996 "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
|
2997 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
|
2998 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
|
2999 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
|
3000 (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
|
3001 (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
|
3002 (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
|
3003 (tramp-message |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
3004 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
|
3005 " with inline copying across machines"))) |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
3006 (save-excursion |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
3007 (set-buffer trampbuf) (erase-buffer) |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
3008 (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
|
3009 ;; 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
|
3010 ;; `jka-compr-inhibit' to t. |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3011 (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
|
3012 (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
|
3013 (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
|
3014 ;; KEEP-DATE handling. |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3015 (when keep-date |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3016 (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
|
3017 (not (equal modtime '(0 0)))) |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3018 (tramp-touch newname modtime))) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3019 ;; Set the mode. |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3020 (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
|
3021 ;; 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
|
3022 (unless (eq op 'copy) |
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
3023 (delete-file filename)))) |
45861 | 3024 |
3025 (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
|
3026 (op multi-method method user host localname1 localname2 keep-date) |
45861 | 3027 "Invokes `cp' or `mv' on the remote system. |
3028 OP must be one of `copy' or `rename', indicating `cp' or `mv', | |
3029 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
|
3030 LOCALNAME1 and LOCALNAME2 specify the two arguments of `cp' or `mv'. |
45861 | 3031 If KEEP-DATE is non-nil, preserve the time stamp when copying." |
3032 ;; CCC: What happens to the timestamp when renaming? | |
3033 (let ((cmd (cond ((and (eq op 'copy) keep-date) "cp -f -p") | |
3034 ((eq op 'copy) "cp -f") | |
3035 ((eq op 'rename) "mv -f") | |
3036 (t (error | |
3037 "Unknown operation `%s', must be `copy' or `rename'" | |
3038 op))))) | |
3039 (save-excursion | |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3040 (tramp-send-command |
45861 | 3041 multi-method method user host |
3042 (format "%s %s %s" | |
3043 cmd | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3044 (tramp-shell-quote-argument localname1) |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3045 (tramp-shell-quote-argument localname2))) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3046 (tramp-wait-for-output) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3047 (goto-char (point-min)) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3048 (unless |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3049 (or |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3050 (and (eq op 'copy) keep-date |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3051 ;; Mask cp -f error. |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3052 (re-search-forward tramp-operation-not-permitted-regexp nil t)) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3053 (zerop (tramp-send-command-and-check |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3054 multi-method method user host nil nil))) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3055 (pop-to-buffer (current-buffer)) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3056 (signal 'file-error |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3057 (format "Copying directly failed, see buffer `%s' for details." |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3058 (buffer-name))))) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3059 ;; Set the mode. |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3060 ;; CCC: Maybe `chmod --reference=localname1 localname2' could be used |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3061 ;; where available? |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3062 (unless (or (eq op 'rename) keep-date) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3063 (set-file-modes |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3064 (tramp-make-tramp-file-name multi-method method user host localname2) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3065 (file-modes |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3066 (tramp-make-tramp-file-name |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3067 multi-method method user host localname1)))))) |
45861 | 3068 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3069 (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
|
3070 "Invoke rcp program to copy. |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3071 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
|
3072 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
|
3073 (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
|
3074 (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
|
3075 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
|
3076 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
|
3077 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
|
3078 source target trampbuf) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3079 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3080 ;; 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
|
3081 ;; 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
|
3082 ;; 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
|
3083 (if t1 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3084 (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
|
3085 (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
|
3086 v1-method l-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3087 v1-user l-user |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3088 v1-host l-host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3089 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
|
3090 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
|
3091 method (tramp-find-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3092 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
|
3093 user l-user |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3094 host l-host |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3095 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
|
3096 v1-multi-method method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3097 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
|
3098 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
|
3099 v1-multi-method method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3100 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
|
3101 (setq v1-localname filename)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3102 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3103 (if t2 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3104 (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
|
3105 (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
|
3106 v2-method l-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3107 v2-user l-user |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3108 v2-host l-host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3109 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
|
3110 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
|
3111 method (tramp-find-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3112 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
|
3113 user l-user |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3114 host l-host |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3115 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
|
3116 v2-multi-method method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3117 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
|
3118 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
|
3119 v2-multi-method method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3120 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
|
3121 (setq v2-localname newname)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3122 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3123 ;; 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
|
3124 ;; 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
|
3125 (if (not t1) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3126 (setq source v1-localname) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3127 (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
|
3128 (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
|
3129 (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
|
3130 (setq source |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3131 (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
|
3132 v1-user v1-host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3133 (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
|
3134 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3135 (if (not t2) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3136 (setq target v2-localname) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3137 (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
|
3138 (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
|
3139 (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
|
3140 (setq target |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3141 (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
|
3142 v2-user v2-host |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3143 (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
|
3144 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3145 ;; Handle keep-date argument |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3146 (when keep-date |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3147 (if t1 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3148 (setq copy-args |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3149 (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
|
3150 v1-multi-method method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3151 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
|
3152 copy-args)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3153 (setq copy-args |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3154 (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
|
3155 v2-multi-method method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3156 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
|
3157 copy-args)))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3158 |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3159 (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
|
3160 trampbuf (generate-new-buffer |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3161 (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
|
3162 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3163 ;; 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
|
3164 (save-excursion |
59031
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
3165 |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
3166 ;; Check for program. |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
3167 (when (and (fboundp 'executable-find) |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
3168 (not (executable-find copy-program))) |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
3169 (error "Cannot find copy program: %s" copy-program)) |
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
3170 |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3171 (set-buffer trampbuf) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3172 (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
|
3173 tramp-current-method method |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3174 tramp-current-user user |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3175 tramp-current-host host) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
3176 (message "Transferring %s to %s..." filename newname) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3177 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3178 ;; 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
|
3179 (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
|
3180 copy-program copy-args))) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3181 (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
|
3182 (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
|
3183 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
|
3184 (kill-buffer trampbuf) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
3185 (message "Transferring %s to %s...done" filename newname) |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3186 |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3187 ;; Set the mode. |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3188 (unless keep-date |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3189 (set-file-modes newname (file-modes filename)))) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3190 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3191 ;; 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
|
3192 (unless (eq op 'copy) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3193 (delete-file filename)))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3194 |
45861 | 3195 ;; mkdir |
3196 (defun tramp-handle-make-directory (dir &optional parents) | |
3197 "Like `make-directory' for tramp files." | |
46752 | 3198 (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
|
3199 (with-parsed-tramp-file-name dir nil |
46790 | 3200 (save-excursion |
3201 (tramp-barf-unless-okay | |
3202 multi-method method user host | |
3203 (format " %s %s" | |
3204 (if parents "mkdir -p" "mkdir") | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3205 (tramp-shell-quote-argument localname)) |
46790 | 3206 nil 'file-error |
3207 "Couldn't make directory %s" dir)))) | |
45861 | 3208 |
3209 ;; CCC error checking? | |
3210 (defun tramp-handle-delete-directory (directory) | |
3211 "Like `delete-directory' for tramp files." | |
46752 | 3212 (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
|
3213 (with-parsed-tramp-file-name directory nil |
45861 | 3214 (save-excursion |
3215 (tramp-send-command | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3216 multi-method method user host |
45861 | 3217 (format "rmdir %s ; echo ok" |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3218 (tramp-shell-quote-argument localname))) |
45861 | 3219 (tramp-wait-for-output)))) |
3220 | |
3221 (defun tramp-handle-delete-file (filename) | |
3222 "Like `delete-file' for tramp files." | |
46752 | 3223 (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
|
3224 (with-parsed-tramp-file-name filename nil |
46048
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
3225 (save-excursion |
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
3226 (unless (zerop (tramp-send-command-and-check |
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
3227 multi-method method user host |
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
3228 (format "rm -f %s" |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3229 (tramp-shell-quote-argument localname)))) |
46048
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
3230 (signal 'file-error "Couldn't delete Tramp file"))))) |
45861 | 3231 |
3232 ;; Dired. | |
3233 | |
3234 ;; CCC: This does not seem to be enough. Something dies when | |
3235 ;; we try and delete two directories under TRAMP :/ | |
3236 (defun tramp-handle-dired-recursive-delete-directory (filename) | |
3237 "Recursively delete the directory given. | |
3238 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
|
3239 (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
|
3240 ;; run a shell command 'rm -r <localname>' |
45861 | 3241 ;; 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
|
3242 (or (file-exists-p filename) |
45861 | 3243 (signal |
3244 'file-error | |
3245 (list "Removing old file name" "no such directory" filename))) | |
3246 ;; Which is better, -r or -R? (-r works for me <daniel@danann.net>) | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
3247 (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
|
3248 (format "rm -r %s" (tramp-shell-quote-argument localname))) |
45861 | 3249 ;; Wait for the remote system to return to us... |
3250 ;; This might take a while, allow it plenty of time. | |
3251 (tramp-wait-for-output 120) | |
3252 ;; Make sure that it worked... | |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3253 (and (file-exists-p filename) |
59031
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
3254 (error "Failed to recursively delete %s" filename)))) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
3255 |
45861 | 3256 (defun tramp-handle-dired-call-process (program discard &rest arguments) |
3257 "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
|
3258 (with-parsed-tramp-file-name default-directory nil |
45861 | 3259 (save-excursion |
3260 (tramp-barf-unless-okay | |
3261 multi-method method user host | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3262 (format "cd %s" (tramp-shell-quote-argument localname)) |
45861 | 3263 nil 'file-error |
3264 "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
|
3265 (tramp-shell-quote-argument localname)) |
45861 | 3266 (tramp-send-command |
3267 multi-method method user host | |
3268 (mapconcat #'tramp-shell-quote-argument (cons program arguments) " ")) | |
3269 (tramp-wait-for-output)) | |
3270 (unless discard | |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3271 ;; We cannot use `insert-buffer' because the tramp buffer |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3272 ;; changes its contents before insertion due to calling |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3273 ;; `expand-file' and alike. |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3274 (insert |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3275 (with-current-buffer |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3276 (tramp-get-buffer multi-method method user host) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3277 (buffer-string)))) |
45861 | 3278 (save-excursion |
3279 (prog1 | |
3280 (tramp-send-command-and-check multi-method method user host nil) | |
3281 (tramp-send-command multi-method method user host "cd") | |
3282 (tramp-wait-for-output))))) | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
3283 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3284 (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
|
3285 "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
|
3286 ;; 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
|
3287 ;; 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
|
3288 (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
|
3289 (save-excursion |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3290 (let ((suffixes |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3291 (if (not (featurep 'xemacs)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3292 ;; Emacs case |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3293 (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
|
3294 ;; 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
|
3295 ;; 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
|
3296 (mapcar |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3297 '(lambda (x) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3298 (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
|
3299 nil |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3300 (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
|
3301 (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
|
3302 suffix) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3303 ;; 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
|
3304 (while suffixes |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3305 (let (case-fold-search) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3306 (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
|
3307 (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
|
3308 (setq suffixes (cdr suffixes)))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3309 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3310 (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
|
3311 nil) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3312 ((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
|
3313 ;; 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
|
3314 (message "Uncompressing %s..." file) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3315 (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
|
3316 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
|
3317 (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
|
3318 (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
|
3319 ;; `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
|
3320 (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
|
3321 (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
|
3322 (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
|
3323 (t |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3324 ;; 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
|
3325 ;; Try gzip. |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3326 (message "Compressing %s..." file) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3327 (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
|
3328 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
|
3329 (concat "gzip -f " localname))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3330 (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
|
3331 ;; `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
|
3332 (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
|
3333 (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
|
3334 (concat file ".gz")) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3335 ((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
|
3336 (concat file ".z")) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3337 (t nil))))))))) |
45861 | 3338 |
3339 ;; Pacify byte-compiler. The function is needed on XEmacs only. I'm | |
3340 ;; not sure at all that this is the right way to do it, but let's hope | |
3341 ;; it works for now, and wait for a guru to point out the Right Way to | |
3342 ;; achieve this. | |
3343 ;;(eval-when-compile | |
3344 ;; (unless (fboundp 'dired-insert-set-properties) | |
3345 ;; (fset 'dired-insert-set-properties 'ignore))) | |
3346 ;; Gerd suggests this: | |
3347 (eval-when-compile (require 'dired)) | |
3348 ;; Note that dired is required at run-time, too, when it is needed. | |
3349 ;; It is only needed on XEmacs for the function | |
3350 ;; `dired-insert-set-properties'. | |
3351 | |
3352 (defun tramp-handle-insert-directory | |
3353 (filename switches &optional wildcard full-directory-p) | |
3354 "Like `insert-directory' for tramp files." | |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3355 (if (and (boundp 'ls-lisp-use-insert-directory-program) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
3356 (not (symbol-value 'ls-lisp-use-insert-directory-program))) |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3357 (tramp-run-real-handler 'insert-directory |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3358 (list filename switches wildcard full-directory-p)) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3359 ;; For the moment, we assume that the remote "ls" program does not |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3360 ;; grok "--dired". In the future, we should detect this on |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3361 ;; connection setup. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3362 (when (string-match "^--dired\\s-+" switches) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3363 (setq switches (replace-match "" nil t switches))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3364 (setq filename (expand-file-name filename)) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3365 (with-parsed-tramp-file-name filename nil |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3366 (tramp-message-for-buffer |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3367 multi-method method user host 10 |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3368 "Inserting directory `ls %s %s', wildcard %s, fulldir %s" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3369 switches filename (if wildcard "yes" "no") |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3370 (if full-directory-p "yes" "no")) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3371 (when wildcard |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3372 (setq wildcard (file-name-nondirectory localname)) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3373 (setq localname (file-name-directory localname))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3374 (when (listp switches) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3375 (setq switches (mapconcat 'identity switches " "))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3376 (unless full-directory-p |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3377 (setq switches (concat "-d " switches))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3378 (when wildcard |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3379 (setq switches (concat switches " " wildcard))) |
45861 | 3380 (save-excursion |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3381 ;; If `full-directory-p', we just say `ls -l FILENAME'. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3382 ;; Else we chdir to the parent directory, then say `ls -ld BASENAME'. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3383 (if full-directory-p |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3384 (tramp-send-command |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3385 multi-method method user host |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3386 (format "%s %s %s" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3387 (tramp-get-ls-command multi-method method user host) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3388 switches |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3389 (if wildcard |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3390 localname |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3391 (tramp-shell-quote-argument (concat localname "."))))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3392 (tramp-barf-unless-okay |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3393 multi-method method user host |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3394 (format "cd %s" (tramp-shell-quote-argument |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3395 (file-name-directory localname))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3396 nil 'file-error |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3397 "Couldn't `cd %s'" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3398 (tramp-shell-quote-argument (file-name-directory localname))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3399 (tramp-send-command |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3400 multi-method method user host |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3401 (format "%s %s %s" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3402 (tramp-get-ls-command multi-method method user host) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3403 switches |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3404 (if wildcard |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3405 localname |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3406 (if (zerop (length (file-name-nondirectory localname))) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3407 "" |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3408 (tramp-shell-quote-argument |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3409 (file-name-nondirectory localname))))))) |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3410 (sit-for 1) ;needed for rsh but not ssh? |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3411 (tramp-wait-for-output)) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3412 ;; The following let-binding is used by code that's commented |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3413 ;; out. Let's leave the let-binding in for a while to see |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3414 ;; that the commented-out code is really not needed. Commenting-out |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3415 ;; happened on 2003-03-13. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3416 (let ((old-pos (point))) |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3417 ;; We cannot use `insert-buffer' because the tramp buffer |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3418 ;; changes its contents before insertion due to calling |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3419 ;; `expand-file' and alike. |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3420 (insert |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3421 (with-current-buffer |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3422 (tramp-get-buffer multi-method method user host) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3423 (buffer-string))) |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3424 ;; On XEmacs, we want to call (exchange-point-and-mark t), but |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3425 ;; that doesn't exist on Emacs, so we use this workaround instead. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3426 ;; Since zmacs-region-stays doesn't exist in Emacs, this ought to |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3427 ;; be safe. Thanks to Daniel Pittman <daniel@danann.net>. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3428 ;; (let ((zmacs-region-stays t)) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3429 ;; (exchange-point-and-mark)) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3430 (save-excursion |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3431 (tramp-send-command multi-method method user host "cd") |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3432 (tramp-wait-for-output)) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3433 ;; For the time being, the XEmacs kludge is commented out. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3434 ;; Please test it on various XEmacs versions to see if it works. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3435 ;; ;; Another XEmacs specialty follows. What's the right way to do |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3436 ;; ;; it? |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3437 ;; (when (and (featurep 'xemacs) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3438 ;; (eq major-mode 'dired-mode)) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3439 ;; (save-excursion |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3440 ;; (require 'dired) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3441 ;; (dired-insert-set-properties old-pos (point)))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3442 )))) |
45861 | 3443 |
3444 ;; Continuation of kluge to pacify byte-compiler. | |
3445 ;;(eval-when-compile | |
3446 ;; (when (eq (symbol-function 'dired-insert-set-properties) 'ignore) | |
3447 ;; (fmakunbound 'dired-insert-set-properties))) | |
3448 | |
3449 ;; CCC is this the right thing to do? | |
3450 (defun tramp-handle-unhandled-file-name-directory (filename) | |
3451 "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
|
3452 (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
|
3453 (expand-file-name "~/"))) |
45861 | 3454 |
3455 ;; Canonicalization of file names. | |
3456 | |
3457 (defun tramp-drop-volume-letter (name) | |
3458 "Cut off unnecessary drive letter from file NAME. | |
3459 The function `tramp-handle-expand-file-name' calls `expand-file-name' | |
3460 locally on a remote file name. When the local system is a W32 system | |
3461 but the remote system is Unix, this introduces a superfluous drive | |
3462 letter into the file name. This function removes it. | |
3463 | |
3464 Doesn't do anything if the NAME does not start with a drive letter." | |
3465 (if (and (> (length name) 1) | |
3466 (char-equal (aref name 1) ?:) | |
3467 (let ((c1 (aref name 0))) | |
3468 (or (and (>= c1 ?A) (<= c1 ?Z)) | |
3469 (and (>= c1 ?a) (<= c1 ?z))))) | |
3470 (substring name 2) | |
3471 name)) | |
3472 | |
3473 (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
|
3474 "Like `expand-file-name' for tramp files. |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3475 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
|
3476 the result will be a local, non-Tramp, filename." |
45861 | 3477 ;; If DIR is not given, use DEFAULT-DIRECTORY or "/". |
3478 (setq dir (or dir default-directory "/")) | |
3479 ;; Unless NAME is absolute, concat DIR and NAME. | |
3480 (unless (file-name-absolute-p name) | |
3481 (setq name (concat (file-name-as-directory dir) name))) | |
3482 ;; If NAME is not a tramp file, run the real handler | |
3483 (if (not (tramp-tramp-file-p name)) | |
3484 (tramp-run-real-handler 'expand-file-name | |
3485 (list name nil)) | |
3486 ;; Dissect NAME. | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3487 (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
|
3488 (unless (file-name-absolute-p localname) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3489 (setq localname (concat "~/" localname))) |
45861 | 3490 (save-excursion |
3491 ;; Tilde expansion if necessary. This needs a shell which | |
3492 ;; groks tilde expansion! The function `tramp-find-shell' is | |
3493 ;; supposed to find such a shell on the remote host. Please | |
3494 ;; 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
|
3495 (when (string-match "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3496 (let ((uname (match-string 1 localname)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3497 (fname (match-string 2 localname))) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3498 ;; We cannot simply apply "~/", because under sudo "~/" is |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3499 ;; expanded to the local user home directory but to the |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3500 ;; root home directory. On the other hand, using always |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3501 ;; the default user name for tilde expansion is not |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3502 ;; appropriate either, because ssh and companions might |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3503 ;; use a user name from the config file. |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3504 (when (and (string-equal uname "~") |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3505 (string-match |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3506 "\\`su\\(do\\)?\\'" |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3507 (tramp-find-method multi-method method user host))) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3508 (setq uname (concat uname (or user "root")))) |
45861 | 3509 ;; CCC fanatic error checking? |
3510 (set-buffer (tramp-get-buffer multi-method method user host)) | |
3511 (erase-buffer) | |
3512 (tramp-send-command | |
3513 multi-method method user host | |
3514 (format "cd %s; pwd" uname) | |
3515 t) | |
3516 (tramp-wait-for-output) | |
3517 (goto-char (point-min)) | |
3518 (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
|
3519 (setq localname (concat uname fname)) |
45861 | 3520 (erase-buffer))) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3521 ;; There might be a double slash, for example when "~/" |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3522 ;; expands to "/". Remove this. |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3523 (while (string-match "//" localname) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3524 (setq localname (replace-match "/" t t localname))) |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3525 ;; 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
|
3526 ;; expand-file-name (this does "/./" and "/../"). We bind |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3527 ;; directory-sep-char here for XEmacs on Windows, which would |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3528 ;; otherwise use backslash. `default-directory' is bound to |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3529 ;; "/", because on Windows there would be problems with UNC |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3530 ;; shares or Cygwin mounts. |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3531 (tramp-let-maybe directory-sep-char ?/ |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3532 (let ((default-directory "/")) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3533 (tramp-make-tramp-file-name |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3534 multi-method (or method (tramp-find-default-method user host)) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3535 user host |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3536 (tramp-drop-volume-letter |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3537 (tramp-run-real-handler 'expand-file-name |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3538 (list localname)))))))))) |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3539 |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3540 ;; 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
|
3541 ;; boundaries. |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3542 ;; ;; 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
|
3543 ;; ;; 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
|
3544 ;; (if (string-match "^/\\.\\./" localname) |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3545 ;; (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
|
3546 ;; ;; 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
|
3547 ;; ;; 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
|
3548 ;; ;; 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
|
3549 ;; ;; would otherwise use backslash. |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3550 ;; (let ((directory-sep-char ?/)) |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3551 ;; (tramp-make-tramp-file-name |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3552 ;; multi-method method user host |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3553 ;; (tramp-drop-volume-letter |
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
3554 ;; (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
|
3555 ;; (list localname)))))))))) |
45861 | 3556 |
3557 ;; Remote commands. | |
3558 | |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3559 (defvar tramp-async-proc nil |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
3560 "Global variable keeping asynchronous process object. |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3561 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
|
3562 |
70020
2578326defd6
* net/tramp.el (tramp-display-shell-command-buffer): New defvar.
Michael Albinus <michael.albinus@gmx.de>
parents:
68820
diff
changeset
|
3563 (defvar tramp-display-shell-command-buffer t |
2578326defd6
* net/tramp.el (tramp-display-shell-command-buffer): New defvar.
Michael Albinus <michael.albinus@gmx.de>
parents:
68820
diff
changeset
|
3564 "Whether to display output buffer of `shell-command'. |
2578326defd6
* net/tramp.el (tramp-display-shell-command-buffer): New defvar.
Michael Albinus <michael.albinus@gmx.de>
parents:
68820
diff
changeset
|
3565 This is necessary for handling DISPLAY of `process-file'.") |
2578326defd6
* net/tramp.el (tramp-display-shell-command-buffer): New defvar.
Michael Albinus <michael.albinus@gmx.de>
parents:
68820
diff
changeset
|
3566 |
45861 | 3567 (defun tramp-handle-shell-command (command &optional output-buffer error-buffer) |
3568 "Like `shell-command' for tramp files. | |
3569 This will break if COMMAND prints a newline, followed by the value of | |
3570 `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
|
3571 ;; Asynchronous processes are far from being perfect. But it works at least |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
3572 ;; for `find-grep-dired' and `find-name-dired' in Emacs 22. |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3573 (if (tramp-tramp-file-p default-directory) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3574 (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
|
3575 (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
|
3576 status) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3577 (unless output-buffer |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3578 (setq output-buffer |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3579 (get-buffer-create |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3580 (if asynchronous |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3581 "*Async Shell Command*" |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3582 "*Shell Command Output*"))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3583 (set-buffer output-buffer) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3584 (erase-buffer)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3585 (unless (bufferp output-buffer) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3586 (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
|
3587 (set-buffer output-buffer) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3588 ;; 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
|
3589 ;; 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
|
3590 ;; 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
|
3591 ;; 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
|
3592 (when asynchronous |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3593 (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
|
3594 error-buffer nil |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3595 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
|
3596 output-buffer "cat"))) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3597 (save-excursion |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3598 (tramp-barf-unless-okay |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3599 multi-method method user host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3600 (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
|
3601 nil 'file-error |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3602 "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
|
3603 (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
|
3604 ;; Define the process filter |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3605 (when asynchronous |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3606 (set-process-filter |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3607 (get-buffer-process |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3608 (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
|
3609 '(lambda (process string) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3610 ;; 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
|
3611 (save-current-buffer |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3612 (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
|
3613 (goto-char (point-max)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3614 (insert string)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3615 ;; 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
|
3616 (let ((end |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3617 (string-match |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3618 (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
|
3619 (when end |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3620 (setq string |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3621 (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
|
3622 (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
|
3623 (when end |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3624 (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
|
3625 (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
|
3626 ;; Send the command |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3627 (tramp-send-command |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3628 multi-method method user host |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3629 (if error-buffer |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3630 (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
|
3631 command) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3632 (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
|
3633 (unless asynchronous |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3634 (tramp-wait-for-output))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3635 (unless asynchronous |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3636 ;; We cannot use `insert-buffer' because the tramp buffer |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3637 ;; changes its contents before insertion due to calling |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3638 ;; `expand-file' and alike. |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3639 (insert |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3640 (with-current-buffer |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3641 (tramp-get-buffer multi-method method user host) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3642 (buffer-string)))) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3643 (when error-buffer |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3644 (save-excursion |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3645 (unless (bufferp error-buffer) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3646 (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
|
3647 (tramp-send-command |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3648 multi-method method user host |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3649 "cat /tmp/tramp.$$.err") |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3650 (tramp-wait-for-output) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3651 (set-buffer error-buffer) |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3652 ;; Same comment as above |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3653 (insert |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3654 (with-current-buffer |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3655 (tramp-get-buffer multi-method method user host) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
3656 (buffer-string))) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3657 (tramp-send-command-and-check |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3658 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
|
3659 (save-excursion |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3660 (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
|
3661 (unless asynchronous |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3662 (tramp-wait-for-output)) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3663 (tramp-send-command |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3664 multi-method method user host |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3665 (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
|
3666 " 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
|
3667 (unless asynchronous |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3668 (tramp-wait-for-output) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3669 (goto-char (point-max)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3670 (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
|
3671 (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
|
3672 (skip-chars-forward "^ ") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3673 (setq status (read (current-buffer))))) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3674 (unless (zerop (buffer-size)) |
70020
2578326defd6
* net/tramp.el (tramp-display-shell-command-buffer): New defvar.
Michael Albinus <michael.albinus@gmx.de>
parents:
68820
diff
changeset
|
3675 (when tramp-display-shell-command-buffer |
2578326defd6
* net/tramp.el (tramp-display-shell-command-buffer): New defvar.
Michael Albinus <michael.albinus@gmx.de>
parents:
68820
diff
changeset
|
3676 (display-buffer output-buffer))) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3677 status)) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3678 ;; 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
|
3679 ;; 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
|
3680 (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
|
3681 default-directory) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3682 (tramp-run-real-handler 'shell-command |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3683 (list command output-buffer error-buffer)))) |
45861 | 3684 |
57653
b324ca4df07c
* simple.el (process-file): New function, similar to call-process
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
57559
diff
changeset
|
3685 (defun tramp-handle-process-file (program &optional infile buffer display &rest args) |
b324ca4df07c
* simple.el (process-file): New function, similar to call-process
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
57559
diff
changeset
|
3686 "Like `process-file' for Tramp files." |
b324ca4df07c
* simple.el (process-file): New function, similar to call-process
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
57559
diff
changeset
|
3687 (when infile (error "Implementation does not handle input from file")) |
b324ca4df07c
* simple.el (process-file): New function, similar to call-process
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
57559
diff
changeset
|
3688 (when (and (numberp buffer) (zerop buffer)) |
b324ca4df07c
* simple.el (process-file): New function, similar to call-process
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
57559
diff
changeset
|
3689 (error "Implementation does not handle immediate return")) |
b324ca4df07c
* simple.el (process-file): New function, similar to call-process
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
57559
diff
changeset
|
3690 (when (consp buffer) (error "Implementation does not handle error files")) |
70020
2578326defd6
* net/tramp.el (tramp-display-shell-command-buffer): New defvar.
Michael Albinus <michael.albinus@gmx.de>
parents:
68820
diff
changeset
|
3691 (let ((tramp-display-shell-command-buffer display)) |
2578326defd6
* net/tramp.el (tramp-display-shell-command-buffer): New defvar.
Michael Albinus <michael.albinus@gmx.de>
parents:
68820
diff
changeset
|
3692 (shell-command |
2578326defd6
* net/tramp.el (tramp-display-shell-command-buffer): New defvar.
Michael Albinus <michael.albinus@gmx.de>
parents:
68820
diff
changeset
|
3693 (mapconcat 'tramp-shell-quote-argument (cons program args) " ") |
2578326defd6
* net/tramp.el (tramp-display-shell-command-buffer): New defvar.
Michael Albinus <michael.albinus@gmx.de>
parents:
68820
diff
changeset
|
3694 buffer))) |
57653
b324ca4df07c
* simple.el (process-file): New function, similar to call-process
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
57559
diff
changeset
|
3695 |
45861 | 3696 ;; File Editing. |
3697 | |
3698 (defsubst tramp-make-temp-file () | |
3699 (funcall (if (fboundp 'make-temp-file) 'make-temp-file 'make-temp-name) | |
3700 (expand-file-name tramp-temp-name-prefix | |
3701 (tramp-temporary-file-directory)))) | |
3702 | |
3703 (defun tramp-handle-file-local-copy (filename) | |
3704 "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
|
3705 (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
|
3706 (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
|
3707 ;; 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
|
3708 ;; 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
|
3709 ;; statement that checks them. But the functions |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3710 ;; 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
|
3711 ;; 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
|
3712 ;; 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
|
3713 (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
|
3714 (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
|
3715 (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
|
3716 (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
|
3717 tmpfil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3718 (unless (file-exists-p filename) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3719 (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
|
3720 filename)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3721 (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
|
3722 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3723 (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
|
3724 ;; `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
|
3725 (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
|
3726 |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3727 ((and rem-enc rem-dec) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3728 ;; Use inline encoding for file transfer. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3729 (save-excursion |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3730 ;; 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
|
3731 ;; tramp-current-user, tramp-current-host. |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3732 (set-buffer tramp-buf) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3733 (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
|
3734 (tramp-barf-unless-okay |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3735 multi-method method user host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3736 (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
|
3737 nil 'file-error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3738 "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
|
3739 tramp-buf) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3740 ;; Remove trailing status code |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3741 (goto-char (point-max)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3742 (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
|
3743 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3744 (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
|
3745 |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
3746 ;; 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
|
3747 (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
|
3748 ;; 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
|
3749 (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
|
3750 (set-buffer tmpbuf) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3751 (erase-buffer) |
65792
8c8e6f2eea3c
Pacify byte compiler warnings in pacification code.
Richard M. Stallman <rms@gnu.org>
parents:
65605
diff
changeset
|
3752 (insert-buffer-substring tramp-buf) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3753 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3754 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3755 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
|
3756 filename loc-dec) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3757 (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
|
3758 ;; 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
|
3759 ;; 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
|
3760 ;; 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
|
3761 ;; 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
|
3762 ;; 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
|
3763 (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
|
3764 (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
|
3765 (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
|
3766 (kill-buffer tmpbuf)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3767 ;; 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
|
3768 ;; 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
|
3769 (let ((tmpfil2 (tramp-make-temp-file))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3770 (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
|
3771 (tramp-message |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3772 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
|
3773 filename loc-dec) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3774 (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
|
3775 loc-dec tmpfil2 tmpfil) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3776 (delete-file tmpfil2))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3777 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3778 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
|
3779 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
|
3780 ;; Set proper permissions. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3781 (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
|
3782 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3783 (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
|
3784 tmpfil))) |
45861 | 3785 |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3786 (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
|
3787 "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
|
3788 (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
|
3789 (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
|
3790 (make-tramp-file-name |
d863bc830907
(tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
55864
diff
changeset
|
3791 :multi-method multi-method |
d863bc830907
(tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
55864
diff
changeset
|
3792 :method method |
d863bc830907
(tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
55864
diff
changeset
|
3793 :user user |
d863bc830907
(tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
55864
diff
changeset
|
3794 :host host |
d863bc830907
(tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
55864
diff
changeset
|
3795 :localname "")))) |
45861 | 3796 |
3797 (defun tramp-handle-insert-file-contents | |
3798 (filename &optional visit beg end replace) | |
3799 "Like `insert-file-contents' for tramp files." | |
3800 (barf-if-buffer-read-only) | |
3801 (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
|
3802 (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
|
3803 (if (not (file-exists-p filename)) |
45861 | 3804 (progn |
3805 (when visit | |
3806 (setq buffer-file-name filename) | |
3807 (set-visited-file-modtime) | |
3808 (set-buffer-modified-p nil)) | |
3809 (signal 'file-error | |
3810 (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
|
3811 (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
|
3812 ;; `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
|
3813 ;; 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
|
3814 ;; 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
|
3815 (let ((local-copy |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3816 (let ((inhibit-file-name-operation |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3817 (when (eq inhibit-file-name-operation |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3818 'insert-file-contents) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3819 'file-local-copy))) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3820 (file-local-copy filename))) |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3821 coding-system-used result) |
45861 | 3822 (when visit |
3823 (setq buffer-file-name filename) | |
3824 (set-visited-file-modtime) | |
3825 (set-buffer-modified-p nil)) | |
3826 (tramp-message-for-buffer | |
3827 multi-method method user host | |
3828 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
|
3829 (setq result (insert-file-contents local-copy nil beg end replace)) |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3830 ;; Now `last-coding-system-used' has right value. Remember it. |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3831 (when (boundp 'last-coding-system-used) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3832 (setq coding-system-used (symbol-value '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
|
3833 (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
|
3834 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
|
3835 9 "Inserting local temp file `%s'...done" local-copy) |
45861 | 3836 (delete-file local-copy) |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3837 (when (boundp 'last-coding-system-used) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3838 (set 'last-coding-system-used coding-system-used)) |
45861 | 3839 (list (expand-file-name filename) |
3840 (second result)))))) | |
3841 | |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3842 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3843 (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
|
3844 "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
|
3845 (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
|
3846 ;; 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
|
3847 ;; Emacs or XEmacs |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3848 (let ((backup-directory-alist |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3849 ;; Emacs case |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3850 (when (boundp 'backup-directory-alist) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3851 (if (boundp 'tramp-backup-directory-alist) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3852 (mapcar |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3853 '(lambda (x) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3854 (cons |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3855 (car x) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3856 (if (and (stringp (cdr x)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3857 (file-name-absolute-p (cdr x)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3858 (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
|
3859 (tramp-make-tramp-file-name |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3860 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
|
3861 (cdr x)))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3862 (symbol-value 'tramp-backup-directory-alist)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3863 (symbol-value 'backup-directory-alist)))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3864 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3865 (bkup-backup-directory-info |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3866 ;; XEmacs case |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3867 (when (boundp 'bkup-backup-directory-info) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3868 (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
|
3869 (mapcar |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3870 '(lambda (x) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3871 (nconc |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3872 (list (car x)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3873 (list |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3874 (if (and (stringp (car (cdr x))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3875 (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
|
3876 (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
|
3877 (tramp-make-tramp-file-name |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3878 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
|
3879 (car (cdr x)))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3880 (cdr (cdr x)))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3881 (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
|
3882 (symbol-value 'bkup-backup-directory-info))))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3883 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3884 (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
|
3885 |
65248
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3886 (defun tramp-handle-make-auto-save-file-name () |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3887 "Like `make-auto-save-file-name' for tramp files. |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3888 Returns a file name in `tramp-auto-save-directory' for autosaving this file." |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3889 (when tramp-auto-save-directory |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3890 (unless (file-exists-p tramp-auto-save-directory) |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3891 (make-directory tramp-auto-save-directory t))) |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3892 ;; jka-compr doesn't like auto-saving, so by appending "~" to the |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3893 ;; file name we make sure that jka-compr isn't used for the |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3894 ;; auto-save file. |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3895 (let ((buffer-file-name |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3896 (if tramp-auto-save-directory |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3897 (expand-file-name |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3898 (tramp-subst-strs-in-string |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3899 '(("_" . "|") |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3900 ("/" . "_a") |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3901 (":" . "_b") |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3902 ("|" . "__") |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3903 ("[" . "_l") |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3904 ("]" . "_r")) |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3905 (buffer-file-name)) |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3906 tramp-auto-save-directory) |
65304
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
3907 (buffer-file-name)))) |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
3908 ;; Run plain `make-auto-save-file-name'. There might be an advice when |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
3909 ;; it is not a magic file name operation (since Emacs 22). |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
3910 ;; We must deactivate it temporarily. |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
3911 (if (not (ad-is-active 'make-auto-save-file-name)) |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
3912 (tramp-run-real-handler |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
3913 'make-auto-save-file-name nil) |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
3914 ;; else |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
3915 (ad-deactivate 'make-auto-save-file-name) |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
3916 (prog1 |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
3917 (tramp-run-real-handler |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
3918 'make-auto-save-file-name nil) |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
3919 (ad-activate 'make-auto-save-file-name))))) |
65248
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3920 |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3921 |
45861 | 3922 ;; CCC grok APPEND, LOCKNAME, CONFIRM |
3923 (defun tramp-handle-write-region | |
3924 (start end filename &optional append visit lockname confirm) | |
3925 "Like `write-region' for tramp files." | |
3926 (unless (eq append nil) | |
3927 (error "Cannot append to file using tramp (`%s')" filename)) | |
3928 (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
|
3929 ;; 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
|
3930 ;; 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
|
3931 ;; Ange-ftp ignores it, too. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3932 ;; (when (and lockname (stringp lockname)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3933 ;; (setq lockname (expand-file-name lockname))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3934 ;; (unless (or (eq lockname nil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3935 ;; (string= lockname filename)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3936 ;; (error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3937 ;; "tramp-handle-write-region: LOCKNAME must be nil or equal FILENAME")) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
3938 ;; XEmacs takes a coding system as the seventh argument, not `confirm' |
45861 | 3939 (when (and (not (featurep 'xemacs)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3940 confirm (file-exists-p filename)) |
45861 | 3941 (unless (y-or-n-p (format "File %s exists; overwrite anyway? " |
3942 filename)) | |
3943 (error "File not overwritten"))) | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3944 (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
|
3945 (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
|
3946 (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
|
3947 (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
|
3948 (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
|
3949 (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
|
3950 (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
|
3951 (modes (file-modes filename)) |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3952 ;; We use this to save the value of `last-coding-system-used' |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3953 ;; after writing the tmp file. At the end of the function, |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3954 ;; we set `last-coding-system-used' to this saved value. |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3955 ;; This way, any intermediary coding systems used while |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3956 ;; talking to the remote shell or suchlike won't hose this |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3957 ;; variable. This approach was snarfed from ange-ftp.el. |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3958 coding-system-used |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3959 tmpfil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3960 ;; 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
|
3961 ;; 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
|
3962 ;; because this makes the logic simpler. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3963 (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
|
3964 ;; 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
|
3965 ;; changed it accidently. |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
3966 (set-buffer curbuf) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3967 ;; 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
|
3968 ;; 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
|
3969 ;; `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
|
3970 (tramp-run-real-handler |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3971 'write-region |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3972 (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
|
3973 (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
|
3974 (list start end tmpfil append 'no-message lockname))) |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3975 ;; Now, `last-coding-system-used' has the right value. Remember it. |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3976 (when (boundp 'last-coding-system-used) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
3977 (setq coding-system-used (symbol-value 'last-coding-system-used))) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3978 ;; 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
|
3979 ;; 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
|
3980 ;; 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
|
3981 ;; permissions. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3982 (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
|
3983 ;; 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
|
3984 ;; 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
|
3985 ;; 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
|
3986 ;; 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
|
3987 ;; _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
|
3988 ;; 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
|
3989 (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
|
3990 ;; `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
|
3991 (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
|
3992 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
3993 ((and rem-enc rem-dec) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3994 ;; Use inline file transfer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3995 (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
|
3996 (save-excursion |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3997 ;; Encode tmpfil into tmpbuf |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
3998 (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
|
3999 5 "Encoding region...") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4000 (set-buffer tmpbuf) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4001 (erase-buffer) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4002 ;; 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
|
4003 (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
|
4004 (progn |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4005 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4006 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
|
4007 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
|
4008 (symbol-name loc-enc)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4009 (insert-file-contents-literally tmpfil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4010 ;; 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
|
4011 ;; 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
|
4012 ;; both of the following conditions are |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4013 ;; 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
|
4014 ;; 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
|
4015 ;; default-directory is remote. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4016 ;; (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
|
4017 ;; 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
|
4018 ;; tmp file anyway. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4019 (let ((default-directory |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4020 (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
|
4021 (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
|
4022 (goto-char (point-max)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4023 (unless (bolp) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4024 (newline))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4025 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4026 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
|
4027 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
|
4028 (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
|
4029 loc-enc tmpfil t)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4030 (pop-to-buffer trampbuf) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4031 (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
|
4032 " 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
|
4033 filename loc-enc))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4034 ;; 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
|
4035 ;; 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
|
4036 ;; 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
|
4037 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4038 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4039 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
|
4040 (tramp-send-command |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4041 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4042 (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
|
4043 rem-dec |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4044 (tramp-shell-quote-argument localname))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4045 (set-buffer tmpbuf) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4046 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4047 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4048 6 "Sending data to remote host...") |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4049 (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
|
4050 (buffer-string)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4051 ;; wait for remote decoding to complete |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4052 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4053 multi-method method user host |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4054 6 "Sending end of data token...") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4055 (tramp-send-command |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
4056 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
|
4057 (tramp-message-for-buffer |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4058 multi-method method user host 6 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4059 "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
|
4060 (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
|
4061 (tramp-wait-for-output) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4062 (tramp-barf-unless-okay |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4063 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
|
4064 (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
|
4065 " 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
|
4066 filename rem-dec) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4067 (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
|
4068 filename) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4069 (kill-buffer tmpbuf)))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4070 (t |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4071 (error |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4072 (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
|
4073 "decoding command or an rcp program") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4074 method))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4075 (delete-file tmpfil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4076 (unless (equal curbuf (current-buffer)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4077 (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
|
4078 curbuf (current-buffer))) |
56644
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
4079 (when (or (eq visit t) (stringp visit)) |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
4080 (set-visited-file-modtime |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
4081 ;; We must pass modtime explicitely, because filename can be different |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
4082 ;; from (buffer-file-name), f.e. if `file-precious-flag' is set. |
0cee455027ed
Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents:
56465
diff
changeset
|
4083 (nth 5 (file-attributes filename)))) |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
4084 ;; Make `last-coding-system-used' have the right value. |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
4085 (when (boundp 'last-coding-system-used) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
4086 (set 'last-coding-system-used coding-system-used)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4087 (when (or (eq visit t) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4088 (eq visit nil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4089 (stringp visit)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4090 (message "Wrote %s" filename))))) |
45861 | 4091 |
4092 ;; Call down to the real handler. | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4093 ;; 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
|
4094 ;; TRAMP file name) it is needed to disable efs as well as tramp for the |
45861 | 4095 ;; operation. |
4096 ;; | |
4097 ;; Other than that, this is the canon file-handler code that the doco | |
4098 ;; says should be used here. Which is nice. | |
4099 ;; | |
4100 ;; 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
|
4101 ;; efs-sifn-handler-function to handle any filename with environment |
45861 | 4102 ;; variables. This has two implications: |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4103 ;; 1) That EFS may not be completely dead (yet) for TRAMP filenames |
45861 | 4104 ;; 2) That TRAMP might want to do the same thing. |
4105 ;; Details as they come in. | |
4106 ;; | |
4107 ;; Daniel Pittman <daniel@danann.net> | |
4108 | |
4109 ;; (defun tramp-run-real-handler (operation args) | |
4110 ;; "Invoke normal file name handler for OPERATION. | |
4111 ;; This inhibits EFS and Ange-FTP, too, because they conflict with tramp. | |
4112 ;; First arg specifies the OPERATION, remaining ARGS are passed to the | |
4113 ;; OPERATION." | |
4114 ;; (let ((inhibit-file-name-handlers | |
4115 ;; (list 'tramp-file-name-handler | |
4116 ;; 'efs-file-handler-function | |
4117 ;; 'ange-ftp-hook-function | |
4118 ;; (and (eq inhibit-file-name-operation operation) | |
4119 ;; inhibit-file-name-handlers))) | |
4120 ;; (inhibit-file-name-operation operation)) | |
4121 ;; (apply operation args))) | |
4122 | |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4123 ;;;###autoload |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4124 (progn (defun tramp-run-real-handler (operation args) |
45861 | 4125 "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
|
4126 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
|
4127 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
|
4128 (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
|
4129 `(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
|
4130 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
|
4131 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
|
4132 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
|
4133 . |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4134 ,(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
|
4135 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
|
4136 (inhibit-file-name-operation operation)) |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4137 (apply operation args)))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4138 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4139 ;; 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
|
4140 ;; 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
|
4141 ;; 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
|
4142 ;; basic I/O operations. |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4143 ;;;###autoload |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4144 (progn (defun tramp-completion-run-real-handler (operation args) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4145 "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
|
4146 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
|
4147 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
|
4148 (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
|
4149 `(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
|
4150 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
|
4151 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
|
4152 . |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4153 ,(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
|
4154 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
|
4155 (inhibit-file-name-operation operation)) |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4156 (apply operation args)))) |
45861 | 4157 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4158 ;; 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
|
4159 ;; 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
|
4160 ;; 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
|
4161 ;; 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
|
4162 ;; 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
|
4163 ;; 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
|
4164 ;; 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
|
4165 (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
|
4166 "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
|
4167 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
|
4168 (cond |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4169 ; 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
|
4170 ((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
|
4171 (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
|
4172 '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
|
4173 '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
|
4174 '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
|
4175 '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
|
4176 '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
|
4177 '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
|
4178 '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
|
4179 '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
|
4180 '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
|
4181 '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
|
4182 '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
|
4183 '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
|
4184 'load 'make-directory 'make-directory-internal |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
4185 '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
|
4186 '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
|
4187 ; 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
|
4188 '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
|
4189 '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
|
4190 '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
|
4191 '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
|
4192 '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
|
4193 '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
|
4194 (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
|
4195 (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
|
4196 (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
|
4197 ; 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
|
4198 ((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
|
4199 (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
|
4200 '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
|
4201 '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
|
4202 ; 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
|
4203 '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
|
4204 '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
|
4205 (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
|
4206 (cond |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4207 ((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
|
4208 ((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
|
4209 (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
|
4210 ; 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
|
4211 ((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
|
4212 (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
|
4213 ; BUF |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4214 ((member operation |
65248
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
4215 (list 'make-auto-save-file-name |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
4216 'set-visited-file-modtime 'verify-visited-file-modtime |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
4217 ; XEmacs only |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4218 '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
|
4219 (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
|
4220 (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
|
4221 ; COMMAND |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4222 ((member operation |
60156
ed97a38d9f53
(tramp-file-name-for-operation): Use dired-call-process instead of
Eli Zaretskii <eliz@gnu.org>
parents:
59996
diff
changeset
|
4223 (list 'dired-call-process |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
4224 ; Emacs only |
60287
865aec6814c3
(tramp-file-name-for-operation): Fix misapplied
Andreas Schwab <schwab@suse.de>
parents:
60156
diff
changeset
|
4225 'shell-command |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
4226 ; Emacs 22 only |
57653
b324ca4df07c
* simple.el (process-file): New function, similar to call-process
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
57559
diff
changeset
|
4227 'process-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
|
4228 ; 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
|
4229 '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
|
4230 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
|
4231 ; 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
|
4232 (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
|
4233 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4234 (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
|
4235 "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
|
4236 (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
|
4237 (let (elt |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
4238 res |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
4239 (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
|
4240 (while handler-alist |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
4241 (setq elt (car handler-alist) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
4242 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
|
4243 (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
|
4244 (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
|
4245 (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
|
4246 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
|
4247 |
45861 | 4248 ;; Main function. |
4249 ;;;###autoload | |
4250 (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
|
4251 "Invoke Tramp file name handler. |
45861 | 4252 Falls back to normal file name handler if no tramp file name handler exists." |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4253 ;; (setq edebug-trace t) |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4254 ;; (edebug-trace "%s" (with-output-to-string (backtrace))) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4255 (save-match-data |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
4256 (let* ((filename (apply 'tramp-file-name-for-operation operation args)) |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4257 (completion (tramp-completion-mode 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
|
4258 (foreign (tramp-find-foreign-file-name-handler filename))) |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4259 (with-parsed-tramp-file-name filename nil |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4260 (cond |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4261 ;; When we are in completion mode, some operations shouldn' be |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4262 ;; handled by backend. |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4263 ((and completion (memq operation '(expand-file-name))) |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4264 (tramp-run-real-handler operation args)) |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4265 ((and completion (zerop (length localname)) |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4266 (memq operation '(file-exists-p file-directory-p))) |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4267 t) |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4268 ;; Call the backend function. |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4269 (foreign (apply foreign operation args)) |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4270 ;; Nothing to do for us. |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4271 (t (tramp-run-real-handler operation args))))))) |
45861 | 4272 |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4273 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4274 ;; 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
|
4275 ;; 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
|
4276 ;; 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
|
4277 ;; 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
|
4278 ;; 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
|
4279 ;; 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
|
4280 ;; 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
|
4281 ;; `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
|
4282 ;; (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
|
4283 ;; 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
|
4284 ;; 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
|
4285 ;; -- 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
|
4286 ;; 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
|
4287 ;; 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
|
4288 ;; 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
|
4289 ;; 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
|
4290 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4291 (defvar tramp-locked nil |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4292 "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
|
4293 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
|
4294 preventing reentrant calls of Tramp.") |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4295 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4296 (defvar tramp-locker nil |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4297 "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
|
4298 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
|
4299 preventing reentrant calls of Tramp.") |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4300 |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
4301 (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
|
4302 "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
|
4303 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
|
4304 (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
|
4305 (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
|
4306 (let ((tl tramp-locked)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4307 (unwind-protect |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4308 (progn |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4309 (setq tramp-locked t) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4310 (let ((tramp-locker t)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4311 (save-match-data |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4312 (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
|
4313 (if fn |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4314 (apply (cdr fn) args) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4315 (tramp-run-real-handler operation args)))))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4316 (setq tramp-locked tl)))) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
4317 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4318 ;;;###autoload |
70255
d57fb8c98714
* net/tramp.el (tramp-completion-file-name-handler): Disable
Michael Albinus <michael.albinus@gmx.de>
parents:
70191
diff
changeset
|
4319 (progn (defun tramp-completion-file-name-handler (operation &rest args) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4320 "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
|
4321 Falls back to normal file name handler if no tramp file name handler exists." |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4322 ;; (setq edebug-trace t) |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4323 ;; (edebug-trace "%s" (with-output-to-string (backtrace))) |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4324 (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4325 (if fn |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4326 (save-match-data (apply (cdr fn) args)) |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4327 (tramp-completion-run-real-handler operation args))))) |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4328 |
45861 | 4329 ;;;###autoload |
70255
d57fb8c98714
* net/tramp.el (tramp-completion-file-name-handler): Disable
Michael Albinus <michael.albinus@gmx.de>
parents:
70191
diff
changeset
|
4330 (defsubst tramp-register-file-name-handlers () |
70191
3a3093f77da8
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
70073
diff
changeset
|
4331 "Add tramp file name handlers to `file-name-handler-alist'." |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4332 (add-to-list 'file-name-handler-alist |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4333 (cons tramp-file-name-regexp 'tramp-file-name-handler)) |
70531
7817f391e9ff
* net/tramp.el (tramp-register-file-name-handlers): Enable Tramp
Michael Albinus <michael.albinus@gmx.de>
parents:
70318
diff
changeset
|
4334 (when (or partial-completion-mode (featurep 'ido)) |
70191
3a3093f77da8
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
70073
diff
changeset
|
4335 (add-to-list 'file-name-handler-alist |
3a3093f77da8
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
70073
diff
changeset
|
4336 (cons tramp-completion-file-name-regexp |
3a3093f77da8
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
70073
diff
changeset
|
4337 'tramp-completion-file-name-handler)) |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4338 (put 'tramp-completion-file-name-handler 'safe-magic t)) |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4339 ;; If jka-compr is already loaded, move it to the front of |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4340 ;; `file-name-handler-alist'. |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4341 (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist))) |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4342 (when jka |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4343 (setq file-name-handler-alist |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4344 (cons jka (delete jka file-name-handler-alist)))))) |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4345 |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4346 ;; During autoload, it shall be checked whether |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4347 ;; `partial-completion-mode' is active. Therefore registering will be |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4348 ;; delayed. |
70191
3a3093f77da8
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
70073
diff
changeset
|
4349 ;;;###autoload(add-hook |
70255
d57fb8c98714
* net/tramp.el (tramp-completion-file-name-handler): Disable
Michael Albinus <michael.albinus@gmx.de>
parents:
70191
diff
changeset
|
4350 ;;;###autoload 'after-init-hook |
d57fb8c98714
* net/tramp.el (tramp-completion-file-name-handler): Disable
Michael Albinus <michael.albinus@gmx.de>
parents:
70191
diff
changeset
|
4351 ;;;###autoload '(lambda () (tramp-register-file-name-handlers))) |
70191
3a3093f77da8
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
70073
diff
changeset
|
4352 (tramp-register-file-name-handlers) |
45861 | 4353 |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4354 ;;;###autoload |
70191
3a3093f77da8
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
70073
diff
changeset
|
4355 (defun tramp-unload-file-name-handlers () |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4356 (setq file-name-handler-alist |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4357 (delete (rassoc 'tramp-file-name-handler |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4358 file-name-handler-alist) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4359 (delete (rassoc 'tramp-completion-file-name-handler |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4360 file-name-handler-alist) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4361 file-name-handler-alist)))) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4362 |
70191
3a3093f77da8
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
70073
diff
changeset
|
4363 (add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4364 |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4365 |
45861 | 4366 ;;; Interactions with other packages: |
4367 | |
4368 ;; -- complete.el -- | |
4369 | |
4370 ;; This function contributed by Ed Sabol | |
4371 (defun tramp-handle-expand-many-files (name) | |
4372 "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
|
4373 (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
|
4374 (save-match-data |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4375 (if (or (string-match "\\*" name) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4376 (string-match "\\?" name) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4377 (string-match "\\[.*\\]" name)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4378 (save-excursion |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4379 (let (bufstr) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4380 ;; 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
|
4381 ;; 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
|
4382 ;; 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
|
4383 ;; don't bother. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4384 ;;-(let ((comint-file-name-quote-list |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4385 ;;- (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
|
4386 ;;- '(?\* ?\? ?[ ?])))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4387 ;;- (tramp-send-command |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4388 ;;- multi-method method user host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4389 ;;- (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
|
4390 ;;- (tramp-wait-for-output)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4391 (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
|
4392 (format "echo %s" localname)) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4393 (tramp-wait-for-output) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4394 (setq bufstr (buffer-substring (point-min) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4395 (tramp-line-end-position))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4396 (goto-char (point-min)) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4397 (if (string-equal localname bufstr) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4398 nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4399 (insert "(\"") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4400 (while (search-forward " " nil t) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4401 (delete-backward-char 1) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4402 (insert "\" \"")) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4403 (goto-char (point-max)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4404 (delete-backward-char 1) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4405 (insert "\")") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4406 (goto-char (point-min)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4407 (mapcar |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4408 (function (lambda (x) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4409 (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
|
4410 user host x))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
4411 (read (current-buffer)))))) |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
4412 (list (expand-file-name name)))))) |
45861 | 4413 |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4414 (eval-after-load "complete" |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4415 '(progn |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4416 (defadvice PC-expand-many-files |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4417 (around tramp-advice-PC-expand-many-files (name) activate) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4418 "Invoke `tramp-handle-expand-many-files' for tramp files." |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4419 (if (tramp-tramp-file-p name) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4420 (setq ad-return-value (tramp-handle-expand-many-files name)) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4421 ad-do-it)) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4422 (add-hook 'tramp-unload-hook |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4423 '(lambda () (ad-unadvise 'PC-expand-many-files))))) |
45861 | 4424 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4425 ;;; 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
|
4426 |
66496
63563507d684
(tramp-completion-mode): defvar moved up.
Richard M. Stallman <rms@gnu.org>
parents:
66135
diff
changeset
|
4427 (defvar tramp-completion-mode nil |
63563507d684
(tramp-completion-mode): defvar moved up.
Richard M. Stallman <rms@gnu.org>
parents:
66135
diff
changeset
|
4428 "If non-nil, we are in file name completion mode.") |
63563507d684
(tramp-completion-mode): defvar moved up.
Richard M. Stallman <rms@gnu.org>
parents:
66135
diff
changeset
|
4429 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4430 ;; 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
|
4431 ;; `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
|
4432 ;; 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
|
4433 ;; `tramp-file-name-handler'). Otherwise, it takes `tramp-run-real-handler'. |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
4434 ;; 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
|
4435 ;; 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
|
4436 ;; 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
|
4437 ;; 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
|
4438 ;; 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
|
4439 ;; 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
|
4440 ;; 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
|
4441 ;; 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
|
4442 (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
|
4443 "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
|
4444 (cond |
66135
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4445 (tramp-completion-mode t) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4446 ((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
|
4447 ((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
|
4448 ((string-match |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
4449 (concat tramp-prefix-regexp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
4450 "\\(" 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
|
4451 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
|
4452 (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
|
4453 ((or (equal last-input-event 'tab) |
70049
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4454 ;; Emacs |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4455 (and (integerp last-input-event) |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4456 (or |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4457 ;; ?\t has event-modifier 'control |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4458 (char-equal last-input-event ?\t) |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4459 (and (not (event-modifiers last-input-event)) |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4460 (or (char-equal last-input-event ?\?) |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4461 (char-equal last-input-event ?\ ))))) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4462 ;; XEmacs |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4463 (and (featurep 'xemacs) |
70049
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4464 (or |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4465 ;; ?\t has event-modifier 'control |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4466 (char-equal |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4467 (funcall (symbol-function 'event-to-character) |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4468 last-input-event) ?\t) |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4469 (and (not (event-modifiers last-input-event)) |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4470 (or (char-equal |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4471 (funcall (symbol-function 'event-to-character) |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4472 last-input-event) ?\?) |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4473 (char-equal |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4474 (funcall (symbol-function 'event-to-character) |
def3f4aee280
Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents:
70020
diff
changeset
|
4475 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
|
4476 t))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4477 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4478 ;; 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
|
4479 ;; `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
|
4480 ;; tramp-file-name structures. For all of them we return possible completions. |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4481 ;;;###autoload |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4482 (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
|
4483 "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
|
4484 |
66135
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4485 (unwind-protect |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4486 ;; We need to reset `tramp-completion-mode'. |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4487 (progn |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4488 (setq tramp-completion-mode t) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4489 (let* |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4490 ((fullname (concat directory filename)) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4491 ;; possible completion structures |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4492 (v (tramp-completion-dissect-file-name fullname)) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4493 result result1) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4494 |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4495 (while v |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4496 (let* ((car (car v)) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4497 (multi-method (tramp-file-name-multi-method car)) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4498 (method (tramp-file-name-method car)) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4499 (user (tramp-file-name-user car)) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4500 (host (tramp-file-name-host car)) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4501 (localname (tramp-file-name-localname car)) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4502 (m (tramp-find-method multi-method method user host)) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4503 (tramp-current-user user) ; see `tramp-parse-passwd' |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4504 all-user-hosts) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4505 |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4506 (unless (or multi-method ;; Not handled (yet). |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4507 localname) ;; Nothing to complete |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4508 |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4509 (if (or user host) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4510 |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4511 ;; Method dependent user / host combinations |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4512 (progn |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4513 (mapcar |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4514 (lambda (x) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4515 (setq all-user-hosts |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4516 (append all-user-hosts |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4517 (funcall (nth 0 x) (nth 1 x))))) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4518 (tramp-get-completion-function m)) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4519 |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4520 (setq result (append result |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4521 (mapcar |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4522 (lambda (x) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4523 (tramp-get-completion-user-host |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4524 method user host (nth 0 x) (nth 1 x))) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4525 (delq nil all-user-hosts))))) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4526 |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4527 ;; Possible methods |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4528 (setq result |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4529 (append result (tramp-get-completion-methods m))))) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4530 |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4531 (setq v (cdr v)))) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4532 |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4533 ;; unify list, remove nil elements |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4534 (while result |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4535 (let ((car (car result))) |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4536 (when car (add-to-list |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4537 'result1 (substring car (length directory)))) |
66135
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4538 (setq result (cdr result)))) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4539 |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4540 ;; Complete local parts |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4541 (append |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4542 result1 |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4543 (condition-case nil |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4544 (if result1 |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4545 ;; "/ssh:" does not need to be expanded as hostname. |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4546 (tramp-run-real-handler |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4547 'file-name-all-completions (list filename directory)) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4548 ;; No method/user/host found to be expanded. |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4549 (tramp-completion-run-real-handler |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4550 'file-name-all-completions (list filename directory))) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4551 (error nil))))) |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4552 ;; unwindform |
5a1bac1c915b
* net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents:
65926
diff
changeset
|
4553 (setq tramp-completion-mode nil))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4554 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4555 ;; Method, host name and user name completion for a file. |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4556 ;;;###autoload |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4557 (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
|
4558 "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
|
4559 (try-completion filename |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4560 (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
|
4561 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4562 ;; 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
|
4563 ;; 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
|
4564 ;; 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
|
4565 ;; 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
|
4566 ;; 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
|
4567 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4568 ;; Expected results: |
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 ;; "/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
|
4571 ;; [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
|
4572 ;; [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
|
4573 ;; [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
|
4574 |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
4575 ;; "/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
|
4576 ;; [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
|
4577 ;; "/[x/" "/[x/y" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4578 ;; [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
|
4579 ;; [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
|
4580 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4581 ;; "/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
|
4582 ;; [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
|
4583 ;; "/[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
|
4584 ;; [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
|
4585 (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
|
4586 "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
|
4587 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
|
4588 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4589 (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
|
4590 (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
|
4591 ;; "/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
|
4592 (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
|
4593 (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
|
4594 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
|
4595 ;; "/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
|
4596 (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
|
4597 (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
|
4598 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
|
4599 ;; "/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
|
4600 (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
|
4601 (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
|
4602 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
|
4603 ;; "/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
|
4604 (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
|
4605 (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
|
4606 "\\(" 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
|
4607 "\\(" 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
|
4608 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
|
4609 ;; "/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
|
4610 (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
|
4611 (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
|
4612 "\\(" 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
|
4613 "\\(" 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
|
4614 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
|
4615 ;; "/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
|
4616 (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
|
4617 (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
|
4618 "\\(" 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
|
4619 "\\(" 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
|
4620 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
|
4621 ;; "/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
|
4622 (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
|
4623 (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
|
4624 "\\(" 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
|
4625 "\\(" 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
|
4626 "\\(" 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
|
4627 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
|
4628 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4629 (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
|
4630 (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
|
4631 (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
|
4632 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4633 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
|
4634 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
|
4635 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
|
4636 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
|
4637 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
|
4638 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
|
4639 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
|
4640 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
|
4641 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4642 (delq nil result))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4643 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4644 (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
|
4645 "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
|
4646 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
|
4647 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
|
4648 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4649 (let (method) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4650 (save-match-data |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4651 (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
|
4652 (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
|
4653 (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
|
4654 (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
|
4655 ;; Not handled (yet). |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4656 (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
|
4657 :multi-method method |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4658 :method nil |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4659 :user nil |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4660 :host nil |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4661 :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
|
4662 (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
|
4663 (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
|
4664 (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
|
4665 (match-string (nth 3 structure) name))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4666 (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
|
4667 (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
|
4668 (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
|
4669 :multi-method nil |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4670 :method method |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4671 :user user |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4672 :host host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4673 :localname localname))))))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4674 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4675 ;; 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
|
4676 ;; trailing method delimeter. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4677 (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
|
4678 "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
|
4679 (mapcar |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
4680 (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
|
4681 (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
|
4682 (string-match (concat "^" (regexp-quote partial-method)) method) |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4683 (tramp-make-tramp-file-name nil method nil nil 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
|
4684 (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
|
4685 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4686 ;; 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
|
4687 (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
|
4688 "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
|
4689 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
|
4690 (cond |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4691 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4692 ((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
|
4693 (if (and host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4694 (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
|
4695 (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
|
4696 (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
|
4697 (setq user nil |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4698 host nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4699 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4700 (partial-user |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4701 (setq host nil) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4702 (unless |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4703 (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
|
4704 (setq user nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4705 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4706 (partial-host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4707 (setq user nil) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4708 (unless |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4709 (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
|
4710 (setq host nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4711 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4712 (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
|
4713 host nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4714 |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4715 (unless (zerop (+ (length user) (length host))) |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
4716 (tramp-make-tramp-file-name nil method user host nil))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4717 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4718 (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
|
4719 "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
|
4720 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
|
4721 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4722 (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
|
4723 (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
|
4724 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4725 (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
|
4726 (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
|
4727 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4728 (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
|
4729 res)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4730 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4731 ;; 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
|
4732 (eval-and-compile |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4733 (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
|
4734 (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
|
4735 'point-at-eol |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4736 'line-end-position))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4737 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4738 (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
|
4739 "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
|
4740 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
|
4741 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4742 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4743 (regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4744 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4745 "^\\(" tramp-host-regexp "\\)" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4746 "\\([ \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
|
4747 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4748 (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
|
4749 (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
|
4750 (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
|
4751 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4752 (forward-line 1) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4753 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4754 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4755 (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
|
4756 "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
|
4757 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
|
4758 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4759 (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
|
4760 (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
|
4761 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4762 (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
|
4763 (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
|
4764 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4765 (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
|
4766 res)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4767 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4768 (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
|
4769 "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
|
4770 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
|
4771 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4772 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4773 (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
|
4774 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4775 (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
|
4776 (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
|
4777 (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
|
4778 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4779 (or |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4780 (> (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
|
4781 (forward-line 1)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4782 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4783 |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4784 (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
|
4785 "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
|
4786 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
|
4787 |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4788 (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
|
4789 (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
|
4790 (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
|
4791 (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
|
4792 (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
|
4793 (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
|
4794 (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
|
4795 res)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4796 |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4797 (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
|
4798 "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
|
4799 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
|
4800 |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4801 (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
|
4802 (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
|
4803 |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4804 (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
|
4805 (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
|
4806 (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
|
4807 (widen) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4808 (or |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4809 (> (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
|
4810 (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
|
4811 result)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4812 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4813 (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
|
4814 "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
|
4815 User is always nil." |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4816 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4817 (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
|
4818 (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
|
4819 result) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4820 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4821 (while files |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4822 (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
|
4823 (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
|
4824 (setq files (cdr files))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4825 result)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4826 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4827 (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
|
4828 "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
|
4829 User is always nil." |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4830 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4831 (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
|
4832 "\\)\\.ssh-\\(dss\\|rsa\\)\\.pub$")) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4833 (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
|
4834 result) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4835 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4836 (while files |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4837 (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
|
4838 (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
|
4839 (setq files (cdr files))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4840 result)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
4841 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4842 (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
|
4843 "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
|
4844 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
|
4845 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4846 (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
|
4847 (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
|
4848 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4849 (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
|
4850 (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
|
4851 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4852 (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
|
4853 res)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4854 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4855 (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
|
4856 "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
|
4857 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
|
4858 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4859 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4860 (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
|
4861 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4862 (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
|
4863 (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
|
4864 (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
|
4865 (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
|
4866 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4867 (or |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4868 (> (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
|
4869 (forward-line 1)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4870 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4871 |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
4872 ;; 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
|
4873 ;; 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
|
4874 ;; 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
|
4875 ;; 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
|
4876 (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
|
4877 "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
|
4878 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
|
4879 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4880 (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
|
4881 (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
|
4882 '(("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
|
4883 (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
|
4884 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4885 (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
|
4886 (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
|
4887 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4888 (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
|
4889 res))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4890 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4891 (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
|
4892 "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
|
4893 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
|
4894 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4895 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4896 (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
|
4897 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4898 (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
|
4899 (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
|
4900 (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
|
4901 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4902 (forward-line 1) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4903 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
4904 |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4905 (defun tramp-parse-netrc (filename) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4906 "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
|
4907 User may be nil." |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4908 |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4909 (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
|
4910 (when (file-readable-p filename) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4911 (with-temp-buffer |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4912 (insert-file-contents filename) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4913 (goto-char (point-min)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4914 (while (not (eobp)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4915 (push (tramp-parse-netrc-group) res)))) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4916 res)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4917 |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4918 (defun tramp-parse-netrc-group () |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4919 "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
|
4920 User may be nil." |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4921 |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4922 (let ((result) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4923 (regexp |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4924 (concat |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4925 "^[ \t]*machine[ \t]+" "\\(" tramp-host-regexp "\\)" |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4926 "\\([ \t]+login[ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?"))) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4927 |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4928 (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
|
4929 (when (re-search-forward regexp nil t) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4930 (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
|
4931 (widen) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4932 (forward-line 1) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4933 result)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
4934 |
45861 | 4935 ;;; Internal Functions: |
4936 | |
59031
1fbbe0bcfaac
Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents:
58776
diff
changeset
|
4937 (defun tramp-maybe-send-perl-script (multi-method method user host script name) |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4938 "Define in remote shell function NAME implemented as perl SCRIPT. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4939 Only send the definition if it has not already been done. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4940 Function may have 0-3 parameters." |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4941 (let ((remote-perl (tramp-get-remote-perl multi-method method user host))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4942 (unless remote-perl (error "No remote perl")) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4943 (let ((perl-scripts (tramp-get-connection-property "perl-scripts" nil |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4944 multi-method method user host))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4945 (unless (memq name perl-scripts) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4946 (with-current-buffer (tramp-get-buffer multi-method method user host) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4947 (tramp-message 5 (concat "Sending the Perl script `" name "'...")) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4948 (tramp-send-string multi-method method user host |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4949 (concat name |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4950 " () {\n" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4951 remote-perl |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4952 " -e '" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4953 script |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4954 "' \"$1\" \"$2\" \"$3\" 2>/dev/null\n}")) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4955 (tramp-wait-for-output) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4956 (tramp-set-connection-property "perl-scripts" (cons name perl-scripts) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4957 multi-method method user host) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4958 (tramp-message 5 (concat "Sending the Perl script `" name "'...done."))))))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
4959 |
45861 | 4960 (defun tramp-set-auto-save () |
4961 (when (and (buffer-file-name) | |
4962 (tramp-tramp-file-p (buffer-file-name)) | |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
4963 ;; ange-ftp has its own auto-save mechanism |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
4964 (eq (tramp-find-foreign-file-name-handler (buffer-file-name)) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
4965 'tramp-sh-file-name-handler) |
45861 | 4966 auto-save-default) |
4967 (auto-save-mode 1))) | |
4968 (add-hook 'find-file-hooks 'tramp-set-auto-save t) | |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4969 (add-hook 'tramp-unload-hook |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4970 '(lambda () |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
4971 (remove-hook 'find-file-hooks 'tramp-set-auto-save))) |
45861 | 4972 |
4973 (defun tramp-run-test (switch filename) | |
4974 "Run `test' on the remote system, given a SWITCH and a FILENAME. | |
4975 Returns the exit code of the `test' program." | |
4976 (let ((v (tramp-dissect-file-name filename))) | |
4977 (save-excursion | |
4978 (tramp-send-command-and-check | |
4979 (tramp-file-name-multi-method v) (tramp-file-name-method v) | |
4980 (tramp-file-name-user v) (tramp-file-name-host v) | |
4981 (format "test %s %s" switch | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4982 (tramp-shell-quote-argument (tramp-file-name-localname v))))))) |
45861 | 4983 |
4984 (defun tramp-run-test2 (program file1 file2 &optional switch) | |
4985 "Run `test'-like PROGRAM on the remote system, given FILE1, FILE2. | |
4986 The optional SWITCH is inserted between the two files. | |
4987 Returns the exit code of the `test' PROGRAM. Barfs if the methods, | |
4988 hosts, or files, disagree." | |
4989 (let* ((v1 (tramp-dissect-file-name file1)) | |
4990 (v2 (tramp-dissect-file-name file2)) | |
4991 (mmethod1 (tramp-file-name-multi-method v1)) | |
4992 (mmethod2 (tramp-file-name-multi-method v2)) | |
4993 (method1 (tramp-file-name-method v1)) | |
4994 (method2 (tramp-file-name-method v2)) | |
4995 (user1 (tramp-file-name-user v1)) | |
4996 (user2 (tramp-file-name-user v2)) | |
4997 (host1 (tramp-file-name-host v1)) | |
4998 (host2 (tramp-file-name-host v2)) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
4999 (localname1 (tramp-file-name-localname v1)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5000 (localname2 (tramp-file-name-localname v2))) |
45861 | 5001 (unless (and method1 method2 host1 host2 |
5002 (equal mmethod1 mmethod2) | |
5003 (equal method1 method2) | |
5004 (equal user1 user2) | |
5005 (equal host1 host2)) | |
5006 (error "tramp-run-test2: %s" | |
5007 "only implemented for same method, same user, same host")) | |
5008 (save-excursion | |
5009 (tramp-send-command-and-check | |
5010 mmethod1 method1 user1 host1 | |
5011 (format "%s %s %s %s" | |
5012 program | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5013 (tramp-shell-quote-argument localname1) |
45861 | 5014 (or switch "") |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5015 (tramp-shell-quote-argument localname2)))))) |
45861 | 5016 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
5017 (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
|
5018 "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
|
5019 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
|
5020 (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
|
5021 (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
|
5022 (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
|
5023 (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
|
5024 (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
|
5025 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
|
5026 (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
|
5027 touch-time |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5028 localname))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5029 (pop-to-buffer buf) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5030 (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
|
5031 buf)))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5032 ;; 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
|
5033 (with-temp-buffer |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5034 (unless (zerop (call-process |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5035 "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
|
5036 (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
|
5037 (error "tramp-touch: touch failed")))))) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5038 |
45861 | 5039 (defun tramp-buffer-name (multi-method method user host) |
5040 "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
|
5041 (if multi-method |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5042 (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
|
5043 (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
|
5044 (if user |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
5045 (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
|
5046 (format "*tramp/%s %s*" method host))))) |
45861 | 5047 |
5048 (defun tramp-buffer-name-multi-method (prefix multi-method method user host) | |
5049 "A name for the multi method connection buffer. | |
5050 MULTI-METHOD gives the multi method, METHOD the array of methods, | |
5051 USER the array of user names, HOST the array of host names." | |
5052 (unless (and (= (length method) (length user)) | |
5053 (= (length method) (length host))) | |
5054 (error "Syntax error in multi method (implementation error)")) | |
5055 (let ((len (length method)) | |
5056 (i 0) | |
5057 string-list) | |
5058 (while (< i len) | |
5059 (setq string-list | |
5060 (cons (if (aref user i) | |
5061 (format "%s#%s@%s:" (aref method i) | |
5062 (aref user i) (aref host i)) | |
5063 (format "%s@%s:" (aref method i) (aref host i))) | |
5064 string-list)) | |
5065 (incf i)) | |
5066 (format "*%s/%s %s*" | |
5067 prefix multi-method | |
5068 (apply 'concat (reverse string-list))))) | |
5069 | |
5070 (defun tramp-get-buffer (multi-method method user host) | |
5071 "Get the connection buffer to be used for USER at HOST using METHOD." | |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5072 (with-current-buffer |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5073 (get-buffer-create (tramp-buffer-name multi-method method user host)) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5074 (setq buffer-undo-list t) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5075 (current-buffer))) |
45861 | 5076 |
5077 (defun tramp-debug-buffer-name (multi-method method user host) | |
5078 "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
|
5079 (if multi-method |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5080 (tramp-buffer-name-multi-method "debug tramp" |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5081 multi-method method user host) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5082 (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
|
5083 (if user |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5084 (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
|
5085 (format "*debug tramp/%s %s*" method host))))) |
45861 | 5086 |
5087 (defun tramp-get-debug-buffer (multi-method method user host) | |
5088 "Get the debug buffer for USER at HOST using METHOD." | |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5089 (with-current-buffer |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5090 (get-buffer-create |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5091 (tramp-debug-buffer-name multi-method method user host)) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5092 (setq buffer-undo-list t) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5093 (current-buffer))) |
45861 | 5094 |
5095 (defun tramp-find-executable (multi-method method user host | |
5096 progname dirlist ignore-tilde) | |
5097 "Searches for PROGNAME in all directories mentioned in DIRLIST. | |
5098 First args METHOD, USER and HOST specify the connection, PROGNAME | |
5099 is the program to search for, and DIRLIST gives the list of directories | |
5100 to search. If IGNORE-TILDE is non-nil, directory names starting | |
5101 with `~' will be ignored. | |
5102 | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
5103 Returns the absolute file name of PROGNAME, if found, and nil otherwise. |
45861 | 5104 |
5105 This function expects to be in the right *tramp* buffer." | |
5106 (let (result) | |
5107 (when ignore-tilde | |
5108 ;; Remove all ~/foo directories from dirlist. In Emacs 20, | |
5109 ;; `remove' is in CL, and we want to avoid CL dependencies. | |
5110 (let (newdl d) | |
5111 (while dirlist | |
5112 (setq d (car dirlist)) | |
5113 (setq dirlist (cdr dirlist)) | |
5114 (unless (char-equal ?~ (aref d 0)) | |
5115 (setq newdl (cons d newdl)))) | |
5116 (setq dirlist (nreverse newdl)))) | |
5117 (tramp-send-command | |
5118 multi-method method user host | |
5119 (format (concat "while read d; " | |
5120 "do if test -x $d/%s -a -f $d/%s; " | |
5121 "then echo tramp_executable $d/%s; " | |
5122 "break; fi; done <<'EOF'") | |
5123 progname progname progname)) | |
5124 (mapcar (lambda (d) | |
5125 (tramp-send-command multi-method method user host d)) | |
5126 dirlist) | |
5127 (tramp-send-command multi-method method user host "EOF") | |
5128 (tramp-wait-for-output) | |
5129 (goto-char (point-max)) | |
5130 (when (search-backward "tramp_executable " nil t) | |
5131 (skip-chars-forward "^ ") | |
5132 (skip-chars-forward " ") | |
5133 (buffer-substring (point) (tramp-line-end-position))))) | |
5134 | |
5135 (defun tramp-set-remote-path (multi-method method user host var dirlist) | |
5136 "Sets the remote environment VAR to existing directories from DIRLIST. | |
5137 I.e., for each directory in DIRLIST, it is tested whether it exists and if | |
5138 so, it is added to the environment variable VAR." | |
5139 (let ((existing-dirs | |
5140 (mapcar | |
5141 (lambda (x) | |
5142 (when (and | |
5143 (file-exists-p | |
5144 (tramp-make-tramp-file-name multi-method method user host x)) | |
5145 (file-directory-p | |
5146 (tramp-make-tramp-file-name multi-method method user host x))) | |
5147 x)) | |
5148 dirlist))) | |
5149 (tramp-send-command | |
5150 multi-method method user host | |
5151 (concat var "=" | |
5152 (mapconcat 'identity (delq nil existing-dirs) ":") | |
5153 "; export " var)) | |
5154 (tramp-wait-for-output))) | |
5155 | |
5156 ;; -- communication with external shell -- | |
5157 | |
5158 (defun tramp-find-file-exists-command (multi-method method user host) | |
5159 "Find a command on the remote host for checking if a file exists. | |
5160 Here, we are looking for a command which has zero exit status if the | |
5161 file exists and nonzero exit status otherwise." | |
5162 (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
|
5163 (tramp-message 9 "Finding command to check if file exists") |
45861 | 5164 (let ((existing |
5165 (tramp-make-tramp-file-name | |
5166 multi-method method user host | |
5167 "/")) ;assume this file always exists | |
5168 (nonexisting | |
5169 (tramp-make-tramp-file-name | |
5170 multi-method method user host | |
5171 "/ this file does not exist "))) ;assume this never exists | |
5172 ;; The algorithm is as follows: we try a list of several commands. | |
5173 ;; For each command, we first run `$cmd /' -- this should return | |
5174 ;; true, as the root directory always exists. And then we run | |
5175 ;; `$cmd /this\ file\ does\ not\ exist', hoping that the file indeed | |
5176 ;; does not exist. This should return false. We use the first | |
5177 ;; command we find that seems to work. | |
5178 ;; The list of commands to try is as follows: | |
5179 ;; `ls -d' This works on most systems, but NetBSD 1.4 | |
5180 ;; has a bug: `ls' always returns zero exit | |
5181 ;; status, even for files which don't exist. | |
5182 ;; `test -e' Some Bourne shells have a `test' builtin | |
5183 ;; which does not know the `-e' option. | |
5184 ;; `/bin/test -e' For those, the `test' binary on disk normally | |
5185 ;; provides the option. Alas, the binary | |
5186 ;; is sometimes `/bin/test' and sometimes it's | |
5187 ;; `/usr/bin/test'. | |
5188 ;; `/usr/bin/test -e' In case `/bin/test' does not exist. | |
5189 (unless (or | |
5190 (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
|
5191 (file-exists-p existing) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5192 (not (file-exists-p nonexisting))) |
45861 | 5193 (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
|
5194 (file-exists-p existing) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5195 (not (file-exists-p nonexisting))) |
45861 | 5196 (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
|
5197 (file-exists-p existing) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5198 (not (file-exists-p nonexisting))) |
46808
cf225aed7a75
Version 2.0.11 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46802
diff
changeset
|
5199 (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
|
5200 (file-exists-p existing) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5201 (not (file-exists-p nonexisting)))) |
63424
9d665488ae5a
(tramp-find-file-exists-command, tramp-find-shell): Follow error conventions.
Juanma Barranquero <lekktu@gmail.com>
parents:
62437
diff
changeset
|
5202 (error "Couldn't find command to check if file exists")))) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5203 |
45861 | 5204 |
5205 ;; CCC test ksh or bash found for tilde expansion? | |
5206 (defun tramp-find-shell (multi-method method user host) | |
5207 "Find a shell on the remote host which groks tilde expansion." | |
5208 (let ((shell nil)) | |
5209 (tramp-send-command multi-method method user host "echo ~root") | |
5210 (tramp-wait-for-output) | |
5211 (cond | |
5212 ((string-match "^~root$" (buffer-string)) | |
5213 (setq shell | |
5214 (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
|
5215 "bash" tramp-remote-path t) |
45861 | 5216 (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
|
5217 "ksh" tramp-remote-path t))) |
45861 | 5218 (unless shell |
5219 (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
|
5220 ;; Find arguments for this shell. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
5221 (let ((alist tramp-sh-extra-args) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
5222 item extra-args) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
5223 (while (and alist (null extra-args)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
5224 (setq item (pop alist)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
5225 (when (string-match (car item) shell) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
5226 (setq extra-args (cdr item)))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
5227 (when extra-args (setq shell (concat shell " " extra-args)))) |
45861 | 5228 (tramp-message |
5229 5 "Starting remote shell `%s' for tilde expansion..." shell) | |
5230 (tramp-send-command | |
5231 multi-method method user host | |
46801
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
5232 (concat "PS1='$ ' exec " shell)) ; |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5233 (tramp-barf-if-no-shell-prompt |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5234 (get-buffer-process (current-buffer)) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5235 60 "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
|
5236 (tramp-message |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5237 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
|
5238 ;; 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
|
5239 ;; 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
|
5240 ;; 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
|
5241 ;; as well. |
45861 | 5242 (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
|
5243 tramp-rsh-end-of-line |
45861 | 5244 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
|
5245 tramp-rsh-end-of-line |
45861 | 5246 tramp-rsh-end-of-line)) |
5247 (tramp-wait-for-output) | |
46801
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
5248 (tramp-message |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5249 9 "Setting remote shell prompt...done") |
46835
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
5250 ) |
45861 | 5251 (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
|
5252 (tramp-get-method-parameter |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5253 multi-method method user host 'tramp-remote-sh)))))) |
45861 | 5254 |
5255 (defun tramp-check-ls-command (multi-method method user host cmd) | |
5256 "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
|
5257 METHOD, USER and HOST specify the connection, CMD (the absolute file name of) |
45861 | 5258 the `ls' executable. Returns t if CMD supports the `-n' option, nil |
5259 otherwise." | |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5260 (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
|
5261 (when (file-executable-p |
45861 | 5262 (tramp-make-tramp-file-name multi-method method user host cmd)) |
5263 (let ((result nil)) | |
5264 (tramp-message 7 "Testing remote command `%s' for -n..." cmd) | |
5265 (setq result | |
5266 (tramp-send-command-and-check | |
5267 multi-method method user host | |
5268 (format "%s -lnd / >/dev/null" | |
5269 cmd))) | |
5270 (tramp-message 7 "Testing remote command `%s' for -n...%s" | |
5271 cmd | |
5272 (if (zerop result) "okay" "failed")) | |
5273 (zerop result)))) | |
5274 | |
5275 (defun tramp-check-ls-commands (multi-method method user host cmd dirlist) | |
5276 "Checks whether the given `ls' executable in one of the dirs groks `-n'. | |
5277 Returns nil if none was found, else the command is returned." | |
5278 (let ((dl dirlist) | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5279 (result nil)) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5280 (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
|
5281 ;; 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
|
5282 ;; 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
|
5283 (while (and dl (not result)) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5284 (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
|
5285 (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
|
5286 (setq result x))) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5287 (setq dl (cdr dl))) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5288 result))) |
45861 | 5289 |
5290 (defun tramp-find-ls-command (multi-method method user host) | |
5291 "Finds an `ls' command which groks the `-n' option, returning nil if failed. | |
5292 \(This option prints numeric user and group ids in a long listing.)" | |
5293 (tramp-message 9 "Finding a suitable `ls' command") | |
5294 (or | |
5295 (tramp-check-ls-commands multi-method method user host "ls" tramp-remote-path) | |
5296 (tramp-check-ls-commands multi-method method user host "gnuls" tramp-remote-path) | |
5297 (tramp-check-ls-commands multi-method method user host "gls" tramp-remote-path))) | |
5298 | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5299 ;; ------------------------------------------------------------ |
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5300 ;; -- Functions for establishing connection -- |
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5301 ;; ------------------------------------------------------------ |
45861 | 5302 |
46752 | 5303 ;; The following functions are actions to be taken when seeing certain |
5304 ;; prompts from the remote host. See the variable | |
5305 ;; `tramp-actions-before-shell' for usage of these functions. | |
5306 | |
5307 (defun tramp-action-login (p multi-method method user host) | |
5308 "Send the login name." | |
5309 (tramp-message 9 "Sending login name `%s'" | |
5310 (or user (user-login-name))) | |
5311 (erase-buffer) | |
5312 (process-send-string nil (concat (or user (user-login-name)) | |
5313 tramp-rsh-end-of-line))) | |
5314 | |
5315 (defun tramp-action-password (p multi-method method user host) | |
5316 "Query the user for a password." | |
65359
71de05246686
* woman.el (top): Remap `man' command by `woman' in
Michael Albinus <michael.albinus@gmx.de>
parents:
65304
diff
changeset
|
5317 (let ((pw-prompt |
71de05246686
* woman.el (top): Remap `man' command by `woman' in
Michael Albinus <michael.albinus@gmx.de>
parents:
65304
diff
changeset
|
5318 (format "Password for %s " |
71de05246686
* woman.el (top): Remap `man' command by `woman' in
Michael Albinus <michael.albinus@gmx.de>
parents:
65304
diff
changeset
|
5319 (tramp-make-tramp-file-name |
71de05246686
* woman.el (top): Remap `man' command by `woman' in
Michael Albinus <michael.albinus@gmx.de>
parents:
65304
diff
changeset
|
5320 nil method user host "")))) |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
5321 (tramp-message 9 "Sending password") |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5322 (tramp-enter-password p pw-prompt user host))) |
46752 | 5323 |
5324 (defun tramp-action-succeed (p multi-method method user host) | |
5325 "Signal success in finding shell prompt." | |
5326 (tramp-message 9 "Found remote shell prompt.") | |
5327 (erase-buffer) | |
5328 (throw 'tramp-action 'ok)) | |
5329 | |
5330 (defun tramp-action-permission-denied (p multi-method method user host) | |
5331 "Signal permission denied." | |
46790 | 5332 (pop-to-buffer (tramp-get-buffer multi-method method user host)) |
46752 | 5333 (tramp-message 9 "Permission denied by remote host.") |
5334 (kill-process p) | |
5335 (throw 'tramp-action 'permission-denied)) | |
5336 | |
5337 (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
|
5338 "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
|
5339 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
|
5340 See also `tramp-action-yn'." |
46752 | 5341 (save-window-excursion |
5342 (pop-to-buffer (tramp-get-buffer multi-method method user host)) | |
5343 (unless (yes-or-no-p (match-string 0)) | |
5344 (kill-process p) | |
5345 (erase-buffer) | |
5346 (throw 'tramp-action 'permission-denied)) | |
5347 (process-send-string p (concat "yes" tramp-rsh-end-of-line)) | |
5348 (erase-buffer))) | |
5349 | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
5350 (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
|
5351 "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
|
5352 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
|
5353 See also `tramp-action-yesno'." |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
5354 (save-window-excursion |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
5355 (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
|
5356 (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
|
5357 (kill-process p) |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
5358 (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
|
5359 (erase-buffer) |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
5360 (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
|
5361 |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
5362 (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
|
5363 "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
|
5364 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
|
5365 (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
|
5366 tramp-terminal-type) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
5367 (erase-buffer) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
5368 (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
|
5369 tramp-rsh-end-of-line))) |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
5370 |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5371 (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
|
5372 "Check whether a process has finished." |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5373 (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
|
5374 (throw 'tramp-action 'process-died))) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5375 |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5376 (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
|
5377 "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
|
5378 (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
|
5379 (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
|
5380 (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
|
5381 (throw 'tramp-action 'ok)) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5382 ((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
|
5383 (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
|
5384 (memq (process-status p) '(signal))) |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5385 ;; `scp' could have copied correctly, but set modes could have failed. |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5386 ;; This can be ignored. |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5387 (goto-char (point-min)) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5388 (if (re-search-forward tramp-operation-not-permitted-regexp nil t) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5389 (progn |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5390 (tramp-message 10 "'set mode' error ignored.") |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5391 (tramp-message 9 "Process has finished.") |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5392 (throw 'tramp-action 'ok)) |
66630
7b4c431b02c5
(tramp-action-out-of-band): Handle scp message "Permission denied".
Lars Hansen <larsh@soem.dk>
parents:
66561
diff
changeset
|
5393 (goto-char (point-min)) |
7b4c431b02c5
(tramp-action-out-of-band): Handle scp message "Permission denied".
Lars Hansen <larsh@soem.dk>
parents:
66561
diff
changeset
|
5394 (when (re-search-forward "^.cp.?: \\(.+: Permission denied.?\\)$" nil t) |
7b4c431b02c5
(tramp-action-out-of-band): Handle scp message "Permission denied".
Lars Hansen <larsh@soem.dk>
parents:
66561
diff
changeset
|
5395 (error "Remote host: %s" (match-string 1))) |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5396 (tramp-message 9 "Process has died.") |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
5397 (throw 'tramp-action 'process-died))) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5398 (t nil))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5399 |
46752 | 5400 ;; The following functions are specifically for multi connections. |
5401 | |
5402 (defun tramp-multi-action-login (p method user host) | |
5403 "Send the login name." | |
5404 (tramp-message 9 "Sending login name `%s'" user) | |
5405 (erase-buffer) | |
5406 (process-send-string p (concat user tramp-rsh-end-of-line))) | |
5407 | |
5408 (defun tramp-multi-action-password (p method user host) | |
5409 "Query the user for a password." | |
65359
71de05246686
* woman.el (top): Remap `man' command by `woman' in
Michael Albinus <michael.albinus@gmx.de>
parents:
65304
diff
changeset
|
5410 (let ((pw-prompt |
71de05246686
* woman.el (top): Remap `man' command by `woman' in
Michael Albinus <michael.albinus@gmx.de>
parents:
65304
diff
changeset
|
5411 (format "Password for %s " |
71de05246686
* woman.el (top): Remap `man' command by `woman' in
Michael Albinus <michael.albinus@gmx.de>
parents:
65304
diff
changeset
|
5412 (tramp-make-tramp-file-name |
71de05246686
* woman.el (top): Remap `man' command by `woman' in
Michael Albinus <michael.albinus@gmx.de>
parents:
65304
diff
changeset
|
5413 nil method user host "")))) |
71de05246686
* woman.el (top): Remap `man' command by `woman' in
Michael Albinus <michael.albinus@gmx.de>
parents:
65304
diff
changeset
|
5414 (tramp-message 9 "Sending password") |
71de05246686
* woman.el (top): Remap `man' command by `woman' in
Michael Albinus <michael.albinus@gmx.de>
parents:
65304
diff
changeset
|
5415 (tramp-enter-password p pw-prompt user host))) |
46752 | 5416 |
5417 (defun tramp-multi-action-succeed (p method user host) | |
5418 "Signal success in finding shell prompt." | |
5419 (tramp-message 9 "Found shell prompt on `%s'" host) | |
5420 (erase-buffer) | |
5421 (throw 'tramp-action 'ok)) | |
5422 | |
5423 (defun tramp-multi-action-permission-denied (p method user host) | |
5424 "Signal permission denied." | |
5425 (tramp-message 9 "Permission denied by remote host `%s'" host) | |
5426 (kill-process p) | |
5427 (erase-buffer) | |
5428 (throw 'tramp-action 'permission-denied)) | |
5429 | |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5430 (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
|
5431 "Check whether a process has finished." |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5432 (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
|
5433 (throw 'tramp-action 'process-died))) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5434 |
46752 | 5435 ;; Functions for processing the actions. |
5436 | |
5437 (defun tramp-process-one-action (p multi-method method user host actions) | |
5438 "Wait for output from the shell and perform one action." | |
5439 (let (found item pattern action todo) | |
5440 (erase-buffer) | |
5441 (tramp-message 9 "Waiting 60s for prompt from remote shell") | |
5442 (with-timeout (60 (throw 'tramp-action 'timeout)) | |
5443 (while (not found) | |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5444 (tramp-accept-process-output p 1) |
46752 | 5445 (goto-char (point-min)) |
5446 (setq todo actions) | |
5447 (while todo | |
5448 (goto-char (point-min)) | |
5449 (setq item (pop todo)) | |
5450 (setq pattern (symbol-value (nth 0 item))) | |
5451 (setq action (nth 1 item)) | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5452 (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
|
5453 pattern) |
46752 | 5454 (when (re-search-forward (concat pattern "\\'") nil t) |
5455 (setq found (funcall action p multi-method method user host))))) | |
5456 found))) | |
5457 | |
5458 (defun tramp-process-actions (p multi-method method user host actions) | |
5459 "Perform actions until success." | |
5460 (let (exit) | |
5461 (while (not exit) | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5462 (tramp-message 9 "Waiting for prompts from remote shell") |
46752 | 5463 (setq exit |
5464 (catch 'tramp-action | |
5465 (tramp-process-one-action | |
5466 p multi-method method user host actions) | |
5467 nil))) | |
5468 (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
|
5469 (tramp-clear-passwd user host) |
46752 | 5470 (error "Login failed")))) |
5471 | |
5472 ;; For multi-actions. | |
5473 | |
5474 (defun tramp-process-one-multi-action (p method user host actions) | |
5475 "Wait for output from the shell and perform one action." | |
5476 (let (found item pattern action todo) | |
5477 (erase-buffer) | |
5478 (tramp-message 9 "Waiting 60s for prompt from remote shell") | |
5479 (with-timeout (60 (throw 'tramp-action 'timeout)) | |
5480 (while (not found) | |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5481 (tramp-accept-process-output p 1) |
46752 | 5482 (setq todo actions) |
5483 (goto-char (point-min)) | |
5484 (while todo | |
5485 (goto-char (point-min)) | |
5486 (setq item (pop todo)) | |
5487 (setq pattern (symbol-value (nth 0 item))) | |
5488 (setq action (nth 1 item)) | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5489 (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
|
5490 pattern) |
46752 | 5491 (when (re-search-forward (concat pattern "\\'") nil t) |
5492 (setq found (funcall action p method user host))))) | |
5493 found))) | |
5494 | |
5495 (defun tramp-process-multi-actions (p method user host actions) | |
5496 "Perform actions until success." | |
5497 (let (exit) | |
5498 (while (not exit) | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5499 (tramp-message 9 "Waiting for prompts from remote shell") |
46752 | 5500 (setq exit |
5501 (catch 'tramp-action | |
5502 (tramp-process-one-multi-action p method user host actions) | |
5503 nil))) | |
5504 (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
|
5505 (tramp-clear-passwd user host) |
46752 | 5506 (error "Login failed")))) |
5507 | |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5508 ;; 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
|
5509 ;; 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
|
5510 ;; 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
|
5511 ;; 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
|
5512 ;; 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
|
5513 ;; 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
|
5514 ;; might be running...) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5515 (defun tramp-process-initial-commands (p |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5516 multi-method method user host |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5517 commands) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5518 "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
|
5519 (let (cmd) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5520 (while commands |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5521 (setq cmd (pop commands)) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5522 (erase-buffer) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5523 (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
|
5524 cmd) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
5525 (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
|
5526 (tramp-barf-if-no-shell-prompt |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5527 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
|
5528 (erase-buffer))) |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5529 |
46752 | 5530 ;; The actual functions for opening connections. |
45861 | 5531 |
5532 (defun tramp-open-connection-telnet (multi-method method user host) | |
5533 "Open a connection using a telnet METHOD. | |
5534 This starts the command `telnet HOST ARGS'[*], then waits for a remote | |
5535 login prompt, then sends the user name USER, then waits for a remote | |
5536 password prompt. It queries the user for the password, then sends the | |
5537 password to the remote host. | |
5538 | |
5539 If USER is nil, uses value returned by `(user-login-name)' instead. | |
5540 | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5541 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
|
5542 `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
|
5543 set up correctly. |
45861 | 5544 |
5545 Please note that it is NOT possible to use this connection method | |
5546 together with an out-of-band transfer method! You must use an inline | |
5547 transfer method. | |
5548 | |
5549 Maybe the different regular expressions need to be tuned. | |
5550 | |
5551 * Actually, the telnet program as well as the args to be used can be | |
5552 specified in the method parameters, see the variable `tramp-methods'." | |
5553 (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
|
5554 (when (tramp-method-out-of-band-p multi-method method user host) |
45861 | 5555 (error "Cannot use out-of-band method `%s' with telnet connection method" |
5556 method)) | |
5557 (when multi-method | |
5558 (error "Cannot multi-connect using telnet connection method")) | |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
5559 (tramp-pre-connection multi-method method user host tramp-chunksize) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5560 (tramp-message 7 "Opening connection for %s@%s using %s..." |
45861 | 5561 (or user (user-login-name)) host method) |
5562 (let ((process-environment (copy-sequence process-environment))) | |
5563 (setenv "TERM" tramp-terminal-type) | |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
5564 (setenv "PS1" "$ ") |
45861 | 5565 (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
|
5566 ;; 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
|
5567 ;; `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
|
5568 ;; we use nil in these cases. Which one is right? |
45861 | 5569 (coding-system-for-read (unless (and (not (featurep 'xemacs)) |
5570 (> emacs-major-version 20)) | |
5571 tramp-dos-coding-system)) | |
5572 (p (apply 'start-process | |
5573 (tramp-buffer-name multi-method method user host) | |
5574 (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
|
5575 (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
|
5576 multi-method |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
5577 (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
|
5578 user host 'tramp-login-program) |
45861 | 5579 host |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5580 (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
|
5581 multi-method |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
5582 (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
|
5583 user host 'tramp-login-args))) |
45861 | 5584 (found nil) |
5585 (pw nil)) | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5586 (tramp-set-process-query-on-exit-flag p nil) |
46752 | 5587 (set-buffer (tramp-get-buffer multi-method method user host)) |
5588 (erase-buffer) | |
5589 (tramp-process-actions p multi-method method user host | |
5590 tramp-actions-before-shell) | |
45861 | 5591 (tramp-open-connection-setup-interactive-shell |
5592 p multi-method method user host) | |
5593 (tramp-post-connection multi-method method user host))))) | |
5594 | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5595 |
45861 | 5596 (defun tramp-open-connection-rsh (multi-method method user host) |
5597 "Open a connection using an rsh METHOD. | |
5598 This starts the command `rsh HOST -l USER'[*], then waits for a remote | |
5599 password or shell prompt. If a password prompt is seen, the user is | |
5600 queried for a password, this function sends the password to the remote | |
5601 host and waits for a shell prompt. | |
5602 | |
5603 If USER is nil, start the command `rsh HOST'[*] instead | |
5604 | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5605 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
|
5606 `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
|
5607 set up correctly. |
45861 | 5608 |
46010
d07b0e5f80b9
(tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46009
diff
changeset
|
5609 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
|
5610 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
|
5611 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
|
5612 |
45861 | 5613 * Actually, the rsh program to be used can be specified in the |
5614 method parameters, see the variable `tramp-methods'." | |
5615 (save-match-data | |
5616 (when multi-method | |
5617 (error "Cannot multi-connect using rsh connection method")) | |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
5618 (tramp-pre-connection multi-method method user host tramp-chunksize) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5619 (if (and user (not (string= user ""))) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5620 (tramp-message 7 "Opening connection for %s@%s using %s..." |
45861 | 5621 user host method) |
5622 (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
|
5623 (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
|
5624 (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
|
5625 (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
|
5626 (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
|
5627 multi-method |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
5628 (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
|
5629 user host 'tramp-login-program)) |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5630 (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
|
5631 multi-method |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
5632 (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
|
5633 user host 'tramp-login-args)) |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5634 (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
|
5635 ;; 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
|
5636 ;; 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
|
5637 (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
|
5638 (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
|
5639 (setq real-host (match-string 1 host))) |
45861 | 5640 (setenv "TERM" tramp-terminal-type) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
5641 (setenv "PS1" "$ ") |
45861 | 5642 (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
|
5643 ;; 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
|
5644 ;; `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
|
5645 ;; we use nil in these cases. Which one is right? |
45861 | 5646 (coding-system-for-read (unless (and (not (featurep 'xemacs)) |
5647 (> emacs-major-version 20)) | |
5648 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
|
5649 (p (if (and user (not (string= user ""))) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5650 (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
|
5651 real-host "-l" user login-args) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5652 (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
|
5653 real-host login-args))) |
45861 | 5654 (found nil)) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5655 (tramp-set-process-query-on-exit-flag p nil) |
46752 | 5656 |
5657 (set-buffer buf) | |
5658 (tramp-process-actions p multi-method method user host | |
5659 tramp-actions-before-shell) | |
45861 | 5660 (tramp-message 7 "Initializing remote shell") |
5661 (tramp-open-connection-setup-interactive-shell | |
5662 p multi-method method user host) | |
5663 (tramp-post-connection multi-method method user host))))) | |
5664 | |
5665 (defun tramp-open-connection-su (multi-method method user host) | |
5666 "Open a connection using the `su' program with METHOD. | |
5667 This starts `su - USER', then waits for a password prompt. The HOST | |
5668 name must be equal to the local host name or to `localhost'. | |
5669 | |
5670 If USER is nil, uses value returned by user-login-name instead. | |
5671 | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5672 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
|
5673 `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
|
5674 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
|
5675 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
|
5676 `shell-prompt-pattern' is set up wrongly!" |
45861 | 5677 (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
|
5678 (when (tramp-method-out-of-band-p multi-method method user host) |
45861 | 5679 (error "Cannot use out-of-band method `%s' with `su' connection method" |
5680 method)) | |
5681 (unless (or (string-match (concat "^" (regexp-quote host)) | |
5682 (system-name)) | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5683 (string= "localhost" host) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5684 (string= "" host)) |
45861 | 5685 (error |
5686 "Cannot connect to different host `%s' with `su' connection method" | |
5687 host)) | |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
5688 (tramp-pre-connection multi-method method user host tramp-chunksize) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
5689 (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
|
5690 (or user "<root>") method) |
45861 | 5691 (let ((process-environment (copy-sequence process-environment))) |
5692 (setenv "TERM" tramp-terminal-type) | |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
5693 (setenv "PS1" "$ ") |
45861 | 5694 (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
|
5695 ;; 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
|
5696 ;; 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
|
5697 ;; cases. What's the difference? Which one is right? |
45861 | 5698 (coding-system-for-read (unless (and (not (featurep 'xemacs)) |
5699 (> emacs-major-version 20)) | |
5700 tramp-dos-coding-system)) | |
5701 (p (apply 'start-process | |
46752 | 5702 (tramp-buffer-name multi-method method user host) |
5703 (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
|
5704 (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
|
5705 multi-method |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
5706 (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
|
5707 user host 'tramp-login-program) |
45861 | 5708 (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
|
5709 (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
|
5710 (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
|
5711 (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
|
5712 multi-method |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
5713 (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
|
5714 user host 'tramp-login-args)))) |
45861 | 5715 (found nil) |
5716 (pw nil)) | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5717 (tramp-set-process-query-on-exit-flag p nil) |
46752 | 5718 (set-buffer (tramp-get-buffer multi-method method user host)) |
5719 (tramp-process-actions p multi-method method user host | |
5720 tramp-actions-before-shell) | |
45861 | 5721 (tramp-open-connection-setup-interactive-shell |
5722 p multi-method method user host) | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5723 (tramp-post-connection multi-method method |
45861 | 5724 user host))))) |
5725 | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5726 ;; HHH: Not Changed. Multi method. It is not clear to me how this can |
45861 | 5727 ;; handle not giving a user name in the "file name". |
5728 ;; | |
5729 ;; This is more difficult than for the single-hop method. In the | |
5730 ;; multi-hop-method, the desired behaviour should be that the | |
5731 ;; user must specify names for the telnet hops of which the user | |
5732 ;; name is different than the "original" name (or different from | |
5733 ;; the previous hop. | |
5734 (defun tramp-open-connection-multi (multi-method method user host) | |
5735 "Open a multi-hop connection using METHOD. | |
5736 This uses a slightly changed file name syntax. The idea is to say | |
5737 [multi/telnet:u1@h1/rsh:u2@h2]/path/to/file | |
5738 This will use telnet to log in as u1 to h1, then use rsh from there to | |
5739 log in as u2 to h2." | |
5740 (save-match-data | |
5741 (unless multi-method | |
5742 (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
|
5743 (when (tramp-method-out-of-band-p multi-method method user host) |
45861 | 5744 (error "No out of band multi-hop connections")) |
5745 (unless (and (arrayp method) (not (stringp method))) | |
5746 (error "METHOD must be an array of strings for multi methods")) | |
5747 (unless (and (arrayp user) (not (stringp user))) | |
5748 (error "USER must be an array of strings for multi methods")) | |
5749 (unless (and (arrayp host) (not (stringp host))) | |
5750 (error "HOST must be an array of strings for multi methods")) | |
5751 (unless (and (= (length method) (length user)) | |
5752 (= (length method) (length host))) | |
5753 (error "Arrays METHOD, USER, HOST must have equal length")) | |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
5754 (tramp-pre-connection multi-method method user host tramp-chunksize) |
45861 | 5755 (tramp-message 7 "Opening `%s' connection..." multi-method) |
5756 (let ((process-environment (copy-sequence process-environment))) | |
5757 (setenv "TERM" tramp-terminal-type) | |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
5758 (setenv "PS1" "$ ") |
45861 | 5759 (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
|
5760 ;; 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
|
5761 ;; 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
|
5762 ;; cases. What's the difference? Which one is right? |
45861 | 5763 (coding-system-for-read (unless (and (not (featurep 'xemacs)) |
5764 (> emacs-major-version 20)) | |
5765 tramp-dos-coding-system)) | |
5766 (p (start-process (tramp-buffer-name multi-method method user host) | |
5767 (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
|
5768 tramp-multi-sh-program)) |
45861 | 5769 (num-hops (length method)) |
5770 (i 0)) | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5771 (tramp-set-process-query-on-exit-flag p nil) |
45861 | 5772 (tramp-message 9 "Waiting 60s for local shell to come up...") |
5773 (unless (tramp-wait-for-regexp | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5774 p 60 (format "\\(%s\\)\\'\\|\\(%s\\)\\'" |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
5775 shell-prompt-pattern tramp-shell-prompt-pattern)) |
45861 | 5776 (pop-to-buffer (buffer-name)) |
5777 (kill-process p) | |
5778 (error "Couldn't find local shell prompt")) | |
5779 ;; Now do all the connections as specified. | |
5780 (while (< i num-hops) | |
5781 (let* ((m (aref method i)) | |
5782 (u (aref user i)) | |
5783 (h (aref host i)) | |
5784 (entry (assoc m tramp-multi-connection-function-alist)) | |
5785 (multi-func (nth 1 entry)) | |
5786 (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
|
5787 ;; The multi-funcs don't need to do save-match-data, as that |
45861 | 5788 ;; is done here. |
5789 (funcall multi-func p m u h command) | |
5790 (erase-buffer) | |
5791 (incf i))) | |
5792 (tramp-open-connection-setup-interactive-shell | |
5793 p multi-method method user host) | |
5794 (tramp-post-connection multi-method method user host))))) | |
5795 | |
5796 ;; HHH: Changed. Multi method. Don't know how to handle this in the case | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5797 ;; of no user name provided. Hack to make it work as it did before: |
45861 | 5798 ;; changed `user' to `(or user (user-login-name))' in the places where |
5799 ;; the value is actually used. | |
5800 (defun tramp-multi-connect-telnet (p method user host command) | |
5801 "Issue `telnet' command. | |
5802 Uses shell COMMAND to issue a `telnet' command to log in as USER to | |
5803 HOST. You can use percent escapes in COMMAND: `%h' is replaced with | |
5804 the host name, and `%n' is replaced with an end of line character, as | |
5805 set in `tramp-rsh-end-of-line'. Use `%%' if you want a literal percent | |
5806 character. | |
5807 | |
5808 If USER is nil, uses the return value of (user-login-name) instead." | |
46752 | 5809 (let ((cmd (format-spec command |
5810 `((?h . ,host) (?n . ,tramp-rsh-end-of-line)))) | |
5811 (cmd1 (format-spec command `((?h . ,host) (?n . "")))) | |
45861 | 5812 found pw) |
5813 (erase-buffer) | |
5814 (tramp-message 9 "Sending telnet command `%s'" cmd1) | |
5815 (process-send-string p cmd) | |
46752 | 5816 (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
|
5817 tramp-multi-actions))) |
45861 | 5818 |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5819 ;; HHH: Changed. Multi method. Don't know how to handle this in the case |
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5820 ;; of no user name provided. Hack to make it work as it did before: |
45861 | 5821 ;; changed `user' to `(or user (user-login-name))' in the places where |
5822 ;; the value is actually used. | |
5823 (defun tramp-multi-connect-rlogin (p method user host command) | |
5824 "Issue `rlogin' command. | |
5825 Uses shell COMMAND to issue an `rlogin' command to log in as USER to | |
5826 HOST. You can use percent escapes in COMMAND. `%u' will be replaced | |
5827 with the user name, `%h' will be replaced with the host name, and `%n' | |
5828 will be replaced with the value of `tramp-rsh-end-of-line'. You can use | |
5829 `%%' if you want to use a literal percent character. | |
5830 | |
5831 If USER is nil, uses the return value of (user-login-name) instead." | |
46752 | 5832 (let ((cmd (format-spec command `((?h . ,host) |
5833 (?u . ,(or user (user-login-name))) | |
5834 (?n . ,tramp-rsh-end-of-line)))) | |
5835 (cmd1 (format-spec command `((?h . ,host) | |
5836 (?u . ,(or user (user-login-name))) | |
5837 (?n . "")))) | |
45861 | 5838 found) |
5839 (erase-buffer) | |
5840 (tramp-message 9 "Sending rlogin command `%s'" cmd1) | |
5841 (process-send-string p cmd) | |
46752 | 5842 (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
|
5843 tramp-multi-actions))) |
45861 | 5844 |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5845 ;; HHH: Changed. Multi method. Don't know how to handle this in the case |
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
5846 ;; of no user name provided. Hack to make it work as it did before: |
45861 | 5847 ;; changed `user' to `(or user (user-login-name))' in the places where |
5848 ;; the value is actually used. | |
5849 (defun tramp-multi-connect-su (p method user host command) | |
5850 "Issue `su' command. | |
5851 Uses shell COMMAND to issue a `su' command to log in as USER on | |
5852 HOST. The HOST name is ignored, this just changes the user id on the | |
5853 host currently logged in to. | |
5854 | |
5855 If USER is nil, uses the return value of (user-login-name) instead. | |
5856 | |
5857 You can use percent escapes in the COMMAND. `%u' is replaced with the | |
5858 user name, and `%n' is replaced with the value of | |
5859 `tramp-rsh-end-of-line'. Use `%%' if you want a literal percent | |
5860 character." | |
46752 | 5861 (let ((cmd (format-spec command `((?u . ,(or user (user-login-name))) |
5862 (?n . ,tramp-rsh-end-of-line)))) | |
5863 (cmd1 (format-spec command `((?u . ,(or user (user-login-name))) | |
5864 (?n . "")))) | |
45861 | 5865 found) |
5866 (erase-buffer) | |
5867 (tramp-message 9 "Sending su command `%s'" cmd1) | |
5868 (process-send-string p cmd) | |
46752 | 5869 (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
|
5870 tramp-multi-actions))) |
45861 | 5871 |
5872 ;; Utility functions. | |
5873 | |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5874 (defun tramp-accept-process-output |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5875 (&optional process timeout timeout-msecs) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5876 "Like `accept-process-output' for Tramp processes. |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5877 This is needed in order to hide `last-coding-system-used', which is set |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5878 for process communication also." |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5879 (let (last-coding-system-used) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5880 (accept-process-output process timeout timeout-msecs))) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5881 |
45861 | 5882 (defun tramp-wait-for-regexp (proc timeout regexp) |
5883 "Wait for a REGEXP to appear from process PROC within TIMEOUT seconds. | |
5884 Expects the output of PROC to be sent to the current buffer. Returns | |
5885 the string that matched, or nil. Waits indefinitely if TIMEOUT is | |
5886 nil." | |
5887 (let ((found nil) | |
5888 (start-time (current-time))) | |
5889 (cond (timeout | |
5890 ;; Work around a bug in XEmacs 21, where the timeout | |
5891 ;; expires faster than it should. This degenerates | |
5892 ;; to polling for buggy XEmacsen, but oh, well. | |
5893 (while (and (not found) | |
5894 (< (tramp-time-diff (current-time) start-time) | |
5895 timeout)) | |
5896 (with-timeout (timeout) | |
5897 (while (not found) | |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5898 (tramp-accept-process-output proc 1) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5899 (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
|
5900 (error "Process has died")) |
45861 | 5901 (goto-char (point-min)) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5902 (setq found (re-search-forward regexp nil t)))))) |
45861 | 5903 (t |
5904 (while (not found) | |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5905 (tramp-accept-process-output proc 1) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
5906 (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
|
5907 (error "Process has died")) |
45861 | 5908 (goto-char (point-min)) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
5909 (setq found (re-search-forward regexp nil t))))) |
45861 | 5910 (when tramp-debug-buffer |
5911 (append-to-buffer | |
5912 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method | |
5913 tramp-current-user tramp-current-host) | |
5914 (point-min) (point-max)) | |
5915 (when (not found) | |
5916 (save-excursion | |
5917 (set-buffer | |
5918 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method | |
5919 tramp-current-user tramp-current-host)) | |
5920 (goto-char (point-max)) | |
5921 (insert "[[Regexp `" regexp "' not found" | |
46048
05db6f1e91ca
(tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46010
diff
changeset
|
5922 (if timeout (format " in %d secs" timeout) "") |
45861 | 5923 "]]")))) |
5924 found)) | |
5925 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5926 (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
|
5927 "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
|
5928 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
|
5929 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
|
5930 and `tramp-shell-prompt-pattern'." |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5931 (tramp-wait-for-regexp |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5932 proc timeout |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5933 (format "\\(%s\\|%s\\)\\'" |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5934 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
|
5935 |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5936 (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
|
5937 "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
|
5938 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
|
5939 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
|
5940 (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
|
5941 (pop-to-buffer (buffer-name)) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5942 (apply 'error error-args))) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5943 |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
5944 (defun tramp-enter-password (p prompt user host) |
45861 | 5945 "Prompt for a password and send it to the remote end. |
5946 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
|
5947 (let ((pw (tramp-read-passwd user host prompt))) |
46752 | 5948 (erase-buffer) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5949 (process-send-string |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
5950 p (concat pw |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5951 (or (tramp-get-method-parameter |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5952 tramp-current-multi-method |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5953 tramp-current-method |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5954 tramp-current-user |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5955 tramp-current-host |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5956 'tramp-password-end-of-line) |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
5957 tramp-default-password-end-of-line))))) |
45861 | 5958 |
5959 ;; HHH: Not Changed. This might handle the case where USER is not | |
5960 ;; 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
|
5961 ;; variable tramp-current-user will be set to nil. |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
5962 (defun tramp-pre-connection (multi-method method user host chunksize) |
45861 | 5963 "Do some setup before actually logging in. |
5964 METHOD, USER and HOST specify the connection." | |
5965 (set-buffer (tramp-get-buffer multi-method method user host)) | |
5966 (set (make-local-variable 'tramp-current-multi-method) multi-method) | |
5967 (set (make-local-variable 'tramp-current-method) method) | |
5968 (set (make-local-variable 'tramp-current-user) user) | |
5969 (set (make-local-variable 'tramp-current-host) host) | |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
5970 (set (make-local-variable 'tramp-chunksize) chunksize) |
45861 | 5971 (set (make-local-variable 'inhibit-eol-conversion) nil) |
5972 (erase-buffer)) | |
5973 | |
5974 (defun tramp-open-connection-setup-interactive-shell | |
5975 (p multi-method method user host) | |
5976 "Set up an interactive shell. | |
5977 Mainly sets the prompt and the echo correctly. P is the shell process | |
5978 to set up. METHOD, USER and HOST specify the connection." | |
5979 ;; Wait a bit in case the remote end feels like sending a little | |
5980 ;; junk first. It seems that fencepost.gnu.org does this when doing | |
5981 ;; a Kerberos login. | |
5982 (sit-for 1) | |
5983 (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
|
5984 (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
|
5985 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
|
5986 ;; 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
|
5987 ;; 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
|
5988 ;; 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
|
5989 ;; 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
|
5990 ;; 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
|
5991 ;; 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
|
5992 ;; 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
|
5993 ;; 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
|
5994 ;; 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
|
5995 ;; 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
|
5996 ;; 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
|
5997 ;; clobbering $PS1. |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5998 (tramp-send-command-internal |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
5999 multi-method method user host |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6000 (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
|
6001 (tramp-get-method-parameter |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
6002 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
|
6003 (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
|
6004 (tramp-get-method-parameter |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
6005 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
|
6006 (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
|
6007 p 30 |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6008 "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
|
6009 (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
|
6010 (buffer-name)) |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6011 (tramp-message 8 "Setting up remote shell environment") |
45861 | 6012 (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
|
6013 (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
|
6014 "stty -inlcr -echo kill '^U'") |
45861 | 6015 (erase-buffer) |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6016 ;; 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
|
6017 (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
|
6018 "echo foo") |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6019 (erase-buffer) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6020 (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
|
6021 "TERM=dumb; export TERM") |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
6022 (erase-buffer) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
6023 ;; Check whether the remote host suffers from buggy `send-process-string'. |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
6024 ;; This is known for FreeBSD (see comment in `send_process', file process.c). |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
6025 ;; I've tested sending 624 bytes successfully, sending 625 bytes failed. |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
6026 ;; Emacs makes a hack when this host type is detected locally. It cannot |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
6027 ;; handle remote hosts, though. |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
6028 (when (or (not tramp-chunksize) (zerop tramp-chunksize)) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
6029 (tramp-message 9 "Checking remote host type for `send-process-string' bug") |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
6030 (tramp-send-command-internal multi-method method user host |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
6031 "(uname -sr) 2>/dev/null") |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
6032 (goto-char (point-min)) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
6033 (when (looking-at "FreeBSD") |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
6034 (setq tramp-chunksize 500))) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
6035 |
45861 | 6036 ;; Try to set up the coding system correctly. |
6037 ;; CCC this can't be the right way to do it. Hm. | |
6038 (save-excursion | |
6039 (erase-buffer) | |
6040 (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
|
6041 (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
|
6042 "echo foo ; echo bar") |
45861 | 6043 (goto-char (point-min)) |
6044 (if (featurep 'mule) | |
6045 ;; Use MULE to select the right EOL convention for communicating | |
6046 ;; with the process. | |
6047 (let* ((cs (or (process-coding-system p) (cons 'undecided 'undecided))) | |
6048 cs-decode cs-encode) | |
6049 (when (symbolp cs) (setq cs (cons cs cs))) | |
6050 (setq cs-decode (car cs)) | |
6051 (setq cs-encode (cdr cs)) | |
6052 (unless cs-decode (setq cs-decode 'undecided)) | |
6053 (unless cs-encode (setq cs-encode 'undecided)) | |
6054 (setq cs-encode (tramp-coding-system-change-eol-conversion | |
6055 cs-encode 'unix)) | |
6056 (when (search-forward "\r" nil t) | |
6057 (setq cs-decode (tramp-coding-system-change-eol-conversion | |
6058 cs-decode 'dos))) | |
6059 (set-buffer-process-coding-system cs-decode cs-encode)) | |
6060 ;; Look for ^M and do something useful if found. | |
6061 (when (search-forward "\r" nil t) | |
6062 ;; We have found a ^M but cannot frob the process coding system | |
6063 ;; because we're running on a non-MULE Emacs. Let's try | |
6064 ;; stty, instead. | |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
6065 (erase-buffer) |
45861 | 6066 (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
|
6067 (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
|
6068 "stty -onlcr")))) |
45861 | 6069 (erase-buffer) |
6070 (tramp-message | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6071 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
|
6072 (tramp-send-command-internal |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6073 multi-method method user host |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6074 "HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE") |
45861 | 6075 (erase-buffer) |
6076 (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
|
6077 (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
|
6078 "set +o vi +o emacs") |
45861 | 6079 (erase-buffer) |
6080 (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
|
6081 (tramp-send-command-internal |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6082 multi-method method user host |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6083 "unset MAIL MAILCHECK MAILPATH 1>/dev/null 2>/dev/null") |
45861 | 6084 (erase-buffer) |
6085 (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
|
6086 (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
|
6087 "unset CDPATH") |
45861 | 6088 (erase-buffer) |
6089 (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
|
6090 ;; 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
|
6091 ;; 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
|
6092 ;; 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
|
6093 ;; "echo are you awake". |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6094 (setq tramp-last-cmd-time (current-time)) |
45861 | 6095 (tramp-send-command |
6096 multi-method method user host | |
6097 (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
|
6098 tramp-rsh-end-of-line |
45861 | 6099 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
|
6100 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
|
6101 (tramp-wait-for-output)) |
45861 | 6102 |
6103 (defun tramp-post-connection (multi-method method user host) | |
6104 "Prepare a remote shell before being able to work on it. | |
6105 METHOD, USER and HOST specify the connection. | |
6106 Among other things, this finds a shell which groks tilde expansion, | |
6107 tries to find an `ls' command which groks the `-n' option, sets the | |
6108 locale to C and sets up the remote shell search path." | |
6109 ;; Search for a good shell before searching for a command which | |
6110 ;; checks if a file exists. This is done because Tramp wants to use | |
6111 ;; "test foo; echo $?" to check if various conditions hold, and | |
6112 ;; there are buggy /bin/sh implementations which don't execute the | |
6113 ;; "echo $?" part if the "test" part has an error. In particular, | |
6114 ;; the Solaris /bin/sh is a problem. I'm betting that all systems | |
6115 ;; with buggy /bin/sh implementations will have a working bash or | |
6116 ;; ksh. Whee... | |
6117 (tramp-find-shell multi-method method user host) | |
6118 ;; Without (sit-for 0.1) at least, my machine will almost always blow | |
6119 ;; up on 'not numberp /root' - a race that causes the 'echo ~root' | |
6120 ;; output of (tramp-find-shell) to show up along with the output of | |
6121 ;; (tramp-find-ls-command) testing. | |
6122 ;; | |
6123 ;; I can't work out why this is a problem though. The (tramp-wait-for-output) | |
6124 ;; call in (tramp-find-shell) *should* make this not happen, I thought. | |
6125 ;; | |
6126 ;; After much debugging I couldn't find any problem with the implementation | |
6127 ;; of that function though. The workaround stays for me at least. :/ | |
6128 ;; | |
6129 ;; Daniel Pittman <daniel@danann.net> | |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
6130 (sleep-for 1) |
46808
cf225aed7a75
Version 2.0.11 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46802
diff
changeset
|
6131 (erase-buffer) |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
6132 (tramp-find-file-exists-command multi-method method user host) |
45861 | 6133 (make-local-variable 'tramp-ls-command) |
6134 (setq tramp-ls-command (tramp-find-ls-command multi-method method user host)) | |
6135 (unless tramp-ls-command | |
6136 (tramp-message | |
6137 1 | |
6138 "Danger! Couldn't find ls which groks -n. Muddling through anyway") | |
6139 (setq tramp-ls-command | |
6140 (tramp-find-executable multi-method method user host | |
6141 "ls" tramp-remote-path nil))) | |
6142 (unless tramp-ls-command | |
6143 (error "Fatal error: Couldn't find remote executable `ls'")) | |
6144 (tramp-message 5 "Using remote command `%s' for getting directory listings" | |
6145 tramp-ls-command) | |
6146 (tramp-send-command multi-method method user host | |
6147 (concat "tramp_set_exit_status () {" tramp-rsh-end-of-line | |
6148 "return $1" tramp-rsh-end-of-line | |
6149 "}")) | |
6150 (tramp-wait-for-output) | |
6151 ;; Set remote PATH variable. | |
6152 (tramp-set-remote-path multi-method method user host "PATH" tramp-remote-path) | |
6153 ;; Tell remote shell to use standard time format, needed for | |
6154 ;; parsing `ls -l' output. | |
6155 (tramp-send-command multi-method method user host | |
6156 "LC_TIME=C; export LC_TIME; echo huhu") | |
6157 (tramp-wait-for-output) | |
6158 (tramp-send-command multi-method method user host | |
6159 "mesg n; echo huhu") | |
6160 (tramp-wait-for-output) | |
6161 (tramp-send-command multi-method method user host | |
6162 "biff n ; echo huhu") | |
6163 (tramp-wait-for-output) | |
6164 ;; Unalias ls(1) to work around issues with those silly people who make it | |
6165 ;; spit out ANSI escapes or whatever. | |
6166 (tramp-send-command multi-method method user host | |
6167 "unalias ls; echo huhu") | |
6168 (tramp-wait-for-output) | |
6169 ;; Does `test A -nt B' work? Use abominable `find' construct if it | |
6170 ;; doesn't. BSD/OS 4.0 wants the parentheses around the command, | |
6171 ;; for otherwise the shell crashes. | |
6172 (erase-buffer) | |
6173 (make-local-variable 'tramp-test-groks-nt) | |
6174 (tramp-send-command multi-method method user host | |
6175 "( test / -nt / )") | |
6176 (tramp-wait-for-output) | |
6177 (goto-char (point-min)) | |
6178 (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
|
6179 (looking-at (format "\n%s\r?\n" (regexp-quote tramp-end-of-output)))) |
45861 | 6180 (unless tramp-test-groks-nt |
6181 (tramp-send-command | |
6182 multi-method method user host | |
6183 (concat "tramp_test_nt () {" tramp-rsh-end-of-line | |
6184 "test -n \"`find $1 -prune -newer $2 -print`\"" tramp-rsh-end-of-line | |
6185 "}"))) | |
6186 (tramp-wait-for-output) | |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
6187 ;; Send the fallback `uudecode' script. |
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
6188 (erase-buffer) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6189 (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
|
6190 (tramp-wait-for-output) |
45861 | 6191 ;; Find a `perl'. |
6192 (erase-buffer) | |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6193 (tramp-set-connection-property "perl-scripts" nil multi-method method user host) |
45861 | 6194 (let ((tramp-remote-perl |
6195 (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
|
6196 "perl5" tramp-remote-path nil) |
45861 | 6197 (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
|
6198 "perl" tramp-remote-path nil)))) |
45861 | 6199 (when tramp-remote-perl |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
6200 (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
|
6201 multi-method method user host) |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6202 (unless (tramp-method-out-of-band-p multi-method method user host) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6203 (tramp-message 5 "Sending the Perl `mime-encode' implementations.") |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6204 (tramp-send-string |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6205 multi-method method user host |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6206 (concat "tramp_encode () {\n" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6207 (format tramp-perl-encode tramp-remote-perl) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6208 " 2>/dev/null" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6209 "\n}")) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6210 (tramp-wait-for-output) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6211 (tramp-send-string |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6212 multi-method method user host |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6213 (concat "tramp_encode_with_module () {\n" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6214 (format tramp-perl-encode-with-module tramp-remote-perl) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6215 " 2>/dev/null" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6216 "\n}")) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6217 (tramp-wait-for-output) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6218 (tramp-message 5 "Sending the Perl `mime-decode' implementations.") |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6219 (tramp-send-string |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6220 multi-method method user host |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6221 (concat "tramp_decode () {\n" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6222 (format tramp-perl-decode tramp-remote-perl) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6223 " 2>/dev/null" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6224 "\n}")) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6225 (tramp-wait-for-output) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6226 (tramp-send-string |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6227 multi-method method user host |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6228 (concat "tramp_decode_with_module () {\n" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6229 (format tramp-perl-decode-with-module tramp-remote-perl) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6230 " 2>/dev/null" |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6231 "\n}")) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6232 (tramp-wait-for-output)))) |
45861 | 6233 ;; Find ln(1) |
6234 (erase-buffer) | |
6235 (let ((ln (tramp-find-executable multi-method method user host | |
6236 "ln" tramp-remote-path nil))) | |
6237 (when ln | |
6238 (tramp-set-connection-property "ln" ln multi-method method user host))) | |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
6239 ;; Set uid and gid. |
45861 | 6240 (erase-buffer) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
6241 (tramp-send-command multi-method method user host "id -u; id -g") |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
6242 (tramp-wait-for-output) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
6243 (goto-char (point-min)) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
6244 (tramp-set-connection-property |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
6245 "uid" (read (current-buffer)) multi-method method user host) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
6246 (tramp-set-connection-property |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
6247 "gid" (read (current-buffer)) multi-method method user host) |
46752 | 6248 ;; Find the right encoding/decoding commands to use. |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
6249 (erase-buffer) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6250 (unless (tramp-method-out-of-band-p multi-method method user host) |
46752 | 6251 (tramp-find-inline-encoding multi-method method user host)) |
45861 | 6252 ;; If encoding/decoding command are given, test to see if they work. |
6253 ;; CCC: Maybe it would be useful to run the encoder both locally and | |
6254 ;; 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
|
6255 (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
|
6256 (rem-dec (tramp-get-remote-decoding multi-method method user host)) |
45861 | 6257 (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
|
6258 (when (and (or rem-dec rem-enc) (not (and rem-dec rem-enc))) |
45861 | 6259 (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
|
6260 ;; Improve error message and/or error check. |
45861 | 6261 (error |
6262 "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
|
6263 (when (and rem-enc rem-dec) |
45861 | 6264 (tramp-message |
6265 5 | |
6266 "Checking to see if encoding/decoding commands work on remote host...") | |
6267 (tramp-send-command | |
6268 multi-method method user host | |
6269 (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
|
6270 (tramp-shell-quote-argument magic-string) rem-enc rem-dec)) |
45861 | 6271 (tramp-wait-for-output) |
6272 (unless (looking-at (regexp-quote magic-string)) | |
6273 (tramp-kill-process multi-method method user host) | |
6274 (error "Remote host cannot execute de/encoding commands. See buffer `%s' for details" | |
6275 (buffer-name))) | |
6276 (erase-buffer) | |
6277 (tramp-message | |
6278 5 "Checking to see if encoding/decoding commands work on remote host...done")))) | |
6279 | |
46752 | 6280 ;; CCC: We should either implement a Perl version of base64 encoding |
6281 ;; and decoding. Then we just use that in the last item. The other | |
6282 ;; alternative is to use the Perl version of UU encoding. But then | |
6283 ;; 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
|
6284 ;; |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6285 ;; 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
|
6286 ;; 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
|
6287 ;; 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
|
6288 ;; 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
|
6289 ;; 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
|
6290 ;; 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
|
6291 ;; 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
|
6292 ;; 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
|
6293 ;; |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6294 ;; 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
|
6295 ;; |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6296 ;; 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
|
6297 |
46752 | 6298 (defvar tramp-coding-commands |
6299 '(("mimencode -b" "mimencode -u -b" | |
6300 base64-encode-region base64-decode-region) | |
6301 ("mmencode -b" "mmencode -u -b" | |
6302 base64-encode-region base64-decode-region) | |
6303 ("recode data..base64" "recode base64..data" | |
6304 base64-encode-region base64-decode-region) | |
57994
07404103ed02
(tramp-coding-commands): Additionally try "uudecode -o /dev/stdout"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
57653
diff
changeset
|
6305 ("uuencode xxx" "uudecode -o /dev/stdout" |
07404103ed02
(tramp-coding-commands): Additionally try "uudecode -o /dev/stdout"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
57653
diff
changeset
|
6306 tramp-uuencode-region uudecode-decode-region) |
46752 | 6307 ("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
|
6308 tramp-uuencode-region uudecode-decode-region) |
46752 | 6309 ("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
|
6310 tramp-uuencode-region uudecode-decode-region) |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
6311 ("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
|
6312 tramp-uuencode-region uudecode-decode-region) |
46790 | 6313 ("tramp_encode_with_module" "tramp_decode_with_module" |
6314 base64-encode-region base64-decode-region) | |
46752 | 6315 ("tramp_encode" "tramp_decode" |
6316 base64-encode-region base64-decode-region)) | |
6317 "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
|
6318 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
|
6319 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6320 \(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
|
6321 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6322 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
|
6323 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
|
6324 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
|
6325 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
|
6326 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
|
6327 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6328 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
|
6329 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
|
6330 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
|
6331 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
|
6332 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
|
6333 input. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6334 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6335 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
|
6336 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
|
6337 with the encoded or decoded results, respectively.") |
46752 | 6338 |
6339 (defun tramp-find-inline-encoding (multi-method method user host) | |
6340 "Find an inline transfer encoding that works. | |
6341 Goes through the list `tramp-coding-commands'." | |
6342 (let ((commands tramp-coding-commands) | |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6343 (magic "xyzzy") |
46752 | 6344 item found) |
6345 (while (and commands (null found)) | |
6346 (setq item (pop commands)) | |
6347 (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
|
6348 (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
|
6349 (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
|
6350 (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
|
6351 (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
|
6352 ;; 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
|
6353 ;; 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
|
6354 ;; 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
|
6355 ;; 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
|
6356 ;; 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
|
6357 ;; 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
|
6358 ;; 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
|
6359 ;; it might change the permissions of /dev/null! |
46752 | 6360 (tramp-message-for-buffer |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
6361 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
|
6362 "Checking remote encoding command `%s' for sanity" rem-enc) |
46752 | 6363 (unless (zerop (tramp-send-command-and-check |
6364 multi-method method user host | |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6365 (format "%s </dev/null" rem-enc) t)) |
46752 | 6366 (throw 'wont-work nil)) |
6367 (tramp-message-for-buffer | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
6368 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
|
6369 "Checking remote decoding command `%s' for sanity" rem-dec) |
46752 | 6370 (unless (zerop (tramp-send-command-and-check |
6371 multi-method method user host | |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6372 (format "echo %s | %s | %s" |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6373 magic rem-enc rem-dec) t)) |
46752 | 6374 (throw 'wont-work nil)) |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6375 (save-excursion |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6376 (goto-char (point-min)) |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6377 (unless (looking-at (regexp-quote magic)) |
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6378 (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
|
6379 ;; 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
|
6380 ;; 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
|
6381 (when (stringp loc-enc) |
46752 | 6382 (tramp-message-for-buffer |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
6383 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
|
6384 "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
|
6385 (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
|
6386 loc-enc nil nil)) |
46752 | 6387 (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
|
6388 (when (stringp loc-dec) |
46752 | 6389 (tramp-message-for-buffer |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
6390 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
|
6391 "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
|
6392 (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
|
6393 loc-dec nil nil)) |
46752 | 6394 (throw 'wont-work nil))) |
6395 ;; CCC: At this point, maybe we should check that the output | |
6396 ;; of the commands is correct. But for the moment we will | |
6397 ;; assume that commands working on empty input will also | |
6398 ;; work in practice. | |
6399 (setq found item)))) | |
6400 ;; Did we find something? If not, issue error. If so, | |
6401 ;; set connection properties. | |
6402 (unless found | |
6403 (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
|
6404 (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
|
6405 (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
|
6406 (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
|
6407 (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
|
6408 (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
|
6409 (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
|
6410 (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
|
6411 (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
|
6412 (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
|
6413 (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
|
6414 (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
|
6415 (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
|
6416 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6417 (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
|
6418 "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
|
6419 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
|
6420 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
|
6421 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
|
6422 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
|
6423 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
|
6424 means discard it)." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6425 (call-process |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6426 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
|
6427 (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
|
6428 input) ;input |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6429 (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
|
6430 nil ;redisplay |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6431 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
|
6432 ;; actual shell command |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6433 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6434 (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
|
6435 (if (stringp output) (concat "> " output) "")))) |
45861 | 6436 |
6437 (defun tramp-maybe-open-connection (multi-method method user host) | |
6438 "Maybe open a connection to HOST, logging in as USER, using METHOD. | |
6439 Does not do anything if a connection is already open, but re-opens the | |
6440 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
|
6441 (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
|
6442 (tramp-get-buffer multi-method method user host))) |
46752 | 6443 last-cmd-time) |
6444 ;; If too much time has passed since last command was sent, look | |
6445 ;; whether process is still alive. If it isn't, kill it. When | |
6446 ;; using ssh, it can sometimes happen that the remote end has hung | |
6447 ;; up but the local ssh client doesn't recognize this until it | |
6448 ;; tries to send some data to the remote end. So that's why we | |
6449 ;; try to send a command from time to time, then look again | |
6450 ;; whether the process is really alive. | |
6451 (save-excursion | |
6452 (set-buffer (tramp-get-buffer multi-method method user host)) | |
6453 (when (and tramp-last-cmd-time | |
47683
9597eaa105a1
Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47584
diff
changeset
|
6454 (> (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
|
6455 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
|
6456 (tramp-send-command |
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
6457 multi-method method user host "echo are you awake" nil t) |
68726
74a3e3db0759
(tramp-maybe-open-connection): Do not wait for output from a dead connection.
Sam Steingold <sds@gnu.org>
parents:
68648
diff
changeset
|
6458 (unless (and (memq (process-status p) '(run open)) |
74a3e3db0759
(tramp-maybe-open-connection): Do not wait for output from a dead connection.
Sam Steingold <sds@gnu.org>
parents:
68648
diff
changeset
|
6459 (tramp-wait-for-output 10)) |
46752 | 6460 (delete-process p) |
6461 (setq p nil)) | |
6462 (erase-buffer))) | |
6463 (unless (and p (processp p) (memq (process-status p) '(run open))) | |
45861 | 6464 (when (and p (processp p)) |
6465 (delete-process p)) | |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6466 (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
|
6467 (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
|
6468 multi-method |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
6469 (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
|
6470 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
|
6471 multi-method method user host))))) |
45861 | 6472 |
6473 (defun tramp-send-command | |
46835
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
6474 (multi-method method user host command &optional noerase neveropen) |
45861 | 6475 "Send the COMMAND to USER at HOST (logged in using METHOD). |
6476 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
|
6477 is true). |
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
6478 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
|
6479 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
|
6480 `tramp-maybe-open-connection' only." |
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
6481 (or neveropen |
df25ef3d3237
Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46808
diff
changeset
|
6482 (tramp-maybe-open-connection multi-method method user host)) |
46752 | 6483 (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
|
6484 (setq tramp-last-cmd command) |
45861 | 6485 (when tramp-debug-buffer |
6486 (save-excursion | |
6487 (set-buffer (tramp-get-debug-buffer multi-method method user host)) | |
6488 (goto-char (point-max)) | |
6489 (tramp-insert-with-face 'bold (format "$ %s\n" command)))) | |
6490 (let ((proc nil)) | |
6491 (set-buffer (tramp-get-buffer multi-method method user host)) | |
6492 (unless noerase (erase-buffer)) | |
6493 (setq proc (get-buffer-process (current-buffer))) | |
6494 (process-send-string proc | |
6495 (concat command tramp-rsh-end-of-line)))) | |
6496 | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6497 (defun tramp-send-command-internal |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6498 (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
|
6499 "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
|
6500 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
|
6501 (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
|
6502 (when msg |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6503 (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
|
6504 (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
|
6505 nil 30 |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6506 "Couldn't `%s', see buffer `%s'" command (buffer-name))) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
6507 |
45861 | 6508 (defun tramp-wait-for-output (&optional timeout) |
6509 "Wait for output from remote rsh command." | |
6510 (let ((proc (get-buffer-process (current-buffer))) | |
6511 (found nil) | |
6512 (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
|
6513 (start-point (point)) |
45861 | 6514 (end-of-output (concat "^" |
6515 (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
|
6516 "\r?$"))) |
45861 | 6517 ;; Algorithm: get waiting output. See if last line contains |
6518 ;; end-of-output sentinel. If not, wait a bit and again get | |
6519 ;; waiting output. Repeat until timeout expires or end-of-output | |
6520 ;; sentinel is seen. Will hang if timeout is nil and | |
6521 ;; end-of-output sentinel never appears. | |
6522 (save-match-data | |
6523 (cond (timeout | |
6524 ;; Work around an XEmacs bug, where the timeout expires | |
6525 ;; faster than it should. This degenerates into polling | |
6526 ;; for buggy XEmacsen, but oh, well. | |
6527 (while (and (not found) | |
6528 (< (tramp-time-diff (current-time) start-time) | |
6529 timeout)) | |
6530 (with-timeout (timeout) | |
6531 (while (not found) | |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
6532 (tramp-accept-process-output proc 1) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6533 (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
|
6534 (error "Process has died")) |
45861 | 6535 (goto-char (point-max)) |
6536 (forward-line -1) | |
6537 (setq found (looking-at end-of-output)))))) | |
6538 (t | |
6539 (while (not found) | |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
6540 (tramp-accept-process-output proc 1) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
6541 (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
|
6542 (error "Process has died")) |
45861 | 6543 (goto-char (point-max)) |
6544 (forward-line -1) | |
6545 (setq found (looking-at end-of-output)))))) | |
6546 ;; At this point, either the timeout has expired or we have found | |
6547 ;; the end-of-output sentinel. | |
6548 (when found | |
6549 (goto-char (point-max)) | |
6550 (forward-line -2) | |
6551 (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
|
6552 ;; 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
|
6553 (when tramp-process-echoes |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6554 (save-excursion |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6555 (goto-char start-point) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
6556 (when (looking-at (regexp-quote tramp-last-cmd)) |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
6557 (delete-region (point) (progn (forward-line 1) (point)))))) |
45861 | 6558 ;; Add output to debug buffer if appropriate. |
6559 (when tramp-debug-buffer | |
6560 (append-to-buffer | |
6561 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method | |
6562 tramp-current-user tramp-current-host) | |
6563 (point-min) (point-max)) | |
6564 (when (not found) | |
6565 (save-excursion | |
6566 (set-buffer | |
6567 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method | |
6568 tramp-current-user tramp-current-host)) | |
6569 (goto-char (point-max)) | |
6570 (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
|
6571 (if timeout (format " in %d secs" timeout) "") |
45861 | 6572 "]]")))) |
6573 (goto-char (point-min)) | |
6574 ;; Return value is whether end-of-output sentinel was found. | |
6575 found)) | |
6576 | |
6577 (defun tramp-send-command-and-check (multi-method method user host command | |
6578 &optional subshell) | |
6579 "Run COMMAND and check its exit status. | |
6580 MULTI-METHOD and METHOD specify how to log in (as USER) to the remote HOST. | |
6581 Sends `echo $?' along with the COMMAND for checking the exit status. If | |
6582 COMMAND is nil, just sends `echo $?'. Returns the exit status found. | |
6583 | |
6584 If the optional argument SUBSHELL is non-nil, the command is executed in | |
6585 a subshell, ie surrounded by parentheses." | |
6586 (tramp-send-command multi-method method user host | |
6587 (concat (if subshell "( " "") | |
6588 command | |
6589 (if command " 2>/dev/null; " "") | |
6590 "echo tramp_exit_status $?" | |
6591 (if subshell " )" " "))) | |
6592 (tramp-wait-for-output) | |
6593 (goto-char (point-max)) | |
6594 (unless (search-backward "tramp_exit_status " nil t) | |
6595 (error "Couldn't find exit status of `%s'" command)) | |
6596 (skip-chars-forward "^ ") | |
6597 (read (current-buffer))) | |
6598 | |
6599 (defun tramp-barf-unless-okay (multi-method method user host command subshell | |
6600 signal fmt &rest args) | |
6601 "Run COMMAND, check exit status, throw error if exit status not okay. | |
6602 Similar to `tramp-send-command-and-check' but accepts two more arguments | |
6603 FMT and ARGS which are passed to `error'." | |
6604 (unless (zerop (tramp-send-command-and-check | |
6605 multi-method method user host command subshell)) | |
6606 ;; CCC: really pop-to-buffer? Maybe it's appropriate to be more | |
6607 ;; silent. | |
6608 (pop-to-buffer (current-buffer)) | |
6609 (funcall 'signal signal (apply 'format fmt args)))) | |
6610 | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6611 ;; 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
|
6612 ;; 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
|
6613 ;; `file-attributes' implementation, for instance.) Therefore, we |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6614 ;; 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
|
6615 (defun tramp-send-string |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6616 (multi-method method user host string) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6617 "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
|
6618 |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6619 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
|
6620 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
|
6621 `tramp-rsh-end-of-line'." |
45861 | 6622 (let ((proc (get-buffer-process |
6623 (tramp-get-buffer multi-method method user host)))) | |
6624 (unless proc | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6625 (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
|
6626 ;; debug message |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6627 (when tramp-debug-buffer |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6628 (save-excursion |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6629 (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
|
6630 (goto-char (point-max)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6631 (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
|
6632 ;; 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
|
6633 (setq string |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6634 (mapconcat 'identity |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6635 (split-string string "\n") |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6636 tramp-rsh-end-of-line)) |
50432
7d56636afc9c
(tramp-send-string): Handle empty string.
Andreas Schwab <schwab@suse.de>
parents:
50338
diff
changeset
|
6637 (unless (or (string= string "") |
7d56636afc9c
(tramp-send-string): Handle empty string.
Andreas Schwab <schwab@suse.de>
parents:
50338
diff
changeset
|
6638 (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
|
6639 (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
|
6640 ;; 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
|
6641 (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
|
6642 (let ((pos 0) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6643 (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
|
6644 (while (< pos end) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6645 (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
|
6646 multi-method method user host 10 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6647 "Sending chunk from %s to %s" |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6648 pos (min (+ pos tramp-chunksize) end)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6649 (process-send-string |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6650 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
|
6651 (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
|
6652 (sleep-for 0.1))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6653 (process-send-string proc string)))) |
45861 | 6654 |
6655 (defun tramp-send-eof (multi-method method user host) | |
6656 "Send EOF to the remote end. | |
46151
eff75835ac2e
(tramp-send-eof): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
46060
diff
changeset
|
6657 METHOD, HOST and USER specify the connection." |
45861 | 6658 (let ((proc (get-buffer-process |
6659 (tramp-get-buffer multi-method method user host)))) | |
6660 (unless proc | |
6661 (error "Can't send EOF to remote host -- not logged in")) | |
6662 (process-send-eof proc))) | |
6663 ; (process-send-string proc "\^D"))) | |
6664 | |
6665 (defun tramp-kill-process (multi-method method user host) | |
6666 "Kill the connection process used by Tramp. | |
46151
eff75835ac2e
(tramp-send-eof): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
46060
diff
changeset
|
6667 MULTI-METHOD, METHOD, USER, and HOST specify the connection." |
45861 | 6668 (let ((proc (get-buffer-process |
6669 (tramp-get-buffer multi-method method user host)))) | |
6670 (kill-process proc))) | |
6671 | |
6672 (defun tramp-discard-garbage-erase-buffer (p multi-method method user host) | |
6673 "Erase buffer, then discard subsequent garbage. | |
6674 If `tramp-discard-garbage' is nil, just erase buffer." | |
6675 (if (not tramp-discard-garbage) | |
6676 (erase-buffer) | |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
6677 (while (prog1 (erase-buffer) (tramp-accept-process-output p 0.25)) |
45861 | 6678 (when tramp-debug-buffer |
6679 (save-excursion | |
6680 (set-buffer (tramp-get-debug-buffer multi-method method user host)) | |
6681 (goto-char (point-max)) | |
6682 (tramp-insert-with-face | |
6683 'bold (format "Additional characters detected\n"))))))) | |
6684 | |
6685 (defun tramp-mode-string-to-int (mode-string) | |
6686 "Converts a ten-letter `drwxrwxrwx'-style mode string into mode bits." | |
6687 (let* ((mode-chars (string-to-vector mode-string)) | |
6688 (owner-read (aref mode-chars 1)) | |
6689 (owner-write (aref mode-chars 2)) | |
6690 (owner-execute-or-setid (aref mode-chars 3)) | |
6691 (group-read (aref mode-chars 4)) | |
6692 (group-write (aref mode-chars 5)) | |
6693 (group-execute-or-setid (aref mode-chars 6)) | |
6694 (other-read (aref mode-chars 7)) | |
6695 (other-write (aref mode-chars 8)) | |
6696 (other-execute-or-sticky (aref mode-chars 9))) | |
6697 (save-match-data | |
6698 (logior | |
6699 (case owner-read | |
6700 (?r (tramp-octal-to-decimal "00400")) (?- 0) | |
6701 (t (error "Second char `%c' must be one of `r-'" owner-read))) | |
6702 (case owner-write | |
6703 (?w (tramp-octal-to-decimal "00200")) (?- 0) | |
6704 (t (error "Third char `%c' must be one of `w-'" owner-write))) | |
6705 (case owner-execute-or-setid | |
6706 (?x (tramp-octal-to-decimal "00100")) | |
6707 (?S (tramp-octal-to-decimal "04000")) | |
6708 (?s (tramp-octal-to-decimal "04100")) | |
6709 (?- 0) | |
6710 (t (error "Fourth char `%c' must be one of `xsS-'" | |
6711 owner-execute-or-setid))) | |
6712 (case group-read | |
6713 (?r (tramp-octal-to-decimal "00040")) (?- 0) | |
6714 (t (error "Fifth char `%c' must be one of `r-'" group-read))) | |
6715 (case group-write | |
6716 (?w (tramp-octal-to-decimal "00020")) (?- 0) | |
6717 (t (error "Sixth char `%c' must be one of `w-'" group-write))) | |
6718 (case group-execute-or-setid | |
6719 (?x (tramp-octal-to-decimal "00010")) | |
6720 (?S (tramp-octal-to-decimal "02000")) | |
6721 (?s (tramp-octal-to-decimal "02010")) | |
6722 (?- 0) | |
6723 (t (error "Seventh char `%c' must be one of `xsS-'" | |
6724 group-execute-or-setid))) | |
6725 (case other-read | |
6726 (?r (tramp-octal-to-decimal "00004")) (?- 0) | |
6727 (t (error "Eighth char `%c' must be one of `r-'" other-read))) | |
6728 (case other-write | |
6729 (?w (tramp-octal-to-decimal "00002")) (?- 0) | |
6730 (t (error "Nineth char `%c' must be one of `w-'" other-write))) | |
6731 (case other-execute-or-sticky | |
6732 (?x (tramp-octal-to-decimal "00001")) | |
6733 (?T (tramp-octal-to-decimal "01000")) | |
6734 (?t (tramp-octal-to-decimal "01001")) | |
6735 (?- 0) | |
6736 (t (error "Tenth char `%c' must be one of `xtT-'" | |
6737 other-execute-or-sticky))))))) | |
6738 | |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6739 (defun tramp-convert-file-attributes (multi-method method user host attr) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6740 "Convert file-attributes ATTR generated by perl script or ls. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6741 Convert file mode bits to string and set virtual device number. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6742 Return ATTR." |
68527
e66f443e6371
* net/tramp.el (tramp-convert-file-attributes): Set file's gid
Michael Albinus <michael.albinus@gmx.de>
parents:
68335
diff
changeset
|
6743 ;; Convert file mode bits to string. |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6744 (unless (stringp (nth 8 attr)) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6745 (setcar (nthcdr 8 attr) (tramp-file-mode-from-int (nth 8 attr)))) |
68527
e66f443e6371
* net/tramp.el (tramp-convert-file-attributes): Set file's gid
Michael Albinus <michael.albinus@gmx.de>
parents:
68335
diff
changeset
|
6746 ;; Set file's gid change bit. Possible only when id-format is 'integer. |
e66f443e6371
* net/tramp.el (tramp-convert-file-attributes): Set file's gid
Michael Albinus <michael.albinus@gmx.de>
parents:
68335
diff
changeset
|
6747 (when (numberp (nth 3 attr)) |
e66f443e6371
* net/tramp.el (tramp-convert-file-attributes): Set file's gid
Michael Albinus <michael.albinus@gmx.de>
parents:
68335
diff
changeset
|
6748 (setcar (nthcdr 9 attr) |
e66f443e6371
* net/tramp.el (tramp-convert-file-attributes): Set file's gid
Michael Albinus <michael.albinus@gmx.de>
parents:
68335
diff
changeset
|
6749 (not (= (nth 3 attr) |
e66f443e6371
* net/tramp.el (tramp-convert-file-attributes): Set file's gid
Michael Albinus <michael.albinus@gmx.de>
parents:
68335
diff
changeset
|
6750 (tramp-get-remote-gid multi-method method user host))))) |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6751 ;; Set virtual device number. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6752 (setcar (nthcdr 11 attr) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6753 (tramp-get-device multi-method method user host)) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6754 attr) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6755 |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6756 (defun tramp-get-device (multi-method method user host) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6757 "Returns the virtual device number. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6758 If it doesn't exist, generate a new one." |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6759 (let ((string (tramp-make-tramp-file-name multi-method method user host ""))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6760 (unless (assoc string tramp-devices) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6761 (add-to-list 'tramp-devices |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6762 (list string (length tramp-devices)))) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
6763 (list -1 (nth 1 (assoc string tramp-devices))))) |
45861 | 6764 |
6765 (defun tramp-file-mode-from-int (mode) | |
6766 "Turn an integer representing a file mode into an ls(1)-like string." | |
6767 (let ((type (cdr (assoc (logand (lsh mode -12) 15) tramp-file-mode-type-map))) | |
6768 (user (logand (lsh mode -6) 7)) | |
6769 (group (logand (lsh mode -3) 7)) | |
6770 (other (logand (lsh mode -0) 7)) | |
6771 (suid (> (logand (lsh mode -9) 4) 0)) | |
6772 (sgid (> (logand (lsh mode -9) 2) 0)) | |
6773 (sticky (> (logand (lsh mode -9) 1) 0))) | |
6774 (setq user (tramp-file-mode-permissions user suid "s")) | |
6775 (setq group (tramp-file-mode-permissions group sgid "s")) | |
6776 (setq other (tramp-file-mode-permissions other sticky "t")) | |
6777 (concat type user group other))) | |
6778 | |
6779 | |
6780 (defun tramp-file-mode-permissions (perm suid suid-text) | |
6781 "Convert a permission bitset into a string. | |
6782 This is used internally by `tramp-file-mode-from-int'." | |
6783 (let ((r (> (logand perm 4) 0)) | |
6784 (w (> (logand perm 2) 0)) | |
6785 (x (> (logand perm 1) 0))) | |
6786 (concat (or (and r "r") "-") | |
6787 (or (and w "w") "-") | |
6788 (or (and suid x suid-text) ; suid, execute | |
6789 (and suid (upcase suid-text)) ; suid, !execute | |
6790 (and x "x") "-")))) ; !suid | |
6791 | |
6792 | |
6793 (defun tramp-decimal-to-octal (i) | |
6794 "Return a string consisting of the octal digits of I. | |
6795 Not actually used. Use `(format \"%o\" i)' instead?" | |
6796 (cond ((< i 0) (error "Cannot convert negative number to octal")) | |
6797 ((not (integerp i)) (error "Cannot convert non-integer to octal")) | |
6798 ((zerop i) "0") | |
6799 (t (concat (tramp-decimal-to-octal (/ i 8)) | |
6800 (number-to-string (% i 8)))))) | |
6801 | |
6802 | |
6803 ;;(defun tramp-octal-to-decimal (ostr) | |
6804 ;; "Given a string of octal digits, return a decimal number." | |
6805 ;; (cond ((null ostr) 0) | |
6806 ;; ((string= "" ostr) 0) | |
6807 ;; (t (let ((last (aref ostr (1- (length ostr)))) | |
6808 ;; (rest (substring ostr 0 (1- (length ostr))))) | |
6809 ;; (unless (and (>= last ?0) | |
6810 ;; (<= last ?7)) | |
6811 ;; (error "Not an octal digit: %c" last)) | |
6812 ;; (+ (- last ?0) (* 8 (tramp-octal-to-decimal rest))))))) | |
6813 ;; Kudos to Gerd Moellmann for this suggestion. | |
6814 (defun tramp-octal-to-decimal (ostr) | |
6815 "Given a string of octal digits, return a decimal number." | |
6816 (let ((x (or ostr ""))) | |
6817 ;; `save-match' is in `tramp-mode-string-to-int' which calls this. | |
6818 (unless (string-match "\\`[0-7]*\\'" x) | |
6819 (error "Non-octal junk in string `%s'" x)) | |
6820 (string-to-number ostr 8))) | |
6821 | |
6822 (defun tramp-shell-case-fold (string) | |
6823 "Converts STRING to shell glob pattern which ignores case." | |
6824 (mapconcat | |
6825 (lambda (c) | |
6826 (if (equal (downcase c) (upcase c)) | |
6827 (vector c) | |
6828 (format "[%c%c]" (downcase c) (upcase c)))) | |
6829 string | |
6830 "")) | |
6831 | |
6832 | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
6833 ;; ------------------------------------------------------------ |
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
6834 ;; -- TRAMP file names -- |
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
6835 ;; ------------------------------------------------------------ |
45861 | 6836 ;; Conversion functions between external representation and |
6837 ;; internal data structure. Convenience functions for internal | |
6838 ;; data structure. | |
6839 | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6840 (defstruct tramp-file-name multi-method method user host localname) |
45861 | 6841 |
6842 (defun tramp-tramp-file-p (name) | |
6843 "Return t iff NAME is a tramp file." | |
6844 (save-match-data | |
6845 (string-match tramp-file-name-regexp name))) | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
6846 |
45861 | 6847 ;; HHH: Changed. Used to assign the return value of (user-login-name) |
6848 ;; to the `user' part of the structure if a user name was not | |
6849 ;; provided, now it assigns nil. | |
6850 (defun tramp-dissect-file-name (name) | |
6851 "Return an `tramp-file-name' structure. | |
6852 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
|
6853 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
|
6854 (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
|
6855 (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
|
6856 (method |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
6857 ; 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
|
6858 (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
|
6859 ; 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
|
6860 (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
|
6861 (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
|
6862 (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
|
6863 (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
|
6864 (if (and method (member method tramp-multi-methods)) |
45861 | 6865 ;; If it's a multi method, the file name structure contains |
6866 ;; arrays of method, user and host. | |
6867 (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
|
6868 ;; 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
|
6869 (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
|
6870 (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
|
6871 (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
|
6872 (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
|
6873 (make-tramp-file-name |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6874 :multi-method nil |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6875 :method method |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6876 :user (or user nil) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6877 :host host |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6878 :localname localname)))))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6879 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6880 (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
|
6881 "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
|
6882 (let ((choices tramp-default-method-alist) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6883 (method tramp-default-method) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6884 item) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6885 (while choices |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6886 (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
|
6887 (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
|
6888 (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
|
6889 (setq method (nth 2 item)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6890 (setq choices nil))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
6891 method)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6892 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6893 (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
|
6894 "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
|
6895 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
|
6896 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
|
6897 `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
|
6898 (or multi-method method (tramp-find-default-method user host))) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
6899 |
45861 | 6900 ;; HHH: Not Changed. Multi method. Will probably not handle the case where |
6901 ;; a user name is not provided in the "file name" very well. | |
6902 (defun tramp-dissect-multi-file-name (name) | |
6903 "Not implemented yet." | |
6904 (let ((regexp (nth 0 tramp-multi-file-name-structure)) | |
6905 (method-index (nth 1 tramp-multi-file-name-structure)) | |
6906 (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
|
6907 (localname-index (nth 3 tramp-multi-file-name-structure)) |
45861 | 6908 (hop-regexp (nth 0 tramp-multi-file-name-hop-structure)) |
6909 (hop-method-index (nth 1 tramp-multi-file-name-hop-structure)) | |
6910 (hop-user-index (nth 2 tramp-multi-file-name-hop-structure)) | |
6911 (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
|
6912 method hops len hop-methods hop-users hop-hosts localname) |
45861 | 6913 (unless (string-match (format regexp hop-regexp) name) |
6914 (error "Not a multi tramp file name: %s" name)) | |
6915 (setq method (match-string method-index name)) | |
6916 (setq hops (match-string hops-index name)) | |
6917 (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
|
6918 (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
|
6919 (setq localname (match-string localname-index name)) |
45861 | 6920 (let ((index 0)) |
6921 (while (string-match hop-regexp hops index) | |
6922 (setq index (match-end 0)) | |
6923 (setq hop-methods | |
6924 (cons (match-string hop-method-index hops) hop-methods)) | |
6925 (setq hop-users | |
6926 (cons (match-string hop-user-index hops) hop-users)) | |
6927 (setq hop-hosts | |
6928 (cons (match-string hop-host-index hops) hop-hosts)))) | |
6929 (make-tramp-file-name | |
6930 :multi-method method | |
6931 :method (apply 'vector (reverse hop-methods)) | |
6932 :user (apply 'vector (reverse hop-users)) | |
6933 :host (apply 'vector (reverse hop-hosts)) | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6934 :localname localname))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6935 |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6936 (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
|
6937 "Constructs a tramp file name from METHOD, USER, HOST and LOCALNAME." |
45861 | 6938 (if multi-method |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6939 (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
|
6940 (format-spec |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6941 (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
|
6942 (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
|
6943 (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
|
6944 (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
|
6945 (when localname (concat "%p"))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6946 `((?m . ,method) (?u . ,user) (?h . ,host) (?p . ,localname))))) |
45861 | 6947 |
6948 ;; CCC: Henrik Holm: Not Changed. Multi Method. What should be done | |
6949 ;; with this when USER is nil? | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6950 (defun tramp-make-tramp-multi-file-name (multi-method method user host localname) |
45861 | 6951 "Constructs a tramp file name for a multi-hop method." |
6952 (unless tramp-make-multi-tramp-file-format | |
6953 (error "`tramp-make-multi-tramp-file-format' is nil")) | |
6954 (let* ((prefix-format (nth 0 tramp-make-multi-tramp-file-format)) | |
6955 (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
|
6956 (localname-format (nth 2 tramp-make-multi-tramp-file-format)) |
46752 | 6957 (prefix (format-spec prefix-format `((?m . ,multi-method)))) |
45861 | 6958 (hops "") |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6959 (localname (format-spec localname-format `((?p . ,localname)))) |
45861 | 6960 (i 0) |
6961 (len (length method))) | |
6962 (while (< i len) | |
46584
f548d7d0c651
Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46347
diff
changeset
|
6963 (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
|
6964 (setq hops (concat hops (format-spec hop-format |
46752 | 6965 `((?m . ,m) (?u . ,u) (?h . ,h))))) |
45861 | 6966 (incf i))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6967 (concat prefix hops localname))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6968 |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
6969 (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
|
6970 "Create a file name suitable to be passed to `rcp' and workalikes." |
45861 | 6971 (if user |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6972 (format "%s@%s:%s" user host localname) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
6973 (format "%s:%s" host localname))) |
45861 | 6974 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
6975 (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
|
6976 "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
|
6977 (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
|
6978 multi-method |
47577
20336ef6b20a
Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47576
diff
changeset
|
6979 (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
|
6980 user host 'tramp-copy-program)) |
45861 | 6981 |
6982 ;; Variables local to connection. | |
6983 | |
6984 (defun tramp-get-ls-command (multi-method method user host) | |
6985 (save-excursion | |
6986 (tramp-maybe-open-connection multi-method method user host) | |
6987 (set-buffer (tramp-get-buffer multi-method method user host)) | |
6988 tramp-ls-command)) | |
6989 | |
6990 (defun tramp-get-test-groks-nt (multi-method method user host) | |
6991 (save-excursion | |
6992 (tramp-maybe-open-connection multi-method method user host) | |
6993 (set-buffer (tramp-get-buffer multi-method method user host)) | |
6994 tramp-test-groks-nt)) | |
6995 | |
6996 (defun tramp-get-file-exists-command (multi-method method user host) | |
6997 (save-excursion | |
6998 (tramp-maybe-open-connection multi-method method user host) | |
6999 (set-buffer (tramp-get-buffer multi-method method user host)) | |
7000 tramp-file-exists-command)) | |
7001 | |
7002 (defun tramp-get-remote-perl (multi-method method user host) | |
7003 (tramp-get-connection-property "perl" nil multi-method method user host)) | |
7004 | |
7005 (defun tramp-get-remote-ln (multi-method method user host) | |
7006 (tramp-get-connection-property "ln" nil multi-method method user host)) | |
7007 | |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7008 (defun tramp-get-remote-uid (multi-method method user host) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7009 (tramp-get-connection-property "uid" nil multi-method method user host)) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7010 |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7011 (defun tramp-get-remote-gid (multi-method method user host) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7012 (tramp-get-connection-property "gid" nil multi-method method user host)) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7013 |
45861 | 7014 ;; Get a property of a TRAMP connection. |
46752 | 7015 (defun tramp-get-connection-property |
7016 (property default multi-method method user host) | |
45861 | 7017 "Get the named property for the connection. |
7018 If the value is not set for the connection, return `default'" | |
7019 (tramp-maybe-open-connection multi-method method user host) | |
7020 (with-current-buffer (tramp-get-buffer multi-method method user host) | |
7021 (let (error) | |
7022 (condition-case nil | |
7023 (symbol-value (intern (concat "tramp-connection-property-" property))) | |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7024 (error default))))) |
45861 | 7025 |
7026 ;; Set a property of a TRAMP connection. | |
46752 | 7027 (defun tramp-set-connection-property |
7028 (property value multi-method method user host) | |
45861 | 7029 "Set the named property of a TRAMP connection." |
7030 (tramp-maybe-open-connection multi-method method user host) | |
7031 (with-current-buffer (tramp-get-buffer multi-method method user host) | |
7032 (set (make-local-variable | |
7033 (intern (concat "tramp-connection-property-" property))) | |
7034 value))) | |
7035 | |
46752 | 7036 ;; 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
|
7037 (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
|
7038 (tramp-set-connection-property "remote-encoding" rem-enc |
46752 | 7039 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
|
7040 (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
|
7041 (tramp-get-connection-property "remote-encoding" nil |
46752 | 7042 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
|
7043 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7044 (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
|
7045 (tramp-set-connection-property "remote-decoding" rem-dec |
46752 | 7046 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
|
7047 (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
|
7048 (tramp-get-connection-property "remote-decoding" nil |
46752 | 7049 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
|
7050 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7051 (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
|
7052 (tramp-set-connection-property "local-encoding" loc-enc |
46752 | 7053 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
|
7054 (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
|
7055 (tramp-get-connection-property "local-encoding" nil |
46752 | 7056 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
|
7057 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7058 (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
|
7059 (tramp-set-connection-property "local-decoding" loc-dec |
46752 | 7060 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
|
7061 (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
|
7062 (tramp-get-connection-property "local-decoding" nil |
46752 | 7063 multi-method method user host)) |
45861 | 7064 |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
7065 (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
|
7066 "Return the method parameter PARAM. |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
7067 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
|
7068 as default." |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
7069 (unless (boundp param) |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
7070 (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
|
7071 (let ((entry (assoc param |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
7072 (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
|
7073 tramp-methods)))) |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
7074 (if entry |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
7075 (second entry) |
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
7076 (symbol-value param)))) |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
7077 |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
7078 |
45861 | 7079 ;; Auto saving to a special directory. |
7080 | |
65304
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
7081 (defun tramp-exists-file-name-handler (operation &rest args) |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
7082 (let ((buffer-file-name "/") |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
7083 (fnha file-name-handler-alist) |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
7084 (check-file-name-operation operation) |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
7085 (file-name-handler-alist |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
7086 (list |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
7087 (cons "/" |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
7088 '(lambda (operation &rest args) |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
7089 "Returns OPERATION if it is the one to be checked" |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
7090 (if (equal check-file-name-operation operation) |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
7091 operation |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
7092 (let ((file-name-handler-alist fnha)) |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
7093 (apply operation args)))))))) |
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
7094 (eq (apply operation args) operation))) |
65248
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
7095 |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
7096 (unless (tramp-exists-file-name-handler 'make-auto-save-file-name) |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
7097 (defadvice make-auto-save-file-name |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
7098 (around tramp-advice-make-auto-save-file-name () activate) |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
7099 "Invoke `tramp-handle-make-auto-save-file-name' for tramp files." |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
7100 (if (and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name))) |
65304
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
7101 (setq ad-return-value (tramp-handle-make-auto-save-file-name)) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7102 ad-do-it)) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7103 (add-hook 'tramp-unload-hook |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7104 '(lambda () (ad-unadvise 'make-auto-save-file-name)))) |
45861 | 7105 |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7106 ;; In Emacs < 22 and XEmacs < 21.5 autosaved remote files have |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7107 ;; permission 0666 minus umask. This is a security threat. |
57463
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
7108 |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
7109 (defun tramp-set-auto-save-file-modes () |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
7110 "Set permissions of autosaved remote files to the original permissions." |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
7111 (let ((bfn (buffer-file-name))) |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
7112 (when (and (stringp bfn) |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
7113 (tramp-tramp-file-p bfn) |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
7114 (stringp buffer-auto-save-file-name) |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7115 (not (equal bfn buffer-auto-save-file-name))) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7116 (unless (file-exists-p buffer-auto-save-file-name) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7117 (write-region "" nil buffer-auto-save-file-name)) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7118 ;; Permissions should be set always, because there might be an old |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7119 ;; auto-saved file belonging to another original file. This could |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7120 ;; be a security threat. |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7121 (set-file-modes buffer-auto-save-file-name |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
7122 (or (file-modes bfn) (tramp-octal-to-decimal "0600")))))) |
57463
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
7123 |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
7124 (unless (or (> emacs-major-version 21) |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
7125 (and (featurep 'xemacs) |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
7126 (= emacs-major-version 21) |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7127 (> emacs-minor-version 4))) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7128 (add-hook 'auto-save-hook 'tramp-set-auto-save-file-modes) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7129 (add-hook 'tramp-unload-hook |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7130 '(lambda () |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7131 (remove-hook 'auto-save-hook 'tramp-set-auto-save-file-modes)))) |
57463
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
7132 |
45861 | 7133 (defun tramp-subst-strs-in-string (alist string) |
7134 "Replace all occurrences of the string FROM with TO in STRING. | |
7135 ALIST is of the form ((FROM . TO) ...)." | |
7136 (save-match-data | |
7137 (while alist | |
7138 (let* ((pr (car alist)) | |
7139 (from (car pr)) | |
7140 (to (cdr pr))) | |
7141 (while (string-match (regexp-quote from) string) | |
7142 (setq string (replace-match to t t string))) | |
7143 (setq alist (cdr alist)))) | |
7144 string)) | |
7145 | |
7146 (defun tramp-insert-with-face (face string) | |
7147 "Insert text with a specific face." | |
7148 (let ((start (point))) | |
7149 (insert string) | |
7150 (add-text-properties start (point) (list 'face face)))) | |
7151 | |
7152 ;; ------------------------------------------------------------ | |
7153 ;; -- Compatibility functions section -- | |
7154 ;; ------------------------------------------------------------ | |
7155 | |
7156 (defun tramp-temporary-file-directory () | |
7157 "Return name of directory for temporary files (compat function). | |
7158 For Emacs, this is the variable `temporary-file-directory', for XEmacs | |
7159 this is the function `temp-directory'." | |
7160 (cond ((boundp 'temporary-file-directory) | |
7161 (symbol-value 'temporary-file-directory)) | |
7162 ((fboundp 'temp-directory) | |
7163 (funcall (symbol-function 'temp-directory))) ;pacify byte-compiler | |
7164 ((let ((d (getenv "TEMP"))) (and d (file-directory-p d))) | |
7165 (file-name-as-directory (getenv "TEMP"))) | |
7166 ((let ((d (getenv "TMP"))) (and d (file-directory-p d))) | |
7167 (file-name-as-directory (getenv "TMP"))) | |
7168 ((let ((d (getenv "TMPDIR"))) (and d (file-directory-p d))) | |
7169 (file-name-as-directory (getenv "TMPDIR"))) | |
7170 ((file-exists-p "c:/temp") (file-name-as-directory "c:/temp")) | |
7171 (t (message (concat "Neither `temporary-file-directory' nor " | |
7172 "`temp-directory' is defined -- using /tmp.")) | |
7173 (file-name-as-directory "/tmp")))) | |
7174 | |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
7175 (defun tramp-read-passwd (user host prompt) |
45861 | 7176 "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
|
7177 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
|
7178 (if (functionp 'password-read) |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
7179 (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
|
7180 (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
|
7181 (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
|
7182 password) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
7183 (read-passwd prompt))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
7184 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
7185 (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
|
7186 "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
|
7187 (interactive) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
7188 (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
|
7189 (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
|
7190 (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
|
7191 (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
|
7192 (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
|
7193 (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
|
7194 (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
|
7195 (key (concat luser "@" lhost))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
7196 (apply #'password-cache-remove (list key)))))) |
45861 | 7197 |
7198 (defun tramp-time-diff (t1 t2) | |
7199 "Return the difference between the two times, in seconds. | |
7200 T1 and T2 are time values (as returned by `current-time' for example). | |
7201 | |
7202 NOTE: This function will fail if the time difference is too large to | |
7203 fit in an integer." | |
7204 ;; 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
|
7205 (cond ((and (fboundp 'subtract-time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
7206 (fboundp 'float-time)) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
7207 (funcall (symbol-function 'float-time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
7208 (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
|
7209 ((and (fboundp 'subtract-time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
7210 (fboundp 'time-to-seconds)) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
7211 (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
|
7212 (funcall (symbol-function 'subtract-time) t1 t2))) |
45861 | 7213 ((fboundp 'itimer-time-difference) |
7214 (floor (funcall | |
7215 (symbol-function 'itimer-time-difference) | |
7216 (if (< (length t1) 3) (append t1 '(0)) t1) | |
7217 (if (< (length t2) 3) (append t2 '(0)) t2)))) | |
7218 (t | |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
7219 ;; 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
|
7220 ;; 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
|
7221 (let ((time (let ((borrow (< (cadr t1) (cadr t2)))) |
45861 | 7222 (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
|
7223 (- (+ (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
|
7224 (+ (* (car time) 65536.0) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
7225 (cadr time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
7226 (/ (or (nth 2 time) 0) 1000000.0)))))) |
45861 | 7227 |
7228 (defun tramp-coding-system-change-eol-conversion (coding-system eol-type) | |
7229 "Return a coding system like CODING-SYSTEM but with given EOL-TYPE. | |
7230 EOL-TYPE can be one of `dos', `unix', or `mac'." | |
7231 (cond ((fboundp 'coding-system-change-eol-conversion) | |
7232 (apply #'coding-system-change-eol-conversion | |
7233 (list coding-system eol-type))) | |
7234 ((fboundp 'subsidiary-coding-system) | |
7235 (apply | |
7236 #'subsidiary-coding-system | |
7237 (list coding-system | |
7238 (cond ((eq eol-type 'dos) 'crlf) | |
7239 ((eq eol-type 'unix) 'lf) | |
7240 ((eq eol-type 'mac) 'cr) | |
7241 (t | |
7242 (error "Unknown EOL-TYPE `%s', must be %s" | |
7243 eol-type | |
7244 "`dos', `unix', or `mac'")))))) | |
7245 (t (error "Can't change EOL conversion -- is MULE missing?")))) | |
7246 | |
7247 (defun tramp-split-string (string pattern) | |
7248 "Like `split-string' but omit empty strings. | |
7249 In Emacs, (split-string \"/foo/bar\" \"/\") returns (\"foo\" \"bar\"). | |
7250 This is, the first, empty, element is omitted. In XEmacs, the first | |
7251 element is not omitted. | |
7252 | |
7253 Note: this function has been written for `tramp-handle-file-truename'. | |
7254 If you want to use it for something else, you'll have to check whether | |
7255 it does the right thing." | |
7256 (delete "" (split-string string pattern))) | |
7257 | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
7258 (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
|
7259 "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
|
7260 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
|
7261 exiting if process is running." |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7262 (funcall |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
7263 (if (fboundp 'set-process-query-on-exit-flag) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7264 (symbol-function 'set-process-query-on-exit-flag) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7265 (symbol-function 'process-kill-without-query)) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7266 process flag)) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
7267 |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
7268 |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
7269 ;; ------------------------------------------------------------ |
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
7270 ;; -- Kludges section -- |
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
7271 ;; ------------------------------------------------------------ |
45861 | 7272 |
7273 ;; Currently (as of Emacs 20.5), the function `shell-quote-argument' | |
7274 ;; does not deal well with newline characters. Newline is replaced by | |
7275 ;; backslash newline. But if, say, the string `a backslash newline b' | |
7276 ;; is passed to a shell, the shell will expand this into "ab", | |
7277 ;; completely omitting the newline. This is not what was intended. | |
7278 ;; It does not appear to be possible to make the function | |
7279 ;; `shell-quote-argument' work with newlines without making it | |
7280 ;; dependent on the shell used. But within this package, we know that | |
7281 ;; we will always use a Bourne-like shell, so we use an approach which | |
7282 ;; groks newlines. | |
7283 ;; | |
7284 ;; The approach is simple: we call `shell-quote-argument', then | |
7285 ;; massage the newline part of the result. | |
7286 ;; | |
7287 ;; This function should produce a string which is grokked by a Unix | |
7288 ;; shell, even if the Emacs is running on Windows. Since this is the | |
7289 ;; kludges section, we bind `system-type' in such a way that | |
7290 ;; `shell-quote-arguments' behaves as if on Unix. | |
7291 ;; | |
7292 ;; Thanks to Mario DeWeerd for the hint that it is sufficient for this | |
7293 ;; function to work with Bourne-like shells. | |
7294 ;; | |
7295 ;; CCC: This function should be rewritten so that | |
7296 ;; `shell-quote-argument' is not used. This way, we are safe from | |
7297 ;; changes in `shell-quote-argument'. | |
7298 (defun tramp-shell-quote-argument (s) | |
7299 "Similar to `shell-quote-argument', but groks newlines. | |
7300 Only works for Bourne-like shells." | |
7301 (let ((system-type 'not-windows)) | |
7302 (save-match-data | |
7303 (let ((result (shell-quote-argument s)) | |
7304 (nl (regexp-quote (format "\\%s" tramp-rsh-end-of-line)))) | |
7305 (when (and (>= (length result) 2) | |
7306 (string= (substring result 0 2) "\\~")) | |
7307 (setq result (substring result 1))) | |
7308 (while (string-match nl result) | |
7309 (setq result (replace-match (format "'%s'" tramp-rsh-end-of-line) | |
7310 t t result))) | |
7311 result)))) | |
7312 | |
7313 ;; ;; EFS hooks itself into the file name handling stuff in more places | |
7314 ;; ;; 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
|
7315 ;; ;; away from tramp.el file names. |
45861 | 7316 ;; ;; |
7317 ;; ;; This is needed because EFS installs (efs-dired-before-readin) into | |
7318 ;; ;; 'dired-before-readin-hook'. This prevents EFS from opening an FTP | |
7319 ;; ;; connection to help it's dired process. Not that I have any real | |
7320 ;; ;; idea *why* this is helpful to dired. | |
7321 ;; ;; | |
7322 ;; ;; Anyway, this advice fixes the problem (with a sledgehammer :) | |
7323 ;; ;; | |
7324 ;; ;; Daniel Pittman <daniel@danann.net> | |
7325 ;; ;; | |
7326 ;; ;; CCC: when the other defadvice calls have disappeared, make sure | |
7327 ;; ;; not to call defadvice unless it's necessary. How do we find out whether | |
7328 ;; ;; it is necessary? (featurep 'efs) is surely the wrong way -- | |
7329 ;; ;; EFS might nicht be loaded yet. | |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
7330 ;; (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
|
7331 ;; "Cause efs-ftp-path to fail when the path is a TRAMP localname." |
45861 | 7332 ;; (if (tramp-tramp-file-p (ad-get-arg 0)) |
7333 ;; nil | |
7334 ;; ad-do-it)) | |
7335 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7336 ;; 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
|
7337 ;; This means that Emacs wants to expand wildcards if |
45861 | 7338 ;; `find-file-wildcards' is non-nil, and then barfs because no |
7339 ;; expansion could be found. We detect this situation and do | |
7340 ;; something really awful: we have `file-expand-wildcards' return the | |
7341 ;; original filename if it can't expand anything. Let's just hope | |
7342 ;; 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
|
7343 ;; 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
|
7344 ;; 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
|
7345 (when (string-match "\\[" tramp-prefix-format) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7346 (defadvice file-expand-wildcards (around tramp-fix activate) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7347 (let ((name (ad-get-arg 0))) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7348 (if (tramp-tramp-file-p name) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7349 ;; If it's a Tramp file, dissect it and look if wildcards |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7350 ;; need to be expanded at all. |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7351 (let ((v (tramp-dissect-file-name name))) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7352 (if (string-match "[[*?]" (tramp-file-name-localname v)) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7353 (let ((res ad-do-it)) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7354 (setq ad-return-value (or res (list name)))) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7355 (setq ad-return-value (list name)))) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7356 ;; If it is not a Tramp file, just run the original function. |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7357 (let ((res ad-do-it)) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7358 (setq ad-return-value (or res (list name))))))) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7359 (add-hook 'tramp-unload-hook |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7360 '(lambda () (ad-unadvise 'file-expand-wildcards)))) |
45861 | 7361 |
46752 | 7362 ;; Tramp version is useful in a number of situations. |
7363 | |
7364 (defun tramp-version (arg) | |
7365 "Print version number of tramp.el in minibuffer or current buffer." | |
7366 (interactive "P") | |
7367 (if arg (insert tramp-version) (message tramp-version))) | |
7368 | |
45861 | 7369 ;; Make the `reporter` functionality available for making bug reports about |
7370 ;; the package. A most useful piece of code. | |
7371 | |
7372 (unless (fboundp 'reporter-submit-bug-report) | |
7373 (autoload 'reporter-submit-bug-report "reporter")) | |
7374 | |
7375 (defun tramp-bug () | |
7376 "Submit a bug report to the TRAMP developers." | |
7377 (interactive) | |
7378 (require 'reporter) | |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7379 (catch 'dont-send |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7380 (let ((reporter-prompt-for-summary-p t)) |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7381 (reporter-submit-bug-report |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7382 tramp-bug-report-address ; to-address |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7383 (format "tramp (%s)" tramp-version) ; package name and version |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7384 (delq nil |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7385 `(;; Current state |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7386 tramp-ls-command |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7387 tramp-test-groks-nt |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7388 tramp-file-exists-command |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7389 tramp-current-multi-method |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7390 tramp-current-method |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7391 tramp-current-user |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7392 tramp-current-host |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7393 |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7394 ;; System defaults |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7395 tramp-auto-save-directory ; vars to dump |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7396 tramp-default-method |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7397 tramp-rsh-end-of-line |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7398 tramp-default-password-end-of-line |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7399 tramp-remote-path |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7400 tramp-login-prompt-regexp |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7401 ;; Mask non-7bit characters |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7402 (tramp-password-prompt-regexp . tramp-reporter-dump-variable) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7403 tramp-wrong-passwd-regexp |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7404 tramp-yesno-prompt-regexp |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7405 tramp-yn-prompt-regexp |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7406 tramp-terminal-prompt-regexp |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7407 tramp-temp-name-prefix |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7408 tramp-file-name-structure |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7409 tramp-file-name-regexp |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7410 tramp-multi-file-name-structure |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7411 tramp-multi-file-name-hop-structure |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7412 tramp-multi-methods |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7413 tramp-multi-connection-function-alist |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7414 tramp-methods |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7415 tramp-end-of-output |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7416 tramp-coding-commands |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7417 tramp-actions-before-shell |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7418 tramp-actions-copy-out-of-band |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7419 tramp-multi-actions |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7420 tramp-terminal-type |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7421 ;; Mask non-7bit characters |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7422 (tramp-shell-prompt-pattern . tramp-reporter-dump-variable) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7423 tramp-chunksize |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7424 ,(when (boundp 'tramp-backup-directory-alist) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7425 'tramp-backup-directory-alist) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7426 ,(when (boundp 'tramp-bkup-backup-directory-info) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7427 'tramp-bkup-backup-directory-info) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7428 |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7429 ;; Non-tramp variables of interest |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7430 ;; Mask non-7bit characters |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7431 (shell-prompt-pattern . tramp-reporter-dump-variable) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7432 backup-by-copying |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7433 backup-by-copying-when-linked |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7434 backup-by-copying-when-mismatch |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7435 ,(when (boundp 'backup-by-copying-when-privileged-mismatch) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7436 'backup-by-copying-when-privileged-mismatch) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7437 ,(when (boundp 'password-cache) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7438 'password-cache) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7439 ,(when (boundp 'password-cache-expiry) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7440 'password-cache-expiry) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7441 ,(when (boundp 'backup-directory-alist) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7442 'backup-directory-alist) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7443 ,(when (boundp 'bkup-backup-directory-info) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7444 'bkup-backup-directory-info) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7445 file-name-handler-alist)) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7446 |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7447 'tramp-load-report-modules ; pre-hook |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7448 'tramp-append-tramp-buffers ; post-hook |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7449 "\ |
45861 | 7450 Enter your bug report in this message, including as much detail as you |
7451 possibly can about the problem, what you did to cause it and what the | |
7452 local and remote machines are. | |
7453 | |
7454 If you can give a simple set of instructions to make this bug happen | |
7455 reliably, please include those. Thank you for helping kill bugs in | |
7456 TRAMP. | |
46801
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
7457 |
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
7458 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
|
7459 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
|
7460 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
|
7461 report. |
3fafc6fca8a8
Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46799
diff
changeset
|
7462 |
46802
10aa49b3d28a
Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46801
diff
changeset
|
7463 --bug report follows this line-- |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7464 ")))) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7465 |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7466 (defun tramp-reporter-dump-variable (varsym mailbuf) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7467 "Pretty-print the value of the variable in symbol VARSYM. |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7468 Used for non-7bit chars in strings." |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7469 (let* ((reporter-eval-buffer (symbol-value 'reporter-eval-buffer)) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7470 (val (with-current-buffer reporter-eval-buffer |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7471 (symbol-value varsym)))) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7472 |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7473 ;; There are characters to be masked. |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7474 (when (and (boundp 'mm-7bit-chars) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7475 (string-match |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7476 (concat "[^" (symbol-value 'mm-7bit-chars) "]") val)) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7477 (with-current-buffer reporter-eval-buffer |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7478 (set varsym (concat "(base64-decode-string \"" |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7479 (base64-encode-string val) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7480 "\")")))) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7481 |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7482 ;; Dump variable. |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7483 (funcall (symbol-function 'reporter-dump-variable) varsym mailbuf) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7484 |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7485 ;; Remove string quotation. |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7486 (forward-line -1) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7487 (when (looking-at |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7488 (concat "\\(^.*\\)" "\"" ;; \1 " |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7489 "\\((base64-decode-string \\)" "\\\\" ;; \2 \ |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7490 "\\(\".*\\)" "\\\\" ;; \3 \ |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7491 "\\(\")\\)" "\"$")) ;; \4 " |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7492 (replace-match "\\1\\2\\3\\4") |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7493 (beginning-of-line) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7494 (insert " ;; variable encoded due to non-printable characters\n")) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7495 (forward-line 1) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7496 |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7497 ;; Reset VARSYM to old value. |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7498 (with-current-buffer reporter-eval-buffer |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7499 (set varsym val)))) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7500 |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7501 (defun tramp-load-report-modules () |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7502 "Load needed modules for reporting." |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7503 |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7504 ;; We load message.el and mml.el from Gnus. |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7505 (if (featurep 'xemacs) |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7506 (progn |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7507 (load "message" 'noerror) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7508 (load "mml" 'noerror)) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7509 (require 'message nil 'noerror) |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7510 (require 'mml nil 'noerror)) |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7511 (when (functionp 'message-mode) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7512 (funcall (symbol-function 'message-mode))) |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7513 (when (functionp 'mml-mode) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7514 (funcall (symbol-function 'mml-mode) t))) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7515 |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7516 (defun tramp-append-tramp-buffers () |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7517 "Append Tramp buffers into the bug report." |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7518 |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7519 (when (and |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7520 (eq major-mode 'message-mode) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7521 (boundp 'mml-mode) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7522 (symbol-value 'mml-mode)) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7523 |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7524 (let* ((tramp-buf-regexp "\\*\\(debug \\)?tramp/") |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7525 (buffer-list |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7526 (delq nil |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7527 (mapcar '(lambda (b) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7528 (when (string-match tramp-buf-regexp (buffer-name b)) b)) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7529 (buffer-list)))) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7530 (curbuf (current-buffer))) |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7531 |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7532 ;; There is at least one Tramp buffer. |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7533 (when buffer-list |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7534 (switch-to-buffer (list-buffers-noselect nil)) |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7535 (delete-other-windows) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7536 (setq buffer-read-only nil) |
62344
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7537 (goto-char (point-min)) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7538 (while (not (eobp)) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7539 (if (re-search-forward tramp-buf-regexp (tramp-point-at-eol) t) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7540 (forward-line 1) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7541 (forward-line 0) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7542 (let ((start (point))) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7543 (forward-line 1) |
5a19ff64befb
Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents:
60763
diff
changeset
|
7544 (kill-region start (point))))) |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7545 (insert " |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7546 The buffer(s) above will be appended to this message. If you don't want |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7547 to append a buffer because it contains sensible data, or because the buffer |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7548 is too large, you should delete the respective buffer. The buffer(s) will |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7549 contain user and host names. Passwords will never be included there.") |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7550 |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7551 (when (and tramp-debug-buffer (> tramp-verbose 9)) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7552 (insert "\n\n") |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7553 (let ((start (point))) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7554 (insert "\ |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7555 Please note that you have set `tramp-verbose' to a value greater than 9. |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7556 Therefore, the contents of files might be included in the debug buffer(s).") |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7557 (add-text-properties start (point) (list 'face 'italic)))) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7558 |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7559 (set-buffer-modified-p nil) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7560 (setq buffer-read-only t) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7561 (goto-char (point-min)) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7562 |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7563 (if (y-or-n-p "Do you want to append the buffer(s)? ") |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7564 ;; OK, let's send. First we delete the buffer list. |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7565 (progn |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7566 (kill-buffer nil) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7567 (switch-to-buffer curbuf) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7568 (goto-char (point-max)) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7569 (insert "\n\n") |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7570 (dolist (buffer buffer-list) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7571 (funcall (symbol-function 'mml-insert-empty-tag) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7572 'part 'type "text/plain" 'encoding "base64" |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7573 'disposition "attachment" 'buffer (buffer-name buffer) |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7574 'description (buffer-name buffer))) |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7575 (set-buffer-modified-p nil)) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7576 |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7577 ;; Don't send. Delete the message buffer. |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7578 (set-buffer curbuf) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7579 (set-buffer-modified-p nil) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7580 (kill-buffer nil) |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
7581 (throw 'dont-send nil)))))) |
45861 | 7582 |
7583 (defalias 'tramp-submit-bug 'tramp-bug) | |
7584 | |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7585 ;; Checklist for `tramp-unload-hook' |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7586 ;; - Unload all `tramp-*' packages |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7587 ;; - Reset `file-name-handler-alist' |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7588 ;; - Cleanup hooks where Tramp functions are in |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7589 ;; - Cleanup advised functions |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7590 ;; - Cleanup autoloads |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7591 ;;;###autoload |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7592 (defun tramp-unload-tramp () |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7593 (interactive) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7594 ;; When Tramp is not loaded yet, its autoloads are still active. |
70191
3a3093f77da8
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
70073
diff
changeset
|
7595 (tramp-unload-file-name-handlers) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7596 ;; ange-ftp settings must be enabled. |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7597 (when (functionp 'tramp-ftp-enable-ange-ftp) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7598 (funcall (symbol-function 'tramp-ftp-enable-ange-ftp))) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7599 ;; `tramp-util' unloads also `tramp'. |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7600 (condition-case nil ;; maybe its not loaded yet. |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7601 (unload-feature (if (featurep 'tramp-util) 'tramp-util 'tramp) 'force) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7602 (error nil))) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7603 |
45861 | 7604 (provide 'tramp) |
7605 | |
7606 ;; Make sure that we get integration with the VC package. | |
7607 ;; When it is loaded, we need to pull in the integration module. | |
7608 ;; This must come after (provide 'tramp) because tramp-vc.el | |
7609 ;; requires tramp. | |
7610 (eval-after-load "vc" | |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7611 '(progn |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7612 (require 'tramp-vc) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7613 (add-hook 'tramp-unload-hook |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7614 '(lambda () |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7615 (when (featurep 'tramp-vc) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
7616 (unload-feature 'tramp-vc 'force)))))) |
45861 | 7617 |
7618 ;;; TODO: | |
7619 | |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
7620 ;; * 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
|
7621 ;; 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
|
7622 ;; 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
|
7623 ;; 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
|
7624 ;; 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
|
7625 ;; 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
|
7626 ;; 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
|
7627 ;; * 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
|
7628 ;; * Autodetect if remote `ls' groks the "--dired" switch. |
46790 | 7629 ;; * Add fallback for inline encodings. This should be used |
7630 ;; if the remote end doesn't support mimencode or a similar program. | |
7631 ;; For reading files from the remote host, we can just parse the output | |
7632 ;; of `od -b'. For writing files to the remote host, we construct | |
7633 ;; a shell program which contains only "safe" ascii characters | |
7634 ;; and which writes the right bytes to the file. We can use printf(1) | |
7635 ;; or "echo -e" or the printf function in awk and use octal escapes | |
7636 ;; for the "dangerous" characters. The null byte might be a problem. | |
7637 ;; On some systems, the octal escape doesn't work. So we try the following | |
7638 ;; two commands to write a null byte: | |
7639 ;; dd if=/dev/zero bs=1 count=1 | |
7640 ;; 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
|
7641 ;; * 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
|
7642 ;; 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
|
7643 ;; for the right local commands and the right remote commands separately. |
45861 | 7644 ;; * Cooperate with PCL-CVS. It uses start-process, which doesn't |
7645 ;; work for remote files. | |
7646 ;; * Rewrite `tramp-shell-quote-argument' to abstain from using | |
46790 | 7647 ;; `shell-quote-argument'. |
45861 | 7648 ;; * Completion gets confused when you leave out the method name. |
7649 ;; * In Emacs 21, `insert-directory' shows total number of bytes used | |
7650 ;; by the files in that directory. Add this here. | |
7651 ;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman) | |
7652 ;; * Make ffap.el grok Tramp filenames. (Eli Tziperman) | |
7653 ;; * When logging in, keep looking for questions according to an alist | |
7654 ;; and then invoke the right function. | |
7655 ;; * Case-insensitive filename completion. (Norbert Goevert.) | |
7656 ;; * Running CVS remotely doesn't appear to work right. It thinks | |
7657 ;; files are locked by somebody else even if I'm the locking user. | |
7658 ;; Sometimes, one gets `No CVSROOT specified' errors from CVS. | |
7659 ;; (Skip Montanaro) | |
7660 ;; * Don't use globbing for directories with many files, as this is | |
7661 ;; likely to produce long command lines, and some shells choke on | |
7662 ;; long command lines. | |
7663 ;; * Find out about the new auto-save mechanism in Emacs 21 and | |
7664 ;; do the right thing. | |
7665 ;; * `vc-directory' does not work. It never displays any files, even | |
7666 ;; if it does show files when run locally. | |
7667 ;; * Allow correction of passwords, if the remote end allows this. | |
7668 ;; (Mark Hershberger) | |
7669 ;; * How to deal with MULE in `insert-file-contents' and `write-region'? | |
7670 ;; * Do asynchronous `shell-command's. | |
7671 ;; * Grok `append' parameter for `write-region'. | |
7672 ;; * Test remote ksh or bash for tilde expansion in `tramp-find-shell'? | |
7673 ;; * abbreviate-file-name | |
7674 ;; * grok ~ in tramp-remote-path (Henrik Holm <henrikh@tele.ntnu.no>) | |
7675 ;; * Also allow to omit user names when doing multi-hop. Not sure yet | |
7676 ;; what the user names should default to, though. | |
7677 ;; * better error checking. At least whenever we see something | |
7678 ;; strange when doing zerop, we should kill the process and start | |
7679 ;; again. (Greg Stark) | |
7680 ;; * Add caching for filename completion. (Greg Stark) | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
7681 ;; Of course, this has issues with usability (stale cache bites) |
45861 | 7682 ;; -- <daniel@danann.net> |
7683 ;; * Provide a local cache of old versions of remote files for the rsync | |
7684 ;; transfer method to use. (Greg Stark) | |
7685 ;; * Remove unneeded parameters from methods. | |
7686 ;; * 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
|
7687 ;; (Francesco Potort,Al(B) |
45861 | 7688 ;; * Should we set PATH ourselves or should we rely on the remote end |
7689 ;; to do it? | |
7690 ;; * Make it work for XEmacs 20, which is missing `with-timeout'. | |
7691 ;; * Make it work for different encodings, and for different file name | |
7692 ;; encodings, too. (Daniel Pittman) | |
7693 ;; * 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
|
7694 ;; than the individual items MULTI-METHOD, METHOD, USER, HOST, LOCALNAME. |
45861 | 7695 ;; * Implement asynchronous shell commands. |
7696 ;; * Clean up unused *tramp/foo* buffers after a while. (Pete Forman) | |
7697 ;; * Progress reports while copying files. (Michael Kifer) | |
7698 ;; * `Smart' connection method that uses inline for small and out of | |
7699 ;; band for large files. (Michael Kifer) | |
7700 ;; * Don't search for perl5 and perl. Instead, only search for perl and | |
7701 ;; then look if it's the right version (with `perl -v'). | |
7702 ;; * When editing a remote CVS controlled file as a different user, VC | |
7703 ;; gets confused about the file locking status. Try to find out why | |
7704 ;; the workaround doesn't work. | |
7705 ;; * Change `copy-file' to grok the case where the filename handler | |
7706 ;; for the source and the target file are different. Right now, | |
7707 ;; it looks at the source file and then calls that handler, if | |
7708 ;; there is one. But since ange-ftp, for instance, does not know | |
7709 ;; about Tramp, it does not do the right thing if the target file | |
7710 ;; name is a Tramp name. | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
7711 ;; * 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
|
7712 ;; ** 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
|
7713 ;; 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
|
7714 ;; 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
|
7715 ;; ** 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
|
7716 ;; ** 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
|
7717 ;; ** 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
|
7718 ;; 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
|
7719 ;; ** 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
|
7720 ;; 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
|
7721 ;; ** 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
|
7722 ;; ** Implement "/multi:" completion. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
7723 ;; ** 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
|
7724 ;; * Allow out-of-band methods as _last_ multi-hop. |
45861 | 7725 |
7726 ;; Functions for file-name-handler-alist: | |
7727 ;; diff-latest-backup-file -- in diff.el | |
7728 ;; dired-uncache -- this will be needed when we do insert-directory caching | |
7729 ;; file-name-as-directory -- use primitive? | |
7730 ;; file-name-sans-versions -- use primitive? | |
7731 ;; get-file-buffer -- use primitive | |
7732 ;; vc-registered | |
7733 | |
52401 | 7734 ;;; arch-tag: 3a21a994-182b-48fa-b0cd-c1d9fede424a |
45861 | 7735 ;;; tramp.el ends here |