annotate lisp/net/tramp.el @ 75733:e61c6445cee2

Add text about next-node.xpm, prev-node.xpm and up-node.xpm.
author Jan Djärv <jan.h.d@swipnet.se>
date Thu, 08 Feb 2007 19:07:25 +0000
parents 0d32395ff1eb
children 3936e0dfa3fc f83d17e1ace6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
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,
75148
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5 ;; 2005, 2006, 2007 Free Software Foundation, Inc.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6
75361
9cc44485654f (tramp-perl-encode, tramp-perl-decode): Update copyrights.
Glenn Morris <rgm@gnu.org>
parents: 75194
diff changeset
7 ;; (copyright statements below in code to be updated with the above notice)
9cc44485654f (tramp-perl-encode, tramp-perl-decode): Update copyrights.
Glenn Morris <rgm@gnu.org>
parents: 75194
diff changeset
8
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
9 ;; 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
10 ;; Michael Albinus <michael.albinus@gmx.de>
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
11 ;; Keywords: comm, processes
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
12
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
13 ;; This file is part of GNU Emacs.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
14
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
15 ;; GNU Emacs is free software; you can redistribute it and/or modify
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
16 ;; it under the terms of the GNU General Public License as published by
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
17 ;; the Free Software Foundation; either version 2, or (at your option)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
18 ;; any later version.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
19
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
20 ;; GNU Emacs is distributed in the hope that it will be useful,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
23 ;; GNU General Public License for more details.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
24
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
25 ;; You should have received a copy of the GNU General Public License
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
26 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64085
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 63588
diff changeset
27 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 63588
diff changeset
28 ;; Boston, MA 02110-1301, USA.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
29
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
30 ;;; Commentary:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
31
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
32 ;; This package provides remote file editing, similar to ange-ftp.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
33 ;; The difference is that ange-ftp uses FTP to transfer files between
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
34 ;; the local and the remote host, whereas tramp.el uses a combination
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
35 ;; of rsh and rcp or other work-alike programs, such as ssh/scp.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
36 ;;
50338
155b4b78aa3b * tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49995
diff changeset
37 ;; For more detailed instructions, please see the info file.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
38 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
39 ;; Notes:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
40 ;; -----
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
41 ;;
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
42 ;; This package only works for Emacs 20 and higher, and for XEmacs 21
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
43 ;; and higher. (XEmacs 20 is missing the `with-timeout' macro. Emacs
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
44 ;; 19 is reported to have other problems. For XEmacs 21, you need the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
45 ;; package `fsf-compat' for the `with-timeout' macro.)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
46 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
47 ;; This version might not work with pre-Emacs 21 VC unless VC is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
48 ;; loaded before tramp.el. Could you please test this and tell me about
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
49 ;; the result? Thanks.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
50 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
51 ;; Also see the todo list at the bottom of this file.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
52 ;;
50338
155b4b78aa3b * tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49995
diff changeset
53 ;; 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
54 ;; http://ftp.gnu.org/gnu/tramp/
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
55 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
56 ;; 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
57 ;; tramp-devel@gnu.org
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
58 ;; 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
59 ;; http://lists.gnu.org/mailman/listinfo/tramp-devel
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
60 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
61 ;; For the adventurous, the current development sources are available
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
62 ;; via CVS. You can find instructions about this at the following URL:
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
63 ;; http://savannah.gnu.org/projects/tramp/
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
64 ;; Click on "CVS" in the navigation bar near the top.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
65 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
66 ;; Don't forget to put on your asbestos longjohns, first!
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
67
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
68 ;;; Code:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
69
50338
155b4b78aa3b * tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49995
diff changeset
70 ;; The Tramp version number and bug report address, as prepared by configure.
155b4b78aa3b * tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49995
diff changeset
71 (require 'trampver)
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
72 (add-hook 'tramp-unload-hook
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
73 '(lambda ()
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
74 (when (featurep 'trampver)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
75 (unload-feature 'trampver 'force))))
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
76
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
77 (if (featurep 'xemacs)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
78 (require 'timer-funcs)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
79 (require 'timer))
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
80
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
81 (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
82 ;; 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
83 ;; be mandatory
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
84 (if (featurep 'xemacs)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
85 (load "password" 'noerror)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
86 (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
87
47205
8a2bf9dded0f * net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46998
diff changeset
88 ;; 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
89 ;; 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
90 ;; in XEmacs.
8a2bf9dded0f * net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46998
diff changeset
91 (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
92 (fboundp 'base64-decode-region))
8a2bf9dded0f * net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46998
diff changeset
93 (require 'base64)) ;for the mimencode methods
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
94 (require 'shell)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
95 (require 'advice)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
96
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
97 (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
98 "Implementation of `uuencode' in Lisp.")
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
99 (add-hook 'tramp-unload-hook
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
100 '(lambda ()
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
101 (when (featurep 'tramp-uu)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
102 (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
103
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
104 (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
105 (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
106
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
107 ;; 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
108 ;; 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
109 ;; 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
110 ;; 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
111 ;; 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
112 ;; 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
113 ;; 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
114 ;; the other places.
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
115 ;;;###autoload
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
116 (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
117 "Non-nil means to use unified Ange-FTP/Tramp filename syntax.
73911
c411526ac6bb (tramp-unified-filenames): Improve previos doc fix.
Glenn Morris <rgm@gnu.org>
parents: 73879
diff changeset
118 Otherwise, use a separate filename syntax for Tramp.")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
119
48973
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
120 ;; 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
121 ;; 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
122
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
123 ;; 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
124 (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
125 (eval-after-load "tramp"
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
126 '(progn
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
127 (require 'tramp-ftp)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
128 (add-hook 'tramp-unload-hook
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
129 '(lambda ()
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
130 (when (featurep 'tramp-ftp)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
131 (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
132 (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
133 (eval-after-load "tramp"
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
134 '(progn
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
135 (require 'tramp-efs)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
136 (add-hook 'tramp-unload-hook
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
137 '(lambda ()
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
138 (when (featurep 'tramp-efs)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
139 (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
140
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
141 ;; 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
142 ;; 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
143 ;; "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
144 ;; 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
145 (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
146 (eval-after-load "tramp"
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
147 '(progn
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
148 (require 'tramp-smb)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
149 (add-hook 'tramp-unload-hook
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
150 '(lambda ()
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
151 (when (featurep 'tramp-smb)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
152 (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
153
74052
6959e5ddb2a9 * net/tramp.el (top): cl and custom are always required.
Michael Albinus <michael.albinus@gmx.de>
parents: 73911
diff changeset
154 (require 'cl)
6959e5ddb2a9 * net/tramp.el (top): cl and custom are always required.
Michael Albinus <michael.albinus@gmx.de>
parents: 73911
diff changeset
155 (require 'custom)
6959e5ddb2a9 * net/tramp.el (top): cl and custom are always required.
Michael Albinus <michael.albinus@gmx.de>
parents: 73911
diff changeset
156 ;; Emacs 19.34 compatibility hack -- is this needed?
6959e5ddb2a9 * net/tramp.el (top): cl and custom are always required.
Michael Albinus <michael.albinus@gmx.de>
parents: 73911
diff changeset
157 (or (>= emacs-major-version 20)
6959e5ddb2a9 * net/tramp.el (top): cl and custom are always required.
Michael Albinus <michael.albinus@gmx.de>
parents: 73911
diff changeset
158 (load "cl-seq"))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
159
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
160 (unless (boundp 'custom-print-functions)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
161 (defvar custom-print-functions nil)) ; not autoloaded before Emacs 20.4
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
162
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
163 ;; 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
164 ;; 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
165 (eval-when-compile
65792
8c8e6f2eea3c Pacify byte compiler warnings in pacification code.
Richard M. Stallman <rms@gnu.org>
parents: 65605
diff changeset
166 (when (featurep 'xemacs)
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
167 (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
168 (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
169 (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
170
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
171 ;; `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
172 ;; 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
173 ;; 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
174 (eval-when-compile
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
175 (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
176 (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
177
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
178 ;;; User Customizable Internal Variables:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
179
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
180 (defgroup tramp nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
181 "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
182 :group 'files
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
183 :version "22.1")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
184
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
185 (defcustom tramp-verbose 9
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
186 "*Verbosity level for tramp.el. 0 means be silent, 10 is most verbose."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
187 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
188 :type 'integer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
189
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
190 (defcustom tramp-debug-buffer nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
191 "*Whether to send all commands and responses to a debug buffer."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
192 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
193 :type 'boolean)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
194
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
195 ;; Emacs case
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
196 (eval-and-compile
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
197 (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
198 (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
199 "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
200 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
201 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
202 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
203 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
204
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
205 \(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
206
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
207 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
208 policy for local files."
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
209 :group 'tramp
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
210 :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
211 (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
212
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
213 ;; 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
214 ;; 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
215 (eval-and-compile
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
216 (when (featurep 'xemacs)
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
217 (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
218 "*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
219 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
220 `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
221 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
222 \(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
223
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
224 \(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
225
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
226 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
227 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
228 :type '(repeat
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
229 (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
230 (string :tag "Backup Dir")
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
231 (set :inline t
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
232 (const ok-create)
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
233 (const full-path)
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
234 (const prepend-name)
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
235 (const search-upward))))
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
236 :group 'tramp)))
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
237
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
238 (defcustom tramp-auto-save-directory nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
239 "*Put auto-save files in this directory, if set.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
240 The idea is to use a local directory so that auto-saving is faster."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
241 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
242 :type '(choice (const nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
243 string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
244
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
245 (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
246 (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
247 (getenv "COMSPEC")
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
248 "/bin/sh")
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
249 "*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
250 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
251 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
252 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
253 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
254
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
255 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
256
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
257 /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
258
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
259 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
260 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
261 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
262 standard input or a file.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
263
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
264 Note that this variable is not used for remote commands. There are
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
265 mechanisms in tramp.el which automatically determine the right shell to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
266 use for the remote host."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
267 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
268 :type '(file :must-match t))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
269
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
270 (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
271 (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
272 "/c"
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
273 "-c")
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
274 "*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
275 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
276 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
277 :type 'string)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
278
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
279 (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
280 "*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
281 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
282
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
283 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
284 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
285 :type 'boolean)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
286
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
287 (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
288 tramp-encoding-shell
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
289 "*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
290 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
291 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
292 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
293 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
294 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
295
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
296 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
297 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
298
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
299 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
300 :group 'tramp
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
301 :type '(file :must-match t))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
302
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
303 ;; CCC I have changed all occurrences of comint-quote-filename with
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
304 ;; tramp-shell-quote-argument, except in tramp-handle-expand-many-files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
305 ;; There, comint-quote-filename was removed altogether. If it turns
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
306 ;; out to be necessary there, something will need to be done.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
307 ;;-(defcustom tramp-file-name-quote-list
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
308 ;;- '(?] ?[ ?\| ?& ?< ?> ?\( ?\) ?\; ?\ ?\* ?\? ?\! ?\" ?\' ?\` ?# ?\@ ?\+ )
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
309 ;;- "*Protect these characters from the remote shell.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
310 ;;-Any character in this list is quoted (preceded with a backslash)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
311 ;;-because it means something special to the shell. This takes effect
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
312 ;;-when sending file and directory names to the remote shell.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
313 ;;-
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
314 ;;-See `comint-file-name-quote-list' for details."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
315 ;;- :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
316 ;;- :type '(repeat character))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
317
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
318 (defcustom tramp-methods
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
319 '( ("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
320 (tramp-login-program "rsh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
321 (tramp-copy-program "rcp")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
322 (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
323 (tramp-login-args nil)
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
324 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
325 (tramp-copy-keep-date-arg "-p")
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
326 (tramp-password-end-of-line nil))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
327 ("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
328 (tramp-login-program "ssh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
329 (tramp-copy-program "scp")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
330 (tramp-remote-sh "/bin/sh")
74737
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
331 (tramp-login-args ("-e" "none"))
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
332 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
333 (tramp-copy-keep-date-arg "-p")
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
334 (tramp-password-end-of-line nil))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
335 ("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
336 (tramp-login-program "ssh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
337 (tramp-copy-program "scp")
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
338 (tramp-remote-sh "/bin/sh")
74737
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
339 (tramp-login-args ("-1" "-e" "none"))
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
340 (tramp-copy-args ("-1"))
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
341 (tramp-copy-keep-date-arg "-p")
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
342 (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
343 ("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
344 (tramp-login-program "ssh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
345 (tramp-copy-program "scp")
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
346 (tramp-remote-sh "/bin/sh")
74737
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
347 (tramp-login-args ("-2" "-e" "none"))
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
348 (tramp-copy-args ("-2"))
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
349 (tramp-copy-keep-date-arg "-p")
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
350 (tramp-password-end-of-line nil))
47683
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
351 ("scp1_old"
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
352 (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
353 (tramp-login-program "ssh1")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
354 (tramp-copy-program "scp1")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
355 (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
356 (tramp-login-args ("-e" "none"))
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
357 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
358 (tramp-copy-keep-date-arg "-p")
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
359 (tramp-password-end-of-line nil))
47683
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
360 ("scp2_old"
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
361 (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
362 (tramp-login-program "ssh2")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
363 (tramp-copy-program "scp2")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
364 (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
365 (tramp-login-args ("-e" "none"))
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
366 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
367 (tramp-copy-keep-date-arg "-p")
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
368 (tramp-password-end-of-line nil))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
369 ("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
370 (tramp-login-program "ssh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
371 (tramp-copy-program "rsync")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
372 (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
373 (tramp-login-args ("-e" "none"))
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
374 (tramp-copy-args ("-e" "ssh"))
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
375 (tramp-copy-keep-date-arg "-t")
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
376 (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
377 ("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
378 (tramp-login-program "remsh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
379 (tramp-copy-program "rcp")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
380 (tramp-remote-sh "/bin/sh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
381 (tramp-login-args nil)
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
382 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
383 (tramp-copy-keep-date-arg "-p")
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
384 (tramp-password-end-of-line nil))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
385 ("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
386 (tramp-login-program "rsh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
387 (tramp-copy-program nil)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
388 (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
389 (tramp-login-args nil)
51603
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
390 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
391 (tramp-copy-keep-date-arg nil)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
392 (tramp-password-end-of-line nil))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
393 ("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
394 (tramp-login-program "ssh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
395 (tramp-copy-program nil)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
396 (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
397 (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
398 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
399 (tramp-copy-keep-date-arg nil)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
400 (tramp-password-end-of-line nil))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
401 ("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
402 (tramp-login-program "ssh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
403 (tramp-copy-program nil)
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
404 (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
405 (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
406 (tramp-copy-args ("-1"))
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
407 (tramp-copy-keep-date-arg nil)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
408 (tramp-password-end-of-line nil))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
409 ("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
410 (tramp-login-program "ssh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
411 (tramp-copy-program nil)
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
412 (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
413 (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
414 (tramp-copy-args ("-2"))
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
415 (tramp-copy-keep-date-arg nil)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
416 (tramp-password-end-of-line nil))
47683
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
417 ("ssh1_old"
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
418 (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
419 (tramp-login-program "ssh1")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
420 (tramp-copy-program nil)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
421 (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
422 (tramp-login-args ("-e" "none"))
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
423 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
424 (tramp-copy-keep-date-arg nil)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
425 (tramp-password-end-of-line nil))
47683
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
426 ("ssh2_old"
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
427 (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
428 (tramp-login-program "ssh2")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
429 (tramp-copy-program nil)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
430 (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
431 (tramp-login-args ("-e" "none"))
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
432 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
433 (tramp-copy-keep-date-arg nil)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
434 (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
435 ("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
436 (tramp-login-program "remsh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
437 (tramp-copy-program nil)
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
438 (tramp-remote-sh "/bin/sh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
439 (tramp-login-args nil)
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
440 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
441 (tramp-copy-keep-date-arg nil)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
442 (tramp-password-end-of-line nil))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
443 ("telnet"
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
444 (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
445 (tramp-login-program "telnet")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
446 (tramp-copy-program nil)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
447 (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
448 (tramp-login-args nil)
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
449 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
450 (tramp-copy-keep-date-arg nil)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
451 (tramp-password-end-of-line nil))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
452 ("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
453 (tramp-login-program "su")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
454 (tramp-copy-program nil)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
455 (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
456 (tramp-login-args ("-" "%u"))
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
457 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
458 (tramp-copy-keep-date-arg nil)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
459 (tramp-password-end-of-line nil))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
460 ("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
461 (tramp-login-program "sudo")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
462 (tramp-copy-program nil)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
463 (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
464 (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
465 "-p" "Password:"))
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
466 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
467 (tramp-copy-keep-date-arg nil)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
468 (tramp-password-end-of-line nil))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
469 ("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
470 (tramp-login-program nil)
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
471 (tramp-copy-program nil)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
472 (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
473 (tramp-login-args nil)
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
474 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
475 (tramp-copy-keep-date-arg nil)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
476 (tramp-password-end-of-line nil))
74737
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
477 ("scpc" (tramp-connection-function tramp-open-connection-rsh)
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
478 (tramp-login-program "ssh")
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
479 (tramp-copy-program "scp")
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
480 (tramp-remote-sh "/bin/sh")
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
481 (tramp-login-args ("-o" "ControlPath=%t.%%r@%%h:%%p"
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
482 "-o" "ControlMaster=yes"
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
483 "-e" "none"))
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
484 (tramp-copy-args ("-o" "ControlPath=%t.%%r@%%h:%%p"
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
485 "-o" "ControlMaster=auto"))
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
486 (tramp-copy-keep-date-arg "-p")
5ac41de0888b * net/tramp.el (tramp-methods): Introduce new method `scpc'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74682
diff changeset
487 (tramp-password-end-of-line nil))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
488 ("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
489 (tramp-login-program "ssh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
490 (tramp-copy-program "scp")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
491 (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
492 (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
493 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
494 (tramp-copy-keep-date-arg "-p")
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
495 (tramp-password-end-of-line nil))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
496 ("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
497 (tramp-login-program "ssh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
498 (tramp-copy-program nil)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
499 (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
500 (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
501 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
502 (tramp-copy-keep-date-arg nil)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
503 (tramp-password-end-of-line nil))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
504 ("krlogin"
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
505 (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
506 (tramp-login-program "krlogin")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
507 (tramp-copy-program nil)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
508 (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
509 (tramp-login-args ("-x"))
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
510 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
511 (tramp-copy-keep-date-arg nil)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
512 (tramp-password-end-of-line nil))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
513 ("plink"
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
514 (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
515 (tramp-login-program "plink")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
516 (tramp-copy-program nil)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
517 (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
518 (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
519 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
520 (tramp-copy-keep-date-arg nil)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
521 (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
522 ("plink1"
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
523 (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
524 (tramp-login-program "plink")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
525 (tramp-copy-program nil)
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
526 (tramp-remote-sh "/bin/sh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
527 (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
528 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
529 (tramp-copy-keep-date-arg nil)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
530 (tramp-password-end-of-line "xy")) ;see docstring for "xy"
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
531 ("pscp"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
532 (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
533 (tramp-login-program "plink")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
534 (tramp-copy-program "pscp")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
535 (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
536 (tramp-login-args ("-ssh"))
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
537 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
538 (tramp-copy-keep-date-arg "-p")
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
539 (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
540 ("fcp"
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
541 (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
542 (tramp-login-program "fsh")
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
543 (tramp-copy-program "fcp")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
544 (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
545 (tramp-login-args ("sh" "-i"))
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
546 (tramp-copy-args nil)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
547 (tramp-copy-keep-date-arg "-p")
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
548 (tramp-password-end-of-line nil))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
549 )
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
550 "*Alist of methods for remote files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
551 This is a list of entries of the form (NAME PARAM1 PARAM2 ...).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
552 Each NAME stands for a remote access method. Each PARAM is a
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
553 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
554 * `tramp-connection-function'
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
555 This specifies the function to use to connect to the remote host.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
556 Currently, `tramp-open-connection-rsh', `tramp-open-connection-telnet'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
557 and `tramp-open-connection-su' are defined. See the documentation
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
558 of these functions for more details.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
559 * `tramp-remote-sh'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
560 This specifies the Bourne shell to use on the remote host. This
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
561 MUST be a Bourne-like shell. It is normally not necessary to set
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
562 this to any value other than \"/bin/sh\": tramp wants to use a shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
563 which groks tilde expansion, but it can search for it. Also note
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
564 that \"/bin/sh\" exists on all Unixen, this might not be true for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
565 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
566 * `tramp-login-program'
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
567 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
568 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
569 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
570 `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
571 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
572 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
573 * `tramp-login-args'
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
574 This specifies the list of arguments to pass to the above
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
575 mentioned program. Please note that this is a list of arguments,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
576 that is, normally you don't want to put \"-a -b\" or \"-f foo\"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
577 here. Instead, you want two list elements, one for \"-a\" and one
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
578 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
579 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
580 \"%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
581 be used to obtain a literal percent character.
74395
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
582 \"%t\" is replaced by the temporary file name for `scp'-like methods.
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
583 * `tramp-copy-program'
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
584 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
585 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
586 a workalike program.
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
587 * `tramp-copy-args'
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
588 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
589 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
590 * `tramp-copy-keep-date-arg'
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
591 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
592 timestamp of the original file should be kept. For `rcp', use `-p', for
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
593 `rsync', use `-t'.
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
594 * `tramp-password-end-of-line'
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
595 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
596 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
597 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
598 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
599 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
600 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
601 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
602 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
603
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
604 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
605 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
606 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
607 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
608 to do this, set `tramp-copy-program' in the method.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
609
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
610 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
611 file is passed through the same buffer used by `tramp-login-program'. In
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
612 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
613 `tramp-login-program' might use escape codes or the connection might not
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
614 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
615 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
616
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
617 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
618 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
619 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
620 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
621 the associated arguments (for example, the login program if you chose
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
622 `tramp-open-connection-telnet').
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
623
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
624 Notes:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
625
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
626 When using `tramp-open-connection-su' the phrase `open connection to a
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
627 remote host' sounds strange, but it is used nevertheless, for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
628 consistency. No connection is opened to a remote host, but `su' is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
629 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
630 host other than `localhost' or the name of the local host."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
631 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
632 :type '(repeat
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
633 (cons string
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
634 (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
635 (list (const tramp-login-program)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
636 (choice (const nil) string))
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
637 (list (const tramp-copy-program)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
638 (choice (const nil) string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
639 (list (const tramp-remote-sh)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
640 (choice (const nil) string))
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
641 (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
642 (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
643 (list (const tramp-copy-keep-date-arg)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
644 (choice (const nil) string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
645 (list (const tramp-encoding-command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
646 (choice (const nil) string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
647 (list (const tramp-decoding-command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
648 (choice (const nil) string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
649 (list (const tramp-encoding-function)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
650 (choice (const nil) function))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
651 (list (const tramp-decoding-function)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
652 (choice (const nil) function))
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
653 (list (const tramp-password-end-of-line)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
654 (choice (const nil) string))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
655
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
656 (defcustom tramp-multi-methods '("multi" "multiu")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
657 "*List of multi-hop methods.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
658 Each entry in this list should be a method name as mentioned in the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
659 variable `tramp-methods'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
660 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
661 :type '(repeat string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
662
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
663 (defcustom tramp-multi-connection-function-alist
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
664 '(("telnet" tramp-multi-connect-telnet "telnet %h%n")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
665 ("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
666 ("remsh" tramp-multi-connect-rlogin "remsh %h -l %u%n")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
667 ("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
668 ("ssht" tramp-multi-connect-rlogin "ssh %h -e none -t -t -l %u%n")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
669 ("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
670 ("sudo" tramp-multi-connect-su "sudo -u %u -s -p Password:%n"))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
671 "*List of connection functions for multi-hop methods.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
672 Each list item is a list of three items (METHOD FUNCTION COMMAND),
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
673 where METHOD is the name as used in the file name, FUNCTION is the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
674 function to be executed, and COMMAND is the shell command used for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
675 connecting.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
676
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
677 COMMAND may contain percent escapes. `%u' will be replaced with the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
678 user name, `%h' will be replaced with the host name, and `%n' will be
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
679 replaced with an end-of-line character, as specified in the variable
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
680 `tramp-rsh-end-of-line'. Use `%%' for a literal percent character.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
681 Note that the interpretation of the percent escapes also depends on
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
682 the FUNCTION. For example, the `%u' escape is forbidden with the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
683 function `tramp-multi-connect-telnet'. See the documentation of the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
684 various functions for details."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
685 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
686 :type '(repeat (list string function string)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
687
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
688 (defcustom tramp-default-method
74777
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
689 ;; An external copy method seems to be preferred, because it is much
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
690 ;; more performant for large files, and it hasn't too serious delays
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
691 ;; for small files. But it must be ensured that there aren't
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
692 ;; permanent password queries. Either a password agent like
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
693 ;; "ssh-agent" or "Pageant" shall run, or the optional password.el
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
694 ;; package shall be active for password caching. "scpc" would be
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
695 ;; another good choice because of the "ControlMaster" option, but
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
696 ;; this is a more modern alternative in OpenSSH 4, which cannot be
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
697 ;; taken as default.
75007
4b58ce68eaec * net/tramp.el (tramp-default-method): Don't call `symbol-function'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74985
diff changeset
698 (let ((e-f (fboundp 'executable-find)))
74777
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
699 (cond
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
700 ;; PuTTY is installed.
75007
4b58ce68eaec * net/tramp.el (tramp-default-method): Don't call `symbol-function'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74985
diff changeset
701 ((and e-f (funcall 'executable-find "pscp"))
74777
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
702 (if (or (fboundp 'password-read)
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
703 ;; Pageant is running.
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
704 (and (fboundp 'w32-window-exists-p)
75007
4b58ce68eaec * net/tramp.el (tramp-default-method): Don't call `symbol-function'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74985
diff changeset
705 (funcall 'w32-window-exists-p "Pageant" "Pageant")))
74777
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
706 "pscp"
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
707 "plink"))
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
708 ;; There is an ssh installation.
75007
4b58ce68eaec * net/tramp.el (tramp-default-method): Don't call `symbol-function'.
Michael Albinus <michael.albinus@gmx.de>
parents: 74985
diff changeset
709 ((and e-f (funcall 'executable-find "scp"))
74777
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
710 (if (or (fboundp 'password-read)
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
711 ;; ssh-agent is running.
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
712 (getenv "SSH_AUTH_SOCK")
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
713 (getenv "SSH_AGENT_PID"))
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
714 "scp"
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
715 "ssh"))
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
716 ;; Under Emacs 20, `executable-find' does not exists. So we
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
717 ;; couldn't check whether there is an ssh implementation. Let's
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
718 ;; hope the best.
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
719 ((not e-f) "ssh")
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
720 ;; Fallback.
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
721 (t "ftp")))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
722 "*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
723 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
724 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
725 :group 'tramp
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
726 :type 'string)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
727
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
728 (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
729 '(("\\`localhost\\'" "\\`root\\'" "su"))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
730 "*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
731 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
732 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
733 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
734 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
735 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
736
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
737 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
738 empty string for the user name.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
739
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
740 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
741 :group 'tramp
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
742 :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
743 (regexp :tag "User regexp")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
744 (string :tag "Method"))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
745
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
746 ;; 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
747 (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
748 (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
749 '((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
750 (tramp-parse-rhosts "~/.rhosts")))
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
751 "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
752
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
753 ;; 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
754 (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
755 (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
756 '((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
757 (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
758 (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
759 (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
760 (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
761 (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
762 (tramp-parse-rhosts "~/.rhosts")
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
763 (tramp-parse-rhosts "~/.shosts")
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
764 (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
765 (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
766 (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
767 (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
768 "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
769
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
770 ;; 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
771 (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
772 (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
773 '((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
774 "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
775
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
776 ;; 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
777 (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
778 (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
779 '((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
780 "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
781
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
782 (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
783 "*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
784 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
785 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
786 \(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
787 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
788
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
789 * `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
790 * `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
791 * `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
792 * `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
793 * `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
794 * `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
795 * `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
796 * `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
797
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
798 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
799 the info pages.")
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
800
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
801 (eval-after-load "tramp"
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
802 '(progn
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 "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
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 "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
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 "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
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 "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
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 "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
813 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
814 "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
815 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
816 "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
817 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
818 "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
819 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
820 "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
821 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
822 "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
823 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
824 "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
825 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
826 "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
827 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
828 "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
829 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
830 "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
831 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
832 "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
833 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
834 "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
835 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
836 "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
837 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
838 "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
839 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
840 "multi" nil)
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
841 (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
842 "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
843 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
844 "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
845 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
846 "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
847 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
848 "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
849 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
850 "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
851 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
852 "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
853 (tramp-set-completion-function
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
854 "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
855
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
856 (defcustom tramp-rsh-end-of-line "\n"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
857 "*String used for end of line in rsh connections.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
858 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
859 if you need to change this.
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
860 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
861 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
862 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
863 :type 'string)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
864
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
865 (defcustom tramp-default-password-end-of-line
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
866 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
867 "*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
868 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
869 `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
870
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
871 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
872 \"\\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
873 \"\\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
874 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
875
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
876 The default value is to use the same value as `tramp-rsh-end-of-line'."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
877 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
878 :type 'string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
879
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
880 (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
881 ;; "/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
882 ;; 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
883 '("/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
884 "/usr/ccs/bin" "/local/bin" "/local/freeware/bin" "/local/gnu/bin"
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
885 "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
886 "*List of directories to search for executables on remote host.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
887 Please notify me about other semi-standard directories to include here.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
888
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
889 You can use `~' in this list, but when searching for a shell which groks
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
890 tilde expansion, all directory names starting with `~' will be ignored."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
891 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
892 :type '(repeat string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
893
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
894 (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
895 ".*ogin\\( .*\\)?: *"
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
896 "*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
897 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
898
efa862a76bc2 * net/tramp.el (tramp-login-prompt-regexp): Expand regexp in order to
Michael Albinus <michael.albinus@gmx.de>
parents: 65359
diff changeset
899 Sometimes the prompt is reported to look like \"login as:\"."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
900 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
901 :type 'regexp)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
902
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
903 (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
904 "^[^#$%>\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
905 "Regexp to match prompts from remote shell.
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
906 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
907 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
908 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
909 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
910 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
911 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
912 which should work well in many cases."
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
913 :group 'tramp
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
914 :type 'regexp)
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
915
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
916 (defcustom tramp-password-prompt-regexp
65925
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
917 "^.*\\([pP]assword\\|passphrase\\).*:\^@? *"
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
918 "*Regexp matching password-like prompts.
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
919 The regexp should match at end of buffer.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
920
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
921 The `sudo' program appears to insert a `^@' character into the prompt."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
922 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
923 :type 'regexp)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
924
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
925 (defcustom tramp-wrong-passwd-regexp
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
926 (concat "^.*"
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
927 ;; These strings should be on the last line
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
928 (regexp-opt '("Permission denied."
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
929 "Login incorrect"
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
930 "Login Incorrect"
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
931 "Connection refused"
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
932 "Connection closed"
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
933 "Sorry, try again."
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
934 "Name or service not known"
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
935 "Host key verification failed.") t)
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
936 ".*"
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
937 "\\|"
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
938 "^.*\\("
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
939 ;; Here comes a list of regexes, separated by \\|
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
940 "Received signal [0-9]+"
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
941 "\\).*")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
942 "*Regexp matching a `login failed' message.
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
943 The regexp should match at end of buffer."
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
944 :group 'tramp
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
945 :type 'regexp)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
946
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
947 (defcustom tramp-yesno-prompt-regexp
46992
6529728ddf05 Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46835
diff changeset
948 (concat
6529728ddf05 Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46835
diff changeset
949 (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
950 "\\s-*")
6529728ddf05 Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46835
diff changeset
951 "Regular expression matching all yes/no queries which need to be confirmed.
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
952 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
953 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
954 See also `tramp-yn-prompt-regexp'."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
955 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
956 :type 'regexp)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
957
46992
6529728ddf05 Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46835
diff changeset
958 (defcustom tramp-yn-prompt-regexp
74985
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
959 (concat
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
960 (regexp-opt '("Store key in cache? (y/n)"
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
961 "Update cached key? (y/n, Return cancels connection)") t)
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
962 "\\s-*")
46992
6529728ddf05 Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46835
diff changeset
963 "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
964 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
965 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
966 See also `tramp-yesno-prompt-regexp'."
6529728ddf05 Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46835
diff changeset
967 :group 'tramp
6529728ddf05 Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46835
diff changeset
968 :type 'regexp)
47771
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
969
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
970 (defcustom tramp-terminal-prompt-regexp
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
971 (concat "\\("
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
972 "TERM = (.*)"
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
973 "\\|"
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
974 "Terminal type\\? \\[.*\\]"
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
975 "\\)\\s-*")
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
976 "Regular expression matching all terminal setting prompts.
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
977 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
978 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
979 :group 'tramp
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
980 :type 'regexp)
46992
6529728ddf05 Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46835
diff changeset
981
59582
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
982 (defcustom tramp-operation-not-permitted-regexp
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
983 (concat "\\(" "preserving times.*" "\\|" "set mode" "\\)" ":\\s-*"
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
984 (regexp-opt '("Operation not permitted") t))
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
985 "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
986 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
987 be ignored safely."
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
988 :group 'tramp
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
989 :type 'regexp)
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
990
74166
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
991 (defcustom tramp-copy-failed-regexp
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
992 (concat "\\(.+: "
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
993 (regexp-opt '("Permission denied"
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
994 "not a regular file"
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
995 "is a directory"
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
996 "No such file or directory") t)
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
997 "\\)\\s-*")
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
998 "Regular expression matching copy problems in (s)cp operations."
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
999 :group 'tramp
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
1000 :type 'regexp)
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
1001
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
1002 (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
1003 ""
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
1004 "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
1005 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
1006 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
1007 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
1008 `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
1009 :group 'tramp
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
1010 :type 'regexp)
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
1011
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1012 (defcustom tramp-temp-name-prefix "tramp."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1013 "*Prefix to use for temporary files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1014 If this is a relative file name (such as \"tramp.\"), it is considered
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1015 relative to the directory name returned by the function
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1016 `tramp-temporary-file-directory' (which see). It may also be an
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1017 absolute file name; don't forget to include a prefix for the filename
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1018 part, though."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1019 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1020 :type 'string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1021
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1022 (defcustom tramp-discard-garbage nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1023 "*If non-nil, try to discard garbage sent by remote shell.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1024 Some shells send such garbage upon connection setup."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1025 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1026 :type 'boolean)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1027
48973
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
1028 (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
1029 "*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
1030 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
1031 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
1032 arguments.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1033
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1034 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
1035 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
1036 shell from reading its init file."
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1037 :group 'tramp
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
1038 ;; 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
1039 ;; `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
1040 :type (if (get 'alist 'widget-type)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
1041 '(alist :key-type string :value-type string)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
1042 '(repeat (cons string string))))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
1043
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1044 (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
1045 (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
1046 "*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
1047 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
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-prefix-regexp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1052 (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
1053 "*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
1054 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
1055 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1056 :type 'regexp)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1057
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1058 (defcustom tramp-method-regexp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1059 "[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
1060 "*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
1061 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1062 :type 'regexp)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1063
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1064 ;; 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
1065 ;; 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
1066 (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
1067 (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
1068 "*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
1069 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
1070 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
1071 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1072 :type 'string)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1073
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1074 (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
1075 (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
1076 "*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
1077 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
1078 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
1079 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1080 :type 'regexp)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1081
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1082 (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
1083 ":"
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1084 "*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
1085 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
1086 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
1087 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1088 :type 'string)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1089
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1090 (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
1091 (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
1092 "*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
1093 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
1094 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
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 'regexp)
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-multi-hop-format
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1099 (if tramp-unified-filenames ":" "/")
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1100 "*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
1101 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
1102 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
1103 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1104 :type 'string)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1105
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1106 (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
1107 (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
1108 "*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
1109 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
1110 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
1111 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1112 :type 'regexp)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1113
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1114 (defcustom tramp-user-regexp
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
1115 "[^:/ \t]*"
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1116 "*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
1117 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1118 :type 'regexp)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1119
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1120 (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
1121 "@"
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1122 "*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
1123 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
1124 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1125 :type 'string)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1126
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1127 (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
1128 (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
1129 "*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
1130 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
1131 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1132 :type 'regexp)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1133
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1134 (defcustom tramp-host-regexp
47771
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
1135 "[a-zA-Z0-9_.-]*"
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
1136 "*Regexp matching host names."
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
1137 :group 'tramp
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
1138 :type 'regexp)
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
1139
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
1140 (defcustom tramp-host-with-port-regexp
47683
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
1141 "[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
1142 "*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
1143 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1144 :type 'regexp)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1145
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1146 (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
1147 (if tramp-unified-filenames ":" "]")
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1148 "*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
1149 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
1150 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1151 :type 'string)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1152
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1153 (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
1154 (regexp-quote tramp-postfix-host-format)
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1155 "*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
1156 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
1157 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1158 :type 'regexp)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1159
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1160 (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
1161 ".*$"
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1162 "*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
1163 :group 'tramp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1164 :type 'regexp)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1165
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1166 ;; File name format.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1167
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1168 (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
1169 (list
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1170 (concat
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1171 tramp-prefix-regexp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1172 "\\(" "\\(" 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
1173 "\\(" "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp "\\)?"
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
1174 "\\(" 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
1175 "\\(" 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
1176 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
1177
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1178 "*List of five elements (REGEXP METHOD USER HOST FILE), detailing \
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1179 the tramp file name structure.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1180
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1181 The first element REGEXP is a regular expression matching a tramp file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1182 name. The regex should contain parentheses around the method name,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1183 the user name, the host name, and the file name parts.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1184
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1185 The second element METHOD is a number, saying which pair of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1186 parentheses matches the method name. The third element USER is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1187 similar, but for the user name. The fourth element HOST is similar,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1188 but for the host name. The fifth element FILE is for the file name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1189 These numbers are passed directly to `match-string', which see. That
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1190 means the opening parentheses are counted to identify the pair.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1191
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1192 See also `tramp-file-name-regexp'."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1193 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1194 :type '(list (regexp :tag "File name regexp")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1195 (integer :tag "Paren pair for method name")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1196 (integer :tag "Paren pair for user name ")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1197 (integer :tag "Paren pair for host name ")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1198 (integer :tag "Paren pair for file name ")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1199
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1200 ;;;###autoload
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1201 (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
1202 "\\`/[^/:]+:"
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1203 "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
1204 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
1205 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
1206
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1207 ;;;###autoload
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1208 (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
1209 "\\`/\\[.*\\]"
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1210 "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
1211 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
1212 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
1213
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1214 ;;;###autoload
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1215 (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
1216 (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
1217 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
1218 tramp-file-name-regexp-separate)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1219 "*Regular expression matching file names handled by tramp.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1220 This regexp should match tramp file names but no other file names.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1221 \(When tramp.el is loaded, this regular expression is prepended to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1222 `file-name-handler-alist', and that is searched sequentially. Thus,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1223 if the tramp entry appears rather early in the `file-name-handler-alist'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1224 and is a bit too general, then some files might be considered tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1225 files which are not really tramp files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1226
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1227 Please note that the entry in `file-name-handler-alist' is made when
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1228 this file (tramp.el) is loaded. This means that this variable must be set
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1229 before loading tramp.el. Alternatively, `file-name-handler-alist' can be
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1230 updated after changing this variable.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1231
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1232 Also see `tramp-file-name-structure'."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1233 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1234 :type 'regexp)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1235
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1236 ;;;###autoload
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1237 (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
1238 "^/$\\|^/[^/:][^/]*$"
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1239 "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
1240 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
1241 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
1242
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1243 ;;;###autoload
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1244 (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
1245 "^/\\([[][^]]*\\)?$"
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1246 "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
1247 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
1248 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
1249
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1250 ;;;###autoload
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1251 (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
1252 (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
1253 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
1254 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
1255 "*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
1256 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
1257
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1258 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
1259 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
1260 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
1261 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
1262
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1263 Also see `tramp-file-name-structure'."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1264 :group 'tramp
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1265 :type 'regexp)
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1266
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1267 (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
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
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1270 tramp-prefix-regexp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1271 "\\(" "\\(" tramp-method-regexp "\\)" "\\)?"
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1272 "\\(" "\\(" tramp-postfix-multi-hop-regexp "%s" "\\)+" "\\)?"
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1273 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
1274 2 3 -1)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1275 "*Describes the file name structure of `multi' files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1276 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
1277 This is a list of four elements (REGEXP METHOD HOP LOCALNAME).
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1278
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1279 The first element, REGEXP, gives a regular expression to match against
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1280 the file name. In this regular expression, `%s' is replaced with the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1281 value of `tramp-multi-file-name-hop-structure'. (Note: in order to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1282 allow multiple hops, you normally want to use something like
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1283 \"\\\\(\\\\(%s\\\\)+\\\\)\" in the regular expression. The outer pair
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1284 of parentheses is used for the HOP element, see below.)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1285
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1286 All remaining elements are numbers. METHOD gives the number of the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1287 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
1288 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
1289 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
1290
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1291 LOCALNAME can also be negative, which means to count from the end. Ie, a
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1292 value of -1 means the last paren pair.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1293
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1294 I think it would be good if the regexp matches the whole of the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1295 string, but I haven't actually tried what happens if it doesn't..."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1296 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1297 :type '(list (regexp :tag "File name regexp")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1298 (integer :tag "Paren pair for method name")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1299 (integer :tag "Paren pair for hops")
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1300 (integer :tag "Paren pair to match localname")))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1301
46306
66cce4969490 (tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46166
diff changeset
1302 (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
1303 (list
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1304 (concat
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1305 "\\(" 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
1306 "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
1307 "\\(" 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
1308 1 2 3)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1309 "*Describes the structure of a hop in multi files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1310 This is a list of four elements (REGEXP METHOD USER HOST). First
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1311 element REGEXP is used to match against the hop. Pair number METHOD
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1312 matches the method of one hop, pair number USER matches the user of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1313 one hop, pair number HOST matches the host of one hop.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1314
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1315 This regular expression should match exactly all of one hop."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1316 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1317 :type '(list (regexp :tag "Hop regexp")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1318 (integer :tag "Paren pair for method name")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1319 (integer :tag "Paren pair for user name")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1320 (integer :tag "Paren pair for host name")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1321
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1322 (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
1323 (list
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1324 (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
1325 (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
1326 "%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
1327 "%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
1328 "%h")
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1329 (concat tramp-postfix-host-format "%p"))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1330 "*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
1331 This is a list of three elements PREFIX, HOP and LOCALNAME.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1332
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1333 The first element PREFIX says how to construct the prefix, the second
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1334 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
1335 LOCALNAME says how to construct the localname (pathname).
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1336
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1337 In PREFIX, `%%' means `%' and `%m' means the method name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1338
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1339 In HOP, `%%' means `%' and `%m', `%u', `%h' mean the hop method, hop
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1340 user and hop host, respectively.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1341
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1342 In LOCALNAME, `%%' means `%' and `%p' means the localname.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1343
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1344 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
1345 copy of LOCALNAME, but there is one copy of HOP for each hop in the file
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1346 name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1347
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1348 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
1349 method name, followed by all the hops, and the localname must come
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1350 last."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1351 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1352 :type '(list string string string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1353
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1354 (defcustom tramp-terminal-type "dumb"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1355 "*Value of TERM environment variable for logging in to remote host.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1356 Because Tramp wants to parse the output of the remote shell, it is easily
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1357 confused by ANSI color escape sequences and suchlike. Often, shell init
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1358 files conditionalize this setup based on the TERM environment variable."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1359 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1360 :type 'string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1361
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1362 (defcustom tramp-completion-without-shell-p nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1363 "*If nil, use shell wildcards for completion, else rely on Lisp only.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1364 Using shell wildcards for completions has the advantage that it can be
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1365 fast even in large directories, but completion is always
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1366 case-sensitive. Relying on Lisp only means that case-insensitive
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1367 completion is possible (subject to the variable `completion-ignore-case'),
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1368 but it might be slow on large directories."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1369 :group 'tramp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1370 :type 'boolean)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1371
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1372 (defcustom tramp-actions-before-shell
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1373 '((tramp-password-prompt-regexp tramp-action-password)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1374 (tramp-login-prompt-regexp tramp-action-login)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1375 (shell-prompt-pattern tramp-action-succeed)
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
1376 (tramp-shell-prompt-pattern tramp-action-succeed)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1377 (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
1378 (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
1379 (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
1380 (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
1381 (tramp-process-alive-regexp tramp-action-process-alive))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1382 "List of pattern/action pairs.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1383 Whenever a pattern matches, the corresponding action is performed.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1384 Each item looks like (PATTERN ACTION).
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1385
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1386 The PATTERN should be a symbol, a variable. The value of this
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1387 variable gives the regular expression to search for. Note that the
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1388 regexp must match at the end of the buffer, \"\\'\" is implicitly
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1389 appended to it.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1390
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1391 The ACTION should also be a symbol, but a function. When the
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1392 corresponding PATTERN matches, the ACTION function is called."
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1393 :group 'tramp
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1394 :type '(repeat (list variable function)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1395
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
1396 (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
1397 '((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
1398 (tramp-wrong-passwd-regexp tramp-action-permission-denied)
74166
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
1399 (tramp-copy-failed-regexp tramp-action-copy-failed)
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
1400 (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
1401 "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
1402 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
1403 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
1404 :group 'tramp
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
1405 :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
1406
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1407 (defcustom tramp-multi-actions
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1408 '((tramp-password-prompt-regexp tramp-multi-action-password)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1409 (tramp-login-prompt-regexp tramp-multi-action-login)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1410 (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
1411 (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
1412 (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
1413 (tramp-process-alive-regexp tramp-multi-action-process-alive))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1414 "List of pattern/action pairs.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1415 This list is used for each hop in multi-hop connections.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1416 See `tramp-actions-before-shell' for more info."
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1417 :group 'tramp
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1418 :type '(repeat (list variable function)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1419
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
1420 (defcustom tramp-initial-commands
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
1421 '("unset HISTORY"
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
1422 "unset correct"
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
1423 "unset autocorrect")
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
1424 "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
1425 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
1426 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
1427 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
1428 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
1429
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
1430 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
1431 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
1432 autocorrect\" to the remote host."
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
1433 :group 'tramp
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
1434 :type '(repeat string))
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
1435
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1436 ;; 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
1437 ;; 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
1438 ;; 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
1439 ;; 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
1440 ;; 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
1441 (defcustom tramp-chunksize
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1442 (when (and (not (featurep 'xemacs))
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1443 (memq system-type '(hpux)))
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1444 500)
66561
742e40a6bf3c * net/tramp.el (tramp-chunksize): Escape parentheses in docstring
Michael Albinus <michael.albinus@gmx.de>
parents: 66496
diff changeset
1445 ;; 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
1446 ;; 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
1447 ;; `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
1448 "*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
1449 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
1450 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
1451 checked via the following code:
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1452
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1453 (with-temp-buffer
65925
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1454 (let* ((user \"xxx\") (host \"yyy\")
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1455 (init 0) (step 50)
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1456 (sent init) (received init))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1457 (while (= sent received)
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1458 (setq sent (+ sent step))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1459 (erase-buffer)
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1460 (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
1461 \"ssh\" \"-l\" user host \"wc\" \"-c\")))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1462 (when (memq (process-status proc) '(run open))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1463 (process-send-string proc (make-string sent ?\\ ))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1464 (process-send-eof proc)
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1465 (process-send-eof proc))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1466 (while (not (progn (goto-char (point-min))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1467 (re-search-forward \"\\\\w+\" (point-max) t)))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1468 (accept-process-output proc 1))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1469 (when (memq (process-status proc) '(run open))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1470 (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
1471 (delete-process proc)
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1472 (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
1473 (sit-for 0))))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1474 (if (> sent (+ init step))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1475 (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
1476 (- sent step))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1477 (message \"Test does not work\")
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1478 (display-buffer (current-buffer))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1479 (sit-for 30))))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1480
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1481 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
1482 \(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
1483 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
1484 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
1485 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
1486 \"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
1487
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1488 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
1489 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
1490 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
1491
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1492 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
1493 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
1494 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
1495 in the third line of the code.
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1496
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
1497 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
1498 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
1499 \(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
1500 performance.
53206
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
1501
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1502 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
1503 this variable to be set as well."
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1504 :group 'tramp
50338
155b4b78aa3b * tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49995
diff changeset
1505 :type '(choice (const nil) integer))
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
1506
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
1507 ;; 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
1508 ;; 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
1509 ;; 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
1510 ;; 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
1511 (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
1512 "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
1513 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
1514 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
1515 :group 'tramp
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
1516 :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
1517
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1518 ;;; Internal Variables:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1519
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1520 (defvar tramp-buffer-file-attributes nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1521 "Holds the `ls -ild' output for the current buffer.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1522 This variable is local to each buffer. It is not used if the remote
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1523 machine groks Perl. If it is used, it's used as an emulation for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1524 the visited file modtime.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1525 (make-variable-buffer-local 'tramp-buffer-file-attributes)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1526
48973
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
1527 (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
1528 (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
1529 ((fboundp 'md5-encode)
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
1530 (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
1531 (funcall (symbol-function 'md5-encode) x))))
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
1532 (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
1533 "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
1534
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
1535 (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
1536 (concat "///"
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
1537 (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
1538 (concat
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
1539 (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
1540 (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
1541 ;; (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
1542 ;; (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
1543 ;; (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
1544 ;; (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
1545 ;; (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
1546 ;; (mapcar
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
1547 ;; (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
1548 ;; (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
1549 ;; (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
1550 ;; (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
1551 ;; t))))
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
1552 )))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1553 "String used to recognize end of output.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1554
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1555 (defvar tramp-connection-function nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1556 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1557 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1558 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1559
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1560 (defvar tramp-remote-sh nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1561 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1562 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1563 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1564
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
1565 (defvar tramp-login-program nil
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1566 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1567 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1568 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1569
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
1570 (defvar tramp-login-args nil
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1571 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1572 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1573 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1574
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
1575 (defvar tramp-copy-program nil
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1576 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1577 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1578 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1579
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
1580 (defvar tramp-copy-args nil
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1581 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1582 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1583 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1584
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
1585 (defvar tramp-copy-keep-date-arg nil
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1586 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1587 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1588 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1589
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1590 (defvar tramp-encoding-command nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1591 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1592 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1593 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1594
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1595 (defvar tramp-decoding-command nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1596 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1597 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1598 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1599
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1600 (defvar tramp-encoding-function nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1601 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1602 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1603 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1604
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1605 (defvar tramp-decoding-function nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1606 "This internal variable holds a parameter for `tramp-methods'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1607 In the connection buffer, this variable has the value of the like-named
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1608 method parameter, as specified in `tramp-methods' (which see).")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1609
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
1610 (defvar tramp-password-end-of-line nil
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
1611 "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
1612 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
1613 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
1614
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1615 ;; CCC `local in each buffer'?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1616 (defvar tramp-ls-command nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1617 "This command is used to get a long listing with numeric user and group ids.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1618 This variable is automatically made buffer-local to each rsh process buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1619 upon opening the connection.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1620
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1621 (defvar tramp-current-multi-method nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1622 "Name of `multi' connection method for this *tramp* buffer, or nil if not multi.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1623 This variable is automatically made buffer-local to each rsh process buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1624 upon opening the connection.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1625
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1626 (defvar tramp-current-method nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1627 "Connection method for this *tramp* buffer.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1628 This variable is automatically made buffer-local to each rsh process buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1629 upon opening the connection.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1630
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1631 (defvar tramp-current-user nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1632 "Remote login name for this *tramp* buffer.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1633 This variable is automatically made buffer-local to each rsh process buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1634 upon opening the connection.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1635
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1636 (defvar tramp-current-host nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1637 "Remote host for this *tramp* buffer.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1638 This variable is automatically made buffer-local to each rsh process buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1639 upon opening the connection.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1640
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1641 (defvar tramp-test-groks-nt nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1642 "Whether the `test' command groks the `-nt' switch.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1643 \(`test A -nt B' tests if file A is newer than file B.)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1644 This variable is automatically made buffer-local to each rsh process buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1645 upon opening the connection.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1646
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1647 (defvar tramp-file-exists-command nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1648 "Command to use for checking if a file exists.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1649 This variable is automatically made buffer-local to each rsh process buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1650 upon opening the connection.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1651
46802
10aa49b3d28a Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46801
diff changeset
1652 (defconst tramp-uudecode "\
10aa49b3d28a Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46801
diff changeset
1653 tramp_uudecode () {
10aa49b3d28a Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46801
diff changeset
1654 \(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
1655 cat /tmp/tramp.$$
10aa49b3d28a Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46801
diff changeset
1656 rm -f /tmp/tramp.$$
10aa49b3d28a Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46801
diff changeset
1657 }"
10aa49b3d28a Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46801
diff changeset
1658 "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
1659 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
1660 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
1661 we have this shell function.")
46802
10aa49b3d28a Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46801
diff changeset
1662
10aa49b3d28a Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46801
diff changeset
1663 ;; 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
1664 ;; 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
1665 ;; 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
1666 ;; 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
1667 ;; 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
1668 ;; 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
1669 (defconst tramp-perl-file-attributes "\
58540
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1670 @stat = lstat($ARGV[0]);
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1671 if (($stat[2] & 0170000) == 0120000)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1672 {
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1673 $type = readlink($ARGV[0]);
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1674 $type = \"\\\"$type\\\"\";
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1675 }
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1676 elsif (($stat[2] & 0170000) == 040000)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1677 {
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1678 $type = \"t\";
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1679 }
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1680 else
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1681 {
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1682 $type = \"nil\"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1683 };
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1684 $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
1685 $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
1686 printf(
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1687 \"(%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
1688 $type,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1689 $stat[3],
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1690 $uid,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1691 $gid,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1692 $stat[8] >> 16 & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1693 $stat[8] & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1694 $stat[9] >> 16 & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1695 $stat[9] & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1696 $stat[10] >> 16 & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1697 $stat[10] & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1698 $stat[7],
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1699 $stat[2],
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1700 $stat[1] >> 16 & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1701 $stat[1] & 0xffff
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1702 );"
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1703 "Perl script to produce output suitable for use with `file-attributes'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1704 on the remote file system.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1705
58540
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1706 (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
1707 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
1708 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
1709 @list = readdir(DIR);
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1710 closedir(DIR);
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1711 $n = scalar(@list);
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1712 printf(\"(\\n\");
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1713 for($i = 0; $i < $n; $i++)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1714 {
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1715 $filename = $list[$i];
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1716 @stat = lstat($filename);
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1717 if (($stat[2] & 0170000) == 0120000)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1718 {
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1719 $type = readlink($filename);
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1720 $type = \"\\\"$type\\\"\";
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1721 }
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1722 elsif (($stat[2] & 0170000) == 040000)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1723 {
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1724 $type = \"t\";
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1725 }
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1726 else
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1727 {
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1728 $type = \"nil\"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1729 };
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1730 $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
1731 $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
1732 printf(
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1733 \"(\\\"%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
1734 $filename,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1735 $type,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1736 $stat[3],
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1737 $uid,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1738 $gid,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1739 $stat[8] >> 16 & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1740 $stat[8] & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1741 $stat[9] >> 16 & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1742 $stat[9] & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1743 $stat[10] >> 16 & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1744 $stat[10] & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1745 $stat[7],
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1746 $stat[2],
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1747 $stat[1] >> 16 & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1748 $stat[1] & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1749 $stat[0] >> 16 & 0xffff,
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1750 $stat[0] & 0xffff);
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1751 }
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1752 printf(\")\\n\");"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1753 "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
1754 output.")
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
1755
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1756 ;; ;; These two use uu encoding.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1757 ;; (defvar tramp-perl-encode "%s -e'\
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1758 ;; print qq(begin 644 xxx\n);
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1759 ;; my $s = q();
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1760 ;; my $res = q();
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1761 ;; while (read(STDIN, $s, 45)) {
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1762 ;; print pack(q(u), $s);
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1763 ;; }
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1764 ;; print qq(`\n);
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1765 ;; print qq(end\n);
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1766 ;; '"
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1767 ;; "Perl program to use for encoding a file.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1768 ;; Escape sequence %s is replaced with name of Perl binary.")
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1769
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1770 ;; (defvar tramp-perl-decode "%s -ne '
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1771 ;; print unpack q(u), $_;
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1772 ;; '"
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1773 ;; "Perl program to use for decoding a file.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1774 ;; Escape sequence %s is replaced with name of Perl binary.")
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1775
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1776 ;; These two use base64 encoding.
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1777 (defvar tramp-perl-encode-with-module
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1778 "perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)'"
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1779 "Perl program to use for encoding a file.
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1780 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
1781 This string is passed to `format', so percent characters need to be doubled.
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1782 This implementation requires the MIME::Base64 Perl module to be installed
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1783 on the remote host.")
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1784
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1785 (defvar tramp-perl-decode-with-module
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1786 "perl -MMIME::Base64 -0777 -ne 'print decode_base64($_)'"
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1787 "Perl program to use for decoding a file.
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1788 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
1789 This string is passed to `format', so percent characters need to be doubled.
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1790 This implementation requires the MIME::Base64 Perl module to be installed
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1791 on the remote host.")
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1792
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1793 (defvar tramp-perl-encode
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1794 "%s -e '
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1795 # This script contributed by Juanma Barranquero <lektu@terra.es>.
75361
9cc44485654f (tramp-perl-encode, tramp-perl-decode): Update copyrights.
Glenn Morris <rgm@gnu.org>
parents: 75194
diff changeset
1796 # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
9cc44485654f (tramp-perl-encode, tramp-perl-decode): Update copyrights.
Glenn Morris <rgm@gnu.org>
parents: 75194
diff changeset
1797 # Free Software Foundation, Inc.
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1798 use strict;
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1799
46795
305403dc91a3 Version 2.0.7.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46790
diff changeset
1800 my %%trans = do {
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1801 my $i = 0;
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1802 map {(substr(unpack(q(B8), chr $i++), 2, 6), $_)}
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1803 split //, q(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/);
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1804 };
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1805
46797
1c4af44cad8c Version 2.0.8.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46795
diff changeset
1806 binmode(\\*STDIN);
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1807
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1808 # We read in chunks of 54 bytes, to generate output lines
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1809 # of 72 chars (plus end of line)
46797
1c4af44cad8c Version 2.0.8.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46795
diff changeset
1810 $/ = \\54;
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1811
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1812 while (my $data = <STDIN>) {
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1813 my $pad = q();
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1814
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1815 # Only for the last chunk, and only if did not fill the last three-byte packet
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1816 if (eof) {
46795
305403dc91a3 Version 2.0.7.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46790
diff changeset
1817 my $mod = length($data) %% 3;
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1818 $pad = q(=) x (3 - $mod) if $mod;
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1819 }
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1820
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1821 # Not the fastest method, but it is simple: unpack to binary string, split
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1822 # by groups of 6 bits and convert back from binary to byte; then map into
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1823 # the translation table
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1824 print
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1825 join q(),
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1826 map($trans{$_},
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1827 (substr(unpack(q(B*), $data) . q(00000), 0, 432) =~ /....../g)),
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1828 $pad,
46797
1c4af44cad8c Version 2.0.8.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46795
diff changeset
1829 qq(\\n);
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1830 }
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1831 '"
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1832 "Perl program to use for encoding a file.
46795
305403dc91a3 Version 2.0.7.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46790
diff changeset
1833 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
1834 This string is passed to `format', so percent characters need to be doubled.")
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1835
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1836 (defvar tramp-perl-decode
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1837 "%s -e '
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1838 # This script contributed by Juanma Barranquero <lektu@terra.es>.
75361
9cc44485654f (tramp-perl-encode, tramp-perl-decode): Update copyrights.
Glenn Morris <rgm@gnu.org>
parents: 75194
diff changeset
1839 # Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
9cc44485654f (tramp-perl-encode, tramp-perl-decode): Update copyrights.
Glenn Morris <rgm@gnu.org>
parents: 75194
diff changeset
1840 # Free Software Foundation, Inc.
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1841 use strict;
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1842
46795
305403dc91a3 Version 2.0.7.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46790
diff changeset
1843 my %%trans = do {
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1844 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
1845 map {($_, substr(unpack(q(B8), chr $i++), 2, 6))}
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1846 split //, q(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/)
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1847 };
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1848
46795
305403dc91a3 Version 2.0.7.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46790
diff changeset
1849 my %%bytes = map {(unpack(q(B8), chr $_), chr $_)} 0 .. 255;
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1850
46797
1c4af44cad8c Version 2.0.8.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46795
diff changeset
1851 binmode(\\*STDOUT);
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1852
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1853 # We are going to accumulate into $pending to accept any line length
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1854 # (we do not check they are <= 76 chars as the RFC says)
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1855 my $pending = q();
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1856
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1857 while (my $data = <STDIN>) {
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1858 chomp $data;
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1859
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1860 # If we find one or two =, we have reached the end and
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1861 # any following data is to be discarded
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1862 my $finished = $data =~ s/(==?).*/$1/;
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1863 $pending .= $data;
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1864
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1865 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
1866 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
1867 $pending = substr($pending, $len & ~3 + 1);
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1868
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1869 # Easy method: translate from chars to (pregenerated) six-bit packets, join,
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1870 # split in 8-bit chunks and convert back to char.
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1871 print join q(),
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1872 map $bytes{$_},
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1873 ((join q(), map {$trans{$_} || q()} split //, $chunk) =~ /......../g);
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1874
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1875 last if $finished;
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1876 }
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
1877 '"
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1878 "Perl program to use for decoding a file.
46795
305403dc91a3 Version 2.0.7.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46790
diff changeset
1879 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
1880 This string is passed to `format', so percent characters need to be doubled.")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1881
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1882 (defconst tramp-file-mode-type-map '((0 . "-") ; Normal file (SVID-v2 and XPG2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1883 (1 . "p") ; fifo
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1884 (2 . "c") ; character device
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1885 (3 . "m") ; multiplexed character device (v7)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1886 (4 . "d") ; directory
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1887 (5 . "?") ; Named special file (XENIX)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1888 (6 . "b") ; block device
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1889 (7 . "?") ; multiplexed block device (v7)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1890 (8 . "-") ; regular file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1891 (9 . "n") ; network special file (HP-UX)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1892 (10 . "l") ; symlink
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1893 (11 . "?") ; ACL shadow inode (Solaris, not userspace)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1894 (12 . "s") ; socket
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1895 (13 . "D") ; door special (Solaris)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1896 (14 . "w")) ; whiteout (BSD)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1897 "A list of file types returned from the `stat' system call.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1898 This is used to map a mode number to a permission string.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1899
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1900 (defvar tramp-dos-coding-system
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1901 (if (and (fboundp 'coding-system-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1902 (funcall 'coding-system-p '(dos)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1903 'dos
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1904 'undecided-dos)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1905 "Some Emacsen know the `dos' coding system, others need `undecided-dos'.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1906
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
1907 (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
1908 "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
1909 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
1910 (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
1911
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
1912 (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
1913 "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
1914
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1915 (defvar tramp-last-cmd-time nil
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1916 "Internal Tramp variable recording the time when the last cmd was sent.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1917 This variable is buffer-local in every buffer.")
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
1918 (make-variable-buffer-local 'tramp-last-cmd-time)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1919
47205
8a2bf9dded0f * net/tramp.el: Version 2.0.15 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46998
diff changeset
1920 ;; 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
1921 ;; 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
1922 (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
1923 (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
1924 (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
1925 (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
1926 '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
1927 "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
1928 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
1929 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
1930
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1931 ;; New handlers should be added here. The following operations can be
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1932 ;; handled using the normal primitives: file-name-as-directory,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1933 ;; file-name-directory, file-name-nondirectory,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1934 ;; file-name-sans-versions, get-file-buffer.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1935 (defconst tramp-file-name-handler-alist
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1936 '(
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1937 (load . tramp-handle-load)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1938 (make-symbolic-link . tramp-handle-make-symbolic-link)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1939 (file-name-directory . tramp-handle-file-name-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1940 (file-name-nondirectory . tramp-handle-file-name-nondirectory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1941 (file-truename . tramp-handle-file-truename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1942 (file-exists-p . tramp-handle-file-exists-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1943 (file-directory-p . tramp-handle-file-directory-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1944 (file-executable-p . tramp-handle-file-executable-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1945 (file-accessible-directory-p . tramp-handle-file-accessible-directory-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1946 (file-readable-p . tramp-handle-file-readable-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1947 (file-regular-p . tramp-handle-file-regular-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1948 (file-symlink-p . tramp-handle-file-symlink-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1949 (file-writable-p . tramp-handle-file-writable-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1950 (file-ownership-preserved-p . tramp-handle-file-ownership-preserved-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1951 (file-newer-than-file-p . tramp-handle-file-newer-than-file-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1952 (file-attributes . tramp-handle-file-attributes)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1953 (file-modes . tramp-handle-file-modes)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1954 (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
1955 (directory-files-and-attributes . tramp-handle-directory-files-and-attributes)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1956 (file-name-all-completions . tramp-handle-file-name-all-completions)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1957 (file-name-completion . tramp-handle-file-name-completion)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1958 (add-name-to-file . tramp-handle-add-name-to-file)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1959 (copy-file . tramp-handle-copy-file)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1960 (rename-file . tramp-handle-rename-file)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1961 (set-file-modes . tramp-handle-set-file-modes)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1962 (make-directory . tramp-handle-make-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1963 (delete-directory . tramp-handle-delete-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1964 (delete-file . tramp-handle-delete-file)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1965 (directory-file-name . tramp-handle-directory-file-name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1966 (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
1967 (process-file . tramp-handle-process-file)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1968 (insert-directory . tramp-handle-insert-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1969 (expand-file-name . tramp-handle-expand-file-name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1970 (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
1971 (file-remote-p . tramp-handle-file-remote-p)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1972 (insert-file-contents . tramp-handle-insert-file-contents)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1973 (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
1974 (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
1975 (make-auto-save-file-name . tramp-handle-make-auto-save-file-name)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1976 (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
1977 (dired-compress-file . tramp-handle-dired-compress-file)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1978 (dired-call-process . tramp-handle-dired-call-process)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1979 (dired-recursive-delete-directory
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1980 . tramp-handle-dired-recursive-delete-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1981 (set-visited-file-modtime . tramp-handle-set-visited-file-modtime)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1982 (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
1983 "Alist of handler functions.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1984 Operations not mentioned here will be handled by the normal Emacs functions.")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
1985
70276
32b384911b4f tramp-file-name-handler-alist): Delete expand-file-name and other
Richard M. Stallman <rms@gnu.org>
parents: 70255
diff changeset
1986 ;; 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
1987 ;; `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
1988 ;;;###autoload
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1989 (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
1990 '((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
1991 (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
1992 "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
1993 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
1994 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
1995 normal Emacs functions.")
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
1996
48973
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
1997 ;; 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
1998 (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
1999 ;; (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
2000 ;; entry, since `identity' always matches.
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
2001 '((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
2002 "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
2003 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
2004 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
2005
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2006 ;;; Internal functions which must come first.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2007
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2008 (defsubst tramp-message (level fmt-string &rest args)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2009 "Emit a message depending on verbosity level.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2010 First arg LEVEL says to be quiet if `tramp-verbose' is less than LEVEL. The
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2011 message is emitted only if `tramp-verbose' is greater than or equal to LEVEL.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2012 Calls function `message' with FMT-STRING as control string and the remaining
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2013 ARGS to actually emit the message (if applicable).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2014
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2015 This function expects to be called from the tramp buffer only!"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2016 (when (<= level tramp-verbose)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2017 (apply #'message (concat "tramp: " fmt-string) args)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2018 (when tramp-debug-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2019 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2020 (set-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2021 (tramp-get-debug-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2022 tramp-current-multi-method tramp-current-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2023 tramp-current-user tramp-current-host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2024 (goto-char (point-max))
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
2025 (unless (bolp)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
2026 (insert "\n"))
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
2027 (tramp-insert-with-face
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2028 'italic
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2029 (concat "# " (apply #'format fmt-string args) "\n"))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2030
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2031 (defun tramp-message-for-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2032 (multi-method method user host level fmt-string &rest args)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2033 "Like `tramp-message' but temporarily switches to the tramp buffer.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2034 First three args METHOD, USER, and HOST identify the tramp buffer to use,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2035 remaining args passed to `tramp-message'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2036 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2037 (set-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2038 (apply 'tramp-message level fmt-string args)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2039
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2040 (defsubst tramp-line-end-position nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2041 "Return point at end of line.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2042 Calls `line-end-position' or `point-at-eol' if defined, else
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2043 own implementation."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2044 (cond
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
2045 ((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
2046 ((fboundp 'point-at-eol) (funcall (symbol-function 'point-at-eol)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2047 (t (save-excursion (end-of-line) (point)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2048
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2049 (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
2050 "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
2051
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2052 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
2053 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
2054 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
2055 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
2056 `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
2057 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
2058 `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
2059
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2060 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
2061 `progn').
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2062
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2063 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
2064 `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
2065 `(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
2066 (,(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
2067 (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
2068 (,(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
2069 (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
2070 (,(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
2071 (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
2072 (,(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
2073 (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
2074 (,(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
2075 (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
2076 ,@body))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2077
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2078 (put 'with-parsed-tramp-file-name 'lisp-indent-function 2)
73529
59b2832e02ef (with-parsed-tramp-file-name): Correct debug spec. Highlight as keyword.
Lars Hansen <larsh@soem.dk>
parents: 72569
diff changeset
2079 ;; Enable debugging.
59b2832e02ef (with-parsed-tramp-file-name): Correct debug spec. Highlight as keyword.
Lars Hansen <larsh@soem.dk>
parents: 72569
diff changeset
2080 (def-edebug-spec with-parsed-tramp-file-name (form symbolp body))
59b2832e02ef (with-parsed-tramp-file-name): Correct debug spec. Highlight as keyword.
Lars Hansen <larsh@soem.dk>
parents: 72569
diff changeset
2081 ;; Highlight as keyword.
74985
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
2082 (when (functionp 'font-lock-add-keywords)
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
2083 (funcall 'font-lock-add-keywords
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
2084 'emacs-lisp-mode '("\\<with-parsed-tramp-file-name\\>")))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2085
55864
dc60eb9fbbdc Sync with Tramp.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 55844
diff changeset
2086 (defmacro tramp-let-maybe (variable value &rest body)
dc60eb9fbbdc Sync with Tramp.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 55844
diff changeset
2087 "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete.
dc60eb9fbbdc Sync with Tramp.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 55844
diff changeset
2088 BODY is executed whether or not the variable is obsolete.
dc60eb9fbbdc Sync with Tramp.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 55844
diff changeset
2089 The intent is to protect against `obsolete variable' warnings."
dc60eb9fbbdc Sync with Tramp.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 55844
diff changeset
2090 `(if (get ',variable 'byte-obsolete-variable)
dc60eb9fbbdc Sync with Tramp.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 55844
diff changeset
2091 (progn ,@body)
dc60eb9fbbdc Sync with Tramp.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 55844
diff changeset
2092 (let ((,variable ,value))
dc60eb9fbbdc Sync with Tramp.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 55844
diff changeset
2093 ,@body)))
dc60eb9fbbdc Sync with Tramp.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 55844
diff changeset
2094 (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
2095 (put 'tramp-let-maybe 'edebug-form-spec t)
55864
dc60eb9fbbdc Sync with Tramp.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 55844
diff changeset
2096
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
2097 ;;; Config Manipulation Functions:
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
2098
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
2099 (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
2100 "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
2101 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
2102 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
2103 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
2104 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
2105 `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
2106 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
2107
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
2108 Example:
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
2109
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
2110 (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
2111 \"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
2112 '((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
2113 (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
2114
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2115 (let ((r function-list)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2116 (v function-list))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2117 (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
2118 (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
2119 tramp-completion-function-alist))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2120
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2121 (while v
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2122 ;; Remove double entries
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2123 (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
2124 (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
2125 ;; 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
2126 (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
2127 (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
2128 (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
2129 (setq v (cdr v)))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2130
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2131 (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
2132 (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
2133 (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
2134
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
2135 (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
2136 "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
2137 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
2138 (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
2139
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2140 ;;; File Name Handler Functions:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2141
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2142 (defun tramp-handle-make-symbolic-link
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2143 (filename linkname &optional ok-if-already-exists)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2144 "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
2145 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
2146 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
2147 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
2148
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2149 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
2150 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
2151 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
2152 target of the symlink differ."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2153 (with-parsed-tramp-file-name linkname l
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
2154 (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
2155 (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
2156 (unless ln
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2157 (signal 'file-error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2158 (list "Making a symbolic link."
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2159 "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
2160
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2161 ;; 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
2162 (when (file-exists-p linkname)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2163 ;; What to do?
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2164 (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
2165 (and (numberp ok-if-already-exists)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2166 (not (yes-or-no-p
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2167 (format
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2168 "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
2169 l-localname)))))
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2170 (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
2171 (delete-file linkname)))
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
2172
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2173 ;; 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
2174 (when (tramp-tramp-file-p filename)
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2175 (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
2176 (tramp-dissect-file-name
a2d047d50fb9 (tramp-handle-make-symbolic-link): Implement.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46306
diff changeset
2177 (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
2178
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2179 ;; 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
2180 ;; 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
2181 ;; that FILENAME belongs to.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2182 (zerop
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2183 (tramp-send-command-and-check
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
2184 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
2185 (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
2186 cwd ln
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
2187 filename
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2188 l-localname)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2189 t)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2190
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2191
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2192 (defun tramp-handle-load (file &optional noerror nomessage nosuffix must-suffix)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2193 "Like `load' for tramp files. Not implemented!"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2194 (unless (file-name-absolute-p file)
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2195 (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
2196 (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
2197 (unless nosuffix
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2198 (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
2199 (setq file (concat file ".elc")))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2200 ((file-exists-p (concat file ".el"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2201 (setq file (concat file ".el")))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2202 (when must-suffix
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2203 ;; 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
2204 ;; Included for safety's sake.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2205 (unless (or (file-name-directory file)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2206 (string-match "\\.elc?\\'" file))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2207 (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
2208 file)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2209 (unless noerror
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2210 (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
2211 (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
2212 (if (not (file-exists-p file))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2213 nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2214 (unless nomessage
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2215 (message "Loading %s..." file))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2216 (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
2217 ;; 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
2218 (load local-copy noerror t t)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2219 (delete-file local-copy))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2220 (unless nomessage
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2221 (message "Loading %s...done" file))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2222 t)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2223
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2224 ;; Localname manipulation functions that grok TRAMP localnames...
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2225 (defun tramp-handle-file-name-directory (file)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2226 "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
2227 ;; 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
2228 (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
2229 ;; 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
2230 (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
2231 multi-method method user host (file-name-directory (or localname "")))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2232
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2233 (defun tramp-handle-file-name-nondirectory (file)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2234 "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
2235 (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
2236 (file-name-nondirectory localname)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2237
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2238 (defun tramp-handle-file-truename (filename &optional counter prev-dirs)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2239 "Like `file-truename' for tramp files."
56644
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2240 (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
2241 (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
2242 (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
2243 (file-name-as-directory localname)))
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2244 (is-dir (string= localname localnamedir))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2245 (thisstep nil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2246 (numchase 0)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2247 ;; 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
2248 ;; 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
2249 ;; 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
2250 ;; 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
2251 (numchase-limit 20)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2252 (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
2253 symlink-target)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2254 (tramp-message-for-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2255 multi-method method user host
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2256 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
2257 (while (and steps (< numchase numchase-limit))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2258 (setq thisstep (pop steps))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2259 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2260 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2261 10 "Check %s"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2262 (mapconcat 'identity
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2263 (append '("") (reverse result) (list thisstep))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2264 "/"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2265 (setq symlink-target
53206
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
2266 (nth 0 (file-attributes
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2267 (tramp-make-tramp-file-name
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2268 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2269 (mapconcat 'identity
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
2270 (append '("")
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
2271 (reverse result)
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
2272 (list thisstep))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2273 "/")))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2274 (cond ((string= "." thisstep)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2275 (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
2276 10 "Ignoring step `.'"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2277 ((string= ".." thisstep)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2278 (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
2279 10 "Processing step `..'")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2280 (pop result))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2281 ((stringp symlink-target)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2282 ;; It's a symlink, follow it.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2283 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2284 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2285 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
2286 (setq numchase (1+ numchase))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2287 (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
2288 (setq result nil))
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
2289 ;; 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
2290 ;; "/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
2291 ;; "/some/target" part from it.
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
2292 (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
2293 (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
2294 (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
2295 (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
2296 sym-user sym-host))
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
2297 (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
2298 symlink-target))
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
2299 (setq symlink-target localname)))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2300 (setq steps
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2301 (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
2302 (t
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2303 ;; It's a file.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2304 (setq result (cons thisstep result)))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2305 (when (>= numchase numchase-limit)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2306 (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
2307 (setq result (reverse result))
47771
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
2308 ;; Combine list to form string.
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
2309 (setq result
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
2310 (if result
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
2311 (mapconcat 'identity (cons "" result) "/")
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
2312 "/"))
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
2313 (when (and is-dir (or (string= "" result)
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
2314 (not (string= (substring result -1) "/"))))
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
2315 (setq result (concat result "/")))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2316 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2317 multi-method method user host
47771
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
2318 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
2319 (tramp-make-tramp-file-name
47771
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
2320 multi-method method user host result))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2321
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2322 ;; Basic functions.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2323
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2324 (defun tramp-handle-file-exists-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2325 "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
2326 (with-parsed-tramp-file-name filename nil
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2327 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2328 (zerop (tramp-send-command-and-check
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2329 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2330 (format
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2331 (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
2332 (tramp-shell-quote-argument localname)))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2333
49612
407d6516031a 2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49598
diff changeset
2334 ;; 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
2335 ;; 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
2336 ;; 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
2337 ;; 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
2338 ;; (-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
2339 (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
2340 "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
2341
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2342 ;; CCC: This should check for an error condition and signal failure
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2343 ;; when something goes wrong.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2344 ;; Daniel Pittman <daniel@danann.net>
53206
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
2345 (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
2346 "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
2347 (when (file-exists-p filename)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2348 ;; file exists, find out stuff
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2349 (unless id-format (setq id-format 'integer))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2350 (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
2351 (save-excursion
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2352 (tramp-convert-file-attributes
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2353 multi-method method user host
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2354 (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
2355 (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
2356 localname id-format)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2357 (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
2358 localname id-format)))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2359
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2360 (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
2361 (multi-method method user host localname &optional id-format)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2362 "Implement `file-attributes' for tramp files using the ls(1) command."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2363 (let (symlinkp dirp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2364 res-inode res-filemodes res-numlinks
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2365 res-uid res-gid res-size res-symlink-target)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2366 (tramp-message-for-buffer multi-method method user host 10
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2367 "file attributes with ls: %s"
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2368 (tramp-make-tramp-file-name
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2369 multi-method method user host localname))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2370 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2371 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2372 (format "%s %s %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2373 (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
2374 (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
2375 (tramp-shell-quote-argument localname)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2376 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2377 ;; parse `ls -l' output ...
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2378 ;; ... inode
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2379 (setq res-inode
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2380 (condition-case err
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2381 (read (current-buffer))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2382 (invalid-read-syntax
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2383 (when (and (equal (cadr err)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2384 "Integer constant overflow in reader")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2385 (string-match
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2386 "^[0-9]+\\([0-9][0-9][0-9][0-9][0-9]\\)\\'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2387 (caddr err)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2388 (let* ((big (read (substring (caddr err) 0
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2389 (match-beginning 1))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2390 (small (read (match-string 1 (caddr err))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2391 (twiddle (/ small 65536)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2392 (cons (+ big twiddle)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2393 (- small (* twiddle 65536))))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2394 ;; ... file mode flags
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2395 (setq res-filemodes (symbol-name (read (current-buffer))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2396 ;; ... number links
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2397 (setq res-numlinks (read (current-buffer)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2398 ;; ... uid and gid
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2399 (setq res-uid (read (current-buffer)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2400 (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
2401 (when (eq id-format 'integer)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2402 (unless (numberp res-uid) (setq res-uid -1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2403 (unless (numberp res-gid) (setq res-gid -1)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2404 ;; ... size
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2405 (setq res-size (read (current-buffer)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2406 ;; From the file modes, figure out other stuff.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2407 (setq symlinkp (eq ?l (aref res-filemodes 0)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2408 (setq dirp (eq ?d (aref res-filemodes 0)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2409 ;; if symlink, find out file name pointed to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2410 (when symlinkp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2411 (search-forward "-> ")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2412 (setq res-symlink-target
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2413 (buffer-substring (point)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2414 (tramp-line-end-position))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2415 ;; return data gathered
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2416 (list
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2417 ;; 0. t for directory, string (name linked to) for symbolic
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2418 ;; link, or nil.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2419 (or dirp res-symlink-target nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2420 ;; 1. Number of links to file.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2421 res-numlinks
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2422 ;; 2. File uid.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2423 res-uid
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2424 ;; 3. File gid.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2425 res-gid
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2426 ;; 4. Last access time, as a list of two integers. First
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2427 ;; integer has high-order 16 bits of time, second has low 16
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2428 ;; bits.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2429 ;; 5. Last modification time, likewise.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2430 ;; 6. Last status change time, likewise.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2431 '(0 0) '(0 0) '(0 0) ;CCC how to find out?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2432 ;; 7. Size in bytes (-1, if number is out of range).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2433 res-size
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2434 ;; 8. File modes, as a string of ten letters or dashes as in ls -l.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2435 res-filemodes
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2436 ;; 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
2437 ;; 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
2438 t
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2439 ;; 10. inode number.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2440 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
2441 ;; 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
2442 -1
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2443 )))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2444
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2445 (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
2446 (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
2447 "Implement `file-attributes' for tramp files using a Perl script."
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2448 (tramp-message-for-buffer multi-method method user host 10
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2449 "file attributes with perl: %s"
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2450 (tramp-make-tramp-file-name
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2451 multi-method method user host localname))
59031
1fbbe0bcfaac Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents: 58776
diff changeset
2452 (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
2453 tramp-perl-file-attributes
1fbbe0bcfaac Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents: 58776
diff changeset
2454 "tramp_file_attributes")
58540
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2455 (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
2456 (format "tramp_file_attributes %s %s"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2457 (tramp-shell-quote-argument localname) id-format))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2458 (tramp-wait-for-output)
58540
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2459 (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
2460
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2461 (defun tramp-handle-set-visited-file-modtime (&optional time-list)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2462 "Like `set-visited-file-modtime' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2463 (unless (buffer-file-name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2464 (error "Can't set-visited-file-modtime: buffer `%s' not visiting a file"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2465 (buffer-name)))
56644
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2466 (if time-list
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2467 (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
2468 (let ((f (buffer-file-name))
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
2469 coding-system-used)
56644
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2470 (with-parsed-tramp-file-name f nil
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2471 (let* ((attr (file-attributes f))
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2472 ;; '(-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
2473 (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
2474 (when (boundp 'last-coding-system-used)
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
2475 (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
2476 ;; 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
2477 ;; `tramp-handle-file-attributes-with-ls'.
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2478 (if (not (equal modtime '(0 0)))
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2479 (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
2480 (save-excursion
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2481 (tramp-send-command
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2482 multi-method method user host
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2483 (format "%s -ild %s"
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2484 (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
2485 (tramp-shell-quote-argument localname)))
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2486 (tramp-wait-for-output)
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2487 (setq attr (buffer-substring (point)
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2488 (progn (end-of-line) (point)))))
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
2489 (setq tramp-buffer-file-attributes attr))
65925
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
2490 (when (boundp 'last-coding-system-used)
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
2491 (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
2492 nil)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2493
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2494 ;; CCC continue here
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2495
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2496 ;; 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
2497 ;; `tramp-handle-set-visited-file-modtime'.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2498 (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
2499 "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
2500 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
2501 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
2502 `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
2503 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
2504 of."
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2505 (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
2506 ;; 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
2507 ;; 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
2508 (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
2509 (eq (visited-file-modtime) 0))
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
2510 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
2511 (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
2512 (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
2513 (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
2514 (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
2515 (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
2516
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
2517 (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
2518 ;; 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
2519 ((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
2520 (< (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
2521 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
2522 ;; 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
2523 ;; (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
2524 ;; 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
2525 (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
2526 (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
2527 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
2528 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
2529 ;; 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
2530 (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
2531 (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
2532 (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
2533 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
2534 (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
2535 (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
2536 (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
2537 (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
2538 (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
2539 (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
2540 (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
2541 ;; 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
2542 ;; 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
2543 (t (equal mt '(-1 65535))))))))))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2544
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2545 (defun tramp-handle-set-file-modes (filename mode)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2546 "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
2547 (with-parsed-tramp-file-name filename nil
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2548 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2549 (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
2550 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2551 (format "chmod %s %s"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2552 (tramp-decimal-to-octal mode)
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2553 (tramp-shell-quote-argument localname))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2554 (signal 'file-error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2555 (list "Doing chmod"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2556 ;; FIXME: extract the proper text from chmod's stderr.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2557 "error while changing file's mode"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2558 filename))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2559
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2560 ;; Simple functions using the `test' command.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2561
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2562 (defun tramp-handle-file-executable-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2563 "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
2564 (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
2565 (zerop (tramp-run-test "-x" filename))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2566
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2567 (defun tramp-handle-file-readable-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2568 "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
2569 (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
2570 (zerop (tramp-run-test "-r" filename))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2571
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2572 (defun tramp-handle-file-accessible-directory-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2573 "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
2574 (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
2575 (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
2576 (zerop (tramp-run-test "-r" filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2577 (zerop (tramp-run-test "-x" filename)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2578
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2579 ;; When the remote shell is started, it looks for a shell which groks
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2580 ;; tilde expansion. Here, we assume that all shells which grok tilde
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2581 ;; expansion will also provide a `test' command which groks `-nt' (for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2582 ;; newer than). If this breaks, tell me about it and I'll try to do
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2583 ;; something smarter about it.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2584 (defun tramp-handle-file-newer-than-file-p (file1 file2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2585 "Like `file-newer-than-file-p' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2586 (cond ((not (file-exists-p file1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2587 nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2588 ((not (file-exists-p file2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2589 t)
47577
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2590 ;; We are sure both files exist at this point.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2591 (t
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2592 (save-excursion
47577
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2593 ;; 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
2594 ;; 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
2595 ;; and obtain the result.
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2596 (let ((fa1 (file-attributes file1))
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2597 (fa2 (file-attributes file2)))
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2598 (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
2599 (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
2600 (> 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
2601 ;; 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
2602 ;; 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
2603 ;; 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
2604 ;; 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
2605 ;; host.
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2606 (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
2607 (tramp-tramp-file-p file2))
47577
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2608 (signal
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2609 'file-error
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2610 (list
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2611 "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
2612 file1 file2)))
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2613 (with-parsed-tramp-file-name file1 v1
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2614 (with-parsed-tramp-file-name file2 v2
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2615 (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
2616 (equal v1-method v2-method)
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2617 (equal v1-user v2-user)
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2618 (equal v1-host v2-host))
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2619 (signal 'file-error
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2620 (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
2621 file1 file2)))
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2622 (unless (and (tramp-tramp-file-p file1)
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2623 (tramp-tramp-file-p file2))
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2624 (signal 'file-error
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2625 (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
2626 file1 file2)))
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2627 (if (tramp-get-test-groks-nt
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2628 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
2629 (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
2630 (zerop (tramp-run-test2
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
2631 "tramp_test_nt" file1 file2)))))))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2632
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2633 ;; Functions implemented using the basic functions above.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2634
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2635 (defun tramp-handle-file-modes (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2636 "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
2637 (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
2638 (when (file-exists-p filename)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2639 (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
2640 (nth 8 (file-attributes filename))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2641
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2642 (defun tramp-handle-file-directory-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2643 "Like `file-directory-p' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2644 ;; Care must be taken that this function returns `t' for symlinks
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2645 ;; pointing to directories. Surely the most obvious implementation
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2646 ;; would be `test -d', but that returns false for such symlinks.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2647 ;; CCC: Stefan Monnier says that `test -d' follows symlinks. And
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2648 ;; I now think he's right. So we could be using `test -d', couldn't
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2649 ;; we?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2650 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2651 ;; 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
2652 (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
2653 (save-excursion
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2654 (zerop
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2655 (tramp-send-command-and-check
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2656 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2657 (format "test -d %s"
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2658 (tramp-shell-quote-argument localname))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2659 t))))) ;run command in subshell
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2660
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2661 (defun tramp-handle-file-regular-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2662 "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
2663 (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
2664 (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
2665 (eq ?- (aref (nth 8 (file-attributes filename)) 0)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2666
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2667 (defun tramp-handle-file-symlink-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2668 "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
2669 (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
2670 (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
2671 (when (stringp x)
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
2672 ;; 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
2673 ;; might do weird things.
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
2674 (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
2675 (tramp-make-tramp-file-name
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
2676 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
2677 x)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2678
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2679 (defun tramp-handle-file-writable-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2680 "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
2681 (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
2682 (if (file-exists-p filename)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2683 ;; Existing files must be writable.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2684 (zerop (tramp-run-test "-w" filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2685 ;; 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
2686 (and (zerop (tramp-run-test
56460
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
2687 "-d" (file-name-directory filename)))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2688 (zerop (tramp-run-test
56460
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
2689 "-w" (file-name-directory filename)))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2690
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2691 (defun tramp-handle-file-ownership-preserved-p (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2692 "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
2693 (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
2694 (let ((attributes (file-attributes filename)))
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
2695 ;; 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
2696 ;; 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
2697 (or (null attributes)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
2698 (= (nth 2 attributes)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
2699 (tramp-get-remote-uid multi-method method user host))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2700
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2701 ;; Other file name ops.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2702
50494
5b6aaf393205 Version 2.0.33 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50432
diff changeset
2703 ;; ;; Matthias K,Av(Bppe <mkoeppe@mail.math.uni-magdeburg.de>
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2704 ;; (defun tramp-handle-directory-file-name (directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2705 ;; "Like `directory-file-name' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2706 ;; (if (and (eq (aref directory (- (length directory) 1)) ?/)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2707 ;; (not (eq (aref directory (- (length directory) 2)) ?:)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2708 ;; (substring directory 0 (- (length directory) 1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2709 ;; directory))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2710
49612
407d6516031a 2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49598
diff changeset
2711 ;; ;; 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
2712 ;; (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
2713 ;; "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
2714 ;; (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
2715 ;; (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
2716 ;; (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
2717 ;; (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
2718 ;; (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
2719 ;; (/= (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
2720 ;; (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
2721 ;; directory)))))
407d6516031a 2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49598
diff changeset
2722
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2723 (defun tramp-handle-directory-file-name (directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2724 "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
2725 ;; 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
2726 ;; 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
2727 ;; 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
2728 ;; to avoid parsing the filename?
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2729 (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
2730 (if (and (not (zerop (length localname)))
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2731 (eq (aref localname (1- (length localname))) ?/)
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2732 (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
2733 (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
2734 directory)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2735
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2736 ;; Directory listings.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2737
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2738 (defun tramp-handle-directory-files (directory
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2739 &optional full match nosort files-only)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2740 "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
2741 (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
2742 (let (result x)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2743 (save-excursion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2744 (tramp-barf-unless-okay
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2745 multi-method method user host
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2746 (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
2747 nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2748 'file-error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2749 "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
2750 (tramp-shell-quote-argument localname))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2751 (tramp-send-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2752 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2753 (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
2754 " -a | cat"))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2755 (tramp-wait-for-output)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2756 (goto-char (point-max))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2757 (while (zerop (forward-line -1))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2758 (setq x (buffer-substring (point)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2759 (tramp-line-end-position)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2760 (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
2761 (if full
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2762 (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
2763 x)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2764 result)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2765 (push x result))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2766 (tramp-send-command multi-method method user host "cd")
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2767 (tramp-wait-for-output)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2768 ;; Remove non-files or non-directories if necessary. Using
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2769 ;; the remote shell for this would probably be way faster.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2770 ;; Maybe something could be adapted from
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2771 ;; tramp-handle-file-name-all-completions.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2772 (when files-only
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2773 (let ((temp (nreverse result))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2774 item)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2775 (setq result nil)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2776 (if (equal files-only t)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2777 ;; files only
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2778 (while temp
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2779 (setq item (pop temp))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2780 (when (file-regular-p item)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2781 (push item result)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2782 ;; directories only
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2783 (while temp
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2784 (setq item (pop temp))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2785 (when (file-directory-p item)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
2786 (push item result)))))))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2787 result)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2788
58540
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2789 (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
2790 (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
2791 "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
2792 (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
2793 (save-excursion
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2794 (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
2795 (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
2796 (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
2797 tramp-perl-directory-files-and-attributes
1fbbe0bcfaac Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents: 58776
diff changeset
2798 "tramp_directory_files_and_attributes")
58540
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2799 (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
2800 (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
2801 (tramp-shell-quote-argument localname)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2802 (or id-format 'integer)))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2803 (tramp-wait-for-output)
65926
e465f3508fd5 (tramp-perl-directory-files-and-attributes): Add error handling.
Lars Hansen <larsh@soem.dk>
parents: 65925
diff changeset
2804 (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
2805 (when (stringp object)
e465f3508fd5 (tramp-perl-directory-files-and-attributes): Add error handling.
Lars Hansen <larsh@soem.dk>
parents: 65925
diff changeset
2806 (error object))
e465f3508fd5 (tramp-perl-directory-files-and-attributes): Add error handling.
Lars Hansen <larsh@soem.dk>
parents: 65925
diff changeset
2807 object)))
58540
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2808 (cell root))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2809 (while (cdr cell)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2810 (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
2811 ;; Remove from list
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2812 (setcdr cell (cddr cell))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2813 ;; Include in list
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2814 (setq cell (cdr cell))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2815 (let ((l (car cell)))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2816 (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
2817 (cdr l))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2818 ;; If FULL, make file name absolute
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2819 (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
2820 (if nosort
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2821 (cdr root)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
2822 (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
2823
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2824 ;; This function should return "foo/" for directories and "bar" for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2825 ;; files. We use `ls -ad' to get a list of files (including
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2826 ;; directories), and `find . -type d \! -name . -prune' to get a list
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2827 ;; of directories.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2828 (defun tramp-handle-file-name-all-completions (filename directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2829 "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
2830 (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
2831 (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
2832 (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
2833 result)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2834 (save-excursion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2835 (tramp-barf-unless-okay
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2836 multi-method method user host
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
2837 (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
2838 nil 'file-error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2839 "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
2840 (tramp-shell-quote-argument localname))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2841
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2842 ;; 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
2843 ;; 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
2844 ;; rock. --daniel@danann.net
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2845 (tramp-send-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2846 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2847 (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
2848 "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
2849 "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
2850 (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
2851 (if (or nowild (zerop (length filename)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2852 ""
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2853 (format "-d %s*"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2854 (tramp-shell-quote-argument filename)))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2855
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2856 ;; Now grab the output.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2857 (tramp-wait-for-output)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2858 (goto-char (point-max))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2859 (while (zerop (forward-line -1))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2860 (push (buffer-substring (point)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2861 (tramp-line-end-position))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2862 result))
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
2863
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2864 (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
2865 (tramp-wait-for-output)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2866
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2867 ;; Return the list.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2868 (if nowild
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2869 (all-completions filename (mapcar 'list result))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2870 result))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2871
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2872
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2873 ;; The following isn't needed for Emacs 20 but for 19.34?
74766
ca4412906dbd * net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents: 74739
diff changeset
2874 (defun tramp-handle-file-name-completion
ca4412906dbd * net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents: 74739
diff changeset
2875 (filename directory &optional predicate)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2876 "Like `file-name-completion' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2877 (unless (tramp-tramp-file-p directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2878 (error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2879 "tramp-handle-file-name-completion invoked on non-tramp directory `%s'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2880 directory))
74777
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
2881 (try-completion
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
2882 filename
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
2883 (mapcar 'list (file-name-all-completions filename directory))
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
2884 (when predicate
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
2885 (lambda (x) (funcall predicate (expand-file-name (car x) directory))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2886
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2887 ;; cp, mv and ln
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2888
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2889 (defun tramp-handle-add-name-to-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2890 (filename newname &optional ok-if-already-exists)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2891 "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
2892 (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
2893 (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
2894 (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
2895 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
2896 (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
2897 (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
2898 (equal v1-method v2-method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2899 (equal v1-user v2-user)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2900 (equal v1-host v2-host))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2901 (error "add-name-to-file: %s"
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2902 "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
2903 (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
2904 (file-exists-p newname)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2905 (not (numberp ok-if-already-exists))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2906 (y-or-n-p
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2907 (format
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2908 "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
2909 newname)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2910 (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
2911 (tramp-barf-unless-okay
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2912 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
2913 (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
2914 (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
2915 nil 'file-error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
2916 "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
2917 (buffer-name))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2918
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2919 (defun tramp-handle-copy-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2920 (filename newname &optional ok-if-already-exists keep-date)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2921 "Like `copy-file' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2922 ;; Check if both files are local -- invoke normal copy-file.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2923 ;; Otherwise, use tramp from local system.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2924 (setq filename (expand-file-name filename))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2925 (setq newname (expand-file-name newname))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2926 ;; At least one file a tramp file?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2927 (if (or (tramp-tramp-file-p filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2928 (tramp-tramp-file-p newname))
59582
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
2929 (tramp-do-copy-or-rename-file
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
2930 'copy filename newname ok-if-already-exists keep-date)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2931 (tramp-run-real-handler
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2932 'copy-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2933 (list filename newname ok-if-already-exists keep-date))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2934
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2935 (defun tramp-handle-rename-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2936 (filename newname &optional ok-if-already-exists)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2937 "Like `rename-file' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2938 ;; Check if both files are local -- invoke normal rename-file.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2939 ;; Otherwise, use tramp from local system.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2940 (setq filename (expand-file-name filename))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2941 (setq newname (expand-file-name newname))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2942 ;; At least one file a tramp file?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2943 (if (or (tramp-tramp-file-p filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2944 (tramp-tramp-file-p newname))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2945 (tramp-do-copy-or-rename-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2946 'rename filename newname ok-if-already-exists)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2947 (tramp-run-real-handler 'rename-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2948 (list filename newname ok-if-already-exists))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2949
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2950 (defun tramp-do-copy-or-rename-file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2951 (op filename newname &optional ok-if-already-exists keep-date)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2952 "Copy or rename a remote file.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2953 OP must be `copy' or `rename' and indicates the operation to perform.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2954 FILENAME specifies the file to copy or rename, NEWNAME is the name of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2955 the new file (for copy) or the new name of the file (for rename).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2956 OK-IF-ALREADY-EXISTS means don't barf if NEWNAME exists already.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2957 KEEP-DATE means to make sure that NEWNAME has the same timestamp
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2958 as FILENAME.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2959
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2960 This function is invoked by `tramp-handle-copy-file' and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2961 `tramp-handle-rename-file'. It is an error if OP is neither of `copy'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2962 and `rename'. FILENAME and NEWNAME must be absolute file names."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2963 (unless (memq op '(copy rename))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2964 (error "Unknown operation `%s', must be `copy' or `rename'" op))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2965 (unless ok-if-already-exists
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2966 (when (file-exists-p newname)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
2967 (signal 'file-already-exists
73529
59b2832e02ef (with-parsed-tramp-file-name): Correct debug spec. Highlight as keyword.
Lars Hansen <larsh@soem.dk>
parents: 72569
diff changeset
2968 (list "File already exists" newname))))
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2969 (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
2970 (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
2971 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
2972 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
2973
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2974 ;; 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
2975 ;; 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
2976 ;; 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
2977 (if t1
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2978 (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
2979 (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
2980 v1-method l-method
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2981 v1-user l-user
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2982 v1-host l-host
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2983 v1-localname l-localname))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2984 (setq v1-localname filename))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2985 (if t2
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2986 (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
2987 (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
2988 v2-method l-method
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2989 v2-user l-user
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2990 v2-host l-host
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2991 v2-localname l-localname))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2992 (setq v2-localname newname))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2993
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2994 (cond
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2995 ;; Both are Tramp files.
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
2996 ((and t1 t2)
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2997 (cond
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
2998 ;; 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
2999 ;; 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
3000 ;; directly.
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3001 ((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
3002 (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
3003 (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
3004 (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
3005 (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
3006 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
3007 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
3008 ;; 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
3009 ;; 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
3010 ;; 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
3011 ;; 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
3012 ;; 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
3013 ((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
3014 (not v2-multi-method)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3015 (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
3016 (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
3017 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
3018 (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
3019 (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
3020 (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
3021 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
3022 ;; 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
3023 ;; 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
3024 ;; 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
3025 ;; 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
3026 ;; 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
3027 ;; 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
3028 ;; 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
3029 ;; 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
3030 ;; source and target file.
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3031 (t
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3032 (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
3033 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
3034
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3035 ;; 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
3036 ((or t1 t2)
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3037 ;; 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
3038 ;; 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
3039 (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
3040 (not v2-multi-method)
73529
59b2832e02ef (with-parsed-tramp-file-name): Correct debug spec. Highlight as keyword.
Lars Hansen <larsh@soem.dk>
parents: 72569
diff changeset
3041 (or (and t1 (tramp-method-out-of-band-p
59b2832e02ef (with-parsed-tramp-file-name): Correct debug spec. Highlight as keyword.
Lars Hansen <larsh@soem.dk>
parents: 72569
diff changeset
3042 v1-multi-method v1-method v1-user v1-host))
59b2832e02ef (with-parsed-tramp-file-name): Correct debug spec. Highlight as keyword.
Lars Hansen <larsh@soem.dk>
parents: 72569
diff changeset
3043 (and t2 (tramp-method-out-of-band-p
59b2832e02ef (with-parsed-tramp-file-name): Correct debug spec. Highlight as keyword.
Lars Hansen <larsh@soem.dk>
parents: 72569
diff changeset
3044 v2-multi-method v2-method v2-user v2-host))))
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3045 (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
3046 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
3047 ;; 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
3048 (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
3049 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
3050
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3051 (t
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3052 ;; 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
3053 (error "Tramp implementation says this cannot happen")))))
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3054
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3055 (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
3056 "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
3057 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
3058 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
3059 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
3060 (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
3061 (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
3062 (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
3063 (tramp-message
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
3064 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
3065 " with inline copying across machines")))
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
3066 (save-excursion
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
3067 (set-buffer trampbuf) (erase-buffer)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
3068 (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
3069 ;; 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
3070 ;; `jka-compr-inhibit' to t.
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
3071 (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
3072 (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
3073 (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
3074 ;; KEEP-DATE handling.
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3075 (when keep-date
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3076 (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
3077 (not (equal modtime '(0 0))))
59582
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3078 (tramp-touch newname modtime)))
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3079 ;; Set the mode.
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3080 (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
3081 ;; 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
3082 (unless (eq op 'copy)
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
3083 (delete-file filename))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3084
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3085 (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
3086 (op multi-method method user host localname1 localname2 keep-date)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3087 "Invokes `cp' or `mv' on the remote system.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3088 OP must be one of `copy' or `rename', indicating `cp' or `mv',
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3089 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
3090 LOCALNAME1 and LOCALNAME2 specify the two arguments of `cp' or `mv'.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3091 If KEEP-DATE is non-nil, preserve the time stamp when copying."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3092 ;; CCC: What happens to the timestamp when renaming?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3093 (let ((cmd (cond ((and (eq op 'copy) keep-date) "cp -f -p")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3094 ((eq op 'copy) "cp -f")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3095 ((eq op 'rename) "mv -f")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3096 (t (error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3097 "Unknown operation `%s', must be `copy' or `rename'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3098 op)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3099 (save-excursion
59582
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3100 (tramp-send-command
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3101 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3102 (format "%s %s %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3103 cmd
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3104 (tramp-shell-quote-argument localname1)
59582
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3105 (tramp-shell-quote-argument localname2)))
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3106 (tramp-wait-for-output)
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3107 (goto-char (point-min))
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3108 (unless
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3109 (or
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3110 (and (eq op 'copy) keep-date
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3111 ;; Mask cp -f error.
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3112 (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
3113 (zerop (tramp-send-command-and-check
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3114 multi-method method user host nil nil)))
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3115 (pop-to-buffer (current-buffer))
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3116 (signal 'file-error
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3117 (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
3118 (buffer-name)))))
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3119 ;; Set the mode.
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3120 ;; 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
3121 ;; where available?
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3122 (unless (or (eq op 'rename) keep-date)
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3123 (set-file-modes
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3124 (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
3125 (file-modes
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3126 (tramp-make-tramp-file-name
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3127 multi-method method user host localname1))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3128
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3129 (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
3130 "Invoke rcp program to copy.
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3131 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
3132 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
3133 (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
3134 (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
3135 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
3136 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
3137 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
3138 source target trampbuf)
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3139
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3140 ;; 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
3141 ;; 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
3142 ;; 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
3143 (if t1
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3144 (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
3145 (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
3146 v1-method l-method
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3147 v1-user l-user
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3148 v1-host l-host
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3149 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
3150 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
3151 method (tramp-find-method
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3152 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
3153 user l-user
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3154 host l-host
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3155 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
3156 v1-multi-method method
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3157 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
3158 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
3159 v1-multi-method method
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3160 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
3161 (setq v1-localname filename))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3162
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3163 (if t2
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3164 (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
3165 (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
3166 v2-method l-method
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3167 v2-user l-user
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3168 v2-host l-host
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3169 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
3170 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
3171 method (tramp-find-method
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3172 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
3173 user l-user
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3174 host l-host
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3175 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
3176 v2-multi-method method
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3177 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
3178 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
3179 v2-multi-method method
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3180 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
3181 (setq v2-localname newname))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3182
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3183 ;; 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
3184 ;; 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
3185 (if (not t1)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3186 (setq source v1-localname)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3187 (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
3188 (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
3189 (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
3190 (setq source
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3191 (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
3192 v1-user v1-host
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3193 (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
3194
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3195 (if (not t2)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3196 (setq target v2-localname)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3197 (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
3198 (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
3199 (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
3200 (setq target
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3201 (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
3202 v2-user v2-host
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3203 (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
3204
74395
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
3205 ;; Handle ControlMaster/ControlPath
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
3206 (setq copy-args
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
3207 (mapcar
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
3208 (lambda (x)
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
3209 (format-spec
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
3210 x `((?t . ,(format "/tmp/%s" tramp-temp-name-prefix)))))
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
3211 copy-args))
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
3212
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3213 ;; Handle keep-date argument
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3214 (when keep-date
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3215 (if t1
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3216 (setq copy-args
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3217 (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
3218 v1-multi-method method
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3219 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
3220 copy-args))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3221 (setq copy-args
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3222 (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
3223 v2-multi-method method
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3224 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
3225 copy-args))))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3226
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3227 (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
3228 trampbuf (generate-new-buffer
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3229 (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
3230
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3231 ;; 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
3232 (save-excursion
59031
1fbbe0bcfaac Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents: 58776
diff changeset
3233
1fbbe0bcfaac Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents: 58776
diff changeset
3234 ;; Check for program.
1fbbe0bcfaac Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents: 58776
diff changeset
3235 (when (and (fboundp 'executable-find)
1fbbe0bcfaac Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents: 58776
diff changeset
3236 (not (executable-find copy-program)))
1fbbe0bcfaac Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents: 58776
diff changeset
3237 (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
3238
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3239 (set-buffer trampbuf)
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3240 (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
3241 tramp-current-method method
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3242 tramp-current-user user
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3243 tramp-current-host host)
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
3244 (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
3245
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3246 ;; Use rcp-like program for file transfer.
74166
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
3247 (unwind-protect
75429
0d32395ff1eb * net/tramp.el (tramp-do-copy-or-rename-file-out-of-band): Set
Michael Albinus <michael.albinus@gmx.de>
parents: 75361
diff changeset
3248 (let* ((default-directory
0d32395ff1eb * net/tramp.el (tramp-do-copy-or-rename-file-out-of-band): Set
Michael Albinus <michael.albinus@gmx.de>
parents: 75361
diff changeset
3249 (if (and (stringp default-directory)
0d32395ff1eb * net/tramp.el (tramp-do-copy-or-rename-file-out-of-band): Set
Michael Albinus <michael.albinus@gmx.de>
parents: 75361
diff changeset
3250 (file-accessible-directory-p default-directory))
0d32395ff1eb * net/tramp.el (tramp-do-copy-or-rename-file-out-of-band): Set
Michael Albinus <michael.albinus@gmx.de>
parents: 75361
diff changeset
3251 default-directory
0d32395ff1eb * net/tramp.el (tramp-do-copy-or-rename-file-out-of-band): Set
Michael Albinus <michael.albinus@gmx.de>
parents: 75361
diff changeset
3252 (tramp-temporary-file-directory)))
0d32395ff1eb * net/tramp.el (tramp-do-copy-or-rename-file-out-of-band): Set
Michael Albinus <michael.albinus@gmx.de>
parents: 75361
diff changeset
3253 (p (apply 'start-process (buffer-name trampbuf) trampbuf
0d32395ff1eb * net/tramp.el (tramp-do-copy-or-rename-file-out-of-band): Set
Michael Albinus <michael.albinus@gmx.de>
parents: 75361
diff changeset
3254 copy-program copy-args)))
74166
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
3255 (tramp-set-process-query-on-exit-flag p nil)
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
3256 (tramp-process-actions p multi-method method user host
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
3257 tramp-actions-copy-out-of-band))
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
3258 (kill-buffer trampbuf))
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
3259 (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
3260
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3261 ;; Set the mode.
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3262 (unless keep-date
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
3263 (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
3264
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3265 ;; 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
3266 (unless (eq op 'copy)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3267 (delete-file filename))))
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3268
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3269 ;; mkdir
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3270 (defun tramp-handle-make-directory (dir &optional parents)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3271 "Like `make-directory' for tramp files."
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
3272 (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
3273 (with-parsed-tramp-file-name dir nil
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
3274 (save-excursion
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
3275 (tramp-barf-unless-okay
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
3276 multi-method method user host
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
3277 (format " %s %s"
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
3278 (if parents "mkdir -p" "mkdir")
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3279 (tramp-shell-quote-argument localname))
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
3280 nil 'file-error
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
3281 "Couldn't make directory %s" dir))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3282
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3283 ;; CCC error checking?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3284 (defun tramp-handle-delete-directory (directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3285 "Like `delete-directory' for tramp files."
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
3286 (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
3287 (with-parsed-tramp-file-name directory nil
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3288 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3289 (tramp-send-command
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3290 multi-method method user host
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3291 (format "rmdir %s ; echo ok"
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3292 (tramp-shell-quote-argument localname)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3293 (tramp-wait-for-output))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3294
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3295 (defun tramp-handle-delete-file (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3296 "Like `delete-file' for tramp files."
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
3297 (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
3298 (with-parsed-tramp-file-name filename nil
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
3299 (save-excursion
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
3300 (unless (zerop (tramp-send-command-and-check
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
3301 multi-method method user host
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
3302 (format "rm -f %s"
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3303 (tramp-shell-quote-argument localname))))
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
3304 (signal 'file-error "Couldn't delete Tramp file")))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3305
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3306 ;; Dired.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3307
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3308 ;; CCC: This does not seem to be enough. Something dies when
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3309 ;; we try and delete two directories under TRAMP :/
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3310 (defun tramp-handle-dired-recursive-delete-directory (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3311 "Recursively delete the directory given.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3312 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
3313 (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
3314 ;; run a shell command 'rm -r <localname>'
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3315 ;; 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
3316 (or (file-exists-p filename)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3317 (signal
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3318 'file-error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3319 (list "Removing old file name" "no such directory" filename)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3320 ;; 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
3321 (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
3322 (format "rm -r %s" (tramp-shell-quote-argument localname)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3323 ;; Wait for the remote system to return to us...
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3324 ;; This might take a while, allow it plenty of time.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3325 (tramp-wait-for-output 120)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3326 ;; Make sure that it worked...
56460
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3327 (and (file-exists-p filename)
59031
1fbbe0bcfaac Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents: 58776
diff changeset
3328 (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
3329
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3330 (defun tramp-handle-dired-call-process (program discard &rest arguments)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3331 "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
3332 (with-parsed-tramp-file-name default-directory nil
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3333 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3334 (tramp-barf-unless-okay
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3335 multi-method method user host
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3336 (format "cd %s" (tramp-shell-quote-argument localname))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3337 nil 'file-error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3338 "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
3339 (tramp-shell-quote-argument localname))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3340 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3341 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3342 (mapconcat #'tramp-shell-quote-argument (cons program arguments) " "))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3343 (tramp-wait-for-output))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3344 (unless discard
62344
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3345 ;; 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
3346 ;; 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
3347 ;; `expand-file' and alike.
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3348 (insert
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3349 (with-current-buffer
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3350 (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
3351 (buffer-string))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3352 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3353 (prog1
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3354 (tramp-send-command-and-check multi-method method user host nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3355 (tramp-send-command multi-method method user host "cd")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3356 (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
3357
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3358 (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
3359 "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
3360 ;; 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
3361 ;; 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
3362 (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
3363 (save-excursion
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3364 (let ((suffixes
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3365 (if (not (featurep 'xemacs))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3366 ;; Emacs case
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3367 (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
3368 ;; 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
3369 ;; 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
3370 (mapcar
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3371 '(lambda (x)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3372 (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
3373 nil
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3374 (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
3375 (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
3376 suffix)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3377 ;; 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
3378 (while suffixes
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3379 (let (case-fold-search)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3380 (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
3381 (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
3382 (setq suffixes (cdr suffixes))))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3383
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3384 (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
3385 nil)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3386 ((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
3387 ;; 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
3388 (message "Uncompressing %s..." file)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3389 (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
3390 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
3391 (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
3392 (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
3393 ;; `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
3394 (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
3395 (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
3396 (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
3397 (t
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3398 ;; 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
3399 ;; Try gzip.
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3400 (message "Compressing %s..." file)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3401 (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
3402 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
3403 (concat "gzip -f " localname)))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3404 (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
3405 ;; `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
3406 (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
3407 (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
3408 (concat file ".gz"))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3409 ((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
3410 (concat file ".z"))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3411 (t nil)))))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3412
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3413 ;; Pacify byte-compiler. The function is needed on XEmacs only. I'm
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3414 ;; not sure at all that this is the right way to do it, but let's hope
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3415 ;; it works for now, and wait for a guru to point out the Right Way to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3416 ;; achieve this.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3417 ;;(eval-when-compile
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3418 ;; (unless (fboundp 'dired-insert-set-properties)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3419 ;; (fset 'dired-insert-set-properties 'ignore)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3420 ;; Gerd suggests this:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3421 (eval-when-compile (require 'dired))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3422 ;; Note that dired is required at run-time, too, when it is needed.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3423 ;; It is only needed on XEmacs for the function
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3424 ;; `dired-insert-set-properties'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3425
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3426 (defun tramp-handle-insert-directory
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3427 (filename switches &optional wildcard full-directory-p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3428 "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
3429 (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
3430 (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
3431 (tramp-run-real-handler 'insert-directory
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3432 (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
3433 ;; 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
3434 ;; 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
3435 ;; connection setup.
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3436 (when (string-match "^--dired\\s-+" switches)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3437 (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
3438 (setq filename (expand-file-name filename))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3439 (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
3440 (tramp-message-for-buffer
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3441 multi-method method user host 10
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3442 "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
3443 switches filename (if wildcard "yes" "no")
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3444 (if full-directory-p "yes" "no"))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3445 (when wildcard
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3446 (setq wildcard (file-name-nondirectory localname))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3447 (setq localname (file-name-directory localname)))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3448 (when (listp switches)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3449 (setq switches (mapconcat 'identity switches " ")))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3450 (unless full-directory-p
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3451 (setq switches (concat "-d " switches)))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3452 (when wildcard
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3453 (setq switches (concat switches " " wildcard)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3454 (save-excursion
58540
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3455 ;; 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
3456 ;; 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
3457 (if full-directory-p
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3458 (tramp-send-command
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3459 multi-method method user host
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3460 (format "%s %s %s"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3461 (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
3462 switches
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3463 (if wildcard
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3464 localname
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3465 (tramp-shell-quote-argument (concat localname ".")))))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3466 (tramp-barf-unless-okay
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3467 multi-method method user host
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3468 (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
3469 (file-name-directory localname)))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3470 nil 'file-error
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3471 "Couldn't `cd %s'"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3472 (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
3473 (tramp-send-command
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3474 multi-method method user host
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3475 (format "%s %s %s"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3476 (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
3477 switches
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3478 (if wildcard
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3479 localname
62344
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3480 (if (zerop (length (file-name-nondirectory localname)))
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3481 ""
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3482 (tramp-shell-quote-argument
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3483 (file-name-nondirectory localname)))))))
58540
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3484 (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
3485 (tramp-wait-for-output))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3486 ;; 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
3487 ;; 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
3488 ;; 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
3489 ;; happened on 2003-03-13.
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3490 (let ((old-pos (point)))
62344
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3491 ;; 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
3492 ;; 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
3493 ;; `expand-file' and alike.
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3494 (insert
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3495 (with-current-buffer
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3496 (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
3497 (buffer-string)))
58540
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3498 ;; 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
3499 ;; 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
3500 ;; 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
3501 ;; 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
3502 ;; (let ((zmacs-region-stays t))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3503 ;; (exchange-point-and-mark))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3504 (save-excursion
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3505 (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
3506 (tramp-wait-for-output))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3507 ;; 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
3508 ;; 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
3509 ;; ;; 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
3510 ;; ;; it?
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3511 ;; (when (and (featurep 'xemacs)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3512 ;; (eq major-mode 'dired-mode))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3513 ;; (save-excursion
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3514 ;; (require 'dired)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
3515 ;; (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
3516 ))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3517
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3518 ;; Continuation of kluge to pacify byte-compiler.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3519 ;;(eval-when-compile
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3520 ;; (when (eq (symbol-function 'dired-insert-set-properties) 'ignore)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3521 ;; (fmakunbound 'dired-insert-set-properties)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3522
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3523 ;; CCC is this the right thing to do?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3524 (defun tramp-handle-unhandled-file-name-directory (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3525 "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
3526 (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
3527 (expand-file-name "~/")))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3528
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3529 ;; Canonicalization of file names.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3530
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3531 (defun tramp-drop-volume-letter (name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3532 "Cut off unnecessary drive letter from file NAME.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3533 The function `tramp-handle-expand-file-name' calls `expand-file-name'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3534 locally on a remote file name. When the local system is a W32 system
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3535 but the remote system is Unix, this introduces a superfluous drive
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3536 letter into the file name. This function removes it.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3537
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3538 Doesn't do anything if the NAME does not start with a drive letter."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3539 (if (and (> (length name) 1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3540 (char-equal (aref name 1) ?:)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3541 (let ((c1 (aref name 0)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3542 (or (and (>= c1 ?A) (<= c1 ?Z))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3543 (and (>= c1 ?a) (<= c1 ?z)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3544 (substring name 2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3545 name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3546
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3547 (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
3548 "Like `expand-file-name' for tramp files.
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3549 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
3550 the result will be a local, non-Tramp, filename."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3551 ;; If DIR is not given, use DEFAULT-DIRECTORY or "/".
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3552 (setq dir (or dir default-directory "/"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3553 ;; Unless NAME is absolute, concat DIR and NAME.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3554 (unless (file-name-absolute-p name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3555 (setq name (concat (file-name-as-directory dir) name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3556 ;; If NAME is not a tramp file, run the real handler
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3557 (if (not (tramp-tramp-file-p name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3558 (tramp-run-real-handler 'expand-file-name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3559 (list name nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3560 ;; Dissect NAME.
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3561 (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
3562 (unless (file-name-absolute-p localname)
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3563 (setq localname (concat "~/" localname)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3564 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3565 ;; Tilde expansion if necessary. This needs a shell which
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3566 ;; groks tilde expansion! The function `tramp-find-shell' is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3567 ;; supposed to find such a shell on the remote host. Please
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3568 ;; 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
3569 (when (string-match "\\`\\(~[^/]*\\)\\(.*\\)\\'" localname)
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3570 (let ((uname (match-string 1 localname))
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3571 (fname (match-string 2 localname)))
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
3572 ;; 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
3573 ;; 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
3574 ;; 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
3575 ;; 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
3576 ;; appropriate either, because ssh and companions might
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
3577 ;; 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
3578 (when (and (string-equal uname "~")
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
3579 (string-match
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
3580 "\\`su\\(do\\)?\\'"
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
3581 (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
3582 (setq uname (concat uname (or user "root"))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3583 ;; CCC fanatic error checking?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3584 (set-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3585 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3586 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3587 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3588 (format "cd %s; pwd" uname)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3589 t)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3590 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3591 (goto-char (point-min))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3592 (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
3593 (setq localname (concat uname fname))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3594 (erase-buffer)))
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
3595 ;; 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
3596 ;; expands to "/". Remove this.
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
3597 (while (string-match "//" localname)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
3598 (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
3599 ;; 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
3600 ;; 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
3601 ;; 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
3602 ;; 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
3603 ;; "/", 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
3604 ;; shares or Cygwin mounts.
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
3605 (tramp-let-maybe directory-sep-char ?/
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
3606 (let ((default-directory "/"))
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
3607 (tramp-make-tramp-file-name
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
3608 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
3609 user host
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
3610 (tramp-drop-volume-letter
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
3611 (tramp-run-real-handler 'expand-file-name
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
3612 (list localname))))))))))
50338
155b4b78aa3b * tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49995
diff changeset
3613
155b4b78aa3b * tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49995
diff changeset
3614 ;; 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
3615 ;; boundaries.
155b4b78aa3b * tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49995
diff changeset
3616 ;; ;; 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
3617 ;; ;; 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
3618 ;; (if (string-match "^/\\.\\./" localname)
155b4b78aa3b * tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49995
diff changeset
3619 ;; (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
3620 ;; ;; 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
3621 ;; ;; 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
3622 ;; ;; 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
3623 ;; ;; would otherwise use backslash.
155b4b78aa3b * tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49995
diff changeset
3624 ;; (let ((directory-sep-char ?/))
155b4b78aa3b * tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49995
diff changeset
3625 ;; (tramp-make-tramp-file-name
155b4b78aa3b * tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49995
diff changeset
3626 ;; multi-method method user host
155b4b78aa3b * tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49995
diff changeset
3627 ;; (tramp-drop-volume-letter
155b4b78aa3b * tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49995
diff changeset
3628 ;; (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
3629 ;; (list localname))))))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3630
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3631 ;; Remote commands.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3632
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3633 (defvar tramp-async-proc nil
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
3634 "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
3635 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
3636
70020
2578326defd6 * net/tramp.el (tramp-display-shell-command-buffer): New defvar.
Michael Albinus <michael.albinus@gmx.de>
parents: 68820
diff changeset
3637 (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
3638 "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
3639 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
3640
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3641 (defun tramp-handle-shell-command (command &optional output-buffer error-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3642 "Like `shell-command' for tramp files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3643 This will break if COMMAND prints a newline, followed by the value of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3644 `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
3645 ;; 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
3646 ;; 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
3647 (if (tramp-tramp-file-p default-directory)
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
3648 (with-parsed-tramp-file-name default-directory nil
71561
21a427e4868a * net/tramp.el (tramp-handle-shell-command): Preserve current-buffer.
Michael Albinus <michael.albinus@gmx.de>
parents: 71485
diff changeset
3649 (let ((curbuf (current-buffer))
21a427e4868a * net/tramp.el (tramp-handle-shell-command): Preserve current-buffer.
Michael Albinus <michael.albinus@gmx.de>
parents: 71485
diff changeset
3650 (asynchronous (string-match "[ \t]*&[ \t]*\\'" command))
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3651 status)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3652 (unless output-buffer
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3653 (setq output-buffer
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3654 (get-buffer-create
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3655 (if asynchronous
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3656 "*Async Shell Command*"
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3657 "*Shell Command Output*")))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3658 (set-buffer output-buffer)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3659 (erase-buffer))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3660 (unless (bufferp output-buffer)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3661 (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
3662 (set-buffer output-buffer)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3663 ;; 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
3664 ;; 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
3665 ;; 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
3666 ;; 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
3667 (when asynchronous
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3668 (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
3669 error-buffer nil
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3670 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
3671 output-buffer "cat")))
47771
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
3672 (save-excursion
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
3673 (tramp-barf-unless-okay
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
3674 multi-method method user host
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3675 (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
3676 nil 'file-error
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
3677 "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
3678 (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
3679 ;; Define the process filter
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3680 (when asynchronous
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3681 (set-process-filter
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3682 (get-buffer-process
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3683 (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
3684 '(lambda (process string)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3685 ;; 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
3686 (save-current-buffer
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3687 (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
3688 (goto-char (point-max))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3689 (insert string))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3690 ;; 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
3691 (let ((end
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3692 (string-match
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3693 (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
3694 (when end
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3695 (setq string
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3696 (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
3697 (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
3698 (when end
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3699 (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
3700 (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
3701 ;; Send the command
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3702 (tramp-send-command
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3703 multi-method method user host
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3704 (if error-buffer
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3705 (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
3706 command)
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3707 (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
3708 (unless asynchronous
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3709 (tramp-wait-for-output)))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3710 (unless asynchronous
62344
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3711 ;; 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
3712 ;; 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
3713 ;; `expand-file' and alike.
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3714 (insert
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3715 (with-current-buffer
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3716 (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
3717 (buffer-string))))
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3718 (when error-buffer
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3719 (save-excursion
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3720 (unless (bufferp error-buffer)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3721 (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
3722 (tramp-send-command
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3723 multi-method method user host
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3724 "cat /tmp/tramp.$$.err")
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3725 (tramp-wait-for-output)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3726 (set-buffer error-buffer)
62344
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3727 ;; Same comment as above
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3728 (insert
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3729 (with-current-buffer
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
3730 (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
3731 (buffer-string)))
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3732 (tramp-send-command-and-check
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3733 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
3734 (save-excursion
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
3735 (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
3736 (unless asynchronous
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3737 (tramp-wait-for-output))
47771
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
3738 (tramp-send-command
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
3739 multi-method method user host
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
3740 (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
3741 " 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
3742 (unless asynchronous
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3743 (tramp-wait-for-output)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3744 (goto-char (point-max))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3745 (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
3746 (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
3747 (skip-chars-forward "^ ")
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3748 (setq status (read (current-buffer)))))
47771
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
3749 (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
3750 (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
3751 (display-buffer output-buffer)))
71561
21a427e4868a * net/tramp.el (tramp-handle-shell-command): Preserve current-buffer.
Michael Albinus <michael.albinus@gmx.de>
parents: 71485
diff changeset
3752 (set-buffer curbuf)
47771
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
3753 status))
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
3754 ;; 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
3755 ;; 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
3756 (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
3757 default-directory)
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
3758 (tramp-run-real-handler 'shell-command
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
3759 (list command output-buffer error-buffer))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3760
57653
b324ca4df07c * simple.el (process-file): New function, similar to call-process
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 57559
diff changeset
3761 (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
3762 "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
3763 (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
3764 (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
3765 (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
3766 (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
3767 (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
3768 (shell-command
2578326defd6 * net/tramp.el (tramp-display-shell-command-buffer): New defvar.
Michael Albinus <michael.albinus@gmx.de>
parents: 68820
diff changeset
3769 (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
3770 buffer)))
57653
b324ca4df07c * simple.el (process-file): New function, similar to call-process
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 57559
diff changeset
3771
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3772 ;; File Editing.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3773
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3774 (defsubst tramp-make-temp-file ()
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3775 (funcall (if (fboundp 'make-temp-file) 'make-temp-file 'make-temp-name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3776 (expand-file-name tramp-temp-name-prefix
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3777 (tramp-temporary-file-directory))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3778
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3779 (defun tramp-handle-file-local-copy (filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3780 "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
3781 (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
3782 (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
3783 ;; 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
3784 ;; 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
3785 ;; statement that checks them. But the functions
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
3786 ;; 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
3787 ;; 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
3788 ;; 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
3789 (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
3790 (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
3791 (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
3792 (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
3793 tmpfil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3794 (unless (file-exists-p filename)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3795 (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
3796 filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3797 (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
3798
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
3799 (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
3800 ;; `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
3801 (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
3802
47683
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
3803 ((and rem-enc rem-dec)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3804 ;; Use inline encoding for file transfer.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3805 (save-excursion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3806 ;; 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
3807 ;; tramp-current-user, tramp-current-host.
47683
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
3808 (set-buffer tramp-buf)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3809 (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
3810 (tramp-barf-unless-okay
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3811 multi-method method user host
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
3812 (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
3813 nil 'file-error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3814 "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
3815 tramp-buf)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3816 ;; Remove trailing status code
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3817 (goto-char (point-max))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3818 (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
3819
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3820 (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
3821
47683
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
3822 ;; 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
3823 (if (and (symbolp loc-dec) (fboundp loc-dec))
75194
59eb85a37abd * net/tramp.el (tramp-handle-file-local-copy): Set
Michael Albinus <michael.albinus@gmx.de>
parents: 75148
diff changeset
3824 ;; If local decoding is a function, we call it. We
59eb85a37abd * net/tramp.el (tramp-handle-file-local-copy): Set
Michael Albinus <michael.albinus@gmx.de>
parents: 75148
diff changeset
3825 ;; must disable multibyte, because
59eb85a37abd * net/tramp.el (tramp-handle-file-local-copy): Set
Michael Albinus <michael.albinus@gmx.de>
parents: 75148
diff changeset
3826 ;; `uudecode-decode-region' doesn't handle it
59eb85a37abd * net/tramp.el (tramp-handle-file-local-copy): Set
Michael Albinus <michael.albinus@gmx.de>
parents: 75148
diff changeset
3827 ;; correctly.
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3828 (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
3829 (set-buffer tmpbuf)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3830 (erase-buffer)
75194
59eb85a37abd * net/tramp.el (tramp-handle-file-local-copy): Set
Michael Albinus <michael.albinus@gmx.de>
parents: 75148
diff changeset
3831 (set-buffer-multibyte nil)
65792
8c8e6f2eea3c Pacify byte compiler warnings in pacification code.
Richard M. Stallman <rms@gnu.org>
parents: 65605
diff changeset
3832 (insert-buffer-substring tramp-buf)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3833 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3834 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3835 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
3836 filename loc-dec)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3837 (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
3838 ;; 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
3839 ;; 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
3840 ;; 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
3841 ;; 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
3842 ;; 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
3843 (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
3844 (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
3845 (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
3846 (kill-buffer tmpbuf))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3847 ;; 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
3848 ;; 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
3849 (let ((tmpfil2 (tramp-make-temp-file)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3850 (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
3851 (tramp-message
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3852 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
3853 filename loc-dec)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
3854 (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
3855 loc-dec tmpfil2 tmpfil)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3856 (delete-file tmpfil2)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3857 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3858 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
3859 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
3860 ;; Set proper permissions.
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3861 (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
3862
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
3863 (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
3864 tmpfil)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3865
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
3866 (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
3867 "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
3868 (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
3869 (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
3870 (make-tramp-file-name
d863bc830907 (tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 55864
diff changeset
3871 :multi-method multi-method
d863bc830907 (tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 55864
diff changeset
3872 :method method
d863bc830907 (tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 55864
diff changeset
3873 :user user
d863bc830907 (tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 55864
diff changeset
3874 :host host
d863bc830907 (tramp-handle-file-remote-p): New implementation to
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 55864
diff changeset
3875 :localname ""))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3876
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3877 (defun tramp-handle-insert-file-contents
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3878 (filename &optional visit beg end replace)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3879 "Like `insert-file-contents' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3880 (barf-if-buffer-read-only)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3881 (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
3882 (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
3883 (if (not (file-exists-p filename))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3884 (progn
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3885 (when visit
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3886 (setq buffer-file-name filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3887 (set-visited-file-modtime)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3888 (set-buffer-modified-p nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3889 (signal 'file-error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3890 (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
3891 (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
3892 ;; `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
3893 ;; 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
3894 ;; 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
3895 (let ((local-copy
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3896 (let ((inhibit-file-name-operation
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3897 (when (eq inhibit-file-name-operation
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3898 'insert-file-contents)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
3899 'file-local-copy)))
51603
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
3900 (file-local-copy filename)))
65925
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
3901 coding-system-used result)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3902 (when visit
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3903 (setq buffer-file-name filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3904 (set-visited-file-modtime)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3905 (set-buffer-modified-p nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3906 (tramp-message-for-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3907 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3908 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
3909 (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
3910 ;; 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
3911 (when (boundp 'last-coding-system-used)
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
3912 (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
3913 (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
3914 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
3915 9 "Inserting local temp file `%s'...done" local-copy)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3916 (delete-file local-copy)
65925
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
3917 (when (boundp 'last-coding-system-used)
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
3918 (set 'last-coding-system-used coding-system-used))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3919 (list (expand-file-name filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3920 (second result))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
3921
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3922
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
3923 (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
3924 "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
3925 (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
3926 ;; 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
3927 ;; Emacs or XEmacs
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3928 (let ((backup-directory-alist
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3929 ;; Emacs case
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3930 (when (boundp 'backup-directory-alist)
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3931 (if (boundp 'tramp-backup-directory-alist)
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3932 (mapcar
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3933 '(lambda (x)
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3934 (cons
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3935 (car x)
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3936 (if (and (stringp (cdr x))
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3937 (file-name-absolute-p (cdr x))
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3938 (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
3939 (tramp-make-tramp-file-name
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3940 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
3941 (cdr x))))
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3942 (symbol-value 'tramp-backup-directory-alist))
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3943 (symbol-value 'backup-directory-alist))))
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3944
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3945 (bkup-backup-directory-info
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3946 ;; XEmacs case
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3947 (when (boundp 'bkup-backup-directory-info)
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3948 (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
3949 (mapcar
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3950 '(lambda (x)
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3951 (nconc
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3952 (list (car x))
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3953 (list
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3954 (if (and (stringp (car (cdr x)))
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3955 (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
3956 (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
3957 (tramp-make-tramp-file-name
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3958 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
3959 (car (cdr x))))
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3960 (cdr (cdr x))))
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3961 (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
3962 (symbol-value 'bkup-backup-directory-info)))))
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3963
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
3964 (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
3965
65248
0f994edbec5e Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents: 64772
diff changeset
3966 (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
3967 "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
3968 Returns a file name in `tramp-auto-save-directory' for autosaving this file."
72569
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3969 (let ((tramp-auto-save-directory tramp-auto-save-directory))
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3970 ;; File name must be unique. This is ensured with Emacs 22 (see
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3971 ;; UNIQUIFY element of `auto-save-file-name-transforms'); but for
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3972 ;; all other cases we must do it ourselves.
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3973 (when (boundp 'auto-save-file-name-transforms)
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3974 (mapcar
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3975 '(lambda (x)
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3976 (when (and (string-match (car x) buffer-file-name)
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3977 (not (car (cddr x))))
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3978 (setq tramp-auto-save-directory
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3979 (or tramp-auto-save-directory temporary-file-directory))))
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3980 (symbol-value 'auto-save-file-name-transforms)))
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3981 ;; Create directory.
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3982 (when tramp-auto-save-directory
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3983 (unless (file-exists-p tramp-auto-save-directory)
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3984 (make-directory tramp-auto-save-directory t)))
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3985 ;; jka-compr doesn't like auto-saving, so by appending "~" to the
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3986 ;; file name we make sure that jka-compr isn't used for the
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3987 ;; auto-save file.
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3988 (let ((buffer-file-name
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3989 (if tramp-auto-save-directory
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3990 (expand-file-name
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3991 (tramp-subst-strs-in-string
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3992 '(("_" . "|")
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3993 ("/" . "_a")
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3994 (":" . "_b")
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3995 ("|" . "__")
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3996 ("[" . "_l")
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3997 ("]" . "_r"))
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3998 (buffer-file-name))
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
3999 tramp-auto-save-directory)
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4000 (buffer-file-name))))
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4001 ;; Run plain `make-auto-save-file-name'. There might be an advice when
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4002 ;; it is not a magic file name operation (since Emacs 22).
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4003 ;; We must deactivate it temporarily.
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4004 (if (not (ad-is-active 'make-auto-save-file-name))
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4005 (tramp-run-real-handler
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4006 'make-auto-save-file-name nil)
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4007 ;; else
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4008 (ad-deactivate 'make-auto-save-file-name)
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4009 (prog1
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4010 (tramp-run-real-handler
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4011 'make-auto-save-file-name nil)
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4012 (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
4013
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
4014
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4015 ;; CCC grok APPEND, LOCKNAME, CONFIRM
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4016 (defun tramp-handle-write-region
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4017 (start end filename &optional append visit lockname confirm)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4018 "Like `write-region' for tramp files."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4019 (unless (eq append nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4020 (error "Cannot append to file using tramp (`%s')" filename))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4021 (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
4022 ;; 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
4023 ;; 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
4024 ;; Ange-ftp ignores it, too.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4025 ;; (when (and lockname (stringp lockname))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4026 ;; (setq lockname (expand-file-name lockname)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4027 ;; (unless (or (eq lockname nil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4028 ;; (string= lockname filename))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4029 ;; (error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4030 ;; "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
4031 ;; XEmacs takes a coding system as the seventh argument, not `confirm'
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4032 (when (and (not (featurep 'xemacs))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4033 confirm (file-exists-p filename))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4034 (unless (y-or-n-p (format "File %s exists; overwrite anyway? "
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4035 filename))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4036 (error "File not overwritten")))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4037 (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
4038 (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
4039 (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
4040 (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
4041 (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
4042 (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
4043 (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
4044 (modes (file-modes filename))
65925
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
4045 ;; 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
4046 ;; 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
4047 ;; 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
4048 ;; 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
4049 ;; 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
4050 ;; 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
4051 coding-system-used
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4052 tmpfil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4053 ;; 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
4054 ;; 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
4055 ;; because this makes the logic simpler.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4056 (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
4057 ;; 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
4058 ;; changed it accidently.
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4059 (set-buffer curbuf)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4060 ;; 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
4061 ;; 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
4062 ;; `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
4063 (tramp-run-real-handler
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4064 'write-region
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4065 (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
4066 (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
4067 (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
4068 ;; 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
4069 (when (boundp 'last-coding-system-used)
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
4070 (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
4071 ;; 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
4072 ;; 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
4073 ;; 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
4074 ;; permissions.
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
4075 (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
4076 ;; 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
4077 ;; 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
4078 ;; 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
4079 ;; 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
4080 ;; _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
4081 ;; 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
4082 (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
4083 ;; `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
4084 (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
4085
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4086 ((and rem-enc rem-dec)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4087 ;; Use inline file transfer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4088 (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
4089 (save-excursion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4090 ;; Encode tmpfil into tmpbuf
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4091 (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
4092 5 "Encoding region...")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4093 (set-buffer tmpbuf)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4094 (erase-buffer)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4095 ;; 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
4096 (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
4097 (progn
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4098 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4099 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
4100 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
4101 (symbol-name loc-enc))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4102 (insert-file-contents-literally tmpfil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4103 ;; 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
4104 ;; 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
4105 ;; both of the following conditions are
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4106 ;; 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
4107 ;; 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
4108 ;; default-directory is remote.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4109 ;; (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
4110 ;; 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
4111 ;; tmp file anyway.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4112 (let ((default-directory
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4113 (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
4114 (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
4115 (goto-char (point-max))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4116 (unless (bolp)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4117 (newline)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4118 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4119 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
4120 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
4121 (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
4122 loc-enc tmpfil t))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4123 (pop-to-buffer trampbuf)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4124 (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
4125 " 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
4126 filename loc-enc)))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4127 ;; 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
4128 ;; 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
4129 ;; 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
4130 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4131 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4132 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
4133 (tramp-send-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4134 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4135 (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
4136 rem-dec
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
4137 (tramp-shell-quote-argument localname)))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4138 (set-buffer tmpbuf)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4139 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4140 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4141 6 "Sending data to remote host...")
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
4142 (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
4143 (buffer-string))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4144 ;; wait for remote decoding to complete
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4145 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4146 multi-method method user host
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4147 6 "Sending end of data token...")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4148 (tramp-send-command
46992
6529728ddf05 Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46835
diff changeset
4149 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
4150 (tramp-message-for-buffer
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4151 multi-method method user host 6
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4152 "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
4153 (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
4154 (tramp-wait-for-output)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4155 (tramp-barf-unless-okay
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4156 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
4157 (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
4158 " 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
4159 filename rem-dec)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4160 (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
4161 filename)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4162 (kill-buffer tmpbuf))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4163 (t
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4164 (error
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4165 (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
4166 "decoding command or an rcp program")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4167 method)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4168 (delete-file tmpfil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4169 (unless (equal curbuf (current-buffer))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4170 (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
4171 curbuf (current-buffer)))
56644
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
4172 (when (or (eq visit t) (stringp visit))
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
4173 (set-visited-file-modtime
0cee455027ed Sync with Tramp 2.0.44.
Michael Albinus <michael.albinus@gmx.de>
parents: 56465
diff changeset
4174 ;; 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
4175 ;; 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
4176 (nth 5 (file-attributes filename))))
65925
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
4177 ;; 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
4178 (when (boundp 'last-coding-system-used)
da00cdf6de37 Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents: 65792
diff changeset
4179 (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
4180 (when (or (eq visit t)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4181 (eq visit nil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4182 (stringp visit))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4183 (message "Wrote %s" filename)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4184
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4185 ;; Call down to the real handler.
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
4186 ;; 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
4187 ;; TRAMP file name) it is needed to disable efs as well as tramp for the
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4188 ;; operation.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4189 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4190 ;; Other than that, this is the canon file-handler code that the doco
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4191 ;; says should be used here. Which is nice.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4192 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4193 ;; 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
4194 ;; efs-sifn-handler-function to handle any filename with environment
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4195 ;; variables. This has two implications:
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
4196 ;; 1) That EFS may not be completely dead (yet) for TRAMP filenames
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4197 ;; 2) That TRAMP might want to do the same thing.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4198 ;; Details as they come in.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4199 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4200 ;; Daniel Pittman <daniel@danann.net>
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4201
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4202 ;; (defun tramp-run-real-handler (operation args)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4203 ;; "Invoke normal file name handler for OPERATION.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4204 ;; This inhibits EFS and Ange-FTP, too, because they conflict with tramp.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4205 ;; First arg specifies the OPERATION, remaining ARGS are passed to the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4206 ;; OPERATION."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4207 ;; (let ((inhibit-file-name-handlers
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4208 ;; (list 'tramp-file-name-handler
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4209 ;; 'efs-file-handler-function
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4210 ;; 'ange-ftp-hook-function
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4211 ;; (and (eq inhibit-file-name-operation operation)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4212 ;; inhibit-file-name-handlers)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4213 ;; (inhibit-file-name-operation operation))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4214 ;; (apply operation args)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4215
70318
77201b466c80 * net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents: 70276
diff changeset
4216 ;;;###autoload
77201b466c80 * net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents: 70276
diff changeset
4217 (progn (defun tramp-run-real-handler (operation args)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4218 "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
4219 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
4220 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
4221 (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
4222 `(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
4223 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
4224 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
4225 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
4226 .
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
4227 ,(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
4228 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
4229 (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
4230 (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
4231
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4232 ;; 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
4233 ;; 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
4234 ;; 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
4235 ;; 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
4236 ;;;###autoload
77201b466c80 * net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents: 70276
diff changeset
4237 (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
4238 "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
4239 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
4240 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
4241 (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
4242 `(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
4243 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
4244 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
4245 .
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
4246 ,(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
4247 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
4248 (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
4249 (apply operation args))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4250
48973
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
4251 ;; 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
4252 ;; 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
4253 ;; 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
4254 ;; 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
4255 ;; 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
4256 ;; 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
4257 ;; 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
4258 (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
4259 "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
4260 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
4261 (cond
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
4262 ; 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
4263 ((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
4264 (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
4265 '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
4266 '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
4267 '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
4268 '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
4269 '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
4270 '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
4271 '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
4272 '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
4273 '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
4274 '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
4275 '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
4276 '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
4277 'load 'make-directory 'make-directory-internal
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
4278 '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
4279 '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
4280 ; 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
4281 '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
4282 '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
4283 '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
4284 '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
4285 '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
4286 '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
4287 (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
4288 (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
4289 (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
4290 ; 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
4291 ((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
4292 (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
4293 '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
4294 '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
4295 ; 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
4296 '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
4297 '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
4298 (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
4299 (cond
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
4300 ((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
4301 ((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
4302 (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
4303 ; 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
4304 ((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
4305 (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
4306 ; BUF
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
4307 ((member operation
65248
0f994edbec5e Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents: 64772
diff changeset
4308 (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
4309 '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
4310 ; 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
4311 '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
4312 (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
4313 (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
4314 ; COMMAND
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
4315 ((member operation
60156
ed97a38d9f53 (tramp-file-name-for-operation): Use dired-call-process instead of
Eli Zaretskii <eliz@gnu.org>
parents: 59996
diff changeset
4316 (list 'dired-call-process
59582
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
4317 ; Emacs only
60287
865aec6814c3 (tramp-file-name-for-operation): Fix misapplied
Andreas Schwab <schwab@suse.de>
parents: 60156
diff changeset
4318 'shell-command
60763
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
4319 ; 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
4320 '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
4321 ; 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
4322 '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
4323 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
4324 ; 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
4325 (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
4326
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
4327 (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
4328 "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
4329 (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
4330 (let (elt
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
4331 res
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
4332 (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
4333 (while handler-alist
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
4334 (setq elt (car handler-alist)
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
4335 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
4336 (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
4337 (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
4338 (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
4339 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
4340
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4341 ;; Main function.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4342 ;;;###autoload
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4343 (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
4344 "Invoke Tramp file name handler.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4345 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
4346 ;; (setq edebug-trace t)
77201b466c80 * net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents: 70276
diff changeset
4347 ;; (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
4348 (save-match-data
51603
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
4349 (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
4350 (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
4351 (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
4352 (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
4353 (cond
77201b466c80 * net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents: 70276
diff changeset
4354 ;; 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
4355 ;; handled by backend.
77201b466c80 * net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents: 70276
diff changeset
4356 ((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
4357 (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
4358 ((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
4359 (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
4360 t)
77201b466c80 * net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents: 70276
diff changeset
4361 ;; Call the backend function.
77201b466c80 * net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents: 70276
diff changeset
4362 (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
4363 ;; 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
4364 (t (tramp-run-real-handler operation args)))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4365
56460
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4366
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4367 ;; 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
4368 ;; 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
4369 ;; 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
4370 ;; 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
4371 ;; 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
4372 ;; 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
4373 ;; 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
4374 ;; `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
4375 ;; (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
4376 ;; 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
4377 ;; 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
4378 ;; -- 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
4379 ;; 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
4380 ;; 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
4381 ;; 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
4382 ;; 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
4383
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4384 (defvar tramp-locked nil
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4385 "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
4386 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
4387 preventing reentrant calls of Tramp.")
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4388
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4389 (defvar tramp-locker nil
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4390 "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
4391 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
4392 preventing reentrant calls of Tramp.")
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4393
51603
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
4394 (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
4395 "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
4396 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
4397 (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
4398 (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
4399 (let ((tl tramp-locked))
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4400 (unwind-protect
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4401 (progn
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4402 (setq tramp-locked t)
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4403 (let ((tramp-locker t))
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4404 (save-match-data
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4405 (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
4406 (if fn
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4407 (apply (cdr fn) args)
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4408 (tramp-run-real-handler operation args))))))
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4409 (setq tramp-locked tl))))
51603
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
4410
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4411 ;;;###autoload
70255
d57fb8c98714 * net/tramp.el (tramp-completion-file-name-handler): Disable
Michael Albinus <michael.albinus@gmx.de>
parents: 70191
diff changeset
4412 (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
4413 "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
4414 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
4415 ;; (setq edebug-trace t)
77201b466c80 * net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents: 70276
diff changeset
4416 ;; (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
4417 (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
4418 (if fn
77201b466c80 * net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents: 70276
diff changeset
4419 (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
4420 (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
4421
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4422 ;;;###autoload
70255
d57fb8c98714 * net/tramp.el (tramp-completion-file-name-handler): Disable
Michael Albinus <michael.albinus@gmx.de>
parents: 70191
diff changeset
4423 (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
4424 "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
4425 (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
4426 (cons tramp-file-name-regexp 'tramp-file-name-handler))
72569
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4427 ;; `partial-completion-mode' is unknown in XEmacs. So we should
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4428 ;; load it unconditionally there. In the GNU Emacs case, method/
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4429 ;; user/host name completion shall be bound to `partial-completion-mode'.
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4430 (when (or (not (boundp 'partial-completion-mode))
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4431 (symbol-value 'partial-completion-mode)
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
4432 (featurep 'ido))
70191
3a3093f77da8 * net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents: 70073
diff changeset
4433 (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
4434 (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
4435 '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
4436 (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
4437 ;; 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
4438 ;; `file-name-handler-alist'.
77201b466c80 * net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents: 70276
diff changeset
4439 (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
4440 (when jka
77201b466c80 * net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents: 70276
diff changeset
4441 (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
4442 (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
4443
77201b466c80 * net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents: 70276
diff changeset
4444 ;; 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
4445 ;; `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
4446 ;; delayed.
70191
3a3093f77da8 * net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents: 70073
diff changeset
4447 ;;;###autoload(add-hook
70255
d57fb8c98714 * net/tramp.el (tramp-completion-file-name-handler): Disable
Michael Albinus <michael.albinus@gmx.de>
parents: 70191
diff changeset
4448 ;;;###autoload 'after-init-hook
d57fb8c98714 * net/tramp.el (tramp-completion-file-name-handler): Disable
Michael Albinus <michael.albinus@gmx.de>
parents: 70191
diff changeset
4449 ;;;###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
4450 (tramp-register-file-name-handlers)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4451
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
4452 ;;;###autoload
70191
3a3093f77da8 * net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents: 70073
diff changeset
4453 (defun tramp-unload-file-name-handlers ()
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
4454 (setq file-name-handler-alist
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
4455 (delete (rassoc 'tramp-file-name-handler
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
4456 file-name-handler-alist)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
4457 (delete (rassoc 'tramp-completion-file-name-handler
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
4458 file-name-handler-alist)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
4459 file-name-handler-alist))))
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
4460
70191
3a3093f77da8 * net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents: 70073
diff changeset
4461 (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
4462
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4463
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4464 ;;; Interactions with other packages:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4465
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4466 ;; -- complete.el --
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4467
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4468 ;; This function contributed by Ed Sabol
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4469 (defun tramp-handle-expand-many-files (name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4470 "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
4471 (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
4472 (save-match-data
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4473 (if (or (string-match "\\*" name)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4474 (string-match "\\?" name)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4475 (string-match "\\[.*\\]" name))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4476 (save-excursion
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4477 (let (bufstr)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4478 ;; 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
4479 ;; 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
4480 ;; 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
4481 ;; don't bother.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4482 ;;-(let ((comint-file-name-quote-list
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4483 ;;- (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
4484 ;;- '(?\* ?\? ?[ ?]))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4485 ;;- (tramp-send-command
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4486 ;;- multi-method method user host
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
4487 ;;- (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
4488 ;;- (tramp-wait-for-output))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4489 (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
4490 (format "echo %s" localname))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4491 (tramp-wait-for-output)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4492 (setq bufstr (buffer-substring (point-min)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4493 (tramp-line-end-position)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4494 (goto-char (point-min))
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
4495 (if (string-equal localname bufstr)
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4496 nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4497 (insert "(\"")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4498 (while (search-forward " " nil t)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4499 (delete-backward-char 1)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4500 (insert "\" \""))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4501 (goto-char (point-max))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4502 (delete-backward-char 1)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4503 (insert "\")")
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4504 (goto-char (point-min))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4505 (mapcar
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4506 (function (lambda (x)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4507 (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
4508 user host x)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
4509 (read (current-buffer))))))
56460
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
4510 (list (expand-file-name name))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4511
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
4512 (eval-after-load "complete"
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
4513 '(progn
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
4514 (defadvice PC-expand-many-files
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
4515 (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
4516 "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
4517 (if (tramp-tramp-file-p name)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
4518 (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
4519 ad-do-it))
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
4520 (add-hook 'tramp-unload-hook
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
4521 '(lambda () (ad-unadvise 'PC-expand-many-files)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
4522
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4523 ;;; 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
4524
66496
63563507d684 (tramp-completion-mode): defvar moved up.
Richard M. Stallman <rms@gnu.org>
parents: 66135
diff changeset
4525 (defvar tramp-completion-mode nil
63563507d684 (tramp-completion-mode): defvar moved up.
Richard M. Stallman <rms@gnu.org>
parents: 66135
diff changeset
4526 "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
4527
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4528 ;; 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
4529 ;; `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
4530 ;; 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
4531 ;; `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
4532 ;; 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
4533 ;; 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
4534 ;; 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
4535 ;; 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
4536 ;; 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
4537 ;; 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
4538 ;; 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
4539 ;; 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
4540 (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
4541 "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
4542 (cond
66135
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4543 (tramp-completion-mode t)
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4544 ((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
4545 ((string-match
47771
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
4546 (concat tramp-prefix-regexp
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
4547 "\\(" 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
4548 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
4549 (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
4550 ((or (equal last-input-event 'tab)
70049
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4551 ;; Emacs
74985
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
4552 (and (wholenump last-input-event)
70049
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4553 (or
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4554 ;; ?\t has event-modifier 'control
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4555 (char-equal last-input-event ?\t)
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4556 (and (not (event-modifiers last-input-event))
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4557 (or (char-equal last-input-event ?\?)
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4558 (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
4559 ;; XEmacs
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4560 (and (featurep 'xemacs)
70049
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4561 (or
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4562 ;; ?\t has event-modifier 'control
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4563 (char-equal
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4564 (funcall (symbol-function 'event-to-character)
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4565 last-input-event) ?\t)
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4566 (and (not (event-modifiers last-input-event))
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4567 (or (char-equal
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4568 (funcall (symbol-function 'event-to-character)
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4569 last-input-event) ?\?)
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4570 (char-equal
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4571 (funcall (symbol-function 'event-to-character)
def3f4aee280 Sync with Tramp 2.0.53.
Michael Albinus <michael.albinus@gmx.de>
parents: 70020
diff changeset
4572 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
4573 t)))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4574
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4575 ;; 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
4576 ;; `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
4577 ;; 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
4578 ;;;###autoload
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4579 (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
4580 "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
4581
66135
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4582 (unwind-protect
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4583 ;; 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
4584 (progn
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4585 (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
4586 (let*
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4587 ((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
4588 ;; possible completion structures
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4589 (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
4590 result result1)
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4591
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4592 (while v
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4593 (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
4594 (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
4595 (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
4596 (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
4597 (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
4598 (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
4599 (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
4600 (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
4601 all-user-hosts)
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4602
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4603 (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
4604 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
4605
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4606 (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
4607
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4608 ;; 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
4609 (progn
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4610 (mapcar
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4611 (lambda (x)
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4612 (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
4613 (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
4614 (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
4615 (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
4616
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4617 (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
4618 (mapcar
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4619 (lambda (x)
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4620 (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
4621 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
4622 (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
4623
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4624 ;; Possible methods
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4625 (setq result
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4626 (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
4627
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4628 (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
4629
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4630 ;; 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
4631 (while result
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4632 (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
4633 (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
4634 '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
4635 (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
4636
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4637 ;; Complete local parts
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4638 (append
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4639 result1
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4640 (condition-case nil
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4641 (if result1
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4642 ;; "/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
4643 (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
4644 '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
4645 ;; 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
4646 (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
4647 '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
4648 (error nil)))))
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4649 ;; unwindform
5a1bac1c915b * net/tramp.el (tramp-completion-mode): New defvar. Used in
Michael Albinus <michael.albinus@gmx.de>
parents: 65926
diff changeset
4650 (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
4651
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4652 ;; 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
4653 ;;;###autoload
74766
ca4412906dbd * net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents: 74739
diff changeset
4654 (defun tramp-completion-handle-file-name-completion
ca4412906dbd * net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents: 74739
diff changeset
4655 (filename directory &optional predicate)
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4656 "Like `file-name-completion' for tramp files."
74766
ca4412906dbd * net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents: 74739
diff changeset
4657 (try-completion
ca4412906dbd * net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents: 74739
diff changeset
4658 filename
ca4412906dbd * net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents: 74739
diff changeset
4659 (mapcar 'list (file-name-all-completions filename directory))
74777
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
4660 (when predicate
948c86bf6396 * net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents: 74766
diff changeset
4661 (lambda (x) (funcall predicate (expand-file-name (car x) directory))))))
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4662
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4663 ;; 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
4664 ;; 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
4665 ;; 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
4666 ;; 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
4667 ;; 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
4668
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4669 ;; Expected results:
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4670
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4671 ;; "/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
4672 ;; [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
4673 ;; [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
4674 ;; [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
4675
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
4676 ;; "/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
4677 ;; [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
4678 ;; "/[x/" "/[x/y"
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4679 ;; [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
4680 ;; [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
4681
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4682 ;; "/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
4683 ;; [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
4684 ;; "/[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
4685 ;; [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
4686 (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
4687 "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
4688 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
4689
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4690 (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
4691 (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
4692 ;; "/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
4693 (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
4694 (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
4695 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
4696 ;; "/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
4697 (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
4698 (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
4699 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
4700 ;; "/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
4701 (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
4702 (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
4703 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
4704 ;; "/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
4705 (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
4706 (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
4707 "\\(" 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
4708 "\\(" 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
4709 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
4710 ;; "/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
4711 (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
4712 (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
4713 "\\(" 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
4714 "\\(" 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
4715 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
4716 ;; "/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
4717 (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
4718 (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
4719 "\\(" 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
4720 "\\(" 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
4721 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
4722 ;; "/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
4723 (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
4724 (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
4725 "\\(" 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
4726 "\\(" 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
4727 "\\(" 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
4728 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
4729
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
4730 (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
4731 (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
4732 (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
4733 (list
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4734 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
4735 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
4736 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
4737 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
4738 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
4739 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
4740 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
4741 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
4742
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4743 (delq nil result)))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4744
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4745 (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
4746 "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
4747 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
4748 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
4749
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4750 (let (method)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4751 (save-match-data
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4752 (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
4753 (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
4754 (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
4755 (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
4756 ;; Not handled (yet).
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4757 (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
4758 :multi-method method
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4759 :method nil
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4760 :user nil
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4761 :host nil
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
4762 :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
4763 (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
4764 (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
4765 (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
4766 (match-string (nth 3 structure) name)))
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
4767 (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
4768 (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
4769 (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
4770 :multi-method nil
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4771 :method method
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4772 :user user
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4773 :host host
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
4774 :localname localname)))))))
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4775
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4776 ;; 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
4777 ;; trailing method delimeter.
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4778 (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
4779 "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
4780 (mapcar
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
4781 (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
4782 (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
4783 (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
4784 (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
4785 (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
4786
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4787 ;; 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
4788 (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
4789 "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
4790 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
4791 (cond
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4792
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4793 ((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
4794 (if (and host
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4795 (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
4796 (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
4797 (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
4798 (setq user nil
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4799 host nil)))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4800
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4801 (partial-user
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4802 (setq host nil)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4803 (unless
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4804 (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
4805 (setq user nil)))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4806
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4807 (partial-host
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4808 (setq user nil)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4809 (unless
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4810 (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
4811 (setq host nil)))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4812
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4813 (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
4814 host nil)))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4815
47578
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
4816 (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
4817 (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
4818
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4819 (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
4820 "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
4821 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
4822
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4823 (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
4824 (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
4825 (with-temp-buffer
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4826 (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
4827 (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
4828 (while (not (eobp))
47578
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
4829 (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
4830 res))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4831
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4832 ;; 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
4833 (eval-and-compile
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4834 (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
4835 (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
4836 'point-at-eol
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4837 'line-end-position)))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4838
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4839 (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
4840 "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
4841 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
4842
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4843 (let ((result)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4844 (regexp
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4845 (concat
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4846 "^\\(" tramp-host-regexp "\\)"
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4847 "\\([ \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
4848
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4849 (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
4850 (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
4851 (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
4852 (widen)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4853 (forward-line 1)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4854 result))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4855
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4856 (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
4857 "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
4858 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
4859
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4860 (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
4861 (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
4862 (with-temp-buffer
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4863 (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
4864 (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
4865 (while (not (eobp))
47578
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
4866 (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
4867 res))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4868
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4869 (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
4870 "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
4871 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
4872
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4873 (let ((result)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4874 (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
4875
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4876 (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
4877 (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
4878 (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
4879 (widen)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4880 (or
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4881 (> (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
4882 (forward-line 1))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4883 result))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4884
49612
407d6516031a 2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49598
diff changeset
4885 (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
4886 "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
4887 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
4888
407d6516031a 2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49598
diff changeset
4889 (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
4890 (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
4891 (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
4892 (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
4893 (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
4894 (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
4895 (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
4896 res))
407d6516031a 2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49598
diff changeset
4897
407d6516031a 2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49598
diff changeset
4898 (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
4899 "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
4900 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
4901
407d6516031a 2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49598
diff changeset
4902 (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
4903 (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
4904
407d6516031a 2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49598
diff changeset
4905 (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
4906 (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
4907 (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
4908 (widen)
407d6516031a 2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49598
diff changeset
4909 (or
407d6516031a 2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49598
diff changeset
4910 (> (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
4911 (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
4912 result))
407d6516031a 2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49598
diff changeset
4913
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4914 (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
4915 "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
4916 User is always nil."
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4917
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4918 (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
4919 (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
4920 result)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4921
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4922 (while files
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4923 (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
4924 (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
4925 (setq files (cdr files)))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4926 result))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4927
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4928 (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
4929 "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
4930 User is always nil."
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4931
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4932 (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
4933 "\\)\\.ssh-\\(dss\\|rsa\\)\\.pub$"))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4934 (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
4935 result)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4936
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4937 (while files
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4938 (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
4939 (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
4940 (setq files (cdr files)))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4941 result))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
4942
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4943 (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
4944 "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
4945 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
4946
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4947 (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
4948 (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
4949 (with-temp-buffer
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4950 (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
4951 (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
4952 (while (not (eobp))
47578
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
4953 (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
4954 res))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4955
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4956 (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
4957 "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
4958 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
4959
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4960 (let ((result)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4961 (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
4962
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4963 (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
4964 (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
4965 (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
4966 (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
4967 (widen)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4968 (or
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4969 (> (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
4970 (forward-line 1))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4971 result))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4972
49612
407d6516031a 2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49598
diff changeset
4973 ;; 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
4974 ;; 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
4975 ;; 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
4976 ;; 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
4977 (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
4978 "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
4979 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
4980
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4981 (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
4982 (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
4983 '(("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
4984 (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
4985 (with-temp-buffer
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4986 (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
4987 (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
4988 (while (not (eobp))
47578
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
4989 (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
4990 res)))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4991
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4992 (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
4993 "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
4994 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
4995
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4996 (let ((result)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4997 (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
4998
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
4999 (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
5000 (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
5001 (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
5002 (widen)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
5003 (forward-line 1)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
5004 result))
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
5005
47578
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5006 (defun tramp-parse-netrc (filename)
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5007 "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
5008 User may be nil."
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5009
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5010 (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
5011 (when (file-readable-p filename)
47578
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5012 (with-temp-buffer
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5013 (insert-file-contents filename)
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5014 (goto-char (point-min))
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5015 (while (not (eobp))
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5016 (push (tramp-parse-netrc-group) res))))
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5017 res))
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5018
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5019 (defun tramp-parse-netrc-group ()
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5020 "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
5021 User may be nil."
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5022
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5023 (let ((result)
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5024 (regexp
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5025 (concat
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5026 "^[ \t]*machine[ \t]+" "\\(" tramp-host-regexp "\\)"
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5027 "\\([ \t]+login[ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?")))
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5028
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5029 (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
5030 (when (re-search-forward regexp nil t)
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5031 (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
5032 (widen)
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5033 (forward-line 1)
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5034 result))
6e910ba94c42 Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47577
diff changeset
5035
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5036 ;;; Internal Functions:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5037
59031
1fbbe0bcfaac Sync with Tramp 2.0.46.
Michael Albinus <michael.albinus@gmx.de>
parents: 58776
diff changeset
5038 (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
5039 "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
5040 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
5041 Function may have 0-3 parameters."
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
5042 (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
5043 (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
5044 (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
5045 multi-method method user host)))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
5046 (unless (memq name perl-scripts)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
5047 (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
5048 (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
5049 (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
5050 (concat name
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
5051 " () {\n"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
5052 remote-perl
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
5053 " -e '"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
5054 script
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
5055 "' \"$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
5056 (tramp-wait-for-output)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
5057 (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
5058 multi-method method user host)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
5059 (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
5060
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5061 (defun tramp-set-auto-save ()
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5062 (when (and (buffer-file-name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5063 (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
5064 ;; 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
5065 (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
5066 'tramp-sh-file-name-handler)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5067 auto-save-default)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5068 (auto-save-mode 1)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5069 (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
5070 (add-hook 'tramp-unload-hook
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
5071 '(lambda ()
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
5072 (remove-hook 'find-file-hooks 'tramp-set-auto-save)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5073
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5074 (defun tramp-run-test (switch filename)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5075 "Run `test' on the remote system, given a SWITCH and a FILENAME.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5076 Returns the exit code of the `test' program."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5077 (let ((v (tramp-dissect-file-name filename)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5078 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5079 (tramp-send-command-and-check
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5080 (tramp-file-name-multi-method v) (tramp-file-name-method v)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5081 (tramp-file-name-user v) (tramp-file-name-host v)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5082 (format "test %s %s" switch
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
5083 (tramp-shell-quote-argument (tramp-file-name-localname v)))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5084
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5085 (defun tramp-run-test2 (program file1 file2 &optional switch)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5086 "Run `test'-like PROGRAM on the remote system, given FILE1, FILE2.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5087 The optional SWITCH is inserted between the two files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5088 Returns the exit code of the `test' PROGRAM. Barfs if the methods,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5089 hosts, or files, disagree."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5090 (let* ((v1 (tramp-dissect-file-name file1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5091 (v2 (tramp-dissect-file-name file2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5092 (mmethod1 (tramp-file-name-multi-method v1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5093 (mmethod2 (tramp-file-name-multi-method v2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5094 (method1 (tramp-file-name-method v1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5095 (method2 (tramp-file-name-method v2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5096 (user1 (tramp-file-name-user v1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5097 (user2 (tramp-file-name-user v2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5098 (host1 (tramp-file-name-host v1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5099 (host2 (tramp-file-name-host v2))
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
5100 (localname1 (tramp-file-name-localname v1))
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
5101 (localname2 (tramp-file-name-localname v2)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5102 (unless (and method1 method2 host1 host2
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5103 (equal mmethod1 mmethod2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5104 (equal method1 method2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5105 (equal user1 user2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5106 (equal host1 host2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5107 (error "tramp-run-test2: %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5108 "only implemented for same method, same user, same host"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5109 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5110 (tramp-send-command-and-check
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5111 mmethod1 method1 user1 host1
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5112 (format "%s %s %s %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5113 program
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
5114 (tramp-shell-quote-argument localname1)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5115 (or switch "")
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
5116 (tramp-shell-quote-argument localname2))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5117
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
5118 (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
5119 "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
5120 TIME is an Emacs internal time value as returned by `current-time'."
74985
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
5121 (let* ((utc
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
5122 ;; With GNU Emacs, `format-time-string' has an optional
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
5123 ;; parameter UNIVERSAL. This is preferred.
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
5124 (and (functionp 'subr-arity)
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
5125 (= 3 (cdr (funcall (symbol-function 'subr-arity)
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
5126 (symbol-function 'format-time-string))))))
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
5127 (touch-time
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
5128 (if utc
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
5129 (format-time-string "%Y%m%d%H%M.%S" time t)
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
5130 (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
5131 (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
5132 (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
5133 (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
5134 (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
5135 multi-method method user host
74985
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
5136 (format "%s touch -t %s %s"
155a8e75cd11 Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents: 74777
diff changeset
5137 (if utc "TZ=UTC; export TZ;" "")
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
5138 touch-time
73529
59b2832e02ef (with-parsed-tramp-file-name): Correct debug spec. Highlight as keyword.
Lars Hansen <larsh@soem.dk>
parents: 72569
diff changeset
5139 (tramp-shell-quote-argument localname))
71350
0844ec8948e9 * net/tramp.el (tramp-touch): Use UTC to express time.
Michael Albinus <michael.albinus@gmx.de>
parents: 70531
diff changeset
5140 t))
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
5141 (pop-to-buffer buf)
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
5142 (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
5143 buf))))
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
5144 ;; 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
5145 (with-temp-buffer
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
5146 (unless (zerop (call-process
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
5147 "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
5148 (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
5149 (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
5150
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5151 (defun tramp-buffer-name (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5152 "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
5153 (if multi-method
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5154 (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
5155 (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
5156 (if user
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
5157 (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
5158 (format "*tramp/%s %s*" method host)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5159
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5160 (defun tramp-buffer-name-multi-method (prefix multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5161 "A name for the multi method connection buffer.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5162 MULTI-METHOD gives the multi method, METHOD the array of methods,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5163 USER the array of user names, HOST the array of host names."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5164 (unless (and (= (length method) (length user))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5165 (= (length method) (length host)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5166 (error "Syntax error in multi method (implementation error)"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5167 (let ((len (length method))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5168 (i 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5169 string-list)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5170 (while (< i len)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5171 (setq string-list
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5172 (cons (if (aref user i)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5173 (format "%s#%s@%s:" (aref method i)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5174 (aref user i) (aref host i))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5175 (format "%s@%s:" (aref method i) (aref host i)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5176 string-list))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5177 (incf i))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5178 (format "*%s/%s %s*"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5179 prefix multi-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5180 (apply 'concat (reverse string-list)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5181
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5182 (defun tramp-get-buffer (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5183 "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
5184 (with-current-buffer
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
5185 (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
5186 (setq buffer-undo-list t)
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
5187 (current-buffer)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5188
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5189 (defun tramp-debug-buffer-name (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5190 "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
5191 (if multi-method
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5192 (tramp-buffer-name-multi-method "debug tramp"
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5193 multi-method method user host)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5194 (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
5195 (if user
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5196 (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
5197 (format "*debug tramp/%s %s*" method host)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5198
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5199 (defun tramp-get-debug-buffer (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5200 "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
5201 (with-current-buffer
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
5202 (get-buffer-create
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
5203 (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
5204 (setq buffer-undo-list t)
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
5205 (current-buffer)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5206
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5207 (defun tramp-find-executable (multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5208 progname dirlist ignore-tilde)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5209 "Searches for PROGNAME in all directories mentioned in DIRLIST.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5210 First args METHOD, USER and HOST specify the connection, PROGNAME
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5211 is the program to search for, and DIRLIST gives the list of directories
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5212 to search. If IGNORE-TILDE is non-nil, directory names starting
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5213 with `~' will be ignored.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5214
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
5215 Returns the absolute file name of PROGNAME, if found, and nil otherwise.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5216
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5217 This function expects to be in the right *tramp* buffer."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5218 (let (result)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5219 (when ignore-tilde
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5220 ;; Remove all ~/foo directories from dirlist. In Emacs 20,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5221 ;; `remove' is in CL, and we want to avoid CL dependencies.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5222 (let (newdl d)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5223 (while dirlist
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5224 (setq d (car dirlist))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5225 (setq dirlist (cdr dirlist))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5226 (unless (char-equal ?~ (aref d 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5227 (setq newdl (cons d newdl))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5228 (setq dirlist (nreverse newdl))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5229 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5230 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5231 (format (concat "while read d; "
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5232 "do if test -x $d/%s -a -f $d/%s; "
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5233 "then echo tramp_executable $d/%s; "
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5234 "break; fi; done <<'EOF'")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5235 progname progname progname))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5236 (mapcar (lambda (d)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5237 (tramp-send-command multi-method method user host d))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5238 dirlist)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5239 (tramp-send-command multi-method method user host "EOF")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5240 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5241 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5242 (when (search-backward "tramp_executable " nil t)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5243 (skip-chars-forward "^ ")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5244 (skip-chars-forward " ")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5245 (buffer-substring (point) (tramp-line-end-position)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5246
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5247 (defun tramp-set-remote-path (multi-method method user host var dirlist)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5248 "Sets the remote environment VAR to existing directories from DIRLIST.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5249 I.e., for each directory in DIRLIST, it is tested whether it exists and if
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5250 so, it is added to the environment variable VAR."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5251 (let ((existing-dirs
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5252 (mapcar
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5253 (lambda (x)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5254 (when (and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5255 (file-exists-p
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5256 (tramp-make-tramp-file-name multi-method method user host x))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5257 (file-directory-p
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5258 (tramp-make-tramp-file-name multi-method method user host x)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5259 x))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5260 dirlist)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5261 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5262 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5263 (concat var "="
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5264 (mapconcat 'identity (delq nil existing-dirs) ":")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5265 "; export " var))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5266 (tramp-wait-for-output)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5267
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5268 ;; -- communication with external shell --
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5269
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5270 (defun tramp-find-file-exists-command (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5271 "Find a command on the remote host for checking if a file exists.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5272 Here, we are looking for a command which has zero exit status if the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5273 file exists and nonzero exit status otherwise."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5274 (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
5275 (tramp-message 9 "Finding command to check if file exists")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5276 (let ((existing
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5277 (tramp-make-tramp-file-name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5278 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5279 "/")) ;assume this file always exists
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5280 (nonexisting
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5281 (tramp-make-tramp-file-name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5282 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5283 "/ this file does not exist "))) ;assume this never exists
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5284 ;; The algorithm is as follows: we try a list of several commands.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5285 ;; For each command, we first run `$cmd /' -- this should return
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5286 ;; true, as the root directory always exists. And then we run
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5287 ;; `$cmd /this\ file\ does\ not\ exist', hoping that the file indeed
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5288 ;; does not exist. This should return false. We use the first
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5289 ;; command we find that seems to work.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5290 ;; The list of commands to try is as follows:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5291 ;; `ls -d' This works on most systems, but NetBSD 1.4
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5292 ;; has a bug: `ls' always returns zero exit
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5293 ;; status, even for files which don't exist.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5294 ;; `test -e' Some Bourne shells have a `test' builtin
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5295 ;; which does not know the `-e' option.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5296 ;; `/bin/test -e' For those, the `test' binary on disk normally
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5297 ;; provides the option. Alas, the binary
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5298 ;; is sometimes `/bin/test' and sometimes it's
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5299 ;; `/usr/bin/test'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5300 ;; `/usr/bin/test -e' In case `/bin/test' does not exist.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5301 (unless (or
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5302 (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
5303 (file-exists-p existing)
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
5304 (not (file-exists-p nonexisting)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5305 (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
5306 (file-exists-p existing)
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
5307 (not (file-exists-p nonexisting)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5308 (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
5309 (file-exists-p existing)
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
5310 (not (file-exists-p nonexisting)))
46808
cf225aed7a75 Version 2.0.11 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46802
diff changeset
5311 (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
5312 (file-exists-p existing)
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
5313 (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
5314 (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
5315
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5316
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5317 ;; CCC test ksh or bash found for tilde expansion?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5318 (defun tramp-find-shell (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5319 "Find a shell on the remote host which groks tilde expansion."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5320 (let ((shell nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5321 (tramp-send-command multi-method method user host "echo ~root")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5322 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5323 (cond
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5324 ((string-match "^~root$" (buffer-string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5325 (setq shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5326 (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
5327 "bash" tramp-remote-path t)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5328 (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
5329 "ksh" tramp-remote-path t)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5330 (unless shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5331 (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
5332 ;; Find arguments for this shell.
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
5333 (let ((alist tramp-sh-extra-args)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
5334 item extra-args)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
5335 (while (and alist (null extra-args))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
5336 (setq item (pop alist))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
5337 (when (string-match (car item) shell)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
5338 (setq extra-args (cdr item))))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
5339 (when extra-args (setq shell (concat shell " " extra-args))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5340 (tramp-message
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5341 5 "Starting remote shell `%s' for tilde expansion..." shell)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5342 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5343 multi-method method user host
46801
3fafc6fca8a8 Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46799
diff changeset
5344 (concat "PS1='$ ' exec " shell)) ;
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
5345 (tramp-barf-if-no-shell-prompt
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
5346 (get-buffer-process (current-buffer))
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
5347 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
5348 (tramp-message
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
5349 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
5350 ;; 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
5351 ;; 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
5352 ;; 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
5353 ;; as well.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5354 (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
5355 tramp-rsh-end-of-line
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5356 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
5357 tramp-rsh-end-of-line
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5358 tramp-rsh-end-of-line))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5359 (tramp-wait-for-output)
46801
3fafc6fca8a8 Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46799
diff changeset
5360 (tramp-message
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
5361 9 "Setting remote shell prompt...done")
46835
df25ef3d3237 Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46808
diff changeset
5362 )
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5363 (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
5364 (tramp-get-method-parameter
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
5365 multi-method method user host 'tramp-remote-sh))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5366
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5367 (defun tramp-check-ls-command (multi-method method user host cmd)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5368 "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
5369 METHOD, USER and HOST specify the connection, CMD (the absolute file name of)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5370 the `ls' executable. Returns t if CMD supports the `-n' option, nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5371 otherwise."
56460
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
5372 (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
5373 (when (file-executable-p
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5374 (tramp-make-tramp-file-name multi-method method user host cmd))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5375 (let ((result nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5376 (tramp-message 7 "Testing remote command `%s' for -n..." cmd)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5377 (setq result
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5378 (tramp-send-command-and-check
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5379 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5380 (format "%s -lnd / >/dev/null"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5381 cmd)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5382 (tramp-message 7 "Testing remote command `%s' for -n...%s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5383 cmd
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5384 (if (zerop result) "okay" "failed"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5385 (zerop result))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5386
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5387 (defun tramp-check-ls-commands (multi-method method user host cmd dirlist)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5388 "Checks whether the given `ls' executable in one of the dirs groks `-n'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5389 Returns nil if none was found, else the command is returned."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5390 (let ((dl dirlist)
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
5391 (result nil))
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
5392 (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
5393 ;; 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
5394 ;; 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
5395 (while (and dl (not result))
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
5396 (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
5397 (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
5398 (setq result x)))
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
5399 (setq dl (cdr dl)))
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
5400 result)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5401
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5402 (defun tramp-find-ls-command (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5403 "Finds an `ls' command which groks the `-n' option, returning nil if failed.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5404 \(This option prints numeric user and group ids in a long listing.)"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5405 (tramp-message 9 "Finding a suitable `ls' command")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5406 (or
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5407 (tramp-check-ls-commands multi-method method user host "ls" tramp-remote-path)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5408 (tramp-check-ls-commands multi-method method user host "gnuls" tramp-remote-path)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5409 (tramp-check-ls-commands multi-method method user host "gls" tramp-remote-path)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5410
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
5411 ;; ------------------------------------------------------------
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
5412 ;; -- 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
5413 ;; ------------------------------------------------------------
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5414
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5415 ;; The following functions are actions to be taken when seeing certain
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5416 ;; prompts from the remote host. See the variable
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5417 ;; `tramp-actions-before-shell' for usage of these functions.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5418
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5419 (defun tramp-action-login (p multi-method method user host)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5420 "Send the login name."
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5421 (tramp-message 9 "Sending login name `%s'"
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5422 (or user (user-login-name)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5423 (erase-buffer)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5424 (process-send-string nil (concat (or user (user-login-name))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5425 tramp-rsh-end-of-line)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5426
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5427 (defun tramp-action-password (p multi-method method user host)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5428 "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
5429 (let ((pw-prompt
71de05246686 * woman.el (top): Remap `man' command by `woman' in
Michael Albinus <michael.albinus@gmx.de>
parents: 65304
diff changeset
5430 (format "Password for %s "
71de05246686 * woman.el (top): Remap `man' command by `woman' in
Michael Albinus <michael.albinus@gmx.de>
parents: 65304
diff changeset
5431 (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
5432 nil method user host ""))))
47683
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
5433 (tramp-message 9 "Sending password")
56460
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
5434 (tramp-enter-password p pw-prompt user host)))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5435
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5436 (defun tramp-action-succeed (p multi-method method user host)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5437 "Signal success in finding shell prompt."
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5438 (tramp-message 9 "Found remote shell prompt.")
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5439 (erase-buffer)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5440 (throw 'tramp-action 'ok))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5441
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5442 (defun tramp-action-permission-denied (p multi-method method user host)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5443 "Signal permission denied."
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
5444 (pop-to-buffer (tramp-get-buffer multi-method method user host))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5445 (tramp-message 9 "Permission denied by remote host.")
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5446 (kill-process p)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5447 (throw 'tramp-action 'permission-denied))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5448
74166
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
5449 (defun tramp-action-copy-failed (p multi-method method user host)
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
5450 "Signal copy failed."
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
5451 (kill-process p)
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
5452 (error "%s" (match-string 1)))
5b973e5dc882 (tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents: 74052
diff changeset
5453
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5454 (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
5455 "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
5456 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
5457 See also `tramp-action-yn'."
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5458 (save-window-excursion
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5459 (pop-to-buffer (tramp-get-buffer multi-method method user host))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5460 (unless (yes-or-no-p (match-string 0))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5461 (kill-process p)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5462 (erase-buffer)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5463 (throw 'tramp-action 'permission-denied))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5464 (process-send-string p (concat "yes" tramp-rsh-end-of-line))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5465 (erase-buffer)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5466
46992
6529728ddf05 Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46835
diff changeset
5467 (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
5468 "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
5469 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
5470 See also `tramp-action-yesno'."
6529728ddf05 Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46835
diff changeset
5471 (save-window-excursion
6529728ddf05 Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46835
diff changeset
5472 (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
5473 (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
5474 (kill-process p)
6529728ddf05 Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46835
diff changeset
5475 (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
5476 (erase-buffer)
46992
6529728ddf05 Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46835
diff changeset
5477 (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
5478
47771
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
5479 (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
5480 "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
5481 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
5482 (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
5483 tramp-terminal-type)
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
5484 (erase-buffer)
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
5485 (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
5486 tramp-rsh-end-of-line)))
ac3dfc909b56 Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47683
diff changeset
5487
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
5488 (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
5489 "Check whether a process has finished."
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
5490 (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
5491 (throw 'tramp-action 'process-died)))
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
5492
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
5493 (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
5494 "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
5495 (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
5496 (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
5497 (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
5498 (throw 'tramp-action 'ok))
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
5499 ((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
5500 (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
5501 (memq (process-status p) '(signal)))
59582
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
5502 ;; `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
5503 ;; This can be ignored.
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
5504 (goto-char (point-min))
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
5505 (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
5506 (progn
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
5507 (tramp-message 10 "'set mode' error ignored.")
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
5508 (tramp-message 9 "Process has finished.")
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
5509 (throw 'tramp-action 'ok))
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
5510 (tramp-message 9 "Process has died.")
92796330257a Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents: 59031
diff changeset
5511 (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
5512 (t nil)))
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
5513
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5514 ;; The following functions are specifically for multi connections.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5515
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5516 (defun tramp-multi-action-login (p method user host)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5517 "Send the login name."
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5518 (tramp-message 9 "Sending login name `%s'" user)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5519 (erase-buffer)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5520 (process-send-string p (concat user tramp-rsh-end-of-line)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5521
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5522 (defun tramp-multi-action-password (p method user host)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5523 "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
5524 (let ((pw-prompt
71de05246686 * woman.el (top): Remap `man' command by `woman' in
Michael Albinus <michael.albinus@gmx.de>
parents: 65304
diff changeset
5525 (format "Password for %s "
71de05246686 * woman.el (top): Remap `man' command by `woman' in
Michael Albinus <michael.albinus@gmx.de>
parents: 65304
diff changeset
5526 (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
5527 nil method user host ""))))
71de05246686 * woman.el (top): Remap `man' command by `woman' in
Michael Albinus <michael.albinus@gmx.de>
parents: 65304
diff changeset
5528 (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
5529 (tramp-enter-password p pw-prompt user host)))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5530
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5531 (defun tramp-multi-action-succeed (p method user host)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5532 "Signal success in finding shell prompt."
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5533 (tramp-message 9 "Found shell prompt on `%s'" host)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5534 (erase-buffer)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5535 (throw 'tramp-action 'ok))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5536
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5537 (defun tramp-multi-action-permission-denied (p method user host)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5538 "Signal permission denied."
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5539 (tramp-message 9 "Permission denied by remote host `%s'" host)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5540 (kill-process p)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5541 (erase-buffer)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5542 (throw 'tramp-action 'permission-denied))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5543
56460
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
5544 (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
5545 "Check whether a process has finished."
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
5546 (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
5547 (throw 'tramp-action 'process-died)))
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
5548
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5549 ;; Functions for processing the actions.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5550
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5551 (defun tramp-process-one-action (p multi-method method user host actions)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5552 "Wait for output from the shell and perform one action."
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5553 (let (found item pattern action todo)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5554 (erase-buffer)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5555 (tramp-message 9 "Waiting 60s for prompt from remote shell")
75148
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5556 (while (not found)
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5557 (tramp-accept-process-output p 1)
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5558 (goto-char (point-min))
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5559 (setq todo actions)
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5560 (while todo
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5561 (goto-char (point-min))
75148
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5562 (setq item (pop todo))
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5563 (setq pattern (symbol-value (nth 0 item)))
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5564 (setq action (nth 1 item))
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5565 (tramp-message 10 "Looking for regexp \"%s\" from remote shell"
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5566 pattern)
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5567 (when (re-search-forward (concat pattern "\\'") nil t)
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5568 (setq found (funcall action p multi-method method user host)))))
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5569 found))
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5570
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5571 (defun tramp-process-actions
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5572 (p multi-method method user host actions &optional timeout)
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5573 "Perform actions until success or TIMEOUT."
74395
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
5574 (tramp-message 10 "%s" (mapconcat 'identity (process-command p) " "))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5575 (let (exit)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5576 (while (not exit)
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
5577 (tramp-message 9 "Waiting for prompts from remote shell")
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5578 (setq exit
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5579 (catch 'tramp-action
75148
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5580 (if timeout
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5581 (with-timeout (timeout)
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5582 (tramp-process-one-action
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5583 p multi-method method user host actions))
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5584 (tramp-process-one-action
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5585 p multi-method method user host actions))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5586 nil)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5587 (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
5588 (tramp-clear-passwd user host)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5589 (error "Login failed"))))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5590
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5591 ;; For multi-actions.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5592
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5593 (defun tramp-process-one-multi-action (p method user host actions)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5594 "Wait for output from the shell and perform one action."
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5595 (let (found item pattern action todo)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5596 (erase-buffer)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5597 (tramp-message 9 "Waiting 60s for prompt from remote shell")
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5598 (with-timeout (60 (throw 'tramp-action 'timeout))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5599 (while (not found)
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
5600 (tramp-accept-process-output p 1)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5601 (setq todo actions)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5602 (goto-char (point-min))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5603 (while todo
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5604 (goto-char (point-min))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5605 (setq item (pop todo))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5606 (setq pattern (symbol-value (nth 0 item)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5607 (setq action (nth 1 item))
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
5608 (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
5609 pattern)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5610 (when (re-search-forward (concat pattern "\\'") nil t)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5611 (setq found (funcall action p method user host)))))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5612 found)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5613
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5614 (defun tramp-process-multi-actions (p method user host actions)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5615 "Perform actions until success."
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5616 (let (exit)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5617 (while (not exit)
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
5618 (tramp-message 9 "Waiting for prompts from remote shell")
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5619 (setq exit
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5620 (catch 'tramp-action
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5621 (tramp-process-one-multi-action p method user host actions)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5622 nil)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5623 (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
5624 (tramp-clear-passwd user host)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5625 (error "Login failed"))))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5626
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5627 ;; 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
5628 ;; 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
5629 ;; 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
5630 ;; 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
5631 ;; 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
5632 ;; 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
5633 ;; might be running...)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5634 (defun tramp-process-initial-commands (p
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5635 multi-method method user host
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5636 commands)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5637 "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
5638 (let (cmd)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5639 (while commands
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5640 (setq cmd (pop commands))
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5641 (erase-buffer)
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5642 (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
5643 cmd)
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
5644 (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
5645 (tramp-barf-if-no-shell-prompt
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5646 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
5647 (erase-buffer)))
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
5648
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5649 ;; The actual functions for opening connections.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5650
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5651 (defun tramp-open-connection-telnet (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5652 "Open a connection using a telnet METHOD.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5653 This starts the command `telnet HOST ARGS'[*], then waits for a remote
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5654 login prompt, then sends the user name USER, then waits for a remote
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5655 password prompt. It queries the user for the password, then sends the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5656 password to the remote host.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5657
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5658 If USER is nil, uses value returned by `(user-login-name)' instead.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5659
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
5660 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
5661 `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
5662 set up correctly.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5663
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5664 Please note that it is NOT possible to use this connection method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5665 together with an out-of-band transfer method! You must use an inline
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5666 transfer method.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5667
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5668 Maybe the different regular expressions need to be tuned.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5669
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5670 * Actually, the telnet program as well as the args to be used can be
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5671 specified in the method parameters, see the variable `tramp-methods'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5672 (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
5673 (when (tramp-method-out-of-band-p multi-method method user host)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5674 (error "Cannot use out-of-band method `%s' with telnet connection method"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5675 method))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5676 (when multi-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5677 (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
5678 (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
5679 (tramp-message 7 "Opening connection for %s@%s using %s..."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5680 (or user (user-login-name)) host method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5681 (let ((process-environment (copy-sequence process-environment)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5682 (setenv "TERM" tramp-terminal-type)
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
5683 (setenv "PS1" "$ ")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5684 (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
5685 ;; 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
5686 ;; `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
5687 ;; we use nil in these cases. Which one is right?
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5688 (coding-system-for-read (unless (and (not (featurep 'xemacs))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5689 (> emacs-major-version 20))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5690 tramp-dos-coding-system))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5691 (p (apply 'start-process
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5692 (tramp-buffer-name multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5693 (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
5694 (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
5695 multi-method
47577
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
5696 (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
5697 user host 'tramp-login-program)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5698 host
53206
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
5699 (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
5700 multi-method
47577
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
5701 (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
5702 user host 'tramp-login-args)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5703 (found nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5704 (pw nil))
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
5705 (tramp-set-process-query-on-exit-flag p nil)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5706 (set-buffer (tramp-get-buffer multi-method method user host))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5707 (erase-buffer)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5708 (tramp-process-actions p multi-method method user host
75148
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5709 tramp-actions-before-shell 60)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5710 (tramp-open-connection-setup-interactive-shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5711 p multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5712 (tramp-post-connection multi-method method user host)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5713
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
5714
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5715 (defun tramp-open-connection-rsh (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5716 "Open a connection using an rsh METHOD.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5717 This starts the command `rsh HOST -l USER'[*], then waits for a remote
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5718 password or shell prompt. If a password prompt is seen, the user is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5719 queried for a password, this function sends the password to the remote
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5720 host and waits for a shell prompt.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5721
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5722 If USER is nil, start the command `rsh HOST'[*] instead
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5723
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
5724 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
5725 `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
5726 set up correctly.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5727
46010
d07b0e5f80b9 (tramp-open-connection-rsh): Support a kludgy feature for the
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46009
diff changeset
5728 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
5729 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
5730 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
5731
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5732 * Actually, the rsh program to be used can be specified in the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5733 method parameters, see the variable `tramp-methods'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5734 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5735 (when multi-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5736 (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
5737 (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
5738 (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
5739 (tramp-message 7 "Opening connection for %s@%s using %s..."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5740 user host method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5741 (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
5742 (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
5743 (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
5744 (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
5745 (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
5746 multi-method
47577
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
5747 (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
5748 user host 'tramp-login-program))
74395
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
5749 (login-args (mapcar
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
5750 (lambda (x)
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
5751 (format-spec
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
5752 x `((?t . ,(format "/tmp/%s" tramp-temp-name-prefix)))))
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
5753 (tramp-get-method-parameter
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
5754 multi-method
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
5755 (tramp-find-method multi-method method user host)
4b5dd1d28ff0 * net/tramp.el (tramp-methods): Add "ControlPath" and
Michael Albinus <michael.albinus@gmx.de>
parents: 74166
diff changeset
5756 user host 'tramp-login-args)))
56460
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
5757 (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
5758 ;; 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
5759 ;; 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
5760 (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
5761 (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
5762 (setq real-host (match-string 1 host)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5763 (setenv "TERM" tramp-terminal-type)
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
5764 (setenv "PS1" "$ ")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5765 (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
5766 ;; 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
5767 ;; `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
5768 ;; we use nil in these cases. Which one is right?
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5769 (coding-system-for-read (unless (and (not (featurep 'xemacs))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5770 (> emacs-major-version 20))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5771 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
5772 (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
5773 (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
5774 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
5775 (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
5776 real-host login-args)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5777 (found nil))
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
5778 (tramp-set-process-query-on-exit-flag p nil)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5779
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5780 (set-buffer buf)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5781 (tramp-process-actions p multi-method method user host
75148
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5782 tramp-actions-before-shell 60)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5783 (tramp-message 7 "Initializing remote shell")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5784 (tramp-open-connection-setup-interactive-shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5785 p multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5786 (tramp-post-connection multi-method method user host)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5787
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5788 (defun tramp-open-connection-su (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5789 "Open a connection using the `su' program with METHOD.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5790 This starts `su - USER', then waits for a password prompt. The HOST
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5791 name must be equal to the local host name or to `localhost'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5792
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5793 If USER is nil, uses value returned by user-login-name instead.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5794
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
5795 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
5796 `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
5797 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
5798 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
5799 `shell-prompt-pattern' is set up wrongly!"
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5800 (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
5801 (when (tramp-method-out-of-band-p multi-method method user host)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5802 (error "Cannot use out-of-band method `%s' with `su' connection method"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5803 method))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5804 (unless (or (string-match (concat "^" (regexp-quote host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5805 (system-name))
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
5806 (string= "localhost" host)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
5807 (string= "" host))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5808 (error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5809 "Cannot connect to different host `%s' with `su' connection method"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5810 host))
62344
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
5811 (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
5812 (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
5813 (or user "<root>") method)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5814 (let ((process-environment (copy-sequence process-environment)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5815 (setenv "TERM" tramp-terminal-type)
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
5816 (setenv "PS1" "$ ")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5817 (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
5818 ;; 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
5819 ;; 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
5820 ;; cases. What's the difference? Which one is right?
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5821 (coding-system-for-read (unless (and (not (featurep 'xemacs))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5822 (> emacs-major-version 20))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5823 tramp-dos-coding-system))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5824 (p (apply 'start-process
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5825 (tramp-buffer-name multi-method method user host)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5826 (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
5827 (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
5828 multi-method
47577
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
5829 (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
5830 user host 'tramp-login-program)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5831 (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
5832 (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
5833 (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
5834 (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
5835 multi-method
47577
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
5836 (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
5837 user host 'tramp-login-args))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5838 (found nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5839 (pw nil))
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
5840 (tramp-set-process-query-on-exit-flag p nil)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5841 (set-buffer (tramp-get-buffer multi-method method user host))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5842 (tramp-process-actions p multi-method method user host
75148
bdffb0038313 * net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents: 75007
diff changeset
5843 tramp-actions-before-shell 60)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5844 (tramp-open-connection-setup-interactive-shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5845 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
5846 (tramp-post-connection multi-method method
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5847 user host)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5848
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
5849 ;; HHH: Not Changed. Multi method. It is not clear to me how this can
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5850 ;; handle not giving a user name in the "file name".
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5851 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5852 ;; This is more difficult than for the single-hop method. In the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5853 ;; multi-hop-method, the desired behaviour should be that the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5854 ;; user must specify names for the telnet hops of which the user
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5855 ;; name is different than the "original" name (or different from
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5856 ;; the previous hop.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5857 (defun tramp-open-connection-multi (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5858 "Open a multi-hop connection using METHOD.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5859 This uses a slightly changed file name syntax. The idea is to say
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5860 [multi/telnet:u1@h1/rsh:u2@h2]/path/to/file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5861 This will use telnet to log in as u1 to h1, then use rsh from there to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5862 log in as u2 to h2."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5863 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5864 (unless multi-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5865 (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
5866 (when (tramp-method-out-of-band-p multi-method method user host)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5867 (error "No out of band multi-hop connections"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5868 (unless (and (arrayp method) (not (stringp method)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5869 (error "METHOD must be an array of strings for multi methods"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5870 (unless (and (arrayp user) (not (stringp user)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5871 (error "USER must be an array of strings for multi methods"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5872 (unless (and (arrayp host) (not (stringp host)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5873 (error "HOST must be an array of strings for multi methods"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5874 (unless (and (= (length method) (length user))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5875 (= (length method) (length host)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5876 (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
5877 (tramp-pre-connection multi-method method user host tramp-chunksize)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5878 (tramp-message 7 "Opening `%s' connection..." multi-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5879 (let ((process-environment (copy-sequence process-environment)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5880 (setenv "TERM" tramp-terminal-type)
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
5881 (setenv "PS1" "$ ")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5882 (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
5883 ;; 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
5884 ;; 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
5885 ;; cases. What's the difference? Which one is right?
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5886 (coding-system-for-read (unless (and (not (featurep 'xemacs))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5887 (> emacs-major-version 20))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5888 tramp-dos-coding-system))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5889 (p (start-process (tramp-buffer-name multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5890 (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
5891 tramp-multi-sh-program))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5892 (num-hops (length method))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5893 (i 0))
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
5894 (tramp-set-process-query-on-exit-flag p nil)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5895 (tramp-message 9 "Waiting 60s for local shell to come up...")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5896 (unless (tramp-wait-for-regexp
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
5897 p 60 (format "\\(%s\\)\\'\\|\\(%s\\)\\'"
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
5898 shell-prompt-pattern tramp-shell-prompt-pattern))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5899 (pop-to-buffer (buffer-name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5900 (kill-process p)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5901 (error "Couldn't find local shell prompt"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5902 ;; Now do all the connections as specified.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5903 (while (< i num-hops)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5904 (let* ((m (aref method i))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5905 (u (aref user i))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5906 (h (aref host i))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5907 (entry (assoc m tramp-multi-connection-function-alist))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5908 (multi-func (nth 1 entry))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5909 (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
5910 ;; The multi-funcs don't need to do save-match-data, as that
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5911 ;; is done here.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5912 (funcall multi-func p m u h command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5913 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5914 (incf i)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5915 (tramp-open-connection-setup-interactive-shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5916 p multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5917 (tramp-post-connection multi-method method user host)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5918
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5919 ;; 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
5920 ;; of no user name provided. Hack to make it work as it did before:
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5921 ;; changed `user' to `(or user (user-login-name))' in the places where
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5922 ;; the value is actually used.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5923 (defun tramp-multi-connect-telnet (p method user host command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5924 "Issue `telnet' command.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5925 Uses shell COMMAND to issue a `telnet' command to log in as USER to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5926 HOST. You can use percent escapes in COMMAND: `%h' is replaced with
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5927 the host name, and `%n' is replaced with an end of line character, as
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5928 set in `tramp-rsh-end-of-line'. Use `%%' if you want a literal percent
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5929 character.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5930
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5931 If USER is nil, uses the return value of (user-login-name) instead."
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5932 (let ((cmd (format-spec command
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5933 `((?h . ,host) (?n . ,tramp-rsh-end-of-line))))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5934 (cmd1 (format-spec command `((?h . ,host) (?n . ""))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5935 found pw)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5936 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5937 (tramp-message 9 "Sending telnet command `%s'" cmd1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5938 (process-send-string p cmd)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5939 (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
5940 tramp-multi-actions)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5941
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
5942 ;; 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
5943 ;; of no user name provided. Hack to make it work as it did before:
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5944 ;; changed `user' to `(or user (user-login-name))' in the places where
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5945 ;; the value is actually used.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5946 (defun tramp-multi-connect-rlogin (p method user host command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5947 "Issue `rlogin' command.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5948 Uses shell COMMAND to issue an `rlogin' command to log in as USER to
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5949 HOST. You can use percent escapes in COMMAND. `%u' will be replaced
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5950 with the user name, `%h' will be replaced with the host name, and `%n'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5951 will be replaced with the value of `tramp-rsh-end-of-line'. You can use
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5952 `%%' if you want to use a literal percent character.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5953
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5954 If USER is nil, uses the return value of (user-login-name) instead."
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5955 (let ((cmd (format-spec command `((?h . ,host)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5956 (?u . ,(or user (user-login-name)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5957 (?n . ,tramp-rsh-end-of-line))))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5958 (cmd1 (format-spec command `((?h . ,host)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5959 (?u . ,(or user (user-login-name)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5960 (?n . ""))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5961 found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5962 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5963 (tramp-message 9 "Sending rlogin command `%s'" cmd1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5964 (process-send-string p cmd)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5965 (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
5966 tramp-multi-actions)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5967
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
5968 ;; 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
5969 ;; of no user name provided. Hack to make it work as it did before:
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5970 ;; changed `user' to `(or user (user-login-name))' in the places where
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5971 ;; the value is actually used.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5972 (defun tramp-multi-connect-su (p method user host command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5973 "Issue `su' command.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5974 Uses shell COMMAND to issue a `su' command to log in as USER on
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5975 HOST. The HOST name is ignored, this just changes the user id on the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5976 host currently logged in to.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5977
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5978 If USER is nil, uses the return value of (user-login-name) instead.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5979
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5980 You can use percent escapes in the COMMAND. `%u' is replaced with the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5981 user name, and `%n' is replaced with the value of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5982 `tramp-rsh-end-of-line'. Use `%%' if you want a literal percent
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5983 character."
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5984 (let ((cmd (format-spec command `((?u . ,(or user (user-login-name)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5985 (?n . ,tramp-rsh-end-of-line))))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5986 (cmd1 (format-spec command `((?u . ,(or user (user-login-name)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5987 (?n . ""))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5988 found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5989 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5990 (tramp-message 9 "Sending su command `%s'" cmd1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5991 (process-send-string p cmd)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
5992 (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
5993 tramp-multi-actions)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5994
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5995 ;; Utility functions.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
5996
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
5997 (defun tramp-accept-process-output
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
5998 (&optional process timeout timeout-msecs)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
5999 "Like `accept-process-output' for Tramp processes.
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
6000 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
6001 for process communication also."
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
6002 (let (last-coding-system-used)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
6003 (accept-process-output process timeout timeout-msecs)))
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
6004
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6005 (defun tramp-wait-for-regexp (proc timeout regexp)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6006 "Wait for a REGEXP to appear from process PROC within TIMEOUT seconds.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6007 Expects the output of PROC to be sent to the current buffer. Returns
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6008 the string that matched, or nil. Waits indefinitely if TIMEOUT is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6009 nil."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6010 (let ((found nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6011 (start-time (current-time)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6012 (cond (timeout
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6013 ;; Work around a bug in XEmacs 21, where the timeout
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6014 ;; expires faster than it should. This degenerates
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6015 ;; to polling for buggy XEmacsen, but oh, well.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6016 (while (and (not found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6017 (< (tramp-time-diff (current-time) start-time)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6018 timeout))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6019 (with-timeout (timeout)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6020 (while (not found)
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
6021 (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
6022 (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
6023 (error "Process has died"))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6024 (goto-char (point-min))
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
6025 (setq found (re-search-forward regexp nil t))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6026 (t
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6027 (while (not found)
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
6028 (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
6029 (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
6030 (error "Process has died"))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6031 (goto-char (point-min))
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
6032 (setq found (re-search-forward regexp nil t)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6033 (when tramp-debug-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6034 (append-to-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6035 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6036 tramp-current-user tramp-current-host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6037 (point-min) (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6038 (when (not found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6039 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6040 (set-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6041 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6042 tramp-current-user tramp-current-host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6043 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6044 (insert "[[Regexp `" regexp "' not found"
46048
05db6f1e91ca (tramp-file-name-structure)
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46010
diff changeset
6045 (if timeout (format " in %d secs" timeout) "")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6046 "]]"))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6047 found))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6048
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6049 (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
6050 "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
6051 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
6052 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
6053 and `tramp-shell-prompt-pattern'."
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6054 (tramp-wait-for-regexp
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6055 proc timeout
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6056 (format "\\(%s\\|%s\\)\\'"
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6057 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
6058
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6059 (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
6060 "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
6061 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
6062 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
6063 (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
6064 (pop-to-buffer (buffer-name))
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6065 (apply 'error error-args)))
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6066
56460
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
6067 (defun tramp-enter-password (p prompt user host)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6068 "Prompt for a password and send it to the remote end.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6069 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
6070 (let ((pw (tramp-read-passwd user host prompt)))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6071 (erase-buffer)
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
6072 (process-send-string
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
6073 p (concat pw
53206
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
6074 (or (tramp-get-method-parameter
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
6075 tramp-current-multi-method
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
6076 tramp-current-method
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
6077 tramp-current-user
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
6078 tramp-current-host
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
6079 'tramp-password-end-of-line)
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
6080 tramp-default-password-end-of-line)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6081
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6082 ;; HHH: Not Changed. This might handle the case where USER is not
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6083 ;; 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
6084 ;; 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
6085 (defun tramp-pre-connection (multi-method method user host chunksize)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6086 "Do some setup before actually logging in.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6087 METHOD, USER and HOST specify the connection."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6088 (set-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6089 (set (make-local-variable 'tramp-current-multi-method) multi-method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6090 (set (make-local-variable 'tramp-current-method) method)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6091 (set (make-local-variable 'tramp-current-user) user)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6092 (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
6093 (set (make-local-variable 'tramp-chunksize) chunksize)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6094 (set (make-local-variable 'inhibit-eol-conversion) nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6095 (erase-buffer))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6096
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6097 (defun tramp-open-connection-setup-interactive-shell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6098 (p multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6099 "Set up an interactive shell.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6100 Mainly sets the prompt and the echo correctly. P is the shell process
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6101 to set up. METHOD, USER and HOST specify the connection."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6102 ;; Wait a bit in case the remote end feels like sending a little
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6103 ;; junk first. It seems that fencepost.gnu.org does this when doing
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6104 ;; a Kerberos login.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6105 (sit-for 1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6106 (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
6107 (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
6108 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
6109 ;; 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
6110 ;; 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
6111 ;; 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
6112 ;; 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
6113 ;; 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
6114 ;; 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
6115 ;; 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
6116 ;; 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
6117 ;; 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
6118 ;; 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
6119 ;; 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
6120 ;; clobbering $PS1.
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6121 (tramp-send-command-internal
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6122 multi-method method user host
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6123 (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
6124 (tramp-get-method-parameter
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
6125 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
6126 (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
6127 (tramp-get-method-parameter
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
6128 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
6129 (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
6130 p 30
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6131 "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
6132 (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
6133 (buffer-name))
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6134 (tramp-message 8 "Setting up remote shell environment")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6135 (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
6136 (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
6137 "stty -inlcr -echo kill '^U'")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6138 (erase-buffer)
55420
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
6139 ;; 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
6140 (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
6141 "echo foo")
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
6142 (erase-buffer)
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6143 (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
6144 "TERM=dumb; export TERM")
62344
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
6145 (erase-buffer)
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
6146 ;; 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
6147 ;; 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
6148 ;; 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
6149 ;; 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
6150 ;; handle remote hosts, though.
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
6151 (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
6152 (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
6153 (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
6154 "(uname -sr) 2>/dev/null")
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
6155 (goto-char (point-min))
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
6156 (when (looking-at "FreeBSD")
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
6157 (setq tramp-chunksize 500)))
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
6158
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6159 ;; Try to set up the coding system correctly.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6160 ;; CCC this can't be the right way to do it. Hm.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6161 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6162 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6163 (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
6164 (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
6165 "echo foo ; echo bar")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6166 (goto-char (point-min))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6167 (if (featurep 'mule)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6168 ;; Use MULE to select the right EOL convention for communicating
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6169 ;; with the process.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6170 (let* ((cs (or (process-coding-system p) (cons 'undecided 'undecided)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6171 cs-decode cs-encode)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6172 (when (symbolp cs) (setq cs (cons cs cs)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6173 (setq cs-decode (car cs))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6174 (setq cs-encode (cdr cs))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6175 (unless cs-decode (setq cs-decode 'undecided))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6176 (unless cs-encode (setq cs-encode 'undecided))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6177 (setq cs-encode (tramp-coding-system-change-eol-conversion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6178 cs-encode 'unix))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6179 (when (search-forward "\r" nil t)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6180 (setq cs-decode (tramp-coding-system-change-eol-conversion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6181 cs-decode 'dos)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6182 (set-buffer-process-coding-system cs-decode cs-encode))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6183 ;; Look for ^M and do something useful if found.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6184 (when (search-forward "\r" nil t)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6185 ;; We have found a ^M but cannot frob the process coding system
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6186 ;; because we're running on a non-MULE Emacs. Let's try
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6187 ;; stty, instead.
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
6188 (erase-buffer)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6189 (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
6190 (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
6191 "stty -onlcr"))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6192 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6193 (tramp-message
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
6194 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
6195 (tramp-send-command-internal
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
6196 multi-method method user host
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
6197 "HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6198 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6199 (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
6200 (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
6201 "set +o vi +o emacs")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6202 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6203 (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
6204 (tramp-send-command-internal
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6205 multi-method method user host
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6206 "unset MAIL MAILCHECK MAILPATH 1>/dev/null 2>/dev/null")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6207 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6208 (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
6209 (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
6210 "unset CDPATH")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6211 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6212 (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
6213 ;; 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
6214 ;; 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
6215 ;; 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
6216 ;; "echo are you awake".
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
6217 (setq tramp-last-cmd-time (current-time))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6218 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6219 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6220 (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
6221 tramp-rsh-end-of-line
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6222 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
6223 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
6224 (tramp-wait-for-output))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6225
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6226 (defun tramp-post-connection (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6227 "Prepare a remote shell before being able to work on it.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6228 METHOD, USER and HOST specify the connection.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6229 Among other things, this finds a shell which groks tilde expansion,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6230 tries to find an `ls' command which groks the `-n' option, sets the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6231 locale to C and sets up the remote shell search path."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6232 ;; Search for a good shell before searching for a command which
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6233 ;; checks if a file exists. This is done because Tramp wants to use
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6234 ;; "test foo; echo $?" to check if various conditions hold, and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6235 ;; there are buggy /bin/sh implementations which don't execute the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6236 ;; "echo $?" part if the "test" part has an error. In particular,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6237 ;; the Solaris /bin/sh is a problem. I'm betting that all systems
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6238 ;; with buggy /bin/sh implementations will have a working bash or
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6239 ;; ksh. Whee...
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6240 (tramp-find-shell multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6241 ;; Without (sit-for 0.1) at least, my machine will almost always blow
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6242 ;; up on 'not numberp /root' - a race that causes the 'echo ~root'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6243 ;; output of (tramp-find-shell) to show up along with the output of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6244 ;; (tramp-find-ls-command) testing.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6245 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6246 ;; I can't work out why this is a problem though. The (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6247 ;; call in (tramp-find-shell) *should* make this not happen, I thought.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6248 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6249 ;; After much debugging I couldn't find any problem with the implementation
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6250 ;; of that function though. The workaround stays for me at least. :/
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6251 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6252 ;; Daniel Pittman <daniel@danann.net>
46802
10aa49b3d28a Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46801
diff changeset
6253 (sleep-for 1)
46808
cf225aed7a75 Version 2.0.11 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46802
diff changeset
6254 (erase-buffer)
46802
10aa49b3d28a Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46801
diff changeset
6255 (tramp-find-file-exists-command multi-method method user host)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6256 (make-local-variable 'tramp-ls-command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6257 (setq tramp-ls-command (tramp-find-ls-command multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6258 (unless tramp-ls-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6259 (tramp-message
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6260 1
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6261 "Danger! Couldn't find ls which groks -n. Muddling through anyway")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6262 (setq tramp-ls-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6263 (tramp-find-executable multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6264 "ls" tramp-remote-path nil)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6265 (unless tramp-ls-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6266 (error "Fatal error: Couldn't find remote executable `ls'"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6267 (tramp-message 5 "Using remote command `%s' for getting directory listings"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6268 tramp-ls-command)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6269 (tramp-send-command multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6270 (concat "tramp_set_exit_status () {" tramp-rsh-end-of-line
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6271 "return $1" tramp-rsh-end-of-line
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6272 "}"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6273 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6274 ;; Set remote PATH variable.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6275 (tramp-set-remote-path multi-method method user host "PATH" tramp-remote-path)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6276 ;; Tell remote shell to use standard time format, needed for
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6277 ;; parsing `ls -l' output.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6278 (tramp-send-command multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6279 "LC_TIME=C; export LC_TIME; echo huhu")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6280 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6281 (tramp-send-command multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6282 "mesg n; echo huhu")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6283 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6284 (tramp-send-command multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6285 "biff n ; echo huhu")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6286 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6287 ;; Unalias ls(1) to work around issues with those silly people who make it
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6288 ;; spit out ANSI escapes or whatever.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6289 (tramp-send-command multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6290 "unalias ls; echo huhu")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6291 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6292 ;; Does `test A -nt B' work? Use abominable `find' construct if it
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6293 ;; doesn't. BSD/OS 4.0 wants the parentheses around the command,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6294 ;; for otherwise the shell crashes.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6295 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6296 (make-local-variable 'tramp-test-groks-nt)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6297 (tramp-send-command multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6298 "( test / -nt / )")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6299 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6300 (goto-char (point-min))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6301 (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
6302 (looking-at (format "\n%s\r?\n" (regexp-quote tramp-end-of-output))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6303 (unless tramp-test-groks-nt
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6304 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6305 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6306 (concat "tramp_test_nt () {" tramp-rsh-end-of-line
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6307 "test -n \"`find $1 -prune -newer $2 -print`\"" tramp-rsh-end-of-line
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6308 "}")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6309 (tramp-wait-for-output)
46802
10aa49b3d28a Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46801
diff changeset
6310 ;; Send the fallback `uudecode' script.
10aa49b3d28a Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46801
diff changeset
6311 (erase-buffer)
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6312 (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
6313 (tramp-wait-for-output)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6314 ;; Find a `perl'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6315 (erase-buffer)
58540
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6316 (tramp-set-connection-property "perl-scripts" nil multi-method method user host)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6317 (let ((tramp-remote-perl
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6318 (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
6319 "perl5" tramp-remote-path nil)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6320 (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
6321 "perl" tramp-remote-path nil))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6322 (when tramp-remote-perl
46802
10aa49b3d28a Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46801
diff changeset
6323 (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
6324 multi-method method user host)
58540
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6325 (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
6326 (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
6327 (tramp-send-string
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6328 multi-method method user host
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6329 (concat "tramp_encode () {\n"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6330 (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
6331 " 2>/dev/null"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6332 "\n}"))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6333 (tramp-wait-for-output)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6334 (tramp-send-string
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6335 multi-method method user host
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6336 (concat "tramp_encode_with_module () {\n"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6337 (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
6338 " 2>/dev/null"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6339 "\n}"))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6340 (tramp-wait-for-output)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6341 (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
6342 (tramp-send-string
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6343 multi-method method user host
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6344 (concat "tramp_decode () {\n"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6345 (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
6346 " 2>/dev/null"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6347 "\n}"))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6348 (tramp-wait-for-output)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6349 (tramp-send-string
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6350 multi-method method user host
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6351 (concat "tramp_decode_with_module () {\n"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6352 (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
6353 " 2>/dev/null"
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6354 "\n}"))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6355 (tramp-wait-for-output))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6356 ;; Find ln(1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6357 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6358 (let ((ln (tramp-find-executable multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6359 "ln" tramp-remote-path nil)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6360 (when ln
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6361 (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
6362 ;; Set uid and gid.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6363 (erase-buffer)
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
6364 (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
6365 (tramp-wait-for-output)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
6366 (goto-char (point-min))
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
6367 (tramp-set-connection-property
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
6368 "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
6369 (tramp-set-connection-property
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
6370 "gid" (read (current-buffer)) multi-method method user host)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6371 ;; 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
6372 (erase-buffer)
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
6373 (unless (tramp-method-out-of-band-p multi-method method user host)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6374 (tramp-find-inline-encoding multi-method method user host))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6375 ;; If encoding/decoding command are given, test to see if they work.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6376 ;; CCC: Maybe it would be useful to run the encoder both locally and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6377 ;; 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
6378 (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
6379 (rem-dec (tramp-get-remote-decoding multi-method method user host))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6380 (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
6381 (when (and (or rem-dec rem-enc) (not (and rem-dec rem-enc)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6382 (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
6383 ;; Improve error message and/or error check.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6384 (error
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6385 "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
6386 (when (and rem-enc rem-dec)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6387 (tramp-message
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6388 5
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6389 "Checking to see if encoding/decoding commands work on remote host...")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6390 (tramp-send-command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6391 multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6392 (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
6393 (tramp-shell-quote-argument magic-string) rem-enc rem-dec))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6394 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6395 (unless (looking-at (regexp-quote magic-string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6396 (tramp-kill-process multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6397 (error "Remote host cannot execute de/encoding commands. See buffer `%s' for details"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6398 (buffer-name)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6399 (erase-buffer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6400 (tramp-message
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6401 5 "Checking to see if encoding/decoding commands work on remote host...done"))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6402
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6403 ;; CCC: We should either implement a Perl version of base64 encoding
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6404 ;; and decoding. Then we just use that in the last item. The other
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6405 ;; alternative is to use the Perl version of UU encoding. But then
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6406 ;; 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
6407 ;;
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6408 ;; 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
6409 ;; 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
6410 ;; 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
6411 ;; 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
6412 ;; 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
6413 ;; 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
6414 ;; 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
6415 ;; 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
6416 ;;
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6417 ;; 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
6418 ;;
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6419 ;; 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
6420
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6421 (defvar tramp-coding-commands
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6422 '(("mimencode -b" "mimencode -u -b"
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6423 base64-encode-region base64-decode-region)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6424 ("mmencode -b" "mmencode -u -b"
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6425 base64-encode-region base64-decode-region)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6426 ("recode data..base64" "recode base64..data"
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6427 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
6428 ("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
6429 tramp-uuencode-region uudecode-decode-region)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6430 ("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
6431 tramp-uuencode-region uudecode-decode-region)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6432 ("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
6433 tramp-uuencode-region uudecode-decode-region)
46802
10aa49b3d28a Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46801
diff changeset
6434 ("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
6435 tramp-uuencode-region uudecode-decode-region)
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
6436 ("tramp_encode_with_module" "tramp_decode_with_module"
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
6437 base64-encode-region base64-decode-region)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6438 ("tramp_encode" "tramp_decode"
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6439 base64-encode-region base64-decode-region))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6440 "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
6441 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
6442
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6443 \(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
6444
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6445 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
6446 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
6447 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
6448 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
6449 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
6450
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6451 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
6452 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
6453 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
6454 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
6455 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
6456 input.
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6457
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6458 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
6459 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
6460 with the encoded or decoded results, respectively.")
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6461
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6462 (defun tramp-find-inline-encoding (multi-method method user host)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6463 "Find an inline transfer encoding that works.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6464 Goes through the list `tramp-coding-commands'."
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6465 (let ((commands tramp-coding-commands)
47683
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
6466 (magic "xyzzy")
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6467 item found)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6468 (while (and commands (null found))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6469 (setq item (pop commands))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6470 (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
6471 (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
6472 (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
6473 (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
6474 (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
6475 ;; 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
6476 ;; 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
6477 ;; 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
6478 ;; 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
6479 ;; 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
6480 ;; 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
6481 ;; 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
6482 ;; it might change the permissions of /dev/null!
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6483 (tramp-message-for-buffer
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
6484 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
6485 "Checking remote encoding command `%s' for sanity" rem-enc)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6486 (unless (zerop (tramp-send-command-and-check
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6487 multi-method method user host
47683
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
6488 (format "%s </dev/null" rem-enc) t))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6489 (throw 'wont-work nil))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6490 (tramp-message-for-buffer
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
6491 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
6492 "Checking remote decoding command `%s' for sanity" rem-dec)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6493 (unless (zerop (tramp-send-command-and-check
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6494 multi-method method user host
47683
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
6495 (format "echo %s | %s | %s"
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
6496 magic rem-enc rem-dec) t))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6497 (throw 'wont-work nil))
47683
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
6498 (save-excursion
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
6499 (goto-char (point-min))
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
6500 (unless (looking-at (regexp-quote magic))
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
6501 (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
6502 ;; 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
6503 ;; 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
6504 (when (stringp loc-enc)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6505 (tramp-message-for-buffer
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
6506 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
6507 "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
6508 (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
6509 loc-enc nil nil))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6510 (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
6511 (when (stringp loc-dec)
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6512 (tramp-message-for-buffer
46998
9d6aef07c793 Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46992
diff changeset
6513 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
6514 "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
6515 (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
6516 loc-dec nil nil))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6517 (throw 'wont-work nil)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6518 ;; CCC: At this point, maybe we should check that the output
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6519 ;; of the commands is correct. But for the moment we will
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6520 ;; assume that commands working on empty input will also
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6521 ;; work in practice.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6522 (setq found item))))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6523 ;; Did we find something? If not, issue error. If so,
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6524 ;; set connection properties.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6525 (unless found
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6526 (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
6527 (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
6528 (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
6529 (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
6530 (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
6531 (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
6532 (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
6533 (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
6534 (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
6535 (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
6536 (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
6537 (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
6538 (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
6539
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6540 (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
6541 "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
6542 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
6543 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
6544 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
6545 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
6546 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
6547 means discard it)."
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6548 (call-process
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6549 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
6550 (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
6551 input) ;input
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6552 (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
6553 nil ;redisplay
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6554 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
6555 ;; actual shell command
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6556 (concat
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6557 (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
6558 (if (stringp output) (concat "> " output) ""))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6559
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6560 (defun tramp-maybe-open-connection (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6561 "Maybe open a connection to HOST, logging in as USER, using METHOD.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6562 Does not do anything if a connection is already open, but re-opens the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6563 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
6564 (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
6565 (tramp-get-buffer multi-method method user host)))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6566 last-cmd-time)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6567 ;; If too much time has passed since last command was sent, look
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6568 ;; whether process is still alive. If it isn't, kill it. When
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6569 ;; using ssh, it can sometimes happen that the remote end has hung
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6570 ;; up but the local ssh client doesn't recognize this until it
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6571 ;; tries to send some data to the remote end. So that's why we
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6572 ;; try to send a command from time to time, then look again
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6573 ;; whether the process is really alive.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6574 (save-excursion
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6575 (set-buffer (tramp-get-buffer multi-method method user host))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6576 (when (and tramp-last-cmd-time
47683
9597eaa105a1 Version 2.0.24 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47584
diff changeset
6577 (> (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
6578 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
6579 (tramp-send-command
df25ef3d3237 Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46808
diff changeset
6580 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
6581 (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
6582 (tramp-wait-for-output 10))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6583 (delete-process p)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6584 (setq p nil))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6585 (erase-buffer)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6586 (unless (and p (processp p) (memq (process-status p) '(run open)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6587 (when (and p (processp p))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6588 (delete-process p))
54198
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
6589 (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
6590 (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
6591 multi-method
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
6592 (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
6593 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
6594 multi-method method user host)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6595
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6596 (defun tramp-send-command
46835
df25ef3d3237 Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46808
diff changeset
6597 (multi-method method user host command &optional noerase neveropen)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6598 "Send the COMMAND to USER at HOST (logged in using METHOD).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6599 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
6600 is true).
df25ef3d3237 Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46808
diff changeset
6601 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
6602 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
6603 `tramp-maybe-open-connection' only."
df25ef3d3237 Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46808
diff changeset
6604 (or neveropen
df25ef3d3237 Version 2.0.12 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46808
diff changeset
6605 (tramp-maybe-open-connection multi-method method user host))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
6606 (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
6607 (setq tramp-last-cmd command)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6608 (when tramp-debug-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6609 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6610 (set-buffer (tramp-get-debug-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6611 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6612 (tramp-insert-with-face 'bold (format "$ %s\n" command))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6613 (let ((proc nil))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6614 (set-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6615 (unless noerase (erase-buffer))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6616 (setq proc (get-buffer-process (current-buffer)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6617 (process-send-string proc
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6618 (concat command tramp-rsh-end-of-line))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6619
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6620 (defun tramp-send-command-internal
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6621 (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
6622 "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
6623 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
6624 (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
6625 (when msg
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6626 (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
6627 (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
6628 nil 30
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
6629 "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
6630
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6631 (defun tramp-wait-for-output (&optional timeout)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6632 "Wait for output from remote rsh command."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6633 (let ((proc (get-buffer-process (current-buffer)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6634 (found nil)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6635 (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
6636 (start-point (point))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6637 (end-of-output (concat "^"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6638 (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
6639 "\r?$")))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6640 ;; Algorithm: get waiting output. See if last line contains
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6641 ;; end-of-output sentinel. If not, wait a bit and again get
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6642 ;; waiting output. Repeat until timeout expires or end-of-output
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6643 ;; sentinel is seen. Will hang if timeout is nil and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6644 ;; end-of-output sentinel never appears.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6645 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6646 (cond (timeout
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6647 ;; Work around an XEmacs bug, where the timeout expires
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6648 ;; faster than it should. This degenerates into polling
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6649 ;; for buggy XEmacsen, but oh, well.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6650 (while (and (not found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6651 (< (tramp-time-diff (current-time) start-time)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6652 timeout))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6653 (with-timeout (timeout)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6654 (while (not found)
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
6655 (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
6656 (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
6657 (error "Process has died"))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6658 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6659 (forward-line -1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6660 (setq found (looking-at end-of-output))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6661 (t
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6662 (while (not found)
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
6663 (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
6664 (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
6665 (error "Process has died"))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6666 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6667 (forward-line -1)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6668 (setq found (looking-at end-of-output))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6669 ;; At this point, either the timeout has expired or we have found
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6670 ;; the end-of-output sentinel.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6671 (when found
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6672 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6673 (forward-line -2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6674 (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
6675 ;; 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
6676 (when tramp-process-echoes
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
6677 (save-excursion
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
6678 (goto-char start-point)
c44f9de543e3 2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 54198
diff changeset
6679 (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
6680 (delete-region (point) (progn (forward-line 1) (point))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6681 ;; Add output to debug buffer if appropriate.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6682 (when tramp-debug-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6683 (append-to-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6684 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6685 tramp-current-user tramp-current-host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6686 (point-min) (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6687 (when (not found)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6688 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6689 (set-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6690 (tramp-get-debug-buffer tramp-current-multi-method tramp-current-method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6691 tramp-current-user tramp-current-host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6692 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6693 (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
6694 (if timeout (format " in %d secs" timeout) "")
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6695 "]]"))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6696 (goto-char (point-min))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6697 ;; Return value is whether end-of-output sentinel was found.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6698 found))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6699
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6700 (defun tramp-send-command-and-check (multi-method method user host command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6701 &optional subshell)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6702 "Run COMMAND and check its exit status.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6703 MULTI-METHOD and METHOD specify how to log in (as USER) to the remote HOST.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6704 Sends `echo $?' along with the COMMAND for checking the exit status. If
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6705 COMMAND is nil, just sends `echo $?'. Returns the exit status found.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6706
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6707 If the optional argument SUBSHELL is non-nil, the command is executed in
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6708 a subshell, ie surrounded by parentheses."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6709 (tramp-send-command multi-method method user host
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6710 (concat (if subshell "( " "")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6711 command
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6712 (if command " 2>/dev/null; " "")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6713 "echo tramp_exit_status $?"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6714 (if subshell " )" " ")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6715 (tramp-wait-for-output)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6716 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6717 (unless (search-backward "tramp_exit_status " nil t)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6718 (error "Couldn't find exit status of `%s'" command))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6719 (skip-chars-forward "^ ")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6720 (read (current-buffer)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6721
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6722 (defun tramp-barf-unless-okay (multi-method method user host command subshell
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6723 signal fmt &rest args)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6724 "Run COMMAND, check exit status, throw error if exit status not okay.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6725 Similar to `tramp-send-command-and-check' but accepts two more arguments
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6726 FMT and ARGS which are passed to `error'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6727 (unless (zerop (tramp-send-command-and-check
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6728 multi-method method user host command subshell))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6729 ;; CCC: really pop-to-buffer? Maybe it's appropriate to be more
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6730 ;; silent.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6731 (pop-to-buffer (current-buffer))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6732 (funcall 'signal signal (apply 'format fmt args))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6733
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6734 ;; 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
6735 ;; 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
6736 ;; `file-attributes' implementation, for instance.) Therefore, we
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6737 ;; 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
6738 (defun tramp-send-string
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6739 (multi-method method user host string)
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6740 "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
6741
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6742 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
6743 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
6744 `tramp-rsh-end-of-line'."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6745 (let ((proc (get-buffer-process
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6746 (tramp-get-buffer multi-method method user host))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6747 (unless proc
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6748 (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
6749 ;; debug message
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6750 (when tramp-debug-buffer
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6751 (save-excursion
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6752 (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
6753 (goto-char (point-max))
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6754 (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
6755 ;; 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
6756 (setq string
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6757 (mapconcat 'identity
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6758 (split-string string "\n")
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6759 tramp-rsh-end-of-line))
50432
7d56636afc9c (tramp-send-string): Handle empty string.
Andreas Schwab <schwab@suse.de>
parents: 50338
diff changeset
6760 (unless (or (string= string "")
7d56636afc9c (tramp-send-string): Handle empty string.
Andreas Schwab <schwab@suse.de>
parents: 50338
diff changeset
6761 (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
6762 (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
6763 ;; 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
6764 (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
6765 (let ((pos 0)
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6766 (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
6767 (while (< pos end)
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
6768 (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
6769 multi-method method user host 10
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6770 "Sending chunk from %s to %s"
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6771 pos (min (+ pos tramp-chunksize) end))
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6772 (process-send-string
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6773 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
6774 (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
6775 (sleep-for 0.1)))
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6776 (process-send-string proc string))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6777
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6778 (defun tramp-send-eof (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6779 "Send EOF to the remote end.
46151
eff75835ac2e (tramp-send-eof): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 46060
diff changeset
6780 METHOD, HOST and USER specify the connection."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6781 (let ((proc (get-buffer-process
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6782 (tramp-get-buffer multi-method method user host))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6783 (unless proc
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6784 (error "Can't send EOF to remote host -- not logged in"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6785 (process-send-eof proc)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6786 ; (process-send-string proc "\^D")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6787
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6788 (defun tramp-kill-process (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6789 "Kill the connection process used by Tramp.
46151
eff75835ac2e (tramp-send-eof): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 46060
diff changeset
6790 MULTI-METHOD, METHOD, USER, and HOST specify the connection."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6791 (let ((proc (get-buffer-process
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6792 (tramp-get-buffer multi-method method user host))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6793 (kill-process proc)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6794
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6795 (defun tramp-discard-garbage-erase-buffer (p multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6796 "Erase buffer, then discard subsequent garbage.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6797 If `tramp-discard-garbage' is nil, just erase buffer."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6798 (if (not tramp-discard-garbage)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6799 (erase-buffer)
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
6800 (while (prog1 (erase-buffer) (tramp-accept-process-output p 0.25))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6801 (when tramp-debug-buffer
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6802 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6803 (set-buffer (tramp-get-debug-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6804 (goto-char (point-max))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6805 (tramp-insert-with-face
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6806 'bold (format "Additional characters detected\n")))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6807
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6808 (defun tramp-mode-string-to-int (mode-string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6809 "Converts a ten-letter `drwxrwxrwx'-style mode string into mode bits."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6810 (let* ((mode-chars (string-to-vector mode-string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6811 (owner-read (aref mode-chars 1))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6812 (owner-write (aref mode-chars 2))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6813 (owner-execute-or-setid (aref mode-chars 3))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6814 (group-read (aref mode-chars 4))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6815 (group-write (aref mode-chars 5))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6816 (group-execute-or-setid (aref mode-chars 6))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6817 (other-read (aref mode-chars 7))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6818 (other-write (aref mode-chars 8))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6819 (other-execute-or-sticky (aref mode-chars 9)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6820 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6821 (logior
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6822 (case owner-read
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6823 (?r (tramp-octal-to-decimal "00400")) (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6824 (t (error "Second char `%c' must be one of `r-'" owner-read)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6825 (case owner-write
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6826 (?w (tramp-octal-to-decimal "00200")) (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6827 (t (error "Third char `%c' must be one of `w-'" owner-write)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6828 (case owner-execute-or-setid
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6829 (?x (tramp-octal-to-decimal "00100"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6830 (?S (tramp-octal-to-decimal "04000"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6831 (?s (tramp-octal-to-decimal "04100"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6832 (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6833 (t (error "Fourth char `%c' must be one of `xsS-'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6834 owner-execute-or-setid)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6835 (case group-read
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6836 (?r (tramp-octal-to-decimal "00040")) (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6837 (t (error "Fifth char `%c' must be one of `r-'" group-read)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6838 (case group-write
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6839 (?w (tramp-octal-to-decimal "00020")) (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6840 (t (error "Sixth char `%c' must be one of `w-'" group-write)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6841 (case group-execute-or-setid
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6842 (?x (tramp-octal-to-decimal "00010"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6843 (?S (tramp-octal-to-decimal "02000"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6844 (?s (tramp-octal-to-decimal "02010"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6845 (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6846 (t (error "Seventh char `%c' must be one of `xsS-'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6847 group-execute-or-setid)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6848 (case other-read
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6849 (?r (tramp-octal-to-decimal "00004")) (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6850 (t (error "Eighth char `%c' must be one of `r-'" other-read)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6851 (case other-write
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6852 (?w (tramp-octal-to-decimal "00002")) (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6853 (t (error "Nineth char `%c' must be one of `w-'" other-write)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6854 (case other-execute-or-sticky
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6855 (?x (tramp-octal-to-decimal "00001"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6856 (?T (tramp-octal-to-decimal "01000"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6857 (?t (tramp-octal-to-decimal "01001"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6858 (?- 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6859 (t (error "Tenth char `%c' must be one of `xtT-'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6860 other-execute-or-sticky)))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6861
58540
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6862 (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
6863 "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
6864 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
6865 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
6866 ;; 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
6867 (unless (stringp (nth 8 attr))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6868 (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
6869 ;; 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
6870 (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
6871 (setcar (nthcdr 9 attr)
72569
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
6872 (not (eql (nth 3 attr)
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
6873 (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
6874 ;; Set virtual device number.
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6875 (setcar (nthcdr 11 attr)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6876 (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
6877 attr)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6878
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6879 (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
6880 "Returns the virtual device number.
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6881 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
6882 (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
6883 (unless (assoc string tramp-devices)
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6884 (add-to-list 'tramp-devices
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6885 (list string (length tramp-devices))))
d3f76ef9ad46 (tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents: 58005
diff changeset
6886 (list -1 (nth 1 (assoc string tramp-devices)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6887
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6888 (defun tramp-file-mode-from-int (mode)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6889 "Turn an integer representing a file mode into an ls(1)-like string."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6890 (let ((type (cdr (assoc (logand (lsh mode -12) 15) tramp-file-mode-type-map)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6891 (user (logand (lsh mode -6) 7))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6892 (group (logand (lsh mode -3) 7))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6893 (other (logand (lsh mode -0) 7))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6894 (suid (> (logand (lsh mode -9) 4) 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6895 (sgid (> (logand (lsh mode -9) 2) 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6896 (sticky (> (logand (lsh mode -9) 1) 0)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6897 (setq user (tramp-file-mode-permissions user suid "s"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6898 (setq group (tramp-file-mode-permissions group sgid "s"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6899 (setq other (tramp-file-mode-permissions other sticky "t"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6900 (concat type user group other)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6901
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6902
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6903 (defun tramp-file-mode-permissions (perm suid suid-text)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6904 "Convert a permission bitset into a string.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6905 This is used internally by `tramp-file-mode-from-int'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6906 (let ((r (> (logand perm 4) 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6907 (w (> (logand perm 2) 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6908 (x (> (logand perm 1) 0)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6909 (concat (or (and r "r") "-")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6910 (or (and w "w") "-")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6911 (or (and suid x suid-text) ; suid, execute
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6912 (and suid (upcase suid-text)) ; suid, !execute
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6913 (and x "x") "-")))) ; !suid
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6914
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6915
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6916 (defun tramp-decimal-to-octal (i)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6917 "Return a string consisting of the octal digits of I.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6918 Not actually used. Use `(format \"%o\" i)' instead?"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6919 (cond ((< i 0) (error "Cannot convert negative number to octal"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6920 ((not (integerp i)) (error "Cannot convert non-integer to octal"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6921 ((zerop i) "0")
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6922 (t (concat (tramp-decimal-to-octal (/ i 8))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6923 (number-to-string (% i 8))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6924
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6925
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6926 ;;(defun tramp-octal-to-decimal (ostr)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6927 ;; "Given a string of octal digits, return a decimal number."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6928 ;; (cond ((null ostr) 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6929 ;; ((string= "" ostr) 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6930 ;; (t (let ((last (aref ostr (1- (length ostr))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6931 ;; (rest (substring ostr 0 (1- (length ostr)))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6932 ;; (unless (and (>= last ?0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6933 ;; (<= last ?7))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6934 ;; (error "Not an octal digit: %c" last))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6935 ;; (+ (- last ?0) (* 8 (tramp-octal-to-decimal rest)))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6936 ;; Kudos to Gerd Moellmann for this suggestion.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6937 (defun tramp-octal-to-decimal (ostr)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6938 "Given a string of octal digits, return a decimal number."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6939 (let ((x (or ostr "")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6940 ;; `save-match' is in `tramp-mode-string-to-int' which calls this.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6941 (unless (string-match "\\`[0-7]*\\'" x)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6942 (error "Non-octal junk in string `%s'" x))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6943 (string-to-number ostr 8)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6944
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6945 (defun tramp-shell-case-fold (string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6946 "Converts STRING to shell glob pattern which ignores case."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6947 (mapconcat
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6948 (lambda (c)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6949 (if (equal (downcase c) (upcase c))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6950 (vector c)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6951 (format "[%c%c]" (downcase c) (upcase c))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6952 string
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6953 ""))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6954
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6955
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
6956 ;; ------------------------------------------------------------
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
6957 ;; -- TRAMP file names --
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
6958 ;; ------------------------------------------------------------
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6959 ;; Conversion functions between external representation and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6960 ;; internal data structure. Convenience functions for internal
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6961 ;; data structure.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6962
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
6963 (defstruct tramp-file-name multi-method method user host localname)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6964
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6965 (defun tramp-tramp-file-p (name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6966 "Return t iff NAME is a tramp file."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6967 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6968 (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
6969
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6970 ;; HHH: Changed. Used to assign the return value of (user-login-name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6971 ;; to the `user' part of the structure if a user name was not
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6972 ;; provided, now it assigns nil.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6973 (defun tramp-dissect-file-name (name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6974 "Return an `tramp-file-name' structure.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6975 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
6976 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
6977 (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
6978 (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
6979 (method
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
6980 ; 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
6981 (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
6982 ; 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
6983 (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
6984 (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
6985 (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
6986 (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
6987 (if (and method (member method tramp-multi-methods))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6988 ;; If it's a multi method, the file name structure contains
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6989 ;; arrays of method, user and host.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
6990 (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
6991 ;; 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
6992 (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
6993 (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
6994 (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
6995 (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
6996 (make-tramp-file-name
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
6997 :multi-method nil
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
6998 :method method
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
6999 :user (or user nil)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
7000 :host host
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
7001 :localname localname))))))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
7002
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
7003 (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
7004 "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
7005 (let ((choices tramp-default-method-alist)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
7006 (method tramp-default-method)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
7007 item)
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
7008 (while choices
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
7009 (setq item (pop choices))
74766
ca4412906dbd * net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents: 74739
diff changeset
7010 (when (and (string-match (or (nth 0 item) "") (or host ""))
ca4412906dbd * net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents: 74739
diff changeset
7011 (string-match (or (nth 1 item) "") (or user "")))
46009
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
7012 (setq method (nth 2 item))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
7013 (setq choices nil)))
72200622ada8 (tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 45861
diff changeset
7014 method))
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
7015
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
7016 (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
7017 "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
7018 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
7019 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
7020 `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
7021 (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
7022
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7023 ;; HHH: Not Changed. Multi method. Will probably not handle the case where
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7024 ;; a user name is not provided in the "file name" very well.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7025 (defun tramp-dissect-multi-file-name (name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7026 "Not implemented yet."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7027 (let ((regexp (nth 0 tramp-multi-file-name-structure))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7028 (method-index (nth 1 tramp-multi-file-name-structure))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7029 (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
7030 (localname-index (nth 3 tramp-multi-file-name-structure))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7031 (hop-regexp (nth 0 tramp-multi-file-name-hop-structure))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7032 (hop-method-index (nth 1 tramp-multi-file-name-hop-structure))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7033 (hop-user-index (nth 2 tramp-multi-file-name-hop-structure))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7034 (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
7035 method hops len hop-methods hop-users hop-hosts localname)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7036 (unless (string-match (format regexp hop-regexp) name)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7037 (error "Not a multi tramp file name: %s" name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7038 (setq method (match-string method-index name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7039 (setq hops (match-string hops-index name))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7040 (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
7041 (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
7042 (setq localname (match-string localname-index name))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7043 (let ((index 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7044 (while (string-match hop-regexp hops index)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7045 (setq index (match-end 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7046 (setq hop-methods
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7047 (cons (match-string hop-method-index hops) hop-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7048 (setq hop-users
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7049 (cons (match-string hop-user-index hops) hop-users))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7050 (setq hop-hosts
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7051 (cons (match-string hop-host-index hops) hop-hosts))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7052 (make-tramp-file-name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7053 :multi-method method
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7054 :method (apply 'vector (reverse hop-methods))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7055 :user (apply 'vector (reverse hop-users))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7056 :host (apply 'vector (reverse hop-hosts))
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
7057 :localname localname)))
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
7058
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
7059 (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
7060 "Constructs a tramp file name from METHOD, USER, HOST and LOCALNAME."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7061 (if multi-method
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
7062 (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
7063 (format-spec
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
7064 (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
7065 (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
7066 (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
7067 (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
7068 (when localname (concat "%p")))
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
7069 `((?m . ,method) (?u . ,user) (?h . ,host) (?p . ,localname)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7070
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7071 ;; CCC: Henrik Holm: Not Changed. Multi Method. What should be done
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7072 ;; with this when USER is nil?
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
7073 (defun tramp-make-tramp-multi-file-name (multi-method method user host localname)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7074 "Constructs a tramp file name for a multi-hop method."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7075 (unless tramp-make-multi-tramp-file-format
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7076 (error "`tramp-make-multi-tramp-file-format' is nil"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7077 (let* ((prefix-format (nth 0 tramp-make-multi-tramp-file-format))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7078 (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
7079 (localname-format (nth 2 tramp-make-multi-tramp-file-format))
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7080 (prefix (format-spec prefix-format `((?m . ,multi-method))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7081 (hops "")
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
7082 (localname (format-spec localname-format `((?p . ,localname))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7083 (i 0)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7084 (len (length method)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7085 (while (< i len)
46584
f548d7d0c651 Bump version to 2.0.2.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46347
diff changeset
7086 (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
7087 (setq hops (concat hops (format-spec hop-format
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7088 `((?m . ,m) (?u . ,u) (?h . ,h)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7089 (incf i)))
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
7090 (concat prefix hops localname)))
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
7091
51177
6234a4fe96f9 Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 50494
diff changeset
7092 (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
7093 "Create a file name suitable to be passed to `rcp' and workalikes."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7094 (if user
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
7095 (format "%s@%s:%s" user host localname)
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
7096 (format "%s:%s" host localname)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7097
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
7098 (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
7099 "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
7100 (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
7101 multi-method
47577
20336ef6b20a Version 2.0.21 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47576
diff changeset
7102 (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
7103 user host 'tramp-copy-program))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7104
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7105 ;; Variables local to connection.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7106
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7107 (defun tramp-get-ls-command (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7108 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7109 (tramp-maybe-open-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7110 (set-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7111 tramp-ls-command))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7112
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7113 (defun tramp-get-test-groks-nt (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7114 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7115 (tramp-maybe-open-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7116 (set-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7117 tramp-test-groks-nt))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7118
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7119 (defun tramp-get-file-exists-command (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7120 (save-excursion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7121 (tramp-maybe-open-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7122 (set-buffer (tramp-get-buffer multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7123 tramp-file-exists-command))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7124
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7125 (defun tramp-get-remote-perl (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7126 (tramp-get-connection-property "perl" nil multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7127
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7128 (defun tramp-get-remote-ln (multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7129 (tramp-get-connection-property "ln" nil multi-method method user host))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7130
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7131 (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
7132 (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
7133
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7134 (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
7135 (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
7136
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7137 ;; Get a property of a TRAMP connection.
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7138 (defun tramp-get-connection-property
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7139 (property default multi-method method user host)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7140 "Get the named property for the connection.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7141 If the value is not set for the connection, return `default'"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7142 (tramp-maybe-open-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7143 (with-current-buffer (tramp-get-buffer multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7144 (let (error)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7145 (condition-case nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7146 (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
7147 (error default)))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7148
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7149 ;; Set a property of a TRAMP connection.
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7150 (defun tramp-set-connection-property
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7151 (property value multi-method method user host)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7152 "Set the named property of a TRAMP connection."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7153 (tramp-maybe-open-connection multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7154 (with-current-buffer (tramp-get-buffer multi-method method user host)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7155 (set (make-local-variable
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7156 (intern (concat "tramp-connection-property-" property)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7157 value)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7158
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7159 ;; 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
7160 (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
7161 (tramp-set-connection-property "remote-encoding" rem-enc
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7162 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
7163 (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
7164 (tramp-get-connection-property "remote-encoding" nil
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7165 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
7166
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
7167 (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
7168 (tramp-set-connection-property "remote-decoding" rem-dec
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7169 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
7170 (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
7171 (tramp-get-connection-property "remote-decoding" nil
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7172 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
7173
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
7174 (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
7175 (tramp-set-connection-property "local-encoding" loc-enc
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7176 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
7177 (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
7178 (tramp-get-connection-property "local-encoding" nil
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7179 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
7180
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
7181 (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
7182 (tramp-set-connection-property "local-decoding" loc-dec
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7183 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
7184 (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
7185 (tramp-get-connection-property "local-decoding" nil
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7186 multi-method method user host))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7187
53206
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
7188 (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
7189 "Return the method parameter PARAM.
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
7190 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
7191 as default."
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
7192 (unless (boundp param)
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
7193 (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
7194 (let ((entry (assoc param
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
7195 (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
7196 tramp-methods))))
53206
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
7197 (if entry
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
7198 (second entry)
0c19f1a19b2b (tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 52401
diff changeset
7199 (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
7200
51968
e4c4c45ea013 Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51603
diff changeset
7201
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7202 ;; Auto saving to a special directory.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7203
65304
379e08762d65 * net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents: 65254
diff changeset
7204 (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
7205 (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
7206 (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
7207 (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
7208 (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
7209 (list
379e08762d65 * net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents: 65254
diff changeset
7210 (cons "/"
379e08762d65 * net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents: 65254
diff changeset
7211 '(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
7212 "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
7213 (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
7214 operation
379e08762d65 * net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents: 65254
diff changeset
7215 (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
7216 (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
7217 (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
7218
0f994edbec5e Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents: 64772
diff changeset
7219 (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
7220 (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
7221 (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
7222 "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
7223 (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
7224 (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
7225 ad-do-it))
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7226 (add-hook 'tramp-unload-hook
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7227 '(lambda () (ad-unadvise 'make-auto-save-file-name))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7228
60763
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7229 ;; 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
7230 ;; 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
7231
40298ea4d83f Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents: 56644
diff changeset
7232 (defun tramp-set-auto-save-file-modes ()
40298ea4d83f Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents: 56644
diff changeset
7233 "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
7234 (let ((bfn (buffer-file-name)))
40298ea4d83f Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents: 56644
diff changeset
7235 (when (and (stringp bfn)
40298ea4d83f Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents: 56644
diff changeset
7236 (tramp-tramp-file-p bfn)
40298ea4d83f Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents: 56644
diff changeset
7237 (stringp buffer-auto-save-file-name)
60763
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7238 (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
7239 (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
7240 (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
7241 ;; 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
7242 ;; 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
7243 ;; be a security threat.
62344
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7244 (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
7245 (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
7246
40298ea4d83f Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents: 56644
diff changeset
7247 (unless (or (> emacs-major-version 21)
40298ea4d83f Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents: 56644
diff changeset
7248 (and (featurep 'xemacs)
40298ea4d83f Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents: 56644
diff changeset
7249 (= emacs-major-version 21)
60763
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7250 (> emacs-minor-version 4)))
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7251 (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
7252 (add-hook 'tramp-unload-hook
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7253 '(lambda ()
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7254 (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
7255
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7256 (defun tramp-subst-strs-in-string (alist string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7257 "Replace all occurrences of the string FROM with TO in STRING.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7258 ALIST is of the form ((FROM . TO) ...)."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7259 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7260 (while alist
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7261 (let* ((pr (car alist))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7262 (from (car pr))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7263 (to (cdr pr)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7264 (while (string-match (regexp-quote from) string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7265 (setq string (replace-match to t t string)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7266 (setq alist (cdr alist))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7267 string))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7268
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7269 (defun tramp-insert-with-face (face string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7270 "Insert text with a specific face."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7271 (let ((start (point)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7272 (insert string)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7273 (add-text-properties start (point) (list 'face face))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7274
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7275 ;; ------------------------------------------------------------
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7276 ;; -- Compatibility functions section --
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7277 ;; ------------------------------------------------------------
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7278
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7279 (defun tramp-temporary-file-directory ()
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7280 "Return name of directory for temporary files (compat function).
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7281 For Emacs, this is the variable `temporary-file-directory', for XEmacs
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7282 this is the function `temp-directory'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7283 (cond ((boundp 'temporary-file-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7284 (symbol-value 'temporary-file-directory))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7285 ((fboundp 'temp-directory)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7286 (funcall (symbol-function 'temp-directory))) ;pacify byte-compiler
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7287 ((let ((d (getenv "TEMP"))) (and d (file-directory-p d)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7288 (file-name-as-directory (getenv "TEMP")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7289 ((let ((d (getenv "TMP"))) (and d (file-directory-p d)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7290 (file-name-as-directory (getenv "TMP")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7291 ((let ((d (getenv "TMPDIR"))) (and d (file-directory-p d)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7292 (file-name-as-directory (getenv "TMPDIR")))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7293 ((file-exists-p "c:/temp") (file-name-as-directory "c:/temp"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7294 (t (message (concat "Neither `temporary-file-directory' nor "
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7295 "`temp-directory' is defined -- using /tmp."))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7296 (file-name-as-directory "/tmp"))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7297
56460
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
7298 (defun tramp-read-passwd (user host prompt)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7299 "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
7300 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
7301 (if (functionp 'password-read)
56460
9459300bf43b Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 56424
diff changeset
7302 (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
7303 (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
7304 (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
7305 password)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
7306 (read-passwd prompt)))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
7307
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
7308 (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
7309 "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
7310 (interactive)
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
7311 (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
7312 (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
7313 (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
7314 (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
7315 (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
7316 (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
7317 (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
7318 (key (concat luser "@" lhost)))
c1bfc266f10a Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 53206
diff changeset
7319 (apply #'password-cache-remove (list key))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7320
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7321 (defun tramp-time-diff (t1 t2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7322 "Return the difference between the two times, in seconds.
72569
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
7323 T1 and T2 are time values (as returned by `current-time' for example)."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7324 ;; 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
7325 (cond ((and (fboundp 'subtract-time)
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
7326 (fboundp 'float-time))
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
7327 (funcall (symbol-function 'float-time)
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
7328 (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
7329 ((and (fboundp 'subtract-time)
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
7330 (fboundp 'time-to-seconds))
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
7331 (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
7332 (funcall (symbol-function 'subtract-time) t1 t2)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7333 ((fboundp 'itimer-time-difference)
72569
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
7334 (funcall (symbol-function 'itimer-time-difference)
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
7335 (if (< (length t1) 3) (append t1 '(0)) t1)
7457615d594a Sync with Tramp 2.0.54.
Michael Albinus <michael.albinus@gmx.de>
parents: 71561
diff changeset
7336 (if (< (length t2) 3) (append t2 '(0)) t2)))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7337 (t
51603
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
7338 ;; 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
7339 ;; 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
7340 (let ((time (let ((borrow (< (cadr t1) (cadr t2))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7341 (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
7342 (- (+ (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
7343 (+ (* (car time) 65536.0)
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
7344 (cadr time)
978e262c8f3a Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 51177
diff changeset
7345 (/ (or (nth 2 time) 0) 1000000.0))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7346
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7347 (defun tramp-coding-system-change-eol-conversion (coding-system eol-type)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7348 "Return a coding system like CODING-SYSTEM but with given EOL-TYPE.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7349 EOL-TYPE can be one of `dos', `unix', or `mac'."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7350 (cond ((fboundp 'coding-system-change-eol-conversion)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7351 (apply #'coding-system-change-eol-conversion
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7352 (list coding-system eol-type)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7353 ((fboundp 'subsidiary-coding-system)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7354 (apply
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7355 #'subsidiary-coding-system
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7356 (list coding-system
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7357 (cond ((eq eol-type 'dos) 'crlf)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7358 ((eq eol-type 'unix) 'lf)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7359 ((eq eol-type 'mac) 'cr)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7360 (t
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7361 (error "Unknown EOL-TYPE `%s', must be %s"
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7362 eol-type
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7363 "`dos', `unix', or `mac'"))))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7364 (t (error "Can't change EOL conversion -- is MULE missing?"))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7365
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7366 (defun tramp-split-string (string pattern)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7367 "Like `split-string' but omit empty strings.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7368 In Emacs, (split-string \"/foo/bar\" \"/\") returns (\"foo\" \"bar\").
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7369 This is, the first, empty, element is omitted. In XEmacs, the first
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7370 element is not omitted.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7371
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7372 Note: this function has been written for `tramp-handle-file-truename'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7373 If you want to use it for something else, you'll have to check whether
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7374 it does the right thing."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7375 (delete "" (split-string string pattern)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7376
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
7377 (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
7378 "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
7379 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
7380 exiting if process is running."
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7381 (funcall
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
7382 (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
7383 (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
7384 (symbol-function 'process-kill-without-query))
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7385 process flag))
55844
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
7386
4bc6cb45c326 Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents: 55420
diff changeset
7387
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
7388 ;; ------------------------------------------------------------
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
7389 ;; -- Kludges section --
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 59582
diff changeset
7390 ;; ------------------------------------------------------------
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7391
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7392 ;; Currently (as of Emacs 20.5), the function `shell-quote-argument'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7393 ;; does not deal well with newline characters. Newline is replaced by
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7394 ;; backslash newline. But if, say, the string `a backslash newline b'
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7395 ;; is passed to a shell, the shell will expand this into "ab",
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7396 ;; completely omitting the newline. This is not what was intended.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7397 ;; It does not appear to be possible to make the function
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7398 ;; `shell-quote-argument' work with newlines without making it
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7399 ;; dependent on the shell used. But within this package, we know that
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7400 ;; we will always use a Bourne-like shell, so we use an approach which
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7401 ;; groks newlines.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7402 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7403 ;; The approach is simple: we call `shell-quote-argument', then
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7404 ;; massage the newline part of the result.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7405 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7406 ;; This function should produce a string which is grokked by a Unix
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7407 ;; shell, even if the Emacs is running on Windows. Since this is the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7408 ;; kludges section, we bind `system-type' in such a way that
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7409 ;; `shell-quote-arguments' behaves as if on Unix.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7410 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7411 ;; Thanks to Mario DeWeerd for the hint that it is sufficient for this
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7412 ;; function to work with Bourne-like shells.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7413 ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7414 ;; CCC: This function should be rewritten so that
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7415 ;; `shell-quote-argument' is not used. This way, we are safe from
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7416 ;; changes in `shell-quote-argument'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7417 (defun tramp-shell-quote-argument (s)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7418 "Similar to `shell-quote-argument', but groks newlines.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7419 Only works for Bourne-like shells."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7420 (let ((system-type 'not-windows))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7421 (save-match-data
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7422 (let ((result (shell-quote-argument s))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7423 (nl (regexp-quote (format "\\%s" tramp-rsh-end-of-line))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7424 (when (and (>= (length result) 2)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7425 (string= (substring result 0 2) "\\~"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7426 (setq result (substring result 1)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7427 (while (string-match nl result)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7428 (setq result (replace-match (format "'%s'" tramp-rsh-end-of-line)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7429 t t result)))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7430 result))))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7431
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7432 ;; ;; EFS hooks itself into the file name handling stuff in more places
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7433 ;; ;; 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
7434 ;; ;; away from tramp.el file names.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7435 ;; ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7436 ;; ;; This is needed because EFS installs (efs-dired-before-readin) into
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7437 ;; ;; 'dired-before-readin-hook'. This prevents EFS from opening an FTP
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7438 ;; ;; connection to help it's dired process. Not that I have any real
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7439 ;; ;; idea *why* this is helpful to dired.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7440 ;; ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7441 ;; ;; Anyway, this advice fixes the problem (with a sledgehammer :)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7442 ;; ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7443 ;; ;; Daniel Pittman <daniel@danann.net>
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7444 ;; ;;
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7445 ;; ;; CCC: when the other defadvice calls have disappeared, make sure
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7446 ;; ;; not to call defadvice unless it's necessary. How do we find out whether
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7447 ;; ;; it is necessary? (featurep 'efs) is surely the wrong way --
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7448 ;; ;; EFS might nicht be loaded yet.
49995
a0e8a85259ed Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 49612
diff changeset
7449 ;; (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
7450 ;; "Cause efs-ftp-path to fail when the path is a TRAMP localname."
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7451 ;; (if (tramp-tramp-file-p (ad-get-arg 0))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7452 ;; nil
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7453 ;; ad-do-it))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7454
47576
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
7455 ;; 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
7456 ;; This means that Emacs wants to expand wildcards if
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7457 ;; `find-file-wildcards' is non-nil, and then barfs because no
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7458 ;; expansion could be found. We detect this situation and do
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7459 ;; something really awful: we have `file-expand-wildcards' return the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7460 ;; original filename if it can't expand anything. Let's just hope
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7461 ;; 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
7462 ;; 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
7463 ;; 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
7464 (when (string-match "\\[" tramp-prefix-format)
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7465 (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
7466 (let ((name (ad-get-arg 0)))
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7467 (if (tramp-tramp-file-p name)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7468 ;; 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
7469 ;; need to be expanded at all.
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7470 (let ((v (tramp-dissect-file-name name)))
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7471 (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
7472 (let ((res ad-do-it))
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7473 (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
7474 (setq ad-return-value (list name))))
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7475 ;; 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
7476 (let ((res ad-do-it))
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7477 (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
7478 (add-hook 'tramp-unload-hook
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7479 '(lambda () (ad-unadvise 'file-expand-wildcards))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7480
46752
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7481 ;; Tramp version is useful in a number of situations.
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7482
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7483 (defun tramp-version (arg)
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7484 "Print version number of tramp.el in minibuffer or current buffer."
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7485 (interactive "P")
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7486 (if arg (insert tramp-version) (message tramp-version)))
54b975949d6a New version 2.0.5.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46584
diff changeset
7487
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7488 ;; Make the `reporter` functionality available for making bug reports about
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7489 ;; the package. A most useful piece of code.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7490
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7491 (unless (fboundp 'reporter-submit-bug-report)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7492 (autoload 'reporter-submit-bug-report "reporter"))
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7493
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7494 (defun tramp-bug ()
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7495 "Submit a bug report to the TRAMP developers."
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7496 (interactive)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7497 (require 'reporter)
60763
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7498 (catch 'dont-send
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7499 (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
7500 (reporter-submit-bug-report
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7501 tramp-bug-report-address ; to-address
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7502 (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
7503 (delq nil
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7504 `(;; Current state
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7505 tramp-ls-command
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7506 tramp-test-groks-nt
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7507 tramp-file-exists-command
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7508 tramp-current-multi-method
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7509 tramp-current-method
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7510 tramp-current-user
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7511 tramp-current-host
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7512
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7513 ;; System defaults
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7514 tramp-auto-save-directory ; vars to dump
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7515 tramp-default-method
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7516 tramp-rsh-end-of-line
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7517 tramp-default-password-end-of-line
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7518 tramp-remote-path
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7519 tramp-login-prompt-regexp
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7520 ;; Mask non-7bit characters
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7521 (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
7522 tramp-wrong-passwd-regexp
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7523 tramp-yesno-prompt-regexp
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7524 tramp-yn-prompt-regexp
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7525 tramp-terminal-prompt-regexp
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7526 tramp-temp-name-prefix
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7527 tramp-file-name-structure
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7528 tramp-file-name-regexp
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7529 tramp-multi-file-name-structure
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7530 tramp-multi-file-name-hop-structure
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7531 tramp-multi-methods
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7532 tramp-multi-connection-function-alist
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7533 tramp-methods
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7534 tramp-end-of-output
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7535 tramp-coding-commands
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7536 tramp-actions-before-shell
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7537 tramp-actions-copy-out-of-band
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7538 tramp-multi-actions
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7539 tramp-terminal-type
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7540 ;; Mask non-7bit characters
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7541 (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
7542 tramp-chunksize
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7543 ,(when (boundp 'tramp-backup-directory-alist)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7544 'tramp-backup-directory-alist)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7545 ,(when (boundp 'tramp-bkup-backup-directory-info)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7546 'tramp-bkup-backup-directory-info)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7547
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7548 ;; Non-tramp variables of interest
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7549 ;; Mask non-7bit characters
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7550 (shell-prompt-pattern . tramp-reporter-dump-variable)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7551 backup-by-copying
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7552 backup-by-copying-when-linked
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7553 backup-by-copying-when-mismatch
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7554 ,(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
7555 'backup-by-copying-when-privileged-mismatch)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7556 ,(when (boundp 'password-cache)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7557 'password-cache)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7558 ,(when (boundp 'password-cache-expiry)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7559 'password-cache-expiry)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7560 ,(when (boundp 'backup-directory-alist)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7561 'backup-directory-alist)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7562 ,(when (boundp 'bkup-backup-directory-info)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7563 'bkup-backup-directory-info)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7564 file-name-handler-alist))
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7565
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7566 'tramp-load-report-modules ; pre-hook
60763
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7567 'tramp-append-tramp-buffers ; post-hook
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7568 "\
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7569 Enter your bug report in this message, including as much detail as you
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7570 possibly can about the problem, what you did to cause it and what the
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7571 local and remote machines are.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7572
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7573 If you can give a simple set of instructions to make this bug happen
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7574 reliably, please include those. Thank you for helping kill bugs in
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7575 TRAMP.
46801
3fafc6fca8a8 Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46799
diff changeset
7576
3fafc6fca8a8 Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46799
diff changeset
7577 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
7578 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
7579 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
7580 report.
3fafc6fca8a8 Version 2.0.9 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46799
diff changeset
7581
46802
10aa49b3d28a Version 2.0.10 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46801
diff changeset
7582 --bug report follows this line--
60763
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7583 "))))
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7584
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7585 (defun tramp-reporter-dump-variable (varsym mailbuf)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7586 "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
7587 Used for non-7bit chars in strings."
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7588 (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
7589 (val (with-current-buffer reporter-eval-buffer
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7590 (symbol-value varsym))))
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7591
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7592 ;; There are characters to be masked.
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7593 (when (and (boundp 'mm-7bit-chars)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7594 (string-match
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7595 (concat "[^" (symbol-value 'mm-7bit-chars) "]") val))
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7596 (with-current-buffer reporter-eval-buffer
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7597 (set varsym (concat "(base64-decode-string \""
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7598 (base64-encode-string val)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7599 "\")"))))
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7600
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7601 ;; Dump variable.
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7602 (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
7603
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7604 ;; Remove string quotation.
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7605 (forward-line -1)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7606 (when (looking-at
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7607 (concat "\\(^.*\\)" "\"" ;; \1 "
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7608 "\\((base64-decode-string \\)" "\\\\" ;; \2 \
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7609 "\\(\".*\\)" "\\\\" ;; \3 \
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7610 "\\(\")\\)" "\"$")) ;; \4 "
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7611 (replace-match "\\1\\2\\3\\4")
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7612 (beginning-of-line)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7613 (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
7614 (forward-line 1)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7615
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7616 ;; Reset VARSYM to old value.
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7617 (with-current-buffer reporter-eval-buffer
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7618 (set varsym val))))
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7619
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7620 (defun tramp-load-report-modules ()
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7621 "Load needed modules for reporting."
60763
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7622
62344
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7623 ;; 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
7624 (if (featurep 'xemacs)
62344
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7625 (progn
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7626 (load "message" 'noerror)
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7627 (load "mml" 'noerror))
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7628 (require 'message nil 'noerror)
60763
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7629 (require 'mml nil 'noerror))
62344
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7630 (when (functionp 'message-mode)
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7631 (funcall (symbol-function 'message-mode)))
62344
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7632 (when (functionp 'mml-mode)
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7633 (funcall (symbol-function 'mml-mode) t)))
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7634
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7635 (defun tramp-append-tramp-buffers ()
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7636 "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
7637
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7638 (when (and
62344
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7639 (eq major-mode 'message-mode)
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7640 (boundp 'mml-mode)
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7641 (symbol-value 'mml-mode))
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7642
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7643 (let* ((tramp-buf-regexp "\\*\\(debug \\)?tramp/")
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7644 (buffer-list
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7645 (delq nil
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7646 (mapcar '(lambda (b)
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7647 (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
7648 (buffer-list))))
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7649 (curbuf (current-buffer)))
60763
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7650
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7651 ;; There is at least one Tramp buffer.
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7652 (when buffer-list
62344
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7653 (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
7654 (delete-other-windows)
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7655 (setq buffer-read-only nil)
62344
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7656 (goto-char (point-min))
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7657 (while (not (eobp))
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7658 (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
7659 (forward-line 1)
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7660 (forward-line 0)
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7661 (let ((start (point)))
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7662 (forward-line 1)
5a19ff64befb Sync with Tramp 2.0.49.
Michael Albinus <michael.albinus@gmx.de>
parents: 60763
diff changeset
7663 (kill-region start (point)))))
60763
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7664 (insert "
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7665 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
7666 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
7667 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
7668 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
7669
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7670 (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
7671 (insert "\n\n")
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7672 (let ((start (point)))
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7673 (insert "\
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7674 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
7675 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
7676 (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
7677
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7678 (set-buffer-modified-p nil)
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7679 (setq buffer-read-only t)
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7680 (goto-char (point-min))
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7681
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7682 (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
7683 ;; 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
7684 (progn
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7685 (kill-buffer nil)
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7686 (switch-to-buffer curbuf)
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7687 (goto-char (point-max))
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7688 (insert "\n\n")
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7689 (dolist (buffer buffer-list)
64772
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7690 (funcall (symbol-function 'mml-insert-empty-tag)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7691 'part 'type "text/plain" 'encoding "base64"
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7692 'disposition "attachment" 'buffer (buffer-name buffer)
060177e931f8 Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents: 64701
diff changeset
7693 'description (buffer-name buffer)))
60763
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7694 (set-buffer-modified-p nil))
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7695
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7696 ;; Don't send. Delete the message buffer.
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7697 (set-buffer curbuf)
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7698 (set-buffer-modified-p nil)
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7699 (kill-buffer nil)
3ba8f94e9cfa Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents: 60287
diff changeset
7700 (throw 'dont-send nil))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7701
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7702 (defalias 'tramp-submit-bug 'tramp-bug)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7703
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7704 ;; Checklist for `tramp-unload-hook'
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7705 ;; - Unload all `tramp-*' packages
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7706 ;; - Reset `file-name-handler-alist'
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7707 ;; - Cleanup hooks where Tramp functions are in
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7708 ;; - Cleanup advised functions
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7709 ;; - Cleanup autoloads
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7710 ;;;###autoload
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7711 (defun tramp-unload-tramp ()
71485
5b1bf37e044d * net/rcompile.el (remote-compile): Replace ange-ftp based
Michael Albinus <michael.albinus@gmx.de>
parents: 71350
diff changeset
7712 "Discard Tramp from loading remote files."
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7713 (interactive)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7714 ;; 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
7715 (tramp-unload-file-name-handlers)
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7716 ;; ange-ftp settings must be enabled.
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7717 (when (functionp 'tramp-ftp-enable-ange-ftp)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7718 (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
7719 ;; `tramp-util' unloads also `tramp'.
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7720 (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
7721 (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
7722 (error nil)))
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7723
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7724 (provide 'tramp)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7725
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7726 ;; Make sure that we get integration with the VC package.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7727 ;; When it is loaded, we need to pull in the integration module.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7728 ;; This must come after (provide 'tramp) because tramp-vc.el
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7729 ;; requires tramp.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7730 (eval-after-load "vc"
68335
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7731 '(progn
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7732 (require 'tramp-vc)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7733 (add-hook 'tramp-unload-hook
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7734 '(lambda ()
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7735 (when (featurep 'tramp-vc)
118ceefc8263 Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents: 66630
diff changeset
7736 (unload-feature 'tramp-vc 'force))))))
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7737
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7738 ;;; TODO:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7739
48973
09acf3f65bb5 * net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47771
diff changeset
7740 ;; * 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
7741 ;; 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
7742 ;; 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
7743 ;; 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
7744 ;; 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
7745 ;; 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
7746 ;; 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
7747 ;; * 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
7748 ;; * Autodetect if remote `ls' groks the "--dired" switch.
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
7749 ;; * Add fallback for inline encodings. This should be used
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
7750 ;; if the remote end doesn't support mimencode or a similar program.
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
7751 ;; For reading files from the remote host, we can just parse the output
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
7752 ;; of `od -b'. For writing files to the remote host, we construct
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
7753 ;; a shell program which contains only "safe" ascii characters
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
7754 ;; and which writes the right bytes to the file. We can use printf(1)
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
7755 ;; or "echo -e" or the printf function in awk and use octal escapes
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
7756 ;; for the "dangerous" characters. The null byte might be a problem.
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
7757 ;; On some systems, the octal escape doesn't work. So we try the following
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
7758 ;; two commands to write a null byte:
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
7759 ;; dd if=/dev/zero bs=1 count=1
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
7760 ;; 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
7761 ;; * 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
7762 ;; 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
7763 ;; for the right local commands and the right remote commands separately.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7764 ;; * Cooperate with PCL-CVS. It uses start-process, which doesn't
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7765 ;; work for remote files.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7766 ;; * Rewrite `tramp-shell-quote-argument' to abstain from using
46790
c217aa0214e2 Version 2.0.6.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46752
diff changeset
7767 ;; `shell-quote-argument'.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7768 ;; * Completion gets confused when you leave out the method name.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7769 ;; * In Emacs 21, `insert-directory' shows total number of bytes used
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7770 ;; by the files in that directory. Add this here.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7771 ;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7772 ;; * Make ffap.el grok Tramp filenames. (Eli Tziperman)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7773 ;; * When logging in, keep looking for questions according to an alist
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7774 ;; and then invoke the right function.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7775 ;; * Case-insensitive filename completion. (Norbert Goevert.)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7776 ;; * Running CVS remotely doesn't appear to work right. It thinks
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7777 ;; files are locked by somebody else even if I'm the locking user.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7778 ;; Sometimes, one gets `No CVSROOT specified' errors from CVS.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7779 ;; (Skip Montanaro)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7780 ;; * Don't use globbing for directories with many files, as this is
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7781 ;; likely to produce long command lines, and some shells choke on
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7782 ;; long command lines.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7783 ;; * Find out about the new auto-save mechanism in Emacs 21 and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7784 ;; do the right thing.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7785 ;; * `vc-directory' does not work. It never displays any files, even
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7786 ;; if it does show files when run locally.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7787 ;; * Allow correction of passwords, if the remote end allows this.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7788 ;; (Mark Hershberger)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7789 ;; * How to deal with MULE in `insert-file-contents' and `write-region'?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7790 ;; * Do asynchronous `shell-command's.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7791 ;; * Grok `append' parameter for `write-region'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7792 ;; * Test remote ksh or bash for tilde expansion in `tramp-find-shell'?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7793 ;; * abbreviate-file-name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7794 ;; * grok ~ in tramp-remote-path (Henrik Holm <henrikh@tele.ntnu.no>)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7795 ;; * Also allow to omit user names when doing multi-hop. Not sure yet
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7796 ;; what the user names should default to, though.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7797 ;; * better error checking. At least whenever we see something
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7798 ;; strange when doing zerop, we should kill the process and start
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7799 ;; again. (Greg Stark)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7800 ;; * 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
7801 ;; Of course, this has issues with usability (stale cache bites)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7802 ;; -- <daniel@danann.net>
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7803 ;; * Provide a local cache of old versions of remote files for the rsync
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7804 ;; transfer method to use. (Greg Stark)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7805 ;; * Remove unneeded parameters from methods.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7806 ;; * 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
7807 ;; (Francesco Potort,Al(B)
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7808 ;; * Should we set PATH ourselves or should we rely on the remote end
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7809 ;; to do it?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7810 ;; * Make it work for XEmacs 20, which is missing `with-timeout'.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7811 ;; * Make it work for different encodings, and for different file name
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7812 ;; encodings, too. (Daniel Pittman)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7813 ;; * 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
7814 ;; than the individual items MULTI-METHOD, METHOD, USER, HOST, LOCALNAME.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7815 ;; * Implement asynchronous shell commands.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7816 ;; * Clean up unused *tramp/foo* buffers after a while. (Pete Forman)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7817 ;; * Progress reports while copying files. (Michael Kifer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7818 ;; * `Smart' connection method that uses inline for small and out of
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7819 ;; band for large files. (Michael Kifer)
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7820 ;; * Don't search for perl5 and perl. Instead, only search for perl and
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7821 ;; then look if it's the right version (with `perl -v').
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7822 ;; * When editing a remote CVS controlled file as a different user, VC
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7823 ;; gets confused about the file locking status. Try to find out why
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7824 ;; the workaround doesn't work.
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7825 ;; * Change `copy-file' to grok the case where the filename handler
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7826 ;; for the source and the target file are different. Right now,
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7827 ;; it looks at the source file and then calls that handler, if
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7828 ;; there is one. But since ange-ftp, for instance, does not know
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7829 ;; about Tramp, it does not do the right thing if the target file
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7830 ;; name is a Tramp name.
46992
6529728ddf05 Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 46835
diff changeset
7831 ;; * 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
7832 ;; ** 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
7833 ;; 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
7834 ;; 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
7835 ;; ** 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
7836 ;; ** 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
7837 ;; ** 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
7838 ;; 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
7839 ;; ** 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
7840 ;; 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
7841 ;; ** 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
7842 ;; ** Implement "/multi:" completion.
b31c8ab7336a Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents: 47205
diff changeset
7843 ;; ** 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
7844 ;; * Allow out-of-band methods as _last_ multi-hop.
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7845
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7846 ;; Functions for file-name-handler-alist:
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7847 ;; diff-latest-backup-file -- in diff.el
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7848 ;; dired-uncache -- this will be needed when we do insert-directory caching
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7849 ;; file-name-as-directory -- use primitive?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7850 ;; file-name-sans-versions -- use primitive?
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7851 ;; get-file-buffer -- use primitive
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7852 ;; vc-registered
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7853
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 51968
diff changeset
7854 ;;; arch-tag: 3a21a994-182b-48fa-b0cd-c1d9fede424a
45861
7b663a89ef2a *** empty log message ***
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
diff changeset
7855 ;;; tramp.el ends here