Mercurial > emacs
annotate lisp/net/tramp.el @ 112453:06719a229a46 default tip
* calc/calc.el (calc-default-power-reference-level)
(calc-default-field-reference-level): New variables.
* calc/calc-units.el (math-standard-units): Add dB and Np.
(math-logunits): New variable.
(math-extract-logunits, math-logcombine, calcFunc-luplus)
(calcFunc-luminus, calc-luplus, calc-luminus, math-logunit-level)
(calcFunc-fieldlevel, calcFunc-powerlevel, calc-level): New
functions.
(math-find-base-units-rec): Add entry for ln(10).
* calc/calc-help.el (calc-u-prefix-help): Add logarithmic help.
(calc-ul-prefix-help): New function.
* calc/calc-ext.el (calc-init-extensions): Autoload new units
functions. Add keybindings for new units functions.
author | Jay Belanger <jay.p.belanger@gmail.com> |
---|---|
date | Sun, 23 Jan 2011 23:08:04 -0600 |
parents | 49f47421e4c1 |
children |
rev | line source |
---|---|
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
1 ;;; tramp.el --- Transparent Remote Access, Multiple Protocol |
45861 | 2 |
112238 | 3 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, |
4 ;; 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. | |
45861 | 5 |
93103
19a32f437b65
Fix up encoding.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93082
diff
changeset
|
6 ;; Author: Kai Großjohann <kai.grossjohann@gmx.net> |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
7 ;; Michael Albinus <michael.albinus@gmx.de> |
45861 | 8 ;; Keywords: comm, processes |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
9 ;; Package: tramp |
45861 | 10 |
11 ;; This file is part of GNU Emacs. | |
12 | |
94677
91e5880a36c1
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94436
diff
changeset
|
13 ;; GNU Emacs is free software: you can redistribute it and/or modify |
45861 | 14 ;; it under the terms of the GNU General Public License as published by |
94677
91e5880a36c1
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94436
diff
changeset
|
15 ;; the Free Software Foundation, either version 3 of the License, or |
91e5880a36c1
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94436
diff
changeset
|
16 ;; (at your option) any later version. |
45861 | 17 |
18 ;; GNU Emacs is distributed in the hope that it will be useful, | |
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 ;; GNU General Public License for more details. | |
22 | |
23 ;; You should have received a copy of the GNU General Public License | |
94677
91e5880a36c1
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
94436
diff
changeset
|
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
45861 | 25 |
26 ;;; Commentary: | |
27 | |
28 ;; This package provides remote file editing, similar to ange-ftp. | |
29 ;; The difference is that ange-ftp uses FTP to transfer files between | |
30 ;; the local and the remote host, whereas tramp.el uses a combination | |
31 ;; of rsh and rcp or other work-alike programs, such as ssh/scp. | |
32 ;; | |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
33 ;; For more detailed instructions, please see the info file. |
45861 | 34 ;; |
35 ;; Notes: | |
36 ;; ----- | |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
37 ;; |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
38 ;; This package only works for Emacs 22.1 and higher, and for XEmacs 21.4 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
39 ;; and higher. For XEmacs 21, you need the package `fsf-compat' for |
106643
9e3bbd77797c
* net/tramp.el (tramp-handle-insert-directory): Quote "'" in the
Michael Albinus <michael.albinus@gmx.de>
parents:
106613
diff
changeset
|
40 ;; the `with-timeout' macro. |
45861 | 41 ;; |
42 ;; Also see the todo list at the bottom of this file. | |
43 ;; | |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
44 ;; The current version of Tramp can be retrieved from the following URL: |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
45 ;; http://ftp.gnu.org/gnu/tramp/ |
45861 | 46 ;; |
47 ;; There's a mailing list for this, as well. Its name is: | |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
48 ;; tramp-devel@gnu.org |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
49 ;; You can use the Web to subscribe, under the following URL: |
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
50 ;; http://lists.gnu.org/mailman/listinfo/tramp-devel |
45861 | 51 ;; |
52 ;; For the adventurous, the current development sources are available | |
53 ;; via CVS. You can find instructions about this at the following URL: | |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
54 ;; http://savannah.gnu.org/projects/tramp/ |
45861 | 55 ;; Click on "CVS" in the navigation bar near the top. |
56 ;; | |
57 ;; Don't forget to put on your asbestos longjohns, first! | |
58 | |
59 ;;; Code: | |
60 | |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
61 (require 'tramp-compat) |
77986
0cc9b64806d2
Sync with Tramp 2.0.56.
Michael Albinus <michael.albinus@gmx.de>
parents:
76846
diff
changeset
|
62 |
45861 | 63 ;;; User Customizable Internal Variables: |
64 | |
65 (defgroup tramp nil | |
66 "Edit remote files with a combination of rsh and rcp or similar programs." | |
58005
f15a720d0f24
(tramp group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents:
57995
diff
changeset
|
67 :group 'files |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
68 :group 'comm |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
69 :version "22.1") |
45861 | 70 |
94436
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
71 ;; Maybe we need once a real Tramp mode, with key bindings etc. |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
72 ;;;###autoload |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
73 (defcustom tramp-mode t |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
74 "*Whether Tramp is enabled. |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
75 If it is set to nil, all remote file names are used literally." |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
76 :group 'tramp |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
77 :type 'boolean) |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
78 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
79 (defcustom tramp-verbose 3 |
105462
f6c5cf0fc0c9
* net/tramp.el (tramp-verbose): Fix docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
105351
diff
changeset
|
80 "*Verbosity level for Tramp messages. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
81 Any level x includes messages for all levels 1 .. x-1. The levels are |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
82 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
83 0 silent (no tramp messages at all) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
84 1 errors |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
85 2 warnings |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
86 3 connection to remote hosts (default level) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
87 4 activities |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
88 5 internal |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
89 6 sent and received strings |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
90 7 file caching |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
91 8 connection properties |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
92 9 test commands |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
93 10 traces (huge)." |
45861 | 94 :group 'tramp |
95 :type 'integer) | |
96 | |
105462
f6c5cf0fc0c9
* net/tramp.el (tramp-verbose): Fix docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
105351
diff
changeset
|
97 ;; Emacs case. |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
98 (eval-and-compile |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
99 (when (boundp 'backup-directory-alist) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
100 (defcustom tramp-backup-directory-alist nil |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
101 "Alist of filename patterns and backup directory names. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
102 Each element looks like (REGEXP . DIRECTORY), with the same meaning like |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
103 in `backup-directory-alist'. If a Tramp file is backed up, and DIRECTORY |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
104 is a local file name, the backup directory is prepended with Tramp file |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
105 name prefix \(method, user, host\) of file. |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
106 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
107 \(setq tramp-backup-directory-alist backup-directory-alist\) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
108 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
109 gives the same backup policy for Tramp files on their hosts like the |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
110 policy for local files." |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
111 :group 'tramp |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
112 :type '(repeat (cons (regexp :tag "Regexp matching filename") |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
113 (directory :tag "Backup directory name")))))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
114 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
115 ;; XEmacs case. We cannot check for `bkup-backup-directory-info', because |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
116 ;; the package "backup-dir" might not be loaded yet. |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
117 (eval-and-compile |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
118 (when (featurep 'xemacs) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
119 (defcustom tramp-bkup-backup-directory-info nil |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
120 "*Alist of (FILE-REGEXP BACKUP-DIR OPTIONS ...)) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
121 It has the same meaning like `bkup-backup-directory-info' from package |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
122 `backup-dir'. If a Tramp file is backed up, and BACKUP-DIR is a local |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
123 file name, the backup directory is prepended with Tramp file name prefix |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
124 \(method, user, host\) of file. |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
125 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
126 \(setq tramp-bkup-backup-directory-info bkup-backup-directory-info\) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
127 |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
128 gives the same backup policy for Tramp files on their hosts like the |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
129 policy for local files." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
130 :type '(repeat |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
131 (list (regexp :tag "File regexp") |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
132 (string :tag "Backup Dir") |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
133 (set :inline t |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
134 (const ok-create) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
135 (const full-path) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
136 (const prepend-name) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
137 (const search-upward)))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
138 :group 'tramp))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
139 |
45861 | 140 (defcustom tramp-auto-save-directory nil |
141 "*Put auto-save files in this directory, if set. | |
142 The idea is to use a local directory so that auto-saving is faster." | |
143 :group 'tramp | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
144 :type '(choice (const nil) string)) |
45861 | 145 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
146 (defcustom tramp-encoding-shell |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
147 (if (memq system-type '(windows-nt)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
148 (getenv "COMSPEC") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
149 "/bin/sh") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
150 "*Use this program for encoding and decoding commands on the local host. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
151 This shell is used to execute the encoding and decoding command on the |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
152 local host, so if you want to use `~' in those commands, you should |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
153 choose a shell here which groks tilde expansion. `/bin/sh' normally |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
154 does not understand tilde expansion. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
155 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
156 For encoding and deocding, commands like the following are executed: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
157 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
158 /bin/sh -c COMMAND < INPUT > OUTPUT |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
159 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
160 This variable can be used to change the \"/bin/sh\" part. See the |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
161 variable `tramp-encoding-command-switch' for the \"-c\" part. |
45861 | 162 |
163 Note that this variable is not used for remote commands. There are | |
164 mechanisms in tramp.el which automatically determine the right shell to | |
165 use for the remote host." | |
166 :group 'tramp | |
167 :type '(file :must-match t)) | |
168 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
169 (defcustom tramp-encoding-command-switch |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
170 (if (string-match "cmd\\.exe" tramp-encoding-shell) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
171 "/c" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
172 "-c") |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
173 "*Use this switch together with `tramp-encoding-shell' for local commands. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
174 See the variable `tramp-encoding-shell' for more information." |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
175 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
176 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
177 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
178 ;;;###tramp-autoload |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
179 (defvar tramp-methods nil |
45861 | 180 "*Alist of methods for remote files. |
181 This is a list of entries of the form (NAME PARAM1 PARAM2 ...). | |
182 Each NAME stands for a remote access method. Each PARAM is a | |
183 pair of the form (KEY VALUE). The following KEYs are defined: | |
184 * `tramp-remote-sh' | |
185 This specifies the Bourne shell to use on the remote host. This | |
186 MUST be a Bourne-like shell. It is normally not necessary to set | |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
187 this to any value other than \"/bin/sh\": Tramp wants to use a shell |
45861 | 188 which groks tilde expansion, but it can search for it. Also note |
189 that \"/bin/sh\" exists on all Unixen, this might not be true for | |
190 the value that you decide to use. You Have Been Warned. | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
191 * `tramp-login-program' |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
192 This specifies the name of the program to use for logging in to the |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
193 remote host. This may be the name of rsh or a workalike program, |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
194 or the name of telnet or a workalike, or the name of su or a workalike. |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
195 * `tramp-login-args' |
45861 | 196 This specifies the list of arguments to pass to the above |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
197 mentioned program. Please note that this is a list of list of arguments, |
45861 | 198 that is, normally you don't want to put \"-a -b\" or \"-f foo\" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
199 here. Instead, you want a list (\"-a\" \"-b\"), or (\"-f\" \"foo\"). |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
200 There are some patterns: \"%h\" in this list is replaced by the host |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
201 name, \"%u\" is replaced by the user name, \"%p\" is replaced by the |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
202 port number, and \"%%\" can be used to obtain a literal percent character. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
203 If a list containing \"%h\", \"%u\" or \"%p\" is unchanged during |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
204 expansion (i.e. no host or no user specified), this list is not used as |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
205 argument. By this, arguments like (\"-l\" \"%u\") are optional. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
206 \"%t\" is replaced by the temporary file name produced with |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
207 `tramp-make-tramp-temp-file'. \"%k\" indicates the keep-date |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
208 parameter of a program, if exists. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
209 * `tramp-async-args' |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
210 When an asynchronous process is started, we know already that |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
211 the connection works. Therefore, we can pass additional |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
212 parameters to suppress diagnostic messages, in order not to |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
213 tamper the process output. |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
214 * `tramp-copy-program' |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
215 This specifies the name of the program to use for remotely copying |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
216 the file; this might be the absolute filename of rcp or the name of |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
217 a workalike program. |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
218 * `tramp-copy-args' |
45861 | 219 This specifies the list of parameters to pass to the above mentioned |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
220 program, the hints for `tramp-login-args' also apply here. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
221 * `tramp-copy-keep-date' |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
222 This specifies whether the copying program when the preserves the |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
223 timestamp of the original file. |
105718
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
224 * `tramp-copy-keep-tmpfile' |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
225 This specifies whether a temporary local file shall be kept |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
226 for optimization reasons (useful for \"rsync\" methods). |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
227 * `tramp-copy-recursive' |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
228 Whether the operation copies directories recursively. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
229 * `tramp-default-port' |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
230 The default port of a method is needed in case of gateway connections. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
231 Additionally, it is used as indication which method is prepared for |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
232 passing gateways. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
233 * `tramp-gw-args' |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
234 As the attribute name says, additional arguments are specified here |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
235 when a method is applied via a gateway. |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
236 * `tramp-password-end-of-line' |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
237 This specifies the string to use for terminating the line after |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
238 submitting the password. If this method parameter is nil, then the |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
239 value of the normal variable `tramp-default-password-end-of-line' |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
240 is used. This parameter is necessary because the \"plink\" program |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
241 requires any two characters after sending the password. These do |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
242 not have to be newline or carriage return characters. Other login |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
243 programs are happy with just one character, the newline character. |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
244 We use \"xy\" as the value for methods using \"plink\". |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
245 |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
246 What does all this mean? Well, you should specify `tramp-login-program' |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
247 for all methods; this program is used to log in to the remote site. Then, |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
248 there are two ways to actually transfer the files between the local and the |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
249 remote side. One way is using an additional rcp-like program. If you want |
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
250 to do this, set `tramp-copy-program' in the method. |
45861 | 251 |
252 Another possibility for file transfer is inline transfer, i.e. the | |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
253 file is passed through the same buffer used by `tramp-login-program'. In |
45861 | 254 this case, the file contents need to be protected since the |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
255 `tramp-login-program' might use escape codes or the connection might not |
45861 | 256 be eight-bit clean. Therefore, file contents are encoded for transit. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
257 See the variables `tramp-local-coding-commands' and |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
258 `tramp-remote-coding-commands' for details. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
259 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
260 So, to summarize: if the method is an out-of-band method, then you |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
261 must specify `tramp-copy-program' and `tramp-copy-args'. If it is an |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
262 inline method, then these two parameters should be nil. Methods which |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
263 are fit for gateways must have `tramp-default-port' at least. |
45861 | 264 |
265 Notes: | |
266 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
267 When using `su' or `sudo' the phrase `open connection to a remote |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
268 host' sounds strange, but it is used nevertheless, for consistency. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
269 No connection is opened to a remote host, but `su' or `sudo' is |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
270 started on the local host. You should specify a remote host |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
271 `localhost' or the name of the local host. Another host name is |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
272 useful only in combination with `tramp-default-proxies-alist'.") |
45861 | 273 |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
274 (defun tramp-detect-ssh-controlmaster () |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
275 "Call ssh to detect whether it supports the ControlMaster argument. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
276 This function may return nil when the argument is supported, but |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
277 shouldn't return t when it isn't." |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
278 (ignore-errors |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
279 (with-temp-buffer |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
280 (call-process "ssh" nil t nil "-o" "ControlMaster") |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
281 (goto-char (point-min)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
282 (search-forward-regexp "Missing ControlMaster argument" nil t)))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
283 |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
284 (defcustom tramp-default-method |
74777
948c86bf6396
* net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents:
74766
diff
changeset
|
285 ;; An external copy method seems to be preferred, because it is much |
948c86bf6396
* net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents:
74766
diff
changeset
|
286 ;; more performant for large files, and it hasn't too serious delays |
948c86bf6396
* net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents:
74766
diff
changeset
|
287 ;; for small files. But it must be ensured that there aren't |
948c86bf6396
* net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents:
74766
diff
changeset
|
288 ;; permanent password queries. Either a password agent like |
105462
f6c5cf0fc0c9
* net/tramp.el (tramp-verbose): Fix docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
105351
diff
changeset
|
289 ;; "ssh-agent" or "Pageant" shall run, or the optional |
f6c5cf0fc0c9
* net/tramp.el (tramp-verbose): Fix docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
105351
diff
changeset
|
290 ;; password-cache.el or auth-sources.el packages shall be active for |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
291 ;; password caching. "scpc" is chosen if we detect that the user is |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
292 ;; running OpenSSH 4.0 or newer. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
293 (cond |
112238 | 294 ;; PuTTY is installed. We don't take it, if it is installed on a |
295 ;; non-windows system, or pscp from the pssh (parallel ssh) package | |
296 ;; is found. | |
297 ((and (eq system-type 'windows-nt) | |
298 (executable-find "pscp")) | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
299 (if (or (fboundp 'password-read) |
105462
f6c5cf0fc0c9
* net/tramp.el (tramp-verbose): Fix docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
105351
diff
changeset
|
300 (fboundp 'auth-source-user-or-password) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
301 ;; Pageant is running. |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
302 (tramp-compat-process-running-p "Pageant")) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
303 "pscp" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
304 "plink")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
305 ;; There is an ssh installation. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
306 ((executable-find "scp") |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
307 (cond |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
308 ((tramp-detect-ssh-controlmaster) "scpc") |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
309 ((or (fboundp 'password-read) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
310 (fboundp 'auth-source-user-or-password) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
311 ;; ssh-agent is running. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
312 (getenv "SSH_AUTH_SOCK") |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
313 (getenv "SSH_AGENT_PID")) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
314 "scp") |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
315 (t "ssh"))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
316 ;; Fallback. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
317 (t "ftp")) |
45861 | 318 "*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
|
319 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
|
320 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
|
321 :group 'tramp |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
322 :type 'string) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
323 |
112032
209df3f0dcc6
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111964
diff
changeset
|
324 ;;;###tramp-autoload |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
325 (defcustom tramp-default-method-alist nil |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
326 "*Default method to use for specific host/user pairs. |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
327 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
|
328 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
|
329 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
|
330 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
|
331 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
|
332 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
333 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
|
334 empty string for the user name. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
335 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
336 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
|
337 :group 'tramp |
111765
202eb704e80b
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111612
diff
changeset
|
338 :type '(repeat (list (choice :tag "Host regexp" regexp sexp) |
202eb704e80b
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111612
diff
changeset
|
339 (choice :tag "User regexp" regexp sexp) |
202eb704e80b
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111612
diff
changeset
|
340 (choice :tag "Method name" string (const nil))))) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
341 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
342 (defcustom tramp-default-user nil |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
343 "*Default user to use for transferring files. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
344 It is nil by default; otherwise settings in configuration files like |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
345 \"~/.ssh/config\" would be overwritten. Also see `tramp-default-user-alist'. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
346 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
347 This variable is regarded as obsolete, and will be removed soon." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
348 :group 'tramp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
349 :type '(choice (const nil) string)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
350 |
112032
209df3f0dcc6
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111964
diff
changeset
|
351 ;;;###tramp-autoload |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
352 (defcustom tramp-default-user-alist nil |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
353 "*Default user to use for specific method/host pairs. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
354 This is an alist of items (METHOD HOST USER). The first matching item |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
355 specifies the user to use for a file name which does not specify a |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
356 user. METHOD and USER are regular expressions or nil, which is |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
357 interpreted as a regular expression which always matches. If no entry |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
358 matches, the variable `tramp-default-user' takes effect. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
359 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
360 If the file name does not specify the method, lookup is done using the |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
361 empty string for the method name." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
362 :group 'tramp |
111765
202eb704e80b
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111612
diff
changeset
|
363 :type '(repeat (list (choice :tag "Method regexp" regexp sexp) |
202eb704e80b
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111612
diff
changeset
|
364 (choice :tag " Host regexp" regexp sexp) |
202eb704e80b
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111612
diff
changeset
|
365 (choice :tag " User name" string (const nil))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
366 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
367 (defcustom tramp-default-host (system-name) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
368 "*Default host to use for transferring files. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
369 Useful for su and sudo methods mostly." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
370 :group 'tramp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
371 :type 'string) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
372 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
373 (defcustom tramp-default-proxies-alist nil |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
374 "*Route to be followed for specific host/user pairs. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
375 This is an alist of items (HOST USER PROXY). The first matching |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
376 item specifies the proxy to be passed for a file name located on |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
377 a remote target matching USER@HOST. HOST and USER are regular |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
378 expressions. PROXY must be a Tramp filename without a localname |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
379 part. Method and user name on PROXY are optional, which is |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
380 interpreted with the default values. PROXY can contain the |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
381 patterns %h and %u, which are replaced by the strings matching |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
382 HOST or USER, respectively. |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
383 |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
384 HOST, USER or PROXY could also be Lisp forms, which will be |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
385 evaluated. The result must be a string or nil, which is |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
386 interpreted as a regular expression which always matches." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
387 :group 'tramp |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
388 :type '(repeat (list (choice :tag "Host regexp" regexp sexp) |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
389 (choice :tag "User regexp" regexp sexp) |
111765
202eb704e80b
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111612
diff
changeset
|
390 (choice :tag " Proxy name" string (const nil))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
391 |
112032
209df3f0dcc6
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111964
diff
changeset
|
392 ;;;###tramp-autoload |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
393 (defconst tramp-local-host-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
394 (concat |
111788
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
395 "\\`" |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
396 (regexp-opt |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
397 (list "localhost" "localhost6" (system-name) "127\.0\.0\.1" "::1") t) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
398 "\\'") |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
399 "*Host names which are regarded as local host.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
400 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
401 (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
|
402 "*Alist of methods for remote files. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
403 This is a list of entries of the form \(NAME PAIR1 PAIR2 ...\). |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
404 Each NAME stands for a remote access method. Each PAIR is of the form |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
405 \(FUNCTION FILE\). FUNCTION is responsible to extract user names and host |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
406 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
|
407 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
408 * `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
|
409 * `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
|
410 * `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
|
411 * `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
|
412 * `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
|
413 * `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
|
414 * `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
|
415 * `tramp-parse-netrc' for \"~/.netrc\" like files. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
416 * `tramp-parse-putty' for PuTTY registry keys. |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
417 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
418 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
|
419 the info pages.") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
420 |
94975
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
421 (defconst tramp-echo-mark-marker "_echo" |
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
422 "String marker to surround echoed commands.") |
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
423 |
106597
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
424 (defconst tramp-echo-mark-marker-length (length tramp-echo-mark-marker) |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
425 "String length of `tramp-echo-mark-marker'.") |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
426 |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
427 (defconst tramp-echo-mark |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
428 (concat tramp-echo-mark-marker |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
429 (make-string tramp-echo-mark-marker-length ?\b)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
430 "String mark to be transmitted around shell commands. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
431 Used to separate their echo from the output they produce. This |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
432 will only be used if we cannot disable remote echo via stty. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
433 This string must have no effect on the remote shell except for |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
434 producing some echo which can later be detected by |
94975
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
435 `tramp-echoed-echo-mark-regexp'. Using `tramp-echo-mark-marker', |
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
436 followed by an equal number of backspaces to erase them will |
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
437 usually suffice.") |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
438 |
106597
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
439 (defconst tramp-echoed-echo-mark-regexp |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
440 (format "%s\\(\b\\( \b\\)?\\)\\{%d\\}" |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
441 tramp-echo-mark-marker tramp-echo-mark-marker-length) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
442 "Regexp which matches `tramp-echo-mark' as it gets echoed by |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
443 the remote shell.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
444 |
45861 | 445 (defcustom tramp-rsh-end-of-line "\n" |
446 "*String used for end of line in rsh connections. | |
447 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
|
448 if you need to change this. |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
449 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
|
450 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
|
451 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
452 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
453 |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
454 (defcustom tramp-default-password-end-of-line |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
455 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
|
456 "*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
|
457 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
|
458 `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
|
459 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
460 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
|
461 \"\\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
|
462 \"\\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
|
463 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
|
464 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
465 The default value is to use the same value as `tramp-rsh-end-of-line'." |
45861 | 466 :group 'tramp |
467 :type 'string) | |
468 | |
469 (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
|
470 ".*ogin\\( .*\\)?: *" |
45861 | 471 "*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
|
472 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
|
473 |
efa862a76bc2
* net/tramp.el (tramp-login-prompt-regexp): Expand regexp in order to
Michael Albinus <michael.albinus@gmx.de>
parents:
65359
diff
changeset
|
474 Sometimes the prompt is reported to look like \"login as:\"." |
45861 | 475 :group 'tramp |
476 :type 'regexp) | |
477 | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
478 (defcustom tramp-shell-prompt-pattern |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
479 ;; Allow a prompt to start right after a ^M since it indeed would be |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
480 ;; displayed at the beginning of the line (and Zsh uses it). This |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
481 ;; regexp works only for GNU Emacs. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
482 (concat (if (featurep 'xemacs) "" "\\(?:^\\|\r\\)") |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
483 "[^#$%>\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
|
484 "Regexp to match prompts from remote shell. |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
485 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
|
486 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
|
487 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
|
488 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
|
489 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
|
490 variable is similar to the default value of `shell-prompt-pattern', |
106470
9e96dbbd314e
Handle prompt rules of ksh in OpenBSD 4.5. Reported by Raphal
Michael Albinus <michael.albinus@gmx.de>
parents:
106390
diff
changeset
|
491 which should work well in many cases. |
9e96dbbd314e
Handle prompt rules of ksh in OpenBSD 4.5. Reported by Raphal
Michael Albinus <michael.albinus@gmx.de>
parents:
106390
diff
changeset
|
492 |
9e96dbbd314e
Handle prompt rules of ksh in OpenBSD 4.5. Reported by Raphal
Michael Albinus <michael.albinus@gmx.de>
parents:
106390
diff
changeset
|
493 This regexp must match both `tramp-initial-end-of-output' and |
9e96dbbd314e
Handle prompt rules of ksh in OpenBSD 4.5. Reported by Raphal
Michael Albinus <michael.albinus@gmx.de>
parents:
106390
diff
changeset
|
494 `tramp-end-of-output'." |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
495 :group 'tramp |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
496 :type 'regexp) |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
497 |
45861 | 498 (defcustom tramp-password-prompt-regexp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
499 "^.*\\([pP]assword\\|[pP]assphrase\\).*:\^@? *" |
45861 | 500 "*Regexp matching password-like prompts. |
46752 | 501 The regexp should match at end of buffer. |
45861 | 502 |
503 The `sudo' program appears to insert a `^@' character into the prompt." | |
504 :group 'tramp | |
505 :type 'regexp) | |
506 | |
507 (defcustom tramp-wrong-passwd-regexp | |
46790 | 508 (concat "^.*" |
509 ;; These strings should be on the last line | |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
510 (regexp-opt '("Permission denied" |
46790 | 511 "Login incorrect" |
512 "Login Incorrect" | |
513 "Connection refused" | |
514 "Connection closed" | |
107021
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
515 "Timeout, server not responding." |
46790 | 516 "Sorry, try again." |
517 "Name or service not known" | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
518 "Host key verification failed." |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
519 "No supported authentication methods left to try!") t) |
46790 | 520 ".*" |
521 "\\|" | |
522 "^.*\\(" | |
523 ;; Here comes a list of regexes, separated by \\| | |
524 "Received signal [0-9]+" | |
525 "\\).*") | |
45861 | 526 "*Regexp matching a `login failed' message. |
46752 | 527 The regexp should match at end of buffer." |
528 :group 'tramp | |
529 :type 'regexp) | |
530 | |
531 (defcustom tramp-yesno-prompt-regexp | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
532 (concat |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
533 (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
|
534 "\\s-*") |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
535 "Regular expression matching all yes/no queries which need to be confirmed. |
46752 | 536 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
|
537 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
|
538 See also `tramp-yn-prompt-regexp'." |
45861 | 539 :group 'tramp |
540 :type 'regexp) | |
541 | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
542 (defcustom tramp-yn-prompt-regexp |
74985
155a8e75cd11
Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents:
74777
diff
changeset
|
543 (concat |
155a8e75cd11
Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents:
74777
diff
changeset
|
544 (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
|
545 "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
|
546 "\\s-*") |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
547 "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
|
548 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
|
549 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
|
550 See also `tramp-yesno-prompt-regexp'." |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
551 :group 'tramp |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
552 :type 'regexp) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
553 |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
554 (defcustom tramp-terminal-prompt-regexp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
555 (concat "\\(" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
556 "TERM = (.*)" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
557 "\\|" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
558 "Terminal type\\? \\[.*\\]" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
559 "\\)\\s-*") |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
560 "Regular expression matching all terminal setting prompts. |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
561 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
|
562 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
|
563 :group 'tramp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
564 :type 'regexp) |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
565 |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
566 (defcustom tramp-operation-not-permitted-regexp |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
567 (concat "\\(" "preserving times.*" "\\|" "set mode" "\\)" ":\\s-*" |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
568 (regexp-opt '("Operation not permitted") t)) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
569 "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
|
570 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
|
571 be ignored safely." |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
572 :group 'tramp |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
573 :type 'regexp) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
574 |
74166
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
575 (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
|
576 (concat "\\(.+: " |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
577 (regexp-opt '("Permission denied" |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
578 "not a regular file" |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
579 "is a directory" |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
580 "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
|
581 "\\)\\s-*") |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
582 "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
|
583 :group 'tramp |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
584 :type 'regexp) |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
585 |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
586 (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
|
587 "" |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
588 "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
|
589 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
|
590 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
|
591 The answer will be provided by `tramp-action-process-alive', |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
592 `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
|
593 :group 'tramp |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
594 :type 'regexp) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
595 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
596 (defconst tramp-temp-name-prefix "tramp." |
45861 | 597 "*Prefix to use for temporary files. |
598 If this is a relative file name (such as \"tramp.\"), it is considered | |
599 relative to the directory name returned by the function | |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
600 `tramp-compat-temporary-file-directory' (which see). It may also be an |
45861 | 601 absolute file name; don't forget to include a prefix for the filename |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
602 part, though.") |
45861 | 603 |
96941
940a290a5646
* net/tramp.el (tramp-methods): Add "-q" for "scp", "scp1",
Michael Albinus <michael.albinus@gmx.de>
parents:
96392
diff
changeset
|
604 (defconst tramp-temp-buffer-name " *tramp temp*" |
940a290a5646
* net/tramp.el (tramp-methods): Add "-q" for "scp", "scp1",
Michael Albinus <michael.albinus@gmx.de>
parents:
96392
diff
changeset
|
605 "Buffer name for a temporary buffer. |
940a290a5646
* net/tramp.el (tramp-methods): Add "-q" for "scp", "scp1",
Michael Albinus <michael.albinus@gmx.de>
parents:
96392
diff
changeset
|
606 It shall be used in combination with `generate-new-buffer-name'.") |
940a290a5646
* net/tramp.el (tramp-methods): Add "-q" for "scp", "scp1",
Michael Albinus <michael.albinus@gmx.de>
parents:
96392
diff
changeset
|
607 |
105718
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
608 (defvar tramp-temp-buffer-file-name nil |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
609 "File name of a persistent local temporary file. |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
610 Useful for \"rsync\" like methods.") |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
611 (make-variable-buffer-local 'tramp-temp-buffer-file-name) |
111964
ec45dfa69a06
* net/tramp.el (tramp-temp-buffer-file-name): Make it permanent-local.
Michael Albinus <michael.albinus@gmx.de>
parents:
111945
diff
changeset
|
612 (put 'tramp-temp-buffer-file-name 'permanent-local t) |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
613 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
614 ;; XEmacs is distributed with few Lisp packages. Further packages are |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
615 ;; installed using EFS. If we use a unified filename format, then |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
616 ;; Tramp is required in addition to EFS. (But why can't Tramp just |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
617 ;; disable EFS when Tramp is loaded? Then XEmacs can ship with EFS |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
618 ;; just like before.) Another reason for using a separate filename |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
619 ;; syntax on XEmacs is that EFS hooks into XEmacs in many places, but |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
620 ;; Tramp only knows how to deal with `file-name-handler-alist', not |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
621 ;; the other places. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
622 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
623 ;; Currently, we have the choice between 'ftp, 'sep, and 'url. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
624 ;;;###autoload |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
625 (defcustom tramp-syntax |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
626 (if (featurep 'xemacs) 'sep 'ftp) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
627 "Tramp filename syntax to be used. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
628 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
629 It can have the following values: |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
630 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
631 'ftp -- Ange-FTP respective EFS like syntax (GNU Emacs default) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
632 'sep -- Syntax as defined for XEmacs (not available yet for GNU Emacs) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
633 'url -- URL-like syntax." |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
634 :group 'tramp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
635 :type (if (featurep 'xemacs) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
636 '(choice (const :tag "EFS" ftp) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
637 (const :tag "XEmacs" sep) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
638 (const :tag "URL" url)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
639 '(choice (const :tag "Ange-FTP" ftp) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
640 (const :tag "URL" url)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
641 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
642 (defconst tramp-prefix-format |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
643 (cond ((equal tramp-syntax 'ftp) "/") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
644 ((equal tramp-syntax 'sep) "/[") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
645 ((equal tramp-syntax 'url) "/") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
646 (t (error "Wrong `tramp-syntax' defined"))) |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
647 "*String matching the very beginning of Tramp file names. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
648 Used in `tramp-make-tramp-file-name'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
649 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
650 (defconst tramp-prefix-regexp |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
651 (concat "^" (regexp-quote tramp-prefix-format)) |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
652 "*Regexp matching the very beginning of Tramp file names. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
653 Should always start with \"^\". Derived from `tramp-prefix-format'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
654 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
655 (defconst tramp-method-regexp |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
656 "[a-zA-Z_0-9-]+" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
657 "*Regexp matching methods identifiers.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
658 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
659 (defconst tramp-postfix-method-format |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
660 (cond ((equal tramp-syntax 'ftp) ":") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
661 ((equal tramp-syntax 'sep) "/") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
662 ((equal tramp-syntax 'url) "://") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
663 (t (error "Wrong `tramp-syntax' defined"))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
664 "*String matching delimeter between method and user or host names. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
665 Used in `tramp-make-tramp-file-name'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
666 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
667 (defconst tramp-postfix-method-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
668 (regexp-quote tramp-postfix-method-format) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
669 "*Regexp matching delimeter between method and user or host names. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
670 Derived from `tramp-postfix-method-format'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
671 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
672 (defconst tramp-user-regexp "[^:/ \t]+" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
673 "*Regexp matching user names.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
674 |
112032
209df3f0dcc6
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111964
diff
changeset
|
675 ;;;###tramp-autoload |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
676 (defconst tramp-prefix-domain-format "%" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
677 "*String matching delimeter between user and domain names.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
678 |
112032
209df3f0dcc6
* net/tramp.el (tramp-default-method-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
111964
diff
changeset
|
679 ;;;###tramp-autoload |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
680 (defconst tramp-prefix-domain-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
681 (regexp-quote tramp-prefix-domain-format) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
682 "*Regexp matching delimeter between user and domain names. |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
683 Derived from `tramp-prefix-domain-format'.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
684 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
685 (defconst tramp-domain-regexp "[-a-zA-Z0-9_.]+" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
686 "*Regexp matching domain names.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
687 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
688 (defconst tramp-user-with-domain-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
689 (concat "\\(" tramp-user-regexp "\\)" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
690 tramp-prefix-domain-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
691 "\\(" tramp-domain-regexp "\\)") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
692 "*Regexp matching user names with domain names.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
693 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
694 (defconst tramp-postfix-user-format "@" |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
695 "*String matching delimeter between user and host names. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
696 Used in `tramp-make-tramp-file-name'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
697 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
698 (defconst tramp-postfix-user-regexp |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
699 (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
|
700 "*Regexp matching delimeter between user and host names. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
701 Derived from `tramp-postfix-user-format'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
702 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
703 (defconst tramp-host-regexp "[a-zA-Z0-9_.-]+" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
704 "*Regexp matching host names.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
705 |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
706 (defconst tramp-prefix-ipv6-format |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
707 (cond ((equal tramp-syntax 'ftp) "[") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
708 ((equal tramp-syntax 'sep) "") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
709 ((equal tramp-syntax 'url) "[") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
710 (t (error "Wrong `tramp-syntax' defined"))) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
711 "*String matching left hand side of IPv6 addresses. |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
712 Used in `tramp-make-tramp-file-name'.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
713 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
714 (defconst tramp-prefix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
715 (regexp-quote tramp-prefix-ipv6-format) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
716 "*Regexp matching left hand side of IPv6 addresses. |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
717 Derived from `tramp-prefix-ipv6-format'.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
718 |
101282
986acdda4aac
* net/tramp.el (tramp-ipv6-regexp): The regexp shall cover also
Michael Albinus <michael.albinus@gmx.de>
parents:
101020
diff
changeset
|
719 ;; The following regexp is a bit sloppy. But it shall serve our |
986acdda4aac
* net/tramp.el (tramp-ipv6-regexp): The regexp shall cover also
Michael Albinus <michael.albinus@gmx.de>
parents:
101020
diff
changeset
|
720 ;; purposes. It covers also IPv4 mapped IPv6 addresses, like in |
986acdda4aac
* net/tramp.el (tramp-ipv6-regexp): The regexp shall cover also
Michael Albinus <michael.albinus@gmx.de>
parents:
101020
diff
changeset
|
721 ;; "::ffff:192.168.0.1". |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
722 (defconst tramp-ipv6-regexp |
101282
986acdda4aac
* net/tramp.el (tramp-ipv6-regexp): The regexp shall cover also
Michael Albinus <michael.albinus@gmx.de>
parents:
101020
diff
changeset
|
723 "\\(?:\\(?:[a-zA-Z0-9]+\\)?:\\)+[a-zA-Z0-9.]+" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
724 "*Regexp matching IPv6 addresses.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
725 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
726 (defconst tramp-postfix-ipv6-format |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
727 (cond ((equal tramp-syntax 'ftp) "]") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
728 ((equal tramp-syntax 'sep) "") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
729 ((equal tramp-syntax 'url) "]") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
730 (t (error "Wrong `tramp-syntax' defined"))) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
731 "*String matching right hand side of IPv6 addresses. |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
732 Used in `tramp-make-tramp-file-name'.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
733 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
734 (defconst tramp-postfix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
735 (regexp-quote tramp-postfix-ipv6-format) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
736 "*Regexp matching right hand side of IPv6 addresses. |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
737 Derived from `tramp-postfix-ipv6-format'.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
738 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
739 (defconst tramp-prefix-port-format |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
740 (cond ((equal tramp-syntax 'ftp) "#") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
741 ((equal tramp-syntax 'sep) "#") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
742 ((equal tramp-syntax 'url) ":") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
743 (t (error "Wrong `tramp-syntax' defined"))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
744 "*String matching delimeter between host names and port numbers.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
745 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
746 (defconst tramp-prefix-port-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
747 (regexp-quote tramp-prefix-port-format) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
748 "*Regexp matching delimeter between host names and port numbers. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
749 Derived from `tramp-prefix-port-format'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
750 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
751 (defconst tramp-port-regexp "[0-9]+" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
752 "*Regexp matching port numbers.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
753 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
754 (defconst tramp-host-with-port-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
755 (concat "\\(" tramp-host-regexp "\\)" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
756 tramp-prefix-port-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
757 "\\(" tramp-port-regexp "\\)") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
758 "*Regexp matching host names with port numbers.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
759 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
760 (defconst tramp-postfix-host-format |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
761 (cond ((equal tramp-syntax 'ftp) ":") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
762 ((equal tramp-syntax 'sep) "]") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
763 ((equal tramp-syntax 'url) "") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
764 (t (error "Wrong `tramp-syntax' defined"))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
765 "*String matching delimeter between host names and localnames. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
766 Used in `tramp-make-tramp-file-name'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
767 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
768 (defconst tramp-postfix-host-regexp |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
769 (regexp-quote tramp-postfix-host-format) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
770 "*Regexp matching delimeter between host names and localnames. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
771 Derived from `tramp-postfix-host-format'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
772 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
773 (defconst tramp-localname-regexp ".*$" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
774 "*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
|
775 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
776 ;;; File name format: |
45861 | 777 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
778 (defconst tramp-file-name-structure |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
779 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
780 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
781 tramp-prefix-regexp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
782 "\\(" "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp "\\)?" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
783 "\\(" "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp "\\)?" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
784 "\\(" "\\(" tramp-host-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
785 "\\|" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
786 tramp-prefix-ipv6-regexp tramp-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
787 tramp-postfix-ipv6-regexp "\\)" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
788 "\\(" tramp-prefix-port-regexp tramp-port-regexp "\\)?" "\\)?" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
789 tramp-postfix-host-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
790 "\\(" tramp-localname-regexp "\\)") |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
791 2 4 5 8) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
792 |
45861 | 793 "*List of five elements (REGEXP METHOD USER HOST FILE), detailing \ |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
794 the Tramp file name structure. |
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
795 |
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
796 The first element REGEXP is a regular expression matching a Tramp file |
45861 | 797 name. The regex should contain parentheses around the method name, |
798 the user name, the host name, and the file name parts. | |
799 | |
800 The second element METHOD is a number, saying which pair of | |
801 parentheses matches the method name. The third element USER is | |
802 similar, but for the user name. The fourth element HOST is similar, | |
803 but for the host name. The fifth element FILE is for the file name. | |
804 These numbers are passed directly to `match-string', which see. That | |
805 means the opening parentheses are counted to identify the pair. | |
806 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
807 See also `tramp-file-name-regexp'.") |
45861 | 808 |
809 ;;;###autoload | |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
810 (defconst tramp-file-name-regexp-unified |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
811 (if (memq system-type '(cygwin windows-nt)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
812 "\\`/\\([^[/:]\\{2,\\}\\|[^/]\\{2,\\}]\\):" |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
813 "\\`/\\([^[/:]+\\|[^/]+]\\):") |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
814 "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
|
815 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
816 Tramp. See `tramp-file-name-structure' for more explanations. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
817 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
818 On W32 systems, the volume letter must be ignored.") |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
819 |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
820 ;;;###autoload |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
821 (defconst tramp-file-name-regexp-separate "\\`/\\[.*\\]" |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
822 "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
|
823 XEmacs uses a separate filename syntax for Tramp and EFS. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
824 See `tramp-file-name-structure' for more explanations.") |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
825 |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
826 ;;;###autoload |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
827 (defconst tramp-file-name-regexp-url "\\`/[^/:]+://" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
828 "Value for `tramp-file-name-regexp' for URL-like remoting. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
829 See `tramp-file-name-structure' for more explanations.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
830 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
831 ;;;###autoload |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
832 (defconst tramp-file-name-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
833 (cond ((equal tramp-syntax 'ftp) tramp-file-name-regexp-unified) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
834 ((equal tramp-syntax 'sep) tramp-file-name-regexp-separate) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
835 ((equal tramp-syntax 'url) tramp-file-name-regexp-url) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
836 (t (error "Wrong `tramp-syntax' defined"))) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84985
diff
changeset
|
837 "*Regular expression matching file names handled by Tramp. |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
838 This regexp should match Tramp file names but no other file names. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
839 When tramp.el is loaded, this regular expression is prepended to |
45861 | 840 `file-name-handler-alist', and that is searched sequentially. Thus, |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
841 if the Tramp entry appears rather early in the `file-name-handler-alist' |
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
842 and is a bit too general, then some files might be considered Tramp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
843 files which are not really Tramp files. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
844 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
845 Please note that the entry in `file-name-handler-alist' is made when |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
846 this file \(tramp.el\) is loaded. This means that this variable must be set |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
847 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
|
848 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
|
849 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
850 Also see `tramp-file-name-structure'.") |
45861 | 851 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
852 ;;;###autoload |
92982
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
853 (defconst tramp-root-regexp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
854 (if (memq system-type '(cygwin windows-nt)) |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
855 "\\`\\([a-zA-Z]:\\)?/" |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
856 "\\`/") |
92982
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
857 "Beginning of an incomplete Tramp file name. |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
858 Usually, it is just \"\\\\`/\". On W32 systems, there might be a |
93040
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
859 volume letter, which will be removed by `tramp-drop-volume-letter'.") |
92982
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
860 |
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
861 ;;;###autoload |
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
862 (defconst tramp-completion-file-name-regexp-unified |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
863 (if (memq system-type '(cygwin windows-nt)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
864 (concat tramp-root-regexp "[^/]\\{2,\\}\\'") |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
865 (concat tramp-root-regexp "[^/]*\\'")) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
866 "Value for `tramp-completion-file-name-regexp' for unified remoting. |
92982
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
867 GNU Emacs uses a unified filename syntax for Tramp and Ange-FTP. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
868 See `tramp-file-name-structure' for more explanations. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
869 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
870 On W32 systems, the volume letter must be ignored.") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
871 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
872 ;;;###autoload |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
873 (defconst tramp-completion-file-name-regexp-separate |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
874 (concat tramp-root-regexp "\\([[][^]]*\\)?\\'") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
875 "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
|
876 XEmacs uses a separate filename syntax for Tramp and EFS. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
877 See `tramp-file-name-structure' for more explanations.") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
878 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
879 ;;;###autoload |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
880 (defconst tramp-completion-file-name-regexp-url |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
881 (concat tramp-root-regexp "[^/:]+\\(:\\(/\\(/[^/]*\\)?\\)?\\)?\\'") |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
882 "Value for `tramp-completion-file-name-regexp' for URL-like remoting. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
883 See `tramp-file-name-structure' for more explanations.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
884 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
885 ;;;###autoload |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
886 (defconst tramp-completion-file-name-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
887 (cond ((equal tramp-syntax 'ftp) tramp-completion-file-name-regexp-unified) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
888 ((equal tramp-syntax 'sep) tramp-completion-file-name-regexp-separate) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
889 ((equal tramp-syntax 'url) tramp-completion-file-name-regexp-url) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
890 (t (error "Wrong `tramp-syntax' defined"))) |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
891 "*Regular expression matching file names handled by Tramp completion. |
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
892 This regexp should match partial Tramp file names only. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
893 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
894 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
|
895 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
|
896 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
|
897 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
|
898 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
899 Also see `tramp-file-name-structure'.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
900 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
901 ;; Chunked sending kludge. We set this to 500 for black-listed constellations |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
902 ;; 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
|
903 ;; 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
|
904 ;; 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
|
905 ;; 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
|
906 (defcustom tramp-chunksize |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
907 (when (and (not (featurep 'xemacs)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
908 (memq system-type '(hpux))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
909 500) |
66561
742e40a6bf3c
* net/tramp.el (tramp-chunksize): Escape parentheses in docstring
Michael Albinus <michael.albinus@gmx.de>
parents:
66496
diff
changeset
|
910 ;; 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
|
911 ;; 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
|
912 ;; `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
|
913 "*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
|
914 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
|
915 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
|
916 checked via the following code: |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
917 |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
918 (with-temp-buffer |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
919 (let* ((user \"xxx\") (host \"yyy\") |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
920 (init 0) (step 50) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
921 (sent init) (received init)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
922 (while (= sent received) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
923 (setq sent (+ sent step)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
924 (erase-buffer) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
925 (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
|
926 \"ssh\" \"-l\" user host \"wc\" \"-c\"))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
927 (when (memq (process-status proc) '(run open)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
928 (process-send-string proc (make-string sent ?\\ )) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
929 (process-send-eof proc) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
930 (process-send-eof proc)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
931 (while (not (progn (goto-char (point-min)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
932 (re-search-forward \"\\\\w+\" (point-max) t))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
933 (accept-process-output proc 1)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
934 (when (memq (process-status proc) '(run open)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
935 (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
|
936 (delete-process proc) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
937 (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
|
938 (sit-for 0)))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
939 (if (> sent (+ init step)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
940 (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
|
941 (- sent step)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
942 (message \"Test does not work\") |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
943 (display-buffer (current-buffer)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
944 (sit-for 30)))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
945 |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
946 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
|
947 \(replace \"xxx\" and \"yyy\" by the remote user and host name, |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
948 respectively\). You can do this, for example, by pasting it into |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
949 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
|
950 last closing parenthesis. Note that it works only if you have configured |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
951 \"ssh\" to run without password query, see ssh-agent\(1\). |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
952 |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
953 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
|
954 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
|
955 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
|
956 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
957 When it is necessary to set `tramp-chunksize', you might consider to |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
958 use an out-of-the-band method \(like \"scp\"\) instead of an internal one |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
959 \(like \"ssh\"\), because setting `tramp-chunksize' to non-nil decreases |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
960 performance. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
961 |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
962 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
|
963 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
|
964 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
|
965 in the third line of the code. |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
966 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
967 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
|
968 this variable to be set as well." |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
969 :group 'tramp |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
970 :type '(choice (const nil) integer)) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
971 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
972 ;; 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
|
973 ;; 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
|
974 ;; 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
|
975 ;; 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
|
976 (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
|
977 "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
|
978 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
|
979 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
|
980 :group 'tramp |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
981 :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
|
982 |
86204
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
983 (defcustom tramp-completion-reread-directory-timeout 10 |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
984 "Defines seconds since last remote command before rereading a directory. |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
985 A remote directory might have changed its contents. In order to |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
986 make it visible during file name completion in the minibuffer, |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
987 Tramp flushes its cache and rereads the directory contents when |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
988 more than `tramp-completion-reread-directory-timeout' seconds |
110702
4e901a2d3669
* files.el (remote-file-name-inhibit-cache): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
110374
diff
changeset
|
989 have been gone since last remote command execution. A value of `t' |
4e901a2d3669
* files.el (remote-file-name-inhibit-cache): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
110374
diff
changeset
|
990 would require an immediate reread during filename completion, `nil' |
86204
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
991 means to use always cached values for the directory contents." |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
992 :group 'tramp |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
993 :type '(choice (const nil) integer)) |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
994 |
45861 | 995 ;;; Internal Variables: |
996 | |
997 (defvar tramp-current-method nil | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
998 "Connection method for this *tramp* buffer.") |
45861 | 999 |
1000 (defvar tramp-current-user nil | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1001 "Remote login name for this *tramp* buffer.") |
45861 | 1002 |
1003 (defvar tramp-current-host nil | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1004 "Remote host for this *tramp* buffer.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1005 |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1006 ;;;###autoload |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1007 (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
|
1008 '((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
|
1009 (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
|
1010 "Alist of completion handler functions. |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1011 Used for file names matching `tramp-file-name-regexp'. Operations |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1012 not mentioned here will be handled by Tramp's file name handler |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1013 functions, or the normal Emacs functions.") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1014 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1015 ;; Handlers for foreign methods, like FTP or SMB, shall be plugged here. |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1016 ;;;###tramp-autoload |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1017 (defvar tramp-foreign-file-name-handler-alist nil |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1018 "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
|
1019 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
|
1020 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
|
1021 |
87648
7ae99e295dfd
* vc-git.el (vc-git--call): Apply `process-file' instead of
Michael Albinus <michael.albinus@gmx.de>
parents:
87368
diff
changeset
|
1022 ;;; Internal functions which must come first: |
45861 | 1023 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1024 ;; Conversion functions between external representation and |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1025 ;; internal data structure. Convenience functions for internal |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1026 ;; data structure. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1027 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1028 (defun tramp-file-name-p (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1029 "Check, whether VEC is a Tramp object." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1030 (and (vectorp vec) (= 4 (length vec)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1031 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1032 (defun tramp-file-name-method (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1033 "Return method component of VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1034 (and (tramp-file-name-p vec) (aref vec 0))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1035 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1036 (defun tramp-file-name-user (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1037 "Return user component of VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1038 (and (tramp-file-name-p vec) (aref vec 1))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1039 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1040 (defun tramp-file-name-host (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1041 "Return host component of VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1042 (and (tramp-file-name-p vec) (aref vec 2))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1043 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1044 (defun tramp-file-name-localname (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1045 "Return localname component of VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1046 (and (tramp-file-name-p vec) (aref vec 3))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1047 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1048 ;; The user part of a Tramp file name vector can be of kind |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1049 ;; "user%domain". Sometimes, we must extract these parts. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1050 (defun tramp-file-name-real-user (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1051 "Return the user name of VEC without domain." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1052 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1053 (let ((user (tramp-file-name-user vec))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1054 (if (and (stringp user) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1055 (string-match tramp-user-with-domain-regexp user)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1056 (match-string 1 user) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1057 user)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1058 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1059 (defun tramp-file-name-domain (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1060 "Return the domain name of VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1061 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1062 (let ((user (tramp-file-name-user vec))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1063 (and (stringp user) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1064 (string-match tramp-user-with-domain-regexp user) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1065 (match-string 2 user))))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1066 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1067 ;; The host part of a Tramp file name vector can be of kind |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1068 ;; "host#port". Sometimes, we must extract these parts. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1069 (defun tramp-file-name-real-host (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1070 "Return the host name of VEC without port." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1071 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1072 (let ((host (tramp-file-name-host vec))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1073 (if (and (stringp host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1074 (string-match tramp-host-with-port-regexp host)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1075 (match-string 1 host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1076 host)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1077 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1078 (defun tramp-file-name-port (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1079 "Return the port number of VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1080 (save-match-data |
111788
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1081 (let ((method (tramp-file-name-method vec)) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1082 (host (tramp-file-name-host vec))) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1083 (or (and (stringp host) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1084 (string-match tramp-host-with-port-regexp host) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1085 (string-to-number (match-string 2 host))) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1086 (tramp-get-method-parameter method 'tramp-default-port))))) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1087 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1088 ;;;###tramp-autoload |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1089 (defun tramp-tramp-file-p (name) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1090 "Return t if NAME is a string with Tramp file name syntax." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1091 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1092 (and (stringp name) (string-match tramp-file-name-regexp name)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1093 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1094 (defun tramp-find-method (method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1095 "Return the right method string to use. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1096 This is METHOD, if non-nil. Otherwise, do a lookup in |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1097 `tramp-default-method-alist'." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1098 (or method |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1099 (let ((choices tramp-default-method-alist) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1100 lmethod item) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1101 (while choices |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1102 (setq item (pop choices)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1103 (when (and (string-match (or (nth 0 item) "") (or host "")) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1104 (string-match (or (nth 1 item) "") (or user ""))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1105 (setq lmethod (nth 2 item)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1106 (setq choices nil))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1107 lmethod) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1108 tramp-default-method)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1109 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1110 (defun tramp-find-user (method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1111 "Return the right user string to use. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1112 This is USER, if non-nil. Otherwise, do a lookup in |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1113 `tramp-default-user-alist'." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1114 (or user |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1115 (let ((choices tramp-default-user-alist) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1116 luser item) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1117 (while choices |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1118 (setq item (pop choices)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1119 (when (and (string-match (or (nth 0 item) "") (or method "")) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1120 (string-match (or (nth 1 item) "") (or host ""))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1121 (setq luser (nth 2 item)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1122 (setq choices nil))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1123 luser) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1124 tramp-default-user)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1125 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1126 (defun tramp-find-host (method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1127 "Return the right host string to use. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1128 This is HOST, if non-nil. Otherwise, it is `tramp-default-host'." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1129 (or (and (> (length host) 0) host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1130 tramp-default-host)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1131 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1132 (defun tramp-dissect-file-name (name &optional nodefault) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1133 "Return a `tramp-file-name' structure. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1134 The structure consists of remote method, remote user, remote host |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1135 and localname (file name on remote host). If NODEFAULT is |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1136 non-nil, the file name parts are not expanded to their default |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1137 values." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1138 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1139 (let ((match (string-match (nth 0 tramp-file-name-structure) name))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1140 (unless match (error "Not a Tramp file name: %s" name)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1141 (let ((method (match-string (nth 1 tramp-file-name-structure) name)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1142 (user (match-string (nth 2 tramp-file-name-structure) name)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1143 (host (match-string (nth 3 tramp-file-name-structure) name)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1144 (localname (match-string (nth 4 tramp-file-name-structure) name))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1145 (when host |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1146 (when (string-match tramp-prefix-ipv6-regexp host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1147 (setq host (replace-match "" nil t host))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1148 (when (string-match tramp-postfix-ipv6-regexp host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1149 (setq host (replace-match "" nil t host)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1150 (if nodefault |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1151 (vector method user host localname) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1152 (vector |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1153 (tramp-find-method method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1154 (tramp-find-user method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1155 (tramp-find-host method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1156 localname)))))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1157 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1158 (defun tramp-buffer-name (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1159 "A name for the connection buffer VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1160 ;; We must use `tramp-file-name-real-host', because for gateway |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1161 ;; methods the default port will be expanded later on, which would |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1162 ;; tamper the name. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1163 (let ((method (tramp-file-name-method vec)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1164 (user (tramp-file-name-user vec)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1165 (host (tramp-file-name-real-host vec))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1166 (if (not (zerop (length user))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1167 (format "*tramp/%s %s@%s*" method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1168 (format "*tramp/%s %s*" method host)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1169 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1170 (defun tramp-make-tramp-file-name (method user host localname) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1171 "Constructs a Tramp file name from METHOD, USER, HOST and LOCALNAME." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1172 (concat tramp-prefix-format |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1173 (when (not (zerop (length method))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1174 (concat method tramp-postfix-method-format)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1175 (when (not (zerop (length user))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1176 (concat user tramp-postfix-user-format)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1177 (when host |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1178 (if (string-match tramp-ipv6-regexp host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1179 (concat tramp-prefix-ipv6-format host tramp-postfix-ipv6-format) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1180 host)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1181 tramp-postfix-host-format |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1182 (when localname localname))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1183 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1184 (defun tramp-completion-make-tramp-file-name (method user host localname) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1185 "Constructs a Tramp file name from METHOD, USER, HOST and LOCALNAME. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1186 It must not be a complete Tramp file name, but as long as there are |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1187 necessary only. This function will be used in file name completion." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1188 (concat tramp-prefix-format |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1189 (when (not (zerop (length method))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1190 (concat method tramp-postfix-method-format)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1191 (when (not (zerop (length user))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1192 (concat user tramp-postfix-user-format)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1193 (when (not (zerop (length host))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1194 (concat |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1195 (if (string-match tramp-ipv6-regexp host) |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1196 (concat |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1197 tramp-prefix-ipv6-format host tramp-postfix-ipv6-format) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1198 host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1199 tramp-postfix-host-format)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1200 (when localname localname))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1201 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1202 (defun tramp-get-buffer (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1203 "Get the connection buffer to be used for VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1204 (or (get-buffer (tramp-buffer-name vec)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1205 (with-current-buffer (get-buffer-create (tramp-buffer-name vec)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1206 (setq buffer-undo-list t) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1207 (setq default-directory |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1208 (tramp-make-tramp-file-name |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1209 (tramp-file-name-method vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1210 (tramp-file-name-user vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1211 (tramp-file-name-host vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1212 "/")) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1213 (current-buffer)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1214 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1215 (defun tramp-get-connection-buffer (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1216 "Get the connection buffer to be used for VEC. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1217 In case a second asynchronous communication has been started, it is different |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1218 from `tramp-get-buffer'." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1219 (or (tramp-get-connection-property vec "process-buffer" nil) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1220 (tramp-get-buffer vec))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1221 |
111788
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1222 (defun tramp-get-connection-name (vec) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1223 "Get the connection name to be used for VEC. |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1224 In case a second asynchronous communication has been started, it is different |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1225 from the default one." |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1226 (or (tramp-get-connection-property vec "process-name" nil) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1227 (tramp-buffer-name vec))) |
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1228 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1229 (defun tramp-get-connection-process (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1230 "Get the connection process to be used for VEC. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1231 In case a second asynchronous communication has been started, it is different |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1232 from the default one." |
111788
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1233 (get-process (tramp-get-connection-name vec))) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1234 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1235 (defun tramp-debug-buffer-name (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1236 "A name for the debug buffer for VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1237 ;; We must use `tramp-file-name-real-host', because for gateway |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1238 ;; methods the default port will be expanded later on, which would |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1239 ;; tamper the name. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1240 (let ((method (tramp-file-name-method vec)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1241 (user (tramp-file-name-user vec)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1242 (host (tramp-file-name-real-host vec))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1243 (if (not (zerop (length user))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1244 (format "*debug tramp/%s %s@%s*" method user host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1245 (format "*debug tramp/%s %s*" method host)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1246 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1247 (defconst tramp-debug-outline-regexp |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1248 "[0-9]+:[0-9]+:[0-9]+\\.[0-9]+ [a-z0-9-]+ (\\([0-9]+\\)) #" |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1249 "Used for highlighting Tramp debug buffers in `outline-mode'.") |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1250 |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1251 (defun tramp-debug-outline-level () |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1252 "Return the depth to which a statement is nested in the outline. |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1253 Point must be at the beginning of a header line. |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1254 |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1255 The outline level is equal to the verbosity of the Tramp message." |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1256 (1+ (string-to-number (match-string 1)))) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1257 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1258 (defun tramp-get-debug-buffer (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1259 "Get the debug buffer for VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1260 (with-current-buffer |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1261 (get-buffer-create (tramp-debug-buffer-name vec)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1262 (when (bobp) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1263 (setq buffer-undo-list t) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1264 ;; Activate `outline-mode'. This runs `text-mode-hook' and |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1265 ;; `outline-mode-hook'. We must prevent that local processes |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1266 ;; die. Yes: I've seen `flyspell-mode', which starts "ispell". |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1267 ;; Furthermore, `outline-regexp' must have the correct value |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1268 ;; already, because it is used by `font-lock-compile-keywords'. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1269 (let ((default-directory (tramp-compat-temporary-file-directory)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1270 (outline-regexp tramp-debug-outline-regexp)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1271 (outline-mode)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1272 (set (make-local-variable 'outline-regexp) tramp-debug-outline-regexp) |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1273 (set (make-local-variable 'outline-level) 'tramp-debug-outline-level)) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1274 (current-buffer))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1275 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1276 (defsubst tramp-debug-message (vec fmt-string &rest args) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1277 "Append message to debug buffer. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1278 Message is formatted with FMT-STRING as control string and the remaining |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1279 ARGS to actually emit the message (if applicable)." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1280 (when (get-buffer (tramp-buffer-name vec)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1281 (with-current-buffer (tramp-get-debug-buffer vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1282 (goto-char (point-max)) |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1283 ;; Headline. |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1284 (when (bobp) |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1285 (insert |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1286 (format |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1287 ";; %sEmacs: %s Tramp: %s -*- mode: outline; -*-" |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1288 (if (featurep 'sxemacs) "SX" (if (featurep 'xemacs) "X" "GNU ")) |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1289 emacs-version tramp-version))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1290 (unless (bolp) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1291 (insert "\n")) |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1292 ;; Timestamp. |
104125
fd4d8124e329
* net/tramp.el (tramp-debug-message): Print also microseconds.
Michael Albinus <michael.albinus@gmx.de>
parents:
104097
diff
changeset
|
1293 (let ((now (current-time))) |
fd4d8124e329
* net/tramp.el (tramp-debug-message): Print also microseconds.
Michael Albinus <michael.albinus@gmx.de>
parents:
104097
diff
changeset
|
1294 (insert (format-time-string "%T." now)) |
fd4d8124e329
* net/tramp.el (tramp-debug-message): Print also microseconds.
Michael Albinus <michael.albinus@gmx.de>
parents:
104097
diff
changeset
|
1295 (insert (format "%06d " (nth 2 now)))) |
112358
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1296 ;; Calling Tramp function. We suppress compat and trace |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1297 ;; functions from being displayed. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1298 (let ((btn 1) btf fn) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1299 (while (not fn) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1300 (setq btf (nth 1 (backtrace-frame btn))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1301 (if (not btf) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1302 (setq fn "") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1303 (when (symbolp btf) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1304 (setq fn (symbol-name btf)) |
112358
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1305 (unless |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1306 (and |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1307 (string-match "^tramp" fn) |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1308 (not |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1309 (string-match |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1310 (concat |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1311 "^" |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1312 (regexp-opt |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1313 '("tramp-compat-funcall" |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1314 "tramp-compat-with-temp-message" |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1315 "tramp-debug-message" |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1316 "tramp-error" |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1317 "tramp-error-with-buffer" |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1318 "tramp-message") |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1319 t) |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1320 "$") |
49f47421e4c1
* net/tramp.el (tramp-debug-message): Extend function exclude
Michael Albinus <michael.albinus@gmx.de>
parents:
112238
diff
changeset
|
1321 fn))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1322 (setq fn nil))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1323 (setq btn (1+ btn)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1324 ;; The following code inserts filename and line number. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1325 ;; Should be deactivated by default, because it is time |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1326 ;; consuming. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1327 ; (let ((ffn (find-function-noselect (intern fn)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1328 ; (insert |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1329 ; (format |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1330 ; "%s:%d: " |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1331 ; (file-name-nondirectory (buffer-file-name (car ffn))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1332 ; (with-current-buffer (car ffn) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1333 ; (1+ (count-lines (point-min) (cdr ffn))))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1334 (insert (format "%s " fn))) |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1335 ;; The message. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1336 (insert (apply 'format fmt-string args))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1337 |
104642
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1338 (defvar tramp-message-show-message t |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1339 "Show Tramp message in the minibuffer. |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1340 This variable is used to disable messages from `tramp-error'. |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1341 The messages are visible anyway, because an error is raised.") |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1342 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1343 (defsubst tramp-message (vec-or-proc level fmt-string &rest args) |
45861 | 1344 "Emit a message depending on verbosity level. |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
1345 VEC-OR-PROC identifies the Tramp buffer to use. It can be either a |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1346 vector or a process. LEVEL says to be quiet if `tramp-verbose' is |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1347 less than LEVEL. The message is emitted only if `tramp-verbose' is |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1348 greater than or equal to LEVEL. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1349 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1350 The message is also logged into the debug buffer when `tramp-verbose' |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1351 is greater than or equal 4. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1352 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1353 Calls functions `message' and `tramp-debug-message' with FMT-STRING as |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1354 control string and the remaining ARGS to actually emit the message (if |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1355 applicable)." |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1356 (ignore-errors |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1357 (when (<= level tramp-verbose) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1358 ;; Match data must be preserved! |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1359 (save-match-data |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1360 ;; Display only when there is a minimum level. |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1361 (when (and tramp-message-show-message (<= level 3)) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1362 (apply 'message |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1363 (concat |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1364 (cond |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1365 ((= level 0) "") |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1366 ((= level 1) "") |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1367 ((= level 2) "Warning: ") |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1368 (t "Tramp: ")) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1369 fmt-string) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1370 args)) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1371 ;; Log only when there is a minimum level. |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1372 (when (>= tramp-verbose 4) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1373 (when (and vec-or-proc |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1374 (processp vec-or-proc) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1375 (buffer-name (process-buffer vec-or-proc))) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1376 (with-current-buffer (process-buffer vec-or-proc) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1377 ;; Translate proc to vec. |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1378 (setq vec-or-proc (tramp-dissect-file-name default-directory)))) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1379 (when (and vec-or-proc (vectorp vec-or-proc)) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1380 (apply 'tramp-debug-message |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1381 vec-or-proc |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1382 (concat (format "(%d) # " level) fmt-string) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1383 args))))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1384 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1385 (defsubst tramp-error (vec-or-proc signal fmt-string &rest args) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1386 "Emit an error. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1387 VEC-OR-PROC identifies the connection to use, SIGNAL is the |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1388 signal identifier to be raised, remaining args passed to |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1389 `tramp-message'. Finally, signal SIGNAL is raised." |
104642
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1390 (let (tramp-message-show-message) |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1391 (tramp-message |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1392 vec-or-proc 1 "%s" |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1393 (error-message-string |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1394 (list signal |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1395 (get signal 'error-message) |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1396 (apply 'format fmt-string args)))) |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1397 (signal signal (list (apply 'format fmt-string args))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1398 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1399 (defsubst tramp-error-with-buffer |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1400 (buffer vec-or-proc signal fmt-string &rest args) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1401 "Emit an error, and show BUFFER. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1402 If BUFFER is nil, show the connection buffer. Wait for 30\", or until |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1403 an input event arrives. The other arguments are passed to `tramp-error'." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1404 (save-window-excursion |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1405 (unwind-protect |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1406 (apply 'tramp-error vec-or-proc signal fmt-string args) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1407 (when (and vec-or-proc |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1408 (not (zerop tramp-verbose)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1409 (not (tramp-completion-mode-p))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1410 (let ((enable-recursive-minibuffers t)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1411 (pop-to-buffer |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1412 (or (and (bufferp buffer) buffer) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1413 (and (processp vec-or-proc) (process-buffer vec-or-proc)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1414 (tramp-get-buffer vec-or-proc))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1415 (sit-for 30)))))) |
45861 | 1416 |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1417 (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
|
1418 "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
|
1419 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1420 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
|
1421 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
|
1422 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
|
1423 holding the components. For example, if VAR is the symbol `foo', then |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1424 `foo' will be bound to the whole structure, `foo-method' will be bound to |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1425 the method component, and so on for `foo-user', `foo-host', `foo-localname'. |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1426 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1427 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
|
1428 `progn'). |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1429 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1430 If VAR is nil, then we bind `v' to the structure and `method', `user', |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1431 `host', `localname' to the components." |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1432 `(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
|
1433 (,(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
|
1434 (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
|
1435 (,(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
|
1436 (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
|
1437 (,(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
|
1438 (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
|
1439 (,(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
|
1440 (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
|
1441 ,@body)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1442 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1443 (put 'with-parsed-tramp-file-name 'lisp-indent-function 2) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1444 (put 'with-parsed-tramp-file-name 'edebug-form-spec '(form symbolp body)) |
110374
932697ced7aa
* net/tramp-compat.el (tramp-compat-with-temp-message)
Michael Albinus <michael.albinus@gmx.de>
parents:
110321
diff
changeset
|
1445 (tramp-compat-font-lock-add-keywords |
932697ced7aa
* net/tramp-compat.el (tramp-compat-with-temp-message)
Michael Albinus <michael.albinus@gmx.de>
parents:
110321
diff
changeset
|
1446 '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
|
1447 |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1448 (defun tramp-progress-reporter-update (reporter &optional value) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1449 (let* ((parameters (cdr reporter)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1450 (message (aref parameters 3))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1451 (when (string-match message (or (current-message) "")) |
110374
932697ced7aa
* net/tramp-compat.el (tramp-compat-with-temp-message)
Michael Albinus <michael.albinus@gmx.de>
parents:
110321
diff
changeset
|
1452 (tramp-compat-funcall 'progress-reporter-update reporter value)))) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1453 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1454 (defmacro with-progress-reporter (vec level message &rest body) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1455 "Executes BODY, spinning a progress reporter with MESSAGE. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1456 If LEVEL does not fit for visible messages, or if this is a |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1457 nested call of the macro, there are only traces without a visible |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1458 progress reporter." |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1459 `(let (pr tm) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1460 (tramp-message ,vec ,level "%s..." ,message) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1461 ;; We start a pulsing progress reporter after 3 seconds. Feature |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1462 ;; introduced in Emacs 24.1. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1463 (when (and tramp-message-show-message |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1464 ;; Display only when there is a minimum level. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1465 (<= ,level (min tramp-verbose 3))) |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1466 (ignore-errors |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1467 (setq pr (tramp-compat-funcall 'make-progress-reporter ,message) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1468 tm (when pr |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1469 (run-at-time 3 0.1 'tramp-progress-reporter-update pr))))) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1470 (unwind-protect |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1471 ;; Execute the body. Unset `tramp-message-show-message' when |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1472 ;; the timer object is created, in order to suppress |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1473 ;; concurrent timers. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1474 (let ((tramp-message-show-message |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1475 (and tramp-message-show-message (not tm)))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1476 ,@body) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1477 ;; Stop progress reporter. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1478 (if tm (tramp-compat-funcall 'cancel-timer tm)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1479 (tramp-message ,vec ,level "%s...done" ,message)))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1480 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1481 (put 'with-progress-reporter 'lisp-indent-function 3) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1482 (put 'with-progress-reporter 'edebug-form-spec t) |
110374
932697ced7aa
* net/tramp-compat.el (tramp-compat-with-temp-message)
Michael Albinus <michael.albinus@gmx.de>
parents:
110321
diff
changeset
|
1483 (tramp-compat-font-lock-add-keywords |
932697ced7aa
* net/tramp-compat.el (tramp-compat-with-temp-message)
Michael Albinus <michael.albinus@gmx.de>
parents:
110321
diff
changeset
|
1484 'emacs-lisp-mode '("\\<with-progress-reporter\\>")) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1485 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1486 (eval-and-compile ;; Silence compiler. |
93566
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1487 (if (memq system-type '(cygwin windows-nt)) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1488 (defun tramp-drop-volume-letter (name) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1489 "Cut off unnecessary drive letter from file NAME. |
111788
8e746f396237
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
Michael Albinus <michael.albinus@gmx.de>
parents:
111779
diff
changeset
|
1490 The functions `tramp-*-handle-expand-file-name' call `expand-file-name' |
93566
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1491 locally on a remote file name. When the local system is a W32 system |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1492 but the remote system is Unix, this introduces a superfluous drive |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1493 letter into the file name. This function removes it." |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1494 (save-match-data |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1495 (if (string-match tramp-root-regexp name) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1496 (replace-match "/" nil t name) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1497 name))) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1498 |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1499 (defalias 'tramp-drop-volume-letter 'identity))) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1500 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1501 ;;; Config Manipulation Functions: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1502 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1503 (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
|
1504 "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
|
1505 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
|
1506 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
|
1507 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
|
1508 Predefined FUNCTIONs are `tramp-parse-rhosts', `tramp-parse-shosts', |
99540
c5c8f07bc47c
* w32-fns.el (w32-shell-dos-semantics):
Juanma Barranquero <lekktu@gmail.com>
parents:
98699
diff
changeset
|
1509 `tramp-parse-sconfig', `tramp-parse-hosts', `tramp-parse-passwd', |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1510 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
|
1511 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1512 Example: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1513 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1514 (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
|
1515 \"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
|
1516 '((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
|
1517 (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
|
1518 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1519 (let ((r function-list) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1520 (v function-list)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1521 (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
|
1522 (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
|
1523 tramp-completion-function-alist)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1524 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1525 (while v |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1526 ;; Remove double entries. |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1527 (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
|
1528 (setcdr v (delete (car v) (cdr v)))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1529 ;; Check for function and file or registry key. |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1530 (unless (and (functionp (nth 0 (car v))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1531 (if (string-match "^HKEY_CURRENT_USER" (nth 1 (car v))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1532 ;; Windows registry. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1533 (and (memq system-type '(cygwin windows-nt)) |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
1534 (zerop |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1535 (tramp-compat-call-process |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
1536 "reg" nil nil nil "query" (nth 1 (car v))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1537 ;; Configuration file. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1538 (file-exists-p (nth 1 (car v))))) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1539 (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
|
1540 (setq v (cdr v))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1541 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1542 (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
|
1543 (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
|
1544 (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
|
1545 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1546 (defun tramp-get-completion-function (method) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1547 "Returns a list of completion functions for METHOD. |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1548 For definition of that list see `tramp-set-completion-function'." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1549 (cons |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1550 ;; Hosts visited once shall be remembered. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1551 `(tramp-parse-connection-properties ,method) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1552 ;; The method related defaults. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1553 (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
|
1554 |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1555 |
87648
7ae99e295dfd
* vc-git.el (vc-git--call): Apply `process-file' instead of
Michael Albinus <michael.albinus@gmx.de>
parents:
87368
diff
changeset
|
1556 ;;; Fontification of `read-file-name': |
7ae99e295dfd
* vc-git.el (vc-git--call): Apply `process-file' instead of
Michael Albinus <michael.albinus@gmx.de>
parents:
87368
diff
changeset
|
1557 |
7ae99e295dfd
* vc-git.el (vc-git--call): Apply `process-file' instead of
Michael Albinus <michael.albinus@gmx.de>
parents:
87368
diff
changeset
|
1558 ;; rfn-eshadow.el is part of Emacs 22. It is autoloaded. |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1559 (defvar tramp-rfn-eshadow-overlay) |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1560 (make-variable-buffer-local 'tramp-rfn-eshadow-overlay) |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1561 |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1562 (defun tramp-rfn-eshadow-setup-minibuffer () |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1563 "Set up a minibuffer for `file-name-shadow-mode'. |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1564 Adds another overlay hiding filename parts according to Tramp's |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1565 special handling of `substitute-in-file-name'." |
84966
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1566 (when (symbol-value 'minibuffer-completing-file-name) |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1567 (setq tramp-rfn-eshadow-overlay |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1568 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1569 'make-overlay |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1570 (tramp-compat-funcall 'minibuffer-prompt-end) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1571 (tramp-compat-funcall 'minibuffer-prompt-end))) |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1572 ;; Copy rfn-eshadow-overlay properties. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1573 (let ((props (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1574 'overlay-properties (symbol-value 'rfn-eshadow-overlay)))) |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1575 (while props |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1576 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1577 'overlay-put tramp-rfn-eshadow-overlay (pop props) (pop props)))))) |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1578 |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1579 (when (boundp 'rfn-eshadow-setup-minibuffer-hook) |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1580 (add-hook 'rfn-eshadow-setup-minibuffer-hook |
95659
926453fe3d68
* net/tramp.el (top): Quote feature names. Remove
Michael Albinus <michael.albinus@gmx.de>
parents:
95067
diff
changeset
|
1581 'tramp-rfn-eshadow-setup-minibuffer) |
926453fe3d68
* net/tramp.el (top): Quote feature names. Remove
Michael Albinus <michael.albinus@gmx.de>
parents:
95067
diff
changeset
|
1582 (add-hook 'tramp-unload-hook |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1583 (lambda () |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1584 (remove-hook 'rfn-eshadow-setup-minibuffer-hook |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1585 'tramp-rfn-eshadow-setup-minibuffer)))) |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1586 |
104137
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1587 (defconst tramp-rfn-eshadow-update-overlay-regexp |
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1588 (format "[^%s/~]*\\(/\\|~\\)" tramp-postfix-host-format)) |
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1589 |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1590 (defun tramp-rfn-eshadow-update-overlay () |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1591 "Update `rfn-eshadow-overlay' to cover shadowed part of minibuffer input. |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1592 This is intended to be used as a minibuffer `post-command-hook' for |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1593 `file-name-shadow-mode'; the minibuffer should have already |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1594 been set up by `rfn-eshadow-setup-minibuffer'." |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1595 ;; In remote files name, there is a shadowing just for the local part. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1596 (let ((end (or (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1597 'overlay-end (symbol-value 'rfn-eshadow-overlay)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1598 (tramp-compat-funcall 'minibuffer-prompt-end)))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1599 (when |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1600 (file-remote-p |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1601 (tramp-compat-funcall 'buffer-substring-no-properties end (point-max))) |
85428
ad84adc0e027
From_ Johan Bockgrd, <http://article.gmane.org/gmane.emacs.devel/81056>
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
85126
diff
changeset
|
1602 (save-excursion |
ad84adc0e027
From_ Johan Bockgrd, <http://article.gmane.org/gmane.emacs.devel/81056>
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
85126
diff
changeset
|
1603 (save-restriction |
ad84adc0e027
From_ Johan Bockgrd, <http://article.gmane.org/gmane.emacs.devel/81056>
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
85126
diff
changeset
|
1604 (narrow-to-region |
104137
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1605 (1+ (or (string-match |
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1606 tramp-rfn-eshadow-update-overlay-regexp (buffer-string) end) |
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1607 end)) |
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1608 (point-max)) |
85428
ad84adc0e027
From_ Johan Bockgrd, <http://article.gmane.org/gmane.emacs.devel/81056>
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
85126
diff
changeset
|
1609 (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay) |
ad84adc0e027
From_ Johan Bockgrd, <http://article.gmane.org/gmane.emacs.devel/81056>
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
85126
diff
changeset
|
1610 (rfn-eshadow-update-overlay-hook nil)) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1611 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1612 'move-overlay rfn-eshadow-overlay (point-max) (point-max)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1613 (tramp-compat-funcall 'rfn-eshadow-update-overlay))))))) |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1614 |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1615 (when (boundp 'rfn-eshadow-update-overlay-hook) |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1616 (add-hook 'rfn-eshadow-update-overlay-hook |
105718
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
1617 'tramp-rfn-eshadow-update-overlay) |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
1618 (add-hook 'tramp-unload-hook |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
1619 (lambda () |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
1620 (remove-hook 'rfn-eshadow-update-overlay-hook |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
1621 'tramp-rfn-eshadow-update-overlay)))) |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1622 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1623 ;; Inodes don't exist for some file systems. Therefore we must |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1624 ;; generate virtual ones. Used in `find-buffer-visiting'. The method |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1625 ;; applied might be not so efficient (Ange-FTP uses hashes). But |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1626 ;; performance isn't the major issue given that file transfer will |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1627 ;; take time. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1628 (defvar tramp-inodes nil |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1629 "Keeps virtual inodes numbers.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1630 |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1631 ;; 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
|
1632 ;; 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
|
1633 ;; 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
|
1634 ;; EFS use device number "-1". In order to be different, we use device number |
97052
bed318e44ebd
* net/tramp.el (tramp-perl-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
97035
diff
changeset
|
1635 ;; (-1 . x), whereby "x" is unique for a given (method user host). |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1636 (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
|
1637 "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
|
1638 |
102851
5cc9a4c776e8
* net/tramp.el (tramp-default-file-modes) New defun. Replace all
Michael Albinus <michael.albinus@gmx.de>
parents:
102287
diff
changeset
|
1639 (defun tramp-default-file-modes (filename) |
5cc9a4c776e8
* net/tramp.el (tramp-default-file-modes) New defun. Replace all
Michael Albinus <michael.albinus@gmx.de>
parents:
102287
diff
changeset
|
1640 "Return file modes of FILENAME as integer. |
5cc9a4c776e8
* net/tramp.el (tramp-default-file-modes) New defun. Replace all
Michael Albinus <michael.albinus@gmx.de>
parents:
102287
diff
changeset
|
1641 If the file modes of FILENAME cannot be determined, return the |
103639
6be9692e90bf
* net/tramp.el (tramp-default-file-modes) Remove execute permissions.
Michael Albinus <michael.albinus@gmx.de>
parents:
103635
diff
changeset
|
1642 value of `default-file-modes', without execute permissions." |
6be9692e90bf
* net/tramp.el (tramp-default-file-modes) Remove execute permissions.
Michael Albinus <michael.albinus@gmx.de>
parents:
103635
diff
changeset
|
1643 (or (file-modes filename) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1644 (logand (default-file-modes) (tramp-compat-octal-to-decimal "0666")))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1645 |
94395
f020c9568544
* net/tramp.el (tramp-replace-environment-variables): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
94333
diff
changeset
|
1646 (defun tramp-replace-environment-variables (filename) |
f020c9568544
* net/tramp.el (tramp-replace-environment-variables): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
94333
diff
changeset
|
1647 "Replace environment variables in FILENAME. |
f020c9568544
* net/tramp.el (tramp-replace-environment-variables): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
94333
diff
changeset
|
1648 Return the string with the replaced variables." |
94436
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1649 (save-match-data |
105615
33df72cf19f1
* net/tramp.el (tramp-replace-environment-variables): Do not fail
Michael Albinus <michael.albinus@gmx.de>
parents:
105549
diff
changeset
|
1650 (let ((idx (string-match "$\\(\\w+\\)" filename))) |
94436
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1651 ;; `$' is coded as `$$'. |
105615
33df72cf19f1
* net/tramp.el (tramp-replace-environment-variables): Do not fail
Michael Albinus <michael.albinus@gmx.de>
parents:
105549
diff
changeset
|
1652 (when (and idx |
33df72cf19f1
* net/tramp.el (tramp-replace-environment-variables): Do not fail
Michael Albinus <michael.albinus@gmx.de>
parents:
105549
diff
changeset
|
1653 (or (zerop idx) (not (eq ?$ (aref filename (1- idx))))) |
33df72cf19f1
* net/tramp.el (tramp-replace-environment-variables): Do not fail
Michael Albinus <michael.albinus@gmx.de>
parents:
105549
diff
changeset
|
1654 (getenv (match-string 1 filename))) |
94436
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1655 (setq filename |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1656 (replace-match |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1657 (substitute-in-file-name (match-string 0 filename)) |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1658 t nil filename))) |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1659 filename))) |
94395
f020c9568544
* net/tramp.el (tramp-replace-environment-variables): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
94333
diff
changeset
|
1660 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1661 ;; In XEmacs, electricity is implemented via a key map for ?/ and ?~, |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1662 ;; which calls corresponding functions (see minibuf.el). |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1663 (when (fboundp 'minibuffer-electric-separator) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
1664 (mapc |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1665 (lambda (x) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1666 (eval |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1667 `(defadvice ,x |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1668 (around ,(intern (format "tramp-advice-%s" x)) activate) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1669 "Invoke `substitute-in-file-name' for Tramp files." |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1670 (if (and (symbol-value 'minibuffer-electric-file-name-behavior) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1671 (tramp-tramp-file-p (buffer-substring))) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1672 ;; We don't need to handle `last-input-event', because |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1673 ;; due to the key map we know it must be ?/ or ?~. |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1674 (let ((s (concat (buffer-substring (point-min) (point)) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1675 (string last-command-char)))) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1676 (delete-region (point-min) (point)) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1677 (insert (substitute-in-file-name s)) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1678 (setq ad-return-value last-command-char)) |
105952
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1679 ad-do-it))) |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1680 (eval |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1681 `(add-hook |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1682 'tramp-unload-hook |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1683 (lambda () |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1684 (ad-remove-advice ',x 'around ',(intern (format "tramp-advice-%s" x))) |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1685 (ad-activate ',x))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1686 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1687 '(minibuffer-electric-separator |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1688 minibuffer-electric-tilde))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1689 |
93938
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1690 (defun tramp-find-file-name-coding-system-alist (filename tmpname) |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1691 "Like `find-operation-coding-system' for Tramp filenames. |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1692 Tramp's `insert-file-contents' and `write-region' work over |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1693 temporary file names. If `file-coding-system-alist' contains an |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1694 expression, which matches more than the file name suffix, the |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1695 coding system might not be determined. This function repairs it." |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1696 (let (result) |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1697 (dolist (elt file-coding-system-alist result) |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1698 (when (and (consp elt) (string-match (car elt) filename)) |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1699 ;; We found a matching entry in `file-coding-system-alist'. |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1700 ;; So we add a similar entry, but with the temporary file name |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1701 ;; as regexp. |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1702 (add-to-list |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1703 'result (cons (regexp-quote tmpname) (cdr elt)) 'append))))) |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1704 |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1705 ;;;###autoload |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1706 (progn (defun tramp-run-real-handler (operation args) |
45861 | 1707 "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
|
1708 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
|
1709 pass to the OPERATION." |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1710 (let* ((inhibit-file-name-handlers |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1711 `(tramp-file-name-handler |
104642
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1712 tramp-vc-file-name-handler |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1713 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
|
1714 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
|
1715 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
|
1716 . |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1717 ,(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
|
1718 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
|
1719 (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
|
1720 (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
|
1721 |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1722 ;;;###autoload |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1723 (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
|
1724 "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
|
1725 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
|
1726 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
|
1727 (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
|
1728 `(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
|
1729 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
|
1730 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
|
1731 . |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1732 ,(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
|
1733 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
|
1734 (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
|
1735 (apply operation args)))) |
45861 | 1736 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1737 ;; 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
|
1738 ;; name as first parameter; nevertheless we check for them explicitly |
96361
a99299e4d2de
American English spelling fix.
Glenn Morris <rgm@gnu.org>
parents:
95967
diff
changeset
|
1739 ;; in order to be signaled if a new primitive appears. This |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1740 ;; 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
|
1741 ;; 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
|
1742 ;; 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
|
1743 ;; 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
|
1744 (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
|
1745 "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
|
1746 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
|
1747 (cond |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1748 ;; FILE resp DIRECTORY. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1749 ((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
|
1750 (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
|
1751 '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
|
1752 '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
|
1753 '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
|
1754 '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
|
1755 '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
|
1756 '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
|
1757 '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
|
1758 '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
|
1759 '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
|
1760 '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
|
1761 '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
|
1762 '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
|
1763 'load 'make-directory 'make-directory-internal |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1764 '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
|
1765 'unhandled-file-name-directory 'vc-registered |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1766 ;; Emacs 22+ only. |
81938
26330ef1aa46
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
81758
diff
changeset
|
1767 'set-file-times |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1768 ;; Emacs 24+ only. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1769 'file-selinux-context 'set-file-selinux-context |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1770 ;; XEmacs only. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1771 '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
|
1772 '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
|
1773 '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
|
1774 'dired-shell-unhandle-file-name 'dired-uucode-file |
95025
bdaea36b81dd
* net/tramp.el: Load auth-source library.
Michael Albinus <michael.albinus@gmx.de>
parents:
94975
diff
changeset
|
1775 'insert-file-contents-literally 'make-temp-name 'recover-file |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1776 '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
|
1777 (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
|
1778 (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
|
1779 (expand-file-name (nth 0 args)))) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1780 ;; FILE DIRECTORY resp FILE1 FILE2. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1781 ((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
|
1782 (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
|
1783 '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
|
1784 'file-newer-than-file-p 'make-symbolic-link 'rename-file |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1785 ;; Emacs 23+ only. |
105462
f6c5cf0fc0c9
* net/tramp.el (tramp-verbose): Fix docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
105351
diff
changeset
|
1786 'copy-directory |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1787 ;; 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
|
1788 '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
|
1789 '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
|
1790 (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
|
1791 (cond |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1792 ((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
|
1793 ((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
|
1794 (t (buffer-file-name (current-buffer)))))) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1795 ;; START END FILE. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1796 ((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
|
1797 (nth 2 args)) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1798 ;; BUFFER. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1799 ((member operation |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1800 (list 'set-visited-file-modtime 'verify-visited-file-modtime |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1801 ;; Emacs 22+ only. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1802 'make-auto-save-file-name |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1803 ;; 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
|
1804 '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
|
1805 (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
|
1806 (if (bufferp (nth 0 args)) (nth 0 args) (current-buffer)))) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1807 ;; COMMAND. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1808 ((member operation |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1809 (list ;; not in Emacs 23+. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1810 'dired-call-process |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1811 ;; Emacs only. |
60287
865aec6814c3
(tramp-file-name-for-operation): Fix misapplied
Andreas Schwab <schwab@suse.de>
parents:
60156
diff
changeset
|
1812 'shell-command |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1813 ;; 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
|
1814 'process-file |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1815 ;; Emacs 23+ only. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1816 'start-file-process |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1817 ;; XEmacs only. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1818 'dired-print-file 'dired-shell-call-process |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1819 ;; nowhere yet. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1820 'executable-find 'start-process |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1821 'call-process 'call-process-region)) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1822 default-directory) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1823 ;; Unknown file primitive. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1824 (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
|
1825 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1826 (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
|
1827 "Return foreign file name handler if exists." |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1828 (when (tramp-tramp-file-p filename) |
84966
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1829 (let ((v (tramp-dissect-file-name filename t)) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1830 (handler tramp-foreign-file-name-handler-alist) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1831 elt res) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1832 ;; When we are not fully sure that filename completion is safe, |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1833 ;; we should not return a handler. |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1834 (when (or (tramp-file-name-method v) (tramp-file-name-user v) |
85089
8fb95bcda144
* net/tramp.el (tramp-find-foreign-file-name-handler): Check also
Michael Albinus <michael.albinus@gmx.de>
parents:
85067
diff
changeset
|
1835 (and (tramp-file-name-host v) |
8fb95bcda144
* net/tramp.el (tramp-find-foreign-file-name-handler): Check also
Michael Albinus <michael.albinus@gmx.de>
parents:
85067
diff
changeset
|
1836 (not (member (tramp-file-name-host v) |
8fb95bcda144
* net/tramp.el (tramp-find-foreign-file-name-handler): Check also
Michael Albinus <michael.albinus@gmx.de>
parents:
85067
diff
changeset
|
1837 (mapcar 'car tramp-methods)))) |
84966
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1838 (not (tramp-completion-mode-p))) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1839 (while handler |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1840 (setq elt (car handler) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1841 handler (cdr handler)) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1842 (when (funcall (car elt) filename) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1843 (setq handler nil |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1844 res (cdr elt)))) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1845 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
|
1846 |
45861 | 1847 ;; Main function. |
1848 ;;;###autoload | |
1849 (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
|
1850 "Invoke Tramp file name handler. |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
1851 Falls back to normal file name handler if no Tramp file name handler exists." |
94436
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1852 (if tramp-mode |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1853 (save-match-data |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1854 (let* ((filename |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1855 (tramp-replace-environment-variables |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1856 (apply 'tramp-file-name-for-operation operation args))) |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1857 (completion (tramp-completion-mode-p)) |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1858 (foreign (tramp-find-foreign-file-name-handler filename))) |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1859 (with-parsed-tramp-file-name filename nil |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1860 ;; Call the backend function. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1861 (if foreign |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1862 (condition-case err |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1863 (apply foreign operation args) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1864 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1865 ;; Trace, that somebody has interrupted the operation. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1866 (quit |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1867 (let (tramp-message-show-message) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1868 (tramp-message |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1869 v 1 "Interrupt received in operation %s" |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1870 (append (list operation) args))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1871 ;; Propagate the quit signal. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1872 (signal (car err) (cdr err))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1873 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1874 ;; When we are in completion mode, some failed |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1875 ;; operations shall return at least a default value |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1876 ;; in order to give the user a chance to correct the |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1877 ;; file name in the minibuffer. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1878 (error |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1879 (cond |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1880 ((and completion (zerop (length localname)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1881 (memq operation '(file-exists-p file-directory-p))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1882 t) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1883 ((and completion (zerop (length localname)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1884 (memq operation |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1885 '(expand-file-name file-name-as-directory))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1886 filename) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1887 ;; Propagate the error. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1888 (t (signal (car err) (cdr err)))))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1889 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1890 ;; Nothing to do for us. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1891 (tramp-run-real-handler operation args))))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1892 |
94436
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1893 ;; When `tramp-mode' is not enabled, we don't do anything. |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1894 (tramp-run-real-handler operation args))) |
45861 | 1895 |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1896 ;; 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
|
1897 ;; 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
|
1898 ;; 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
|
1899 ;; 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
|
1900 ;; 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
|
1901 ;; 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
|
1902 ;; 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
|
1903 ;; `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
|
1904 ;; (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
|
1905 ;; 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
|
1906 ;; 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
|
1907 ;; -- 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
|
1908 ;; 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
|
1909 ;; 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
|
1910 ;; 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
|
1911 ;; 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
|
1912 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1913 (defvar tramp-locked nil |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1914 "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
|
1915 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
|
1916 preventing reentrant calls of Tramp.") |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1917 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1918 (defvar tramp-locker nil |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1919 "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
|
1920 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
|
1921 preventing reentrant calls of Tramp.") |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1922 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1923 ;;;###autoload |
70255
d57fb8c98714
* net/tramp.el (tramp-completion-file-name-handler): Disable
Michael Albinus <michael.albinus@gmx.de>
parents:
70191
diff
changeset
|
1924 (progn (defun tramp-completion-file-name-handler (operation &rest args) |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
1925 "Invoke Tramp file name completion handler. |
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
1926 Falls back to normal file name handler if no Tramp file name handler exists." |
93040
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
1927 ;; We bind `directory-sep-char' here for XEmacs on Windows, which |
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
1928 ;; would otherwise use backslash. |
93082
7e079018403b
* net/tramp.el (tramp-let-maybe): Removed.
Michael Albinus <michael.albinus@gmx.de>
parents:
93062
diff
changeset
|
1929 (let ((directory-sep-char ?/) |
7e079018403b
* net/tramp.el (tramp-let-maybe): Removed.
Michael Albinus <michael.albinus@gmx.de>
parents:
93062
diff
changeset
|
1930 (fn (assoc operation tramp-completion-file-name-handler-alist))) |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1931 (if (and |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1932 ;; When `tramp-mode' is not enabled, we don't do anything. |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1933 fn tramp-mode |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1934 ;; For other syntaxes than `sep', the regexp matches many common |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1935 ;; situations where the user doesn't actually want to use Tramp. |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1936 ;; So to avoid autoloading Tramp after typing just "/s", we |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1937 ;; disable this part of the completion, unless the user implicitly |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1938 ;; indicated his interest in using a fancier completion system. |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1939 (or (eq tramp-syntax 'sep) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1940 (featurep 'tramp) ;; If it's loaded, we may as well use it. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1941 ;; `partial-completion-mode' does not exist in XEmacs. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1942 ;; It is obsoleted with Emacs 24.1. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1943 (and (boundp 'partial-completion-mode) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
1944 (symbol-value 'partial-completion-mode)) |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1945 ;; FIXME: These may have been loaded even if the user never |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1946 ;; intended to use them. |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1947 (featurep 'ido) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1948 (featurep 'icicles))) |
93082
7e079018403b
* net/tramp.el (tramp-let-maybe): Removed.
Michael Albinus <michael.albinus@gmx.de>
parents:
93062
diff
changeset
|
1949 (save-match-data (apply (cdr fn) args)) |
7e079018403b
* net/tramp.el (tramp-let-maybe): Removed.
Michael Albinus <michael.albinus@gmx.de>
parents:
93062
diff
changeset
|
1950 (tramp-completion-run-real-handler operation args))))) |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1951 |
45861 | 1952 ;;;###autoload |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1953 (progn (defun tramp-register-file-name-handlers () |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1954 "Add Tramp file name handlers to `file-name-handler-alist'." |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1955 ;; Remove autoloaded handlers from file name handler alist. Useful, |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1956 ;; if `tramp-syntax' has been changed. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1957 (let ((a1 (rassq 'tramp-file-name-handler file-name-handler-alist))) |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1958 (setq file-name-handler-alist (delq a1 file-name-handler-alist))) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1959 (let ((a1 (rassq |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1960 'tramp-completion-file-name-handler file-name-handler-alist))) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1961 (setq file-name-handler-alist (delq a1 file-name-handler-alist))) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1962 ;; Add the handlers. |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1963 (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
|
1964 (cons tramp-file-name-regexp 'tramp-file-name-handler)) |
107040
5555e86608c1
* net/ange-ftp.el (ange-ftp-insert-directory): Handle the case,
Michael Albinus <albinus@detlef>
parents:
107021
diff
changeset
|
1965 (put 'tramp-file-name-handler 'safe-magic t) |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1966 (add-to-list 'file-name-handler-alist |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1967 (cons tramp-completion-file-name-regexp |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1968 'tramp-completion-file-name-handler)) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1969 (put 'tramp-completion-file-name-handler 'safe-magic t) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1970 ;; If jka-compr or epa-file are already loaded, move them to the |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1971 ;; front of `file-name-handler-alist'. |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1972 (dolist (fnh '(epa-file-handler jka-compr-handler)) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1973 (let ((entry (rassoc fnh file-name-handler-alist))) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1974 (when entry |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1975 (setq file-name-handler-alist |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1976 (cons entry (delete entry file-name-handler-alist)))))))) |
76846
d55ab93ab5bf
* net/tramp.el (tramp-register-file-name-handler)
Michael Albinus <michael.albinus@gmx.de>
parents:
76326
diff
changeset
|
1977 |
d55ab93ab5bf
* net/tramp.el (tramp-register-file-name-handler)
Michael Albinus <michael.albinus@gmx.de>
parents:
76326
diff
changeset
|
1978 ;; `tramp-file-name-handler' must be registered before evaluation of |
d55ab93ab5bf
* net/tramp.el (tramp-register-file-name-handler)
Michael Albinus <michael.albinus@gmx.de>
parents:
76326
diff
changeset
|
1979 ;; site-start and init files, because there might exist remote files |
d55ab93ab5bf
* net/tramp.el (tramp-register-file-name-handler)
Michael Albinus <michael.albinus@gmx.de>
parents:
76326
diff
changeset
|
1980 ;; already, f.e. files kept via recentf-mode. |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1981 ;;;###autoload |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1982 (tramp-register-file-name-handlers) |
45861 | 1983 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1984 (defun tramp-exists-file-name-handler (operation &rest args) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1985 "Check, whether OPERATION runs a file name handler." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1986 ;; The file name handler is determined on base of either an |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1987 ;; argument, `buffer-file-name', or `default-directory'. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1988 (ignore-errors |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1989 (let* ((buffer-file-name "/") |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1990 (default-directory "/") |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1991 (fnha file-name-handler-alist) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1992 (check-file-name-operation operation) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1993 (file-name-handler-alist |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1994 (list |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1995 (cons "/" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1996 (lambda (operation &rest args) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1997 "Returns OPERATION if it is the one to be checked." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1998 (if (equal check-file-name-operation operation) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
1999 operation |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2000 (let ((file-name-handler-alist fnha)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2001 (apply operation args)))))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2002 (equal (apply operation args) operation)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2003 |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2004 ;;;###autoload |
70191
3a3093f77da8
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
70073
diff
changeset
|
2005 (defun tramp-unload-file-name-handlers () |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2006 (setq file-name-handler-alist |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2007 (delete (rassoc 'tramp-file-name-handler |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2008 file-name-handler-alist) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2009 (delete (rassoc 'tramp-completion-file-name-handler |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2010 file-name-handler-alist) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2011 file-name-handler-alist)))) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2012 |
70191
3a3093f77da8
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
70073
diff
changeset
|
2013 (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
|
2014 |
87648
7ae99e295dfd
* vc-git.el (vc-git--call): Apply `process-file' instead of
Michael Albinus <michael.albinus@gmx.de>
parents:
87368
diff
changeset
|
2015 ;;; File name handler functions for completion mode: |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2016 |
66496
63563507d684
(tramp-completion-mode): defvar moved up.
Richard M. Stallman <rms@gnu.org>
parents:
66135
diff
changeset
|
2017 (defvar tramp-completion-mode nil |
78997
ef0a2673bf5e
* net/tramp.el (tramp-completion-mode): Extend doc-string.
Michael Albinus <michael.albinus@gmx.de>
parents:
78887
diff
changeset
|
2018 "If non-nil, external packages signal that they are in file name completion. |
ef0a2673bf5e
* net/tramp.el (tramp-completion-mode): Extend doc-string.
Michael Albinus <michael.albinus@gmx.de>
parents:
78887
diff
changeset
|
2019 |
ef0a2673bf5e
* net/tramp.el (tramp-completion-mode): Extend doc-string.
Michael Albinus <michael.albinus@gmx.de>
parents:
78887
diff
changeset
|
2020 This is necessary, because Tramp uses a heuristic depending on last |
ef0a2673bf5e
* net/tramp.el (tramp-completion-mode): Extend doc-string.
Michael Albinus <michael.albinus@gmx.de>
parents:
78887
diff
changeset
|
2021 input event. This fails when external packages use other characters |
ef0a2673bf5e
* net/tramp.el (tramp-completion-mode): Extend doc-string.
Michael Albinus <michael.albinus@gmx.de>
parents:
78887
diff
changeset
|
2022 but <TAB>, <SPACE> or ?\\? for file name completion. This variable |
ef0a2673bf5e
* net/tramp.el (tramp-completion-mode): Extend doc-string.
Michael Albinus <michael.albinus@gmx.de>
parents:
78887
diff
changeset
|
2023 should never be set globally, the intention is to let-bind it.") |
66496
63563507d684
(tramp-completion-mode): defvar moved up.
Richard M. Stallman <rms@gnu.org>
parents:
66135
diff
changeset
|
2024 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2025 ;; Necessary because `tramp-file-name-regexp-unified' and |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2026 ;; `tramp-completion-file-name-regexp-unified' aren't different. If |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2027 ;; nil, `tramp-completion-run-real-handler' is called (i.e. forwarding |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2028 ;; to `tramp-file-name-handler'). Otherwise, it takes |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2029 ;; `tramp-run-real-handler'. Using `last-input-event' is a little bit |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2030 ;; risky, because completing a file might require loading other files, |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2031 ;; like "~/.netrc", and for them it shouldn't be decided based on that |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2032 ;; variable. On the other hand, those files shouldn't have partial |
85694
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
2033 ;; Tramp file name syntax. Maybe another variable should be introduced |
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
2034 ;; overwriting this check in such cases. Or we change Tramp file name |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2035 ;; syntax in order to avoid ambiguities, like in XEmacs ... |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
2036 ;;;###tramp-autoload |
84833
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2037 (defun tramp-completion-mode-p () |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2038 "Check, whether method / user name / host name completion is active." |
84833
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2039 (or |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2040 ;; Signal from outside. `non-essential' has been introduced in Emacs 24. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2041 (and (boundp 'non-essential) (symbol-value 'non-essential)) |
85067
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
2042 tramp-completion-mode |
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
2043 ;; Emacs. |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84985
diff
changeset
|
2044 (equal last-input-event 'tab) |
84833
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2045 (and (natnump last-input-event) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84985
diff
changeset
|
2046 (or |
85067
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
2047 ;; ?\t has event-modifier 'control. |
93036
50a5f7c885c1
(tramp-completion-mode-p): Don't use char-equal for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92982
diff
changeset
|
2048 (equal last-input-event ?\t) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84985
diff
changeset
|
2049 (and (not (event-modifiers last-input-event)) |
93036
50a5f7c885c1
(tramp-completion-mode-p): Don't use char-equal for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92982
diff
changeset
|
2050 (or (equal last-input-event ?\?) |
50a5f7c885c1
(tramp-completion-mode-p): Don't use char-equal for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92982
diff
changeset
|
2051 (equal last-input-event ?\ ))))) |
85067
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
2052 ;; XEmacs. |
84833
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2053 (and (featurep 'xemacs) |
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2054 ;; `last-input-event' might be nil. |
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2055 (not (null last-input-event)) |
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2056 ;; `last-input-event' may have no character approximation. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2057 (tramp-compat-funcall 'event-to-character last-input-event) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84985
diff
changeset
|
2058 (or |
85067
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
2059 ;; ?\t has event-modifier 'control. |
93036
50a5f7c885c1
(tramp-completion-mode-p): Don't use char-equal for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92982
diff
changeset
|
2060 (equal |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2061 (tramp-compat-funcall 'event-to-character last-input-event) ?\t) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84985
diff
changeset
|
2062 (and (not (event-modifiers last-input-event)) |
93036
50a5f7c885c1
(tramp-completion-mode-p): Don't use char-equal for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92982
diff
changeset
|
2063 (or (equal |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2064 (tramp-compat-funcall 'event-to-character last-input-event) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2065 ?\?) |
93036
50a5f7c885c1
(tramp-completion-mode-p): Don't use char-equal for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92982
diff
changeset
|
2066 (equal |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2067 (tramp-compat-funcall 'event-to-character last-input-event) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2068 ?\ ))))))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2069 |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2070 (defun tramp-connectable-p (filename) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2071 "Check, whether it is possible to connect the remote host w/o side-effects. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2072 This is true, if either the remote host is already connected, or if we are |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2073 not in completion mode." |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2074 (and (tramp-tramp-file-p filename) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2075 (with-parsed-tramp-file-name filename nil |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2076 (or (get-buffer (tramp-buffer-name v)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2077 (not (tramp-completion-mode-p)))))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2078 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2079 ;; 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
|
2080 ;; `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
|
2081 ;; 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
|
2082 ;;;###autoload |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2083 (defun tramp-completion-handle-file-name-all-completions (filename directory) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2084 "Like `file-name-all-completions' for partial Tramp files." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2085 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2086 (let* ((fullname (tramp-drop-volume-letter |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2087 (expand-file-name filename directory))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2088 ;; Possible completion structures. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2089 (v (tramp-completion-dissect-file-name fullname)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2090 result result1) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2091 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2092 (while v |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2093 (let* ((car (car v)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2094 (method (tramp-file-name-method car)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2095 (user (tramp-file-name-user car)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2096 (host (tramp-file-name-host car)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2097 (localname (tramp-file-name-localname car)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2098 (m (tramp-find-method method user host)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2099 (tramp-current-user user) ; see `tramp-parse-passwd' |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2100 all-user-hosts) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2101 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2102 (unless localname ;; Nothing to complete. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2103 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2104 (if (or user host) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2105 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2106 ;; Method dependent user / host combinations. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2107 (progn |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2108 (mapc |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2109 (lambda (x) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2110 (setq all-user-hosts |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2111 (append all-user-hosts |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2112 (funcall (nth 0 x) (nth 1 x))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2113 (tramp-get-completion-function m)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2114 |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2115 (setq result |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2116 (append result |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2117 (mapcar |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2118 (lambda (x) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2119 (tramp-get-completion-user-host |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2120 method user host (nth 0 x) (nth 1 x))) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2121 (delq nil all-user-hosts))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2122 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2123 ;; Possible methods. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2124 (setq result |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2125 (append result (tramp-get-completion-methods m))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2126 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2127 (setq v (cdr v)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2128 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2129 ;; Unify list, remove nil elements. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2130 (while result |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2131 (let ((car (car result))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2132 (when car |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2133 (add-to-list |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2134 'result1 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2135 (substring car (length (tramp-drop-volume-letter directory))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2136 (setq result (cdr result)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2137 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2138 ;; Complete local parts. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2139 (append |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2140 result1 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2141 (ignore-errors |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2142 (apply (if (tramp-connectable-p fullname) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2143 'tramp-completion-run-real-handler |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2144 'tramp-run-real-handler) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2145 'file-name-all-completions (list (list filename directory))))))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2146 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2147 ;; 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
|
2148 ;;;###autoload |
74766
ca4412906dbd
* net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
74739
diff
changeset
|
2149 (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
|
2150 (filename directory &optional predicate) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2151 "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
|
2152 (try-completion |
ca4412906dbd
* net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
74739
diff
changeset
|
2153 filename |
ca4412906dbd
* net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
74739
diff
changeset
|
2154 (mapcar 'list (file-name-all-completions filename directory)) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2155 (when (and predicate |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2156 (tramp-connectable-p (expand-file-name filename directory))) |
74777
948c86bf6396
* net/tramp.el (tramp-default-method): We still need to check for
Michael Albinus <michael.albinus@gmx.de>
parents:
74766
diff
changeset
|
2157 (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
|
2158 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2159 ;; 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
|
2160 ;; 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
|
2161 ;; Return value is a list of tramp-file-name structures according to possible |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2162 ;; completions. If "localname" is non-nil it means there |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2163 ;; 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
|
2164 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2165 ;; Expected results: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2166 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2167 ;; "/x" "/[x" "/x@" "/[x@" "/x@y" "/[x@y" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2168 ;; [nil nil "x" nil] [nil "x" nil nil] [nil "x" "y" nil] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2169 ;; [nil "x" nil nil] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2170 ;; ["x" nil nil nil] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2171 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2172 ;; "/x:" "/x:y" "/x:y:" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2173 ;; [nil nil "x" ""] [nil nil "x" "y"] ["x" nil "y" ""] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2174 ;; "/[x/" "/[x/y" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2175 ;; ["x" nil "" nil] ["x" nil "y" nil] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2176 ;; ["x" "" nil nil] ["x" "y" nil nil] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2177 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2178 ;; "/x:y@" "/x:y@z" "/x:y@z:" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2179 ;; [nil nil "x" "y@"] [nil nil "x" "y@z"] ["x" "y" "z" ""] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2180 ;; "/[x/y@" "/[x/y@z" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2181 ;; ["x" nil "y" nil] ["x" "y" "z" nil] |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2182 (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
|
2183 "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
|
2184 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
|
2185 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2186 (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
|
2187 (x-nil "\\|\\(\\)") |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2188 (tramp-completion-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2189 (format |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2190 "[^%s]*" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2191 (if (zerop (length tramp-postfix-ipv6-format)) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2192 tramp-postfix-host-format |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2193 tramp-postfix-ipv6-format))) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2194 ;; "/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
|
2195 (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
|
2196 (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
|
2197 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
|
2198 ;; "/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
|
2199 (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
|
2200 (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
|
2201 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
|
2202 ;; "/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
|
2203 (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
|
2204 (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
|
2205 nil nil 1 nil)) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2206 ;; "/[ipv6" "/[ipv6" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2207 (tramp-completion-file-name-structure4 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2208 (list (concat tramp-prefix-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2209 tramp-prefix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2210 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2211 nil nil 1 nil)) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2212 ;; "/user@host" "/[user@host" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2213 (tramp-completion-file-name-structure5 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2214 (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
|
2215 "\\(" 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
|
2216 "\\(" 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
|
2217 nil 1 2 nil)) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2218 ;; "/user@[ipv6" "/[user@ipv6" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2219 (tramp-completion-file-name-structure6 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2220 (list (concat tramp-prefix-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2221 "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2222 tramp-prefix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2223 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2224 nil 1 2 nil)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2225 ;; "/method:user" "/[method/user" "/method://user" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2226 (tramp-completion-file-name-structure7 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2227 (list (concat tramp-prefix-regexp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2228 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2229 "\\(" 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
|
2230 1 2 nil nil)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2231 ;; "/method:host" "/[method/host" "/method://host" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2232 (tramp-completion-file-name-structure8 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2233 (list (concat tramp-prefix-regexp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2234 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2235 "\\(" 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
|
2236 1 nil 2 nil)) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2237 ;; "/method:[ipv6" "/[method/ipv6" "/method://[ipv6" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2238 (tramp-completion-file-name-structure9 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2239 (list (concat tramp-prefix-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2240 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2241 tramp-prefix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2242 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2243 1 nil 2 nil)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2244 ;; "/method:user@host" "/[method/user@host" "/method://user@host" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2245 (tramp-completion-file-name-structure10 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2246 (list (concat tramp-prefix-regexp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2247 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2248 "\\(" 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
|
2249 "\\(" tramp-host-regexp x-nil "\\)$") |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2250 1 2 3 nil)) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2251 ;; "/method:user@[ipv6" "/[method/user@ipv6" "/method://user@[ipv6" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2252 (tramp-completion-file-name-structure11 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2253 (list (concat tramp-prefix-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2254 "\\(" tramp-method-regexp "\\)" tramp-postfix-method-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2255 "\\(" tramp-user-regexp "\\)" tramp-postfix-user-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2256 tramp-prefix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2257 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2258 1 2 3 nil)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2259 ;; "/method: "/method:/" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2260 (tramp-completion-file-name-structure12 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2261 (list |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2262 (if (equal tramp-syntax 'url) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2263 (concat tramp-prefix-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2264 "\\(" tramp-method-regexp "\\)" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2265 "\\(" (substring tramp-postfix-method-regexp 0 1) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2266 "\\|" (substring tramp-postfix-method-regexp 1 2) "\\)" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2267 "\\(" "\\)$") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2268 ;; Should not match if not URL syntax. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2269 (concat tramp-prefix-regexp "/$")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2270 1 3 nil nil)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2271 ;; "/method: "/method:/" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2272 (tramp-completion-file-name-structure13 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2273 (list |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2274 (if (equal tramp-syntax 'url) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2275 (concat tramp-prefix-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2276 "\\(" tramp-method-regexp "\\)" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2277 "\\(" (substring tramp-postfix-method-regexp 0 1) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2278 "\\|" (substring tramp-postfix-method-regexp 1 2) "\\)" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2279 "\\(" "\\)$") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2280 ;; Should not match if not URL syntax. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2281 (concat tramp-prefix-regexp "/$")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2282 1 nil 3 nil))) |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2283 |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2284 (mapc (lambda (regexp) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2285 (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
|
2286 (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
|
2287 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2288 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
|
2289 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
|
2290 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
|
2291 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
|
2292 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
|
2293 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
|
2294 tramp-completion-file-name-structure7 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2295 tramp-completion-file-name-structure8 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2296 tramp-completion-file-name-structure9 |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2297 tramp-completion-file-name-structure10 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2298 tramp-completion-file-name-structure11 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2299 tramp-completion-file-name-structure12 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2300 tramp-completion-file-name-structure13 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2301 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
|
2302 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2303 (delq nil result))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2304 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2305 (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
|
2306 "Returns a `tramp-file-name' structure matching STRUCTURE. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2307 The structure consists of remote method, remote user, |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2308 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
|
2309 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2310 (save-match-data |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2311 (when (string-match (nth 0 structure) name) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2312 (let ((method (and (nth 1 structure) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2313 (match-string (nth 1 structure) name))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2314 (user (and (nth 2 structure) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2315 (match-string (nth 2 structure) name))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2316 (host (and (nth 3 structure) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2317 (match-string (nth 3 structure) name))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2318 (localname (and (nth 4 structure) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2319 (match-string (nth 4 structure) name)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2320 (vector method user host localname))))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2321 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2322 ;; 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
|
2323 ;; trailing method delimeter. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2324 (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
|
2325 "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
|
2326 (mapcar |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2327 (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
|
2328 (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
|
2329 (string-match (concat "^" (regexp-quote partial-method)) method) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2330 (tramp-completion-make-tramp-file-name method nil nil nil))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2331 (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
|
2332 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2333 ;; 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
|
2334 (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
|
2335 "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
|
2336 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
|
2337 (cond |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2338 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2339 ((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
|
2340 (if (and host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2341 (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
|
2342 (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
|
2343 (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
|
2344 (setq user nil |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2345 host nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2346 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2347 (partial-user |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2348 (setq host nil) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2349 (unless |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2350 (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
|
2351 (setq user nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2352 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2353 (partial-host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2354 (setq user nil) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2355 (unless |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2356 (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
|
2357 (setq host nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2358 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2359 (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
|
2360 host nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2361 |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2362 (unless (zerop (+ (length user) (length host))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2363 (tramp-completion-make-tramp-file-name method user host nil))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2364 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2365 (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
|
2366 "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
|
2367 Either user or host may be nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2368 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2369 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2370 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2371 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
|
2372 (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
|
2373 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2374 (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
|
2375 (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
|
2376 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2377 (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
|
2378 res)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2379 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2380 (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
|
2381 "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
|
2382 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
|
2383 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2384 (regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2385 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2386 "^\\(" tramp-host-regexp "\\)" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2387 "\\([ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?"))) |
111525
49c1b16ca6b1
* net/tramp-compat.el (tramp-compat-line-beginning-position)
Michael Albinus <michael.albinus@gmx.de>
parents:
111449
diff
changeset
|
2388 (narrow-to-region (point) (point-at-eol)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2389 (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
|
2390 (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
|
2391 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2392 (forward-line 1) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2393 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2394 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2395 (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
|
2396 "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
|
2397 User is always nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2398 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2399 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2400 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2401 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
|
2402 (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
|
2403 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2404 (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
|
2405 (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
|
2406 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2407 (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
|
2408 res)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2409 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2410 (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
|
2411 "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
|
2412 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
|
2413 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2414 (regexp (concat "^\\(" tramp-host-regexp "\\)"))) |
111525
49c1b16ca6b1
* net/tramp-compat.el (tramp-compat-line-beginning-position)
Michael Albinus <michael.albinus@gmx.de>
parents:
111449
diff
changeset
|
2415 (narrow-to-region (point) (point-at-eol)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2416 (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
|
2417 (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
|
2418 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2419 (or |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2420 (> (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
|
2421 (forward-line 1)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2422 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2423 |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2424 (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
|
2425 "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
|
2426 User is always nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2427 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2428 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2429 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2430 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
|
2431 (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
|
2432 (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
|
2433 (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
|
2434 (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
|
2435 (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
|
2436 (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
|
2437 res)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2438 |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2439 (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
|
2440 "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
|
2441 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
|
2442 (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
|
2443 (regexp (concat "^[ \t]*Host[ \t]+" "\\(" tramp-host-regexp "\\)"))) |
111525
49c1b16ca6b1
* net/tramp-compat.el (tramp-compat-line-beginning-position)
Michael Albinus <michael.albinus@gmx.de>
parents:
111449
diff
changeset
|
2444 (narrow-to-region (point) (point-at-eol)) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2445 (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
|
2446 (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
|
2447 (widen) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2448 (or |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2449 (> (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
|
2450 (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
|
2451 result)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2452 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2453 (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
|
2454 "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
|
2455 User is always nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2456 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2457 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2458 (let* ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2459 (regexp (concat "^key_[0-9]+_\\(" tramp-host-regexp "\\)\\.pub$")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2460 (files (when (file-directory-p dirname) (directory-files dirname))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2461 result) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2462 (while files |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2463 (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
|
2464 (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
|
2465 (setq files (cdr files))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2466 result)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2467 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2468 (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
|
2469 "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
|
2470 User is always nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2471 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2472 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2473 (let* ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2474 (regexp (concat "^\\(" tramp-host-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2475 "\\)\\.ssh-\\(dss\\|rsa\\)\\.pub$")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2476 (files (when (file-directory-p dirname) (directory-files dirname))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2477 result) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2478 (while files |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2479 (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
|
2480 (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
|
2481 (setq files (cdr files))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2482 result)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2483 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2484 (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
|
2485 "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
|
2486 User is always nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2487 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2488 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2489 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2490 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
|
2491 (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
|
2492 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2493 (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
|
2494 (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
|
2495 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2496 (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
|
2497 res)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2498 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2499 (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
|
2500 "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
|
2501 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
|
2502 (let ((result) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2503 (regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2504 (concat "^\\(" tramp-ipv6-regexp "\\|" tramp-host-regexp "\\)"))) |
111525
49c1b16ca6b1
* net/tramp-compat.el (tramp-compat-line-beginning-position)
Michael Albinus <michael.albinus@gmx.de>
parents:
111449
diff
changeset
|
2505 (narrow-to-region (point) (point-at-eol)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2506 (when (re-search-forward regexp nil t) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2507 (setq result (list nil (match-string 1)))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2508 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2509 (or |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2510 (> (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
|
2511 (forward-line 1)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2512 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2513 |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2514 ;; 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
|
2515 ;; as default. Unfortunately, we have no information whether any user name |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2516 ;; has been typed already. So we use `tramp-current-user' as indication, |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2517 ;; 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
|
2518 (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
|
2519 "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
|
2520 Host is always \"localhost\"." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2521 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2522 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2523 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2524 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
|
2525 (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
|
2526 '(("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
|
2527 (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
|
2528 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2529 (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
|
2530 (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
|
2531 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2532 (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
|
2533 res))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2534 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2535 (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
|
2536 "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
|
2537 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
|
2538 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2539 (regexp (concat "^\\(" tramp-user-regexp "\\):"))) |
111525
49c1b16ca6b1
* net/tramp-compat.el (tramp-compat-line-beginning-position)
Michael Albinus <michael.albinus@gmx.de>
parents:
111449
diff
changeset
|
2540 (narrow-to-region (point) (point-at-eol)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2541 (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
|
2542 (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
|
2543 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2544 (forward-line 1) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2545 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2546 |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2547 (defun tramp-parse-netrc (filename) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2548 "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
|
2549 User may be nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2550 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2551 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2552 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2553 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
|
2554 (when (file-readable-p filename) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2555 (with-temp-buffer |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2556 (insert-file-contents filename) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2557 (goto-char (point-min)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2558 (while (not (eobp)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2559 (push (tramp-parse-netrc-group) res)))) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2560 res)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2561 |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2562 (defun tramp-parse-netrc-group () |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2563 "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
|
2564 User may be nil." |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2565 (let ((result) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2566 (regexp |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2567 (concat |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2568 "^[ \t]*machine[ \t]+" "\\(" tramp-host-regexp "\\)" |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2569 "\\([ \t]+login[ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?"))) |
111525
49c1b16ca6b1
* net/tramp-compat.el (tramp-compat-line-beginning-position)
Michael Albinus <michael.albinus@gmx.de>
parents:
111449
diff
changeset
|
2570 (narrow-to-region (point) (point-at-eol)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2571 (when (re-search-forward regexp nil t) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2572 (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
|
2573 (widen) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2574 (forward-line 1) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2575 result)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2576 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2577 (defun tramp-parse-putty (registry) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2578 "Return a list of (user host) tuples allowed to access. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2579 User is always nil." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2580 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2581 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2582 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2583 res) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2584 (with-temp-buffer |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
2585 (when (zerop (tramp-compat-call-process "reg" nil t nil "query" registry)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2586 (goto-char (point-min)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2587 (while (not (eobp)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2588 (push (tramp-parse-putty-group registry) res)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2589 res)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2590 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2591 (defun tramp-parse-putty-group (registry) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2592 "Return a (user host) tuple allowed to access. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2593 User is always nil." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2594 (let ((result) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2595 (regexp (concat (regexp-quote registry) "\\\\\\(.+\\)"))) |
111525
49c1b16ca6b1
* net/tramp-compat.el (tramp-compat-line-beginning-position)
Michael Albinus <michael.albinus@gmx.de>
parents:
111449
diff
changeset
|
2596 (narrow-to-region (point) (point-at-eol)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2597 (when (re-search-forward regexp nil t) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2598 (setq result (list nil (match-string 1)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2599 (widen) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2600 (forward-line 1) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2601 result)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2602 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2603 ;;; Common file name handler functions for different backends: |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2604 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2605 (defvar tramp-handle-file-local-copy-hook nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2606 "Normal hook to be run at the end of `tramp-*-handle-file-local-copy'.") |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2607 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2608 (defvar tramp-handle-write-region-hook nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2609 "Normal hook to be run at the end of `tramp-*-handle-write-region'.") |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2610 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2611 (defun tramp-handle-directory-file-name (directory) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2612 "Like `directory-file-name' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2613 ;; If localname component of filename is "/", leave it unchanged. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2614 ;; Otherwise, remove any trailing slash from localname component. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2615 ;; Method, host, etc, are unchanged. Does it make sense to try |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2616 ;; to avoid parsing the filename? |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2617 (with-parsed-tramp-file-name directory nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2618 (if (and (not (zerop (length localname))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2619 (eq (aref localname (1- (length localname))) ?/) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2620 (not (string= localname "/"))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2621 (substring directory 0 -1) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2622 directory))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2623 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2624 (defun tramp-handle-directory-files |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2625 (directory &optional full match nosort files-only) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2626 "Like `directory-files' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2627 ;; FILES-ONLY is valid for XEmacs only. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2628 (when (file-directory-p directory) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2629 (setq directory (file-name-as-directory (expand-file-name directory))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2630 (let ((temp (nreverse (file-name-all-completions "" directory))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2631 result item) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2632 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2633 (while temp |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2634 (setq item (directory-file-name (pop temp))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2635 (when (and (or (null match) (string-match match item)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2636 (or (null files-only) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2637 ;; Files only. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2638 (and (equal files-only t) (file-regular-p item)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2639 ;; Directories only. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2640 (file-directory-p item))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2641 (push (if full (concat directory item) item) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2642 result))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2643 (if nosort result (sort result 'string<))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2644 |
110776
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2645 (defun tramp-handle-directory-files-and-attributes |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2646 (directory &optional full match nosort id-format) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2647 "Like `directory-files-and-attributes' for Tramp files." |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2648 (mapcar |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2649 (lambda (x) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2650 (cons x (tramp-compat-file-attributes |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2651 (if full x (expand-file-name x directory)) id-format))) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2652 (directory-files directory full match nosort))) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2653 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2654 (defun tramp-handle-dired-uncache (dir &optional dir-p) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2655 "Like `dired-uncache' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2656 ;; DIR-P is valid for XEmacs only. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2657 (with-parsed-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2658 (if (or dir-p (file-directory-p dir)) dir (file-name-directory dir)) nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2659 (tramp-flush-directory-property v localname))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2660 |
110776
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2661 (defun tramp-handle-file-exists-p (filename) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2662 "Like `file-exists-p' for Tramp files." |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2663 (not (null (file-attributes filename)))) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2664 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2665 (defun tramp-handle-file-modes (filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2666 "Like `file-modes' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2667 (let ((truename (or (file-truename filename) filename))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2668 (when (file-exists-p truename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2669 (tramp-mode-string-to-int (nth 8 (file-attributes truename)))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2670 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2671 ;; Localname manipulation functions that grok Tramp localnames... |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2672 (defun tramp-handle-file-name-as-directory (file) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2673 "Like `file-name-as-directory' but aware of Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2674 ;; `file-name-as-directory' would be sufficient except localname is |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2675 ;; the empty string. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2676 (let ((v (tramp-dissect-file-name file t))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2677 ;; Run the command on the localname portion only. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2678 (tramp-make-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2679 (tramp-file-name-method v) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2680 (tramp-file-name-user v) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2681 (tramp-file-name-host v) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2682 (tramp-run-real-handler |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2683 'file-name-as-directory (list (or (tramp-file-name-localname v) "")))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2684 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2685 (defun tramp-handle-file-name-completion |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2686 (filename directory &optional predicate) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2687 "Like `file-name-completion' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2688 (unless (tramp-tramp-file-p directory) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2689 (error |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2690 "tramp-handle-file-name-completion invoked on non-tramp directory `%s'" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2691 directory)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2692 (try-completion |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2693 filename |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2694 (mapcar 'list (file-name-all-completions filename directory)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2695 (when predicate |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2696 (lambda (x) (funcall predicate (expand-file-name (car x) directory)))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2697 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2698 (defun tramp-handle-file-name-directory (file) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2699 "Like `file-name-directory' but aware of Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2700 ;; Everything except the last filename thing is the directory. We |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2701 ;; cannot apply `with-parsed-tramp-file-name', because this expands |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2702 ;; the remote file name parts. This is a problem when we are in |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2703 ;; file name completion. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2704 (let ((v (tramp-dissect-file-name file t))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2705 ;; Run the command on the localname portion only. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2706 (tramp-make-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2707 (tramp-file-name-method v) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2708 (tramp-file-name-user v) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2709 (tramp-file-name-host v) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2710 (tramp-run-real-handler |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2711 'file-name-directory (list (or (tramp-file-name-localname v) "")))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2712 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2713 (defun tramp-handle-file-name-nondirectory (file) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2714 "Like `file-name-nondirectory' but aware of Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2715 (with-parsed-tramp-file-name file nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2716 (tramp-run-real-handler 'file-name-nondirectory (list localname)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2717 |
110776
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2718 (defun tramp-handle-file-newer-than-file-p (file1 file2) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2719 "Like `file-newer-than-file-p' for Tramp files." |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2720 (cond |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2721 ((not (file-exists-p file1)) nil) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2722 ((not (file-exists-p file2)) t) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2723 (t (tramp-time-less-p (nth 5 (file-attributes file2)) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2724 (nth 5 (file-attributes file1)))))) |
073caec7510f
* net/tramp.el (tramp-handle-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
110762
diff
changeset
|
2725 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2726 (defun tramp-handle-file-regular-p (filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2727 "Like `file-regular-p' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2728 (and (file-exists-p filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2729 (eq ?- (aref (nth 8 (file-attributes filename)) 0)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2730 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2731 (defun tramp-handle-file-remote-p (filename &optional identification connected) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2732 "Like `file-remote-p' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2733 (let ((tramp-verbose 3)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2734 (when (tramp-tramp-file-p filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2735 (let* ((v (tramp-dissect-file-name filename)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2736 (p (tramp-get-connection-process v)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2737 (c (and p (processp p) (memq (process-status p) '(run open))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2738 ;; We expand the file name only, if there is already a connection. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2739 (with-parsed-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2740 (if c (expand-file-name filename) filename) nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2741 (and (or (not connected) c) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2742 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2743 ((eq identification 'method) method) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2744 ((eq identification 'user) user) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2745 ((eq identification 'host) host) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2746 ((eq identification 'localname) localname) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2747 (t (tramp-make-tramp-file-name method user host ""))))))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2748 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2749 (defun tramp-handle-file-symlink-p (filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2750 "Like `file-symlink-p' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2751 (with-parsed-tramp-file-name filename nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2752 (let ((x (car (file-attributes filename)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2753 (when (stringp x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2754 ;; When Tramp is running on VMS, then `file-name-absolute-p' |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2755 ;; might do weird things. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2756 (if (file-name-absolute-p x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2757 (tramp-make-tramp-file-name method user host x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2758 x))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2759 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2760 (defun tramp-handle-find-backup-file-name (filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2761 "Like `find-backup-file-name' for Tramp files." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2762 (with-parsed-tramp-file-name filename nil |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2763 ;; We set both variables. It doesn't matter whether it is |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2764 ;; Emacs or XEmacs. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2765 (let ((backup-directory-alist |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2766 ;; Emacs case. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2767 (when (boundp 'backup-directory-alist) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2768 (if (symbol-value 'tramp-backup-directory-alist) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2769 (mapcar |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2770 (lambda (x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2771 (cons |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2772 (car x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2773 (if (and (stringp (cdr x)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2774 (file-name-absolute-p (cdr x)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2775 (not (tramp-file-name-p (cdr x)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2776 (tramp-make-tramp-file-name method user host (cdr x)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2777 (cdr x)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2778 (symbol-value 'tramp-backup-directory-alist)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2779 (symbol-value 'backup-directory-alist)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2780 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2781 (bkup-backup-directory-info |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2782 ;; XEmacs case. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2783 (when (boundp 'bkup-backup-directory-info) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2784 (if (symbol-value 'tramp-bkup-backup-directory-info) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2785 (mapcar |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2786 (lambda (x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2787 (nconc |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2788 (list (car x)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2789 (list |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2790 (if (and (stringp (car (cdr x))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2791 (file-name-absolute-p (car (cdr x))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2792 (not (tramp-file-name-p (car (cdr x))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2793 (tramp-make-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2794 method user host (car (cdr x))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2795 (car (cdr x)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2796 (cdr (cdr x)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2797 (symbol-value 'tramp-bkup-backup-directory-info)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2798 (symbol-value 'bkup-backup-directory-info))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2799 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2800 (tramp-run-real-handler 'find-backup-file-name (list filename))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2801 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2802 (defun tramp-handle-insert-file-contents |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2803 (filename &optional visit beg end replace) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2804 "Like `insert-file-contents' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2805 (barf-if-buffer-read-only) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2806 (setq filename (expand-file-name filename)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2807 (let (result local-copy remote-copy) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2808 (with-parsed-tramp-file-name filename nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2809 (unwind-protect |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2810 (if (not (file-exists-p filename)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2811 ;; We don't raise a Tramp error, because it might be |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2812 ;; suppressed, like in `find-file-noselect-1'. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2813 (signal 'file-error |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2814 (list "File not found on remote host" filename)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2815 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2816 (if (and (tramp-local-host-p v) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2817 (let (file-name-handler-alist) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2818 (file-readable-p localname))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2819 ;; Short track: if we are on the local host, we can |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2820 ;; run directly. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2821 (setq result |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2822 (tramp-run-real-handler |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2823 'insert-file-contents |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2824 (list localname visit beg end replace))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2825 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2826 ;; When we shall insert only a part of the file, we copy |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2827 ;; this part. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2828 (when (or beg end) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2829 (setq remote-copy (tramp-make-tramp-temp-file v)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2830 ;; This is defined in tramp-sh.el. Let's assume this |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2831 ;; is loaded already. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2832 (tramp-compat-funcall 'tramp-send-command |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2833 v |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2834 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2835 ((and beg end) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2836 (format "tail -c +%d %s | head -c +%d >%s" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2837 (1+ beg) (tramp-shell-quote-argument localname) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2838 (- end beg) remote-copy)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2839 (beg |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2840 (format "tail -c +%d %s >%s" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2841 (1+ beg) (tramp-shell-quote-argument localname) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2842 remote-copy)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2843 (end |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2844 (format "head -c +%d %s >%s" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2845 (1+ end) (tramp-shell-quote-argument localname) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2846 remote-copy))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2847 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2848 ;; `insert-file-contents-literally' takes care to avoid |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2849 ;; calling jka-compr. By let-binding |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2850 ;; `inhibit-file-name-operation', we propagate that care |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2851 ;; to the `file-local-copy' operation. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2852 (setq local-copy |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2853 (let ((inhibit-file-name-operation |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2854 (when (eq inhibit-file-name-operation |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2855 'insert-file-contents) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2856 'file-local-copy))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2857 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2858 ((stringp remote-copy) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2859 (file-local-copy |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2860 (tramp-make-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2861 method user host remote-copy))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2862 ((stringp tramp-temp-buffer-file-name) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2863 (copy-file filename tramp-temp-buffer-file-name 'ok) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2864 tramp-temp-buffer-file-name) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2865 (t (file-local-copy filename))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2866 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2867 ;; When the file is not readable for the owner, it |
111964
ec45dfa69a06
* net/tramp.el (tramp-temp-buffer-file-name): Make it permanent-local.
Michael Albinus <michael.albinus@gmx.de>
parents:
111945
diff
changeset
|
2868 ;; cannot be inserted, even if it is readable for the |
ec45dfa69a06
* net/tramp.el (tramp-temp-buffer-file-name): Make it permanent-local.
Michael Albinus <michael.albinus@gmx.de>
parents:
111945
diff
changeset
|
2869 ;; group or for everybody. |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2870 (set-file-modes local-copy (tramp-compat-octal-to-decimal "0600")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2871 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2872 (when (and (null remote-copy) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2873 (tramp-get-method-parameter |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2874 method 'tramp-copy-keep-tmpfile)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2875 ;; We keep the local file for performance reasons, |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2876 ;; useful for "rsync". |
111964
ec45dfa69a06
* net/tramp.el (tramp-temp-buffer-file-name): Make it permanent-local.
Michael Albinus <michael.albinus@gmx.de>
parents:
111945
diff
changeset
|
2877 (setq tramp-temp-buffer-file-name local-copy)) |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2878 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2879 (with-progress-reporter |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2880 v 3 (format "Inserting local temp file `%s'" local-copy) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2881 ;; We must ensure that `file-coding-system-alist' |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2882 ;; matches `local-copy'. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2883 (let ((file-coding-system-alist |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2884 (tramp-find-file-name-coding-system-alist |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2885 filename local-copy))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2886 (setq result |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2887 (insert-file-contents |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2888 local-copy nil nil nil replace)))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2889 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2890 ;; Save exit. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2891 (progn |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2892 (when visit |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2893 (setq buffer-file-name filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2894 (setq buffer-read-only (not (file-writable-p filename))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2895 (set-visited-file-modtime) |
111667
daaca509a6d8
* files.el (backup-by-copying-when-mismatch): The default value is
Michael Albinus <michael.albinus@gmx.de>
parents:
111647
diff
changeset
|
2896 (set-buffer-modified-p nil)) |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2897 (when (and (stringp local-copy) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2898 (or remote-copy (null tramp-temp-buffer-file-name))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2899 (delete-file local-copy)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2900 (when (stringp remote-copy) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2901 (delete-file |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2902 (tramp-make-tramp-file-name method user host remote-copy)))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2903 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2904 ;; Result. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2905 (list (expand-file-name filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2906 (cadr result)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2907 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2908 (defun tramp-handle-load (file &optional noerror nomessage nosuffix must-suffix) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2909 "Like `load' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2910 (with-parsed-tramp-file-name (expand-file-name file) nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2911 (unless nosuffix |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2912 (cond ((file-exists-p (concat file ".elc")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2913 (setq file (concat file ".elc"))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2914 ((file-exists-p (concat file ".el")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2915 (setq file (concat file ".el"))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2916 (when must-suffix |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2917 ;; The first condition is always true for absolute file names. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2918 ;; Included for safety's sake. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2919 (unless (or (file-name-directory file) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2920 (string-match "\\.elc?\\'" file)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2921 (tramp-error |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2922 v 'file-error |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2923 "File `%s' does not include a `.el' or `.elc' suffix" file))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2924 (unless noerror |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2925 (when (not (file-exists-p file)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2926 (tramp-error v 'file-error "Cannot load nonexistent file `%s'" file))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2927 (if (not (file-exists-p file)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2928 nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2929 (let ((tramp-message-show-message (not nomessage))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2930 (with-progress-reporter v 0 (format "Loading %s" file) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2931 (let ((local-copy (file-local-copy file))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2932 ;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2933 (unwind-protect |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2934 (load local-copy noerror t t) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2935 (delete-file local-copy))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2936 t))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2937 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2938 (defun tramp-handle-substitute-in-file-name (filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2939 "Like `substitute-in-file-name' for Tramp files. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2940 \"//\" and \"/~\" substitute only in the local filename part. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2941 If the URL Tramp syntax is chosen, \"//\" as method delimeter and \"/~\" at |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2942 beginning of local filename are not substituted." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2943 ;; First, we must replace environment variables. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2944 (setq filename (tramp-replace-environment-variables filename)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2945 (with-parsed-tramp-file-name filename nil |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2946 (if (equal tramp-syntax 'url) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2947 ;; We need to check localname only. The other parts cannot contain |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2948 ;; "//" or "/~". |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2949 (if (and (> (length localname) 1) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2950 (or (string-match "//" localname) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2951 (string-match "/~" localname 1))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2952 (tramp-run-real-handler 'substitute-in-file-name (list filename)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2953 (tramp-make-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2954 (when method (substitute-in-file-name method)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2955 (when user (substitute-in-file-name user)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2956 (when host (substitute-in-file-name host)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2957 (when localname |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2958 (tramp-run-real-handler |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2959 'substitute-in-file-name (list localname))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2960 ;; Ignore in LOCALNAME everything before "//" or "/~". |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2961 (when (and (stringp localname) (string-match ".+?/\\(/\\|~\\)" localname)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2962 (setq filename |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2963 (concat (file-remote-p filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2964 (replace-match "\\1" nil nil localname))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2965 ;; "/m:h:~" does not work for completion. We use "/m:h:~/". |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2966 (when (string-match "~$" filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2967 (setq filename (concat filename "/")))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2968 (tramp-run-real-handler 'substitute-in-file-name (list filename))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2969 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2970 (defun tramp-handle-unhandled-file-name-directory (filename) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2971 "Like `unhandled-file-name-directory' for Tramp files." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2972 ;; With Emacs 23, we could simply return `nil'. But we must keep it |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2973 ;; for backward compatibility. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2974 (expand-file-name "~/")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2975 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
2976 ;;; Functions for establishing connection: |
45861 | 2977 |
46752 | 2978 ;; The following functions are actions to be taken when seeing certain |
2979 ;; prompts from the remote host. See the variable | |
2980 ;; `tramp-actions-before-shell' for usage of these functions. | |
2981 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2982 (defun tramp-action-login (proc vec) |
46752 | 2983 "Send the login name." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2984 (when (not (stringp tramp-current-user)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2985 (save-window-excursion |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2986 (let ((enable-recursive-minibuffers t)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2987 (pop-to-buffer (tramp-get-connection-buffer vec)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2988 (setq tramp-current-user (read-string (match-string 0)))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2989 (tramp-message vec 3 "Sending login name `%s'" tramp-current-user) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2990 (with-current-buffer (tramp-get-connection-buffer vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2991 (tramp-message vec 6 "\n%s" (buffer-string))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2992 (tramp-send-string vec tramp-current-user)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2993 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2994 (defun tramp-action-password (proc vec) |
46752 | 2995 "Query the user for a password." |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
2996 (with-current-buffer (process-buffer proc) |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
2997 (tramp-check-for-regexp proc tramp-password-prompt-regexp) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2998 (tramp-message vec 3 "Sending %s" (match-string 1)) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
2999 (tramp-enter-password proc) |
111932
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3000 ;; Hide password prompt. |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3001 (narrow-to-region (point-max) (point-max)))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3002 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3003 (defun tramp-action-succeed (proc vec) |
46752 | 3004 "Signal success in finding shell prompt." |
3005 (throw 'tramp-action 'ok)) | |
3006 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3007 (defun tramp-action-permission-denied (proc vec) |
46752 | 3008 "Signal permission denied." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3009 (kill-process proc) |
46752 | 3010 (throw 'tramp-action 'permission-denied)) |
3011 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3012 (defun tramp-action-yesno (proc vec) |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
3013 "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
|
3014 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
|
3015 See also `tramp-action-yn'." |
46752 | 3016 (save-window-excursion |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3017 (let ((enable-recursive-minibuffers t)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3018 (save-match-data (pop-to-buffer (tramp-get-connection-buffer vec))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3019 (unless (yes-or-no-p (match-string 0)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3020 (kill-process proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3021 (throw 'tramp-action 'permission-denied)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3022 (with-current-buffer (tramp-get-connection-buffer vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3023 (tramp-message vec 6 "\n%s" (buffer-string))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3024 (tramp-send-string vec "yes")))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3025 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3026 (defun tramp-action-yn (proc vec) |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
3027 "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
|
3028 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
|
3029 See also `tramp-action-yesno'." |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
3030 (save-window-excursion |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3031 (let ((enable-recursive-minibuffers t)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3032 (save-match-data (pop-to-buffer (tramp-get-connection-buffer vec))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3033 (unless (y-or-n-p (match-string 0)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3034 (kill-process proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3035 (throw 'tramp-action 'permission-denied)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3036 (with-current-buffer (tramp-get-connection-buffer vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3037 (tramp-message vec 6 "\n%s" (buffer-string))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3038 (tramp-send-string vec "y")))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3039 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3040 (defun tramp-action-terminal (proc vec) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
3041 "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
|
3042 The terminal type can be configured with `tramp-terminal-type'." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3043 (tramp-message vec 5 "Setting `%s' as terminal type." tramp-terminal-type) |
85553
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3044 (with-current-buffer (tramp-get-connection-buffer vec) |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3045 (tramp-message vec 6 "\n%s" (buffer-string))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3046 (tramp-send-string vec tramp-terminal-type)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3047 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3048 (defun tramp-action-process-alive (proc vec) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3049 "Check, whether a process has finished." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3050 (unless (memq (process-status proc) '(run open)) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3051 (throw 'tramp-action 'process-died))) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3052 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3053 (defun tramp-action-out-of-band (proc vec) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3054 "Check, whether an out-of-band copy has finished." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3055 (cond ((and (memq (process-status proc) '(stop exit)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3056 (zerop (process-exit-status proc))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3057 (tramp-message vec 3 "Process has finished.") |
55420
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3058 (throw 'tramp-action 'ok)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3059 ((or (and (memq (process-status proc) '(stop exit)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3060 (not (zerop (process-exit-status proc)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3061 (memq (process-status proc) '(signal))) |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
3062 ;; `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
|
3063 ;; This can be ignored. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3064 (with-current-buffer (process-buffer proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3065 (goto-char (point-min)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3066 (if (re-search-forward tramp-operation-not-permitted-regexp nil t) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3067 (progn |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3068 (tramp-message vec 5 "'set mode' error ignored.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3069 (tramp-message vec 3 "Process has finished.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3070 (throw 'tramp-action 'ok)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3071 (tramp-message vec 3 "Process has died.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3072 (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
|
3073 (t nil))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
3074 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3075 ;;; Functions for processing the actions: |
46752 | 3076 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3077 (defun tramp-process-one-action (proc vec actions) |
46752 | 3078 "Wait for output from the shell and perform one action." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3079 (let (found todo item pattern action) |
75148
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3080 (while (not found) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3081 ;; Reread output once all actions have been performed. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3082 ;; Obviously, the output was not complete. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3083 (tramp-accept-process-output proc 1) |
75148
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3084 (setq todo actions) |
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3085 (while todo |
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3086 (setq item (pop todo)) |
98699
f3c1254483a0
* net/tramp.el (tramp-process-one-action): Embed regexp in
Michael Albinus <michael.albinus@gmx.de>
parents:
97613
diff
changeset
|
3087 (setq pattern (format "\\(%s\\)\\'" (symbol-value (nth 0 item)))) |
75148
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3088 (setq action (nth 1 item)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3089 (tramp-message |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3090 vec 5 "Looking for regexp \"%s\" from remote shell" pattern) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3091 (when (tramp-check-for-regexp proc pattern) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3092 (tramp-message vec 5 "Call `%s'" (symbol-name action)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3093 (setq found (funcall action proc vec))))) |
75148
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3094 found)) |
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3095 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3096 (defun tramp-process-actions (proc vec actions &optional timeout) |
75148
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
3097 "Perform actions until success or TIMEOUT." |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3098 ;; Preserve message for `progress-reporter'. |
110374
932697ced7aa
* net/tramp-compat.el (tramp-compat-with-temp-message)
Michael Albinus <michael.albinus@gmx.de>
parents:
110321
diff
changeset
|
3099 (tramp-compat-with-temp-message "" |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3100 ;; Enable auth-source and password-cache. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3101 (tramp-set-connection-property vec "first-password-request" t) |
111932
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3102 (save-restriction |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3103 (let (exit) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3104 (while (not exit) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3105 (tramp-message proc 3 "Waiting for prompts from remote shell") |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3106 (setq exit |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3107 (catch 'tramp-action |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3108 (if timeout |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3109 (with-timeout (timeout) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3110 (tramp-process-one-action proc vec actions)) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3111 (tramp-process-one-action proc vec actions))))) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3112 (with-current-buffer (tramp-get-connection-buffer vec) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3113 (widen) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3114 (tramp-message vec 6 "\n%s" (buffer-string))) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3115 (unless (eq exit 'ok) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3116 (tramp-clear-passwd vec) |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3117 (tramp-error-with-buffer |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3118 nil vec 'file-error |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3119 (cond |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3120 ((eq exit 'permission-denied) "Permission denied") |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3121 ((eq exit 'process-died) "Process died") |
656e54e27a1b
* net/tramp.el (tramp-action-password, tramp-process-actions):
Michael Albinus <michael.albinus@gmx.de>
parents:
111926
diff
changeset
|
3122 (t "Login failed")))))))) |
45861 | 3123 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3124 :;; Utility functions: |
45861 | 3125 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3126 (defun tramp-accept-process-output (&optional proc timeout timeout-msecs) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
3127 "Like `accept-process-output' for Tramp processes. |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
3128 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
|
3129 for process communication also." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3130 (with-current-buffer (process-buffer proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3131 (tramp-message proc 10 "%s %s" proc (process-status proc)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3132 (let (buffer-read-only last-coding-system-used) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3133 ;; Under Windows XP, accept-process-output doesn't return |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3134 ;; sometimes. So we add an additional timeout. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3135 (with-timeout ((or timeout 1)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3136 (accept-process-output proc timeout timeout-msecs))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3137 (tramp-message proc 10 "\n%s" (buffer-string)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3138 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3139 (defun tramp-check-for-regexp (proc regexp) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3140 "Check, whether REGEXP is contained in process buffer of PROC. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3141 Erase echoed commands if exists." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3142 (with-current-buffer (process-buffer proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3143 (goto-char (point-min)) |
94975
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
3144 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3145 ;; Check whether we need to remove echo output. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3146 (when (and (tramp-get-connection-property proc "check-remote-echo" nil) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3147 (re-search-forward tramp-echoed-echo-mark-regexp nil t)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3148 (let ((begin (match-beginning 0))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3149 (when (re-search-forward tramp-echoed-echo-mark-regexp nil t) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3150 ;; Discard echo from remote output. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3151 (tramp-set-connection-property proc "check-remote-echo" nil) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3152 (tramp-message proc 5 "echo-mark found") |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3153 (forward-line 1) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3154 (delete-region begin (point)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3155 (goto-char (point-min))))) |
94975
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
3156 |
106597
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
3157 (when (or (not (tramp-get-connection-property proc "check-remote-echo" nil)) |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
3158 ;; Sometimes, the echo string is suppressed on the remote side. |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
3159 (not (string-equal |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3160 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3161 'substring-no-properties tramp-echo-mark-marker |
106597
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
3162 0 (min tramp-echo-mark-marker-length (1- (point-max)))) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3163 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3164 'buffer-substring-no-properties |
106597
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
3165 1 (min (1+ tramp-echo-mark-marker-length) (point-max)))))) |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
3166 ;; No echo to be handled, now we can look for the regexp. |
94975
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
3167 (goto-char (point-min)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3168 (re-search-forward regexp nil t)))) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
3169 |
45861 | 3170 (defun tramp-wait-for-regexp (proc timeout regexp) |
3171 "Wait for a REGEXP to appear from process PROC within TIMEOUT seconds. | |
3172 Expects the output of PROC to be sent to the current buffer. Returns | |
3173 the string that matched, or nil. Waits indefinitely if TIMEOUT is | |
3174 nil." | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3175 (with-current-buffer (process-buffer proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3176 (let ((found (tramp-check-for-regexp proc regexp)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3177 (start-time (current-time))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3178 (cond (timeout |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3179 ;; Work around a bug in XEmacs 21, where the timeout |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3180 ;; expires faster than it should. This degenerates |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3181 ;; to polling for buggy XEmacsen, but oh, well. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3182 (while (and (not found) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3183 (< (tramp-time-diff (current-time) start-time) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3184 timeout)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3185 (with-timeout (timeout) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3186 (while (not found) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3187 (tramp-accept-process-output proc 1) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3188 (unless (memq (process-status proc) '(run open)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3189 (tramp-error-with-buffer |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3190 nil proc 'file-error "Process has died")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3191 (setq found (tramp-check-for-regexp proc regexp)))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3192 (t |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3193 (while (not found) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3194 (tramp-accept-process-output proc 1) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3195 (unless (memq (process-status proc) '(run open)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3196 (tramp-error-with-buffer |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3197 nil proc 'file-error "Process has died")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3198 (setq found (tramp-check-for-regexp proc regexp))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3199 (tramp-message proc 6 "\n%s" (buffer-string)) |
45861 | 3200 (when (not found) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3201 (if timeout |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3202 (tramp-error |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3203 proc 'file-error "[[Regexp `%s' not found in %d secs]]" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3204 regexp timeout) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3205 (tramp-error proc 'file-error "[[Regexp `%s' not found]]" regexp))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3206 found))) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
3207 |
85553
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3208 ;; We don't call `tramp-send-string' in order to hide the password |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3209 ;; from the debug buffer, and because end-of-line handling of the |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3210 ;; string. |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3211 (defun tramp-enter-password (proc) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3212 "Prompt for a password and send it to the remote end." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3213 (process-send-string |
85553
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3214 proc (concat (tramp-read-passwd proc) |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3215 (or (tramp-get-method-parameter |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3216 tramp-current-method |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3217 'tramp-password-end-of-line) |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
3218 tramp-default-password-end-of-line)))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3219 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3220 ;; 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
|
3221 ;; 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
|
3222 ;; `file-attributes' implementation, for instance.) Therefore, we |
82324
5399c02bfd07
* net/tramp.el (tramp-wrong-passwd-regexp): Make the regexp more
Michael Albinus <michael.albinus@gmx.de>
parents:
82201
diff
changeset
|
3223 ;; have this function which sends the string in chunks. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3224 (defun tramp-send-string (vec string) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3225 "Send the STRING via connection VEC. |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3226 |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
3227 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
|
3228 the remote host use line-endings as defined in the variable |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3229 `tramp-rsh-end-of-line'. The communication buffer is erased before sending." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3230 (let* ((p (tramp-get-connection-process vec)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3231 (chunksize (tramp-get-connection-property p "chunksize" nil))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3232 (unless p |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3233 (tramp-error |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3234 vec 'file-error "Can't send string to remote host -- not logged in")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3235 (tramp-set-connection-property p "last-cmd-time" (current-time)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3236 (tramp-message vec 10 "%s" string) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3237 (with-current-buffer (tramp-get-connection-buffer vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3238 ;; Clean up the buffer. We cannot call `erase-buffer' because |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3239 ;; narrowing might be in effect. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3240 (let (buffer-read-only) (delete-region (point-min) (point-max))) |
82324
5399c02bfd07
* net/tramp.el (tramp-wrong-passwd-regexp): Make the regexp more
Michael Albinus <michael.albinus@gmx.de>
parents:
82201
diff
changeset
|
3241 ;; Replace "\n" by `tramp-rsh-end-of-line'. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3242 (setq string |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3243 (mapconcat 'identity |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
3244 (tramp-compat-split-string string "\n") |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3245 tramp-rsh-end-of-line)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3246 (unless (or (string= string "") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3247 (string-equal (substring string -1) tramp-rsh-end-of-line)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3248 (setq string (concat string tramp-rsh-end-of-line))) |
82324
5399c02bfd07
* net/tramp.el (tramp-wrong-passwd-regexp): Make the regexp more
Michael Albinus <michael.albinus@gmx.de>
parents:
82201
diff
changeset
|
3249 ;; Send the string. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3250 (if (and chunksize (not (zerop chunksize))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3251 (let ((pos 0) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3252 (end (length string))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3253 (while (< pos end) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3254 (tramp-message |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3255 vec 10 "Sending chunk from %s to %s" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3256 pos (min (+ pos chunksize) end)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3257 (process-send-string |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3258 p (substring string pos (min (+ pos chunksize) end))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3259 (setq pos (+ pos chunksize)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3260 (process-send-string p string))))) |
45861 | 3261 |
81938
26330ef1aa46
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
81758
diff
changeset
|
3262 (defun tramp-get-inode (vec) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3263 "Returns the virtual inode number. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3264 If it doesn't exist, generate a new one." |
81938
26330ef1aa46
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
81758
diff
changeset
|
3265 (let ((string (tramp-make-tramp-file-name |
26330ef1aa46
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
81758
diff
changeset
|
3266 (tramp-file-name-method vec) |
26330ef1aa46
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
81758
diff
changeset
|
3267 (tramp-file-name-user vec) |
26330ef1aa46
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
81758
diff
changeset
|
3268 (tramp-file-name-host vec) |
26330ef1aa46
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
81758
diff
changeset
|
3269 ""))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3270 (unless (assoc string tramp-inodes) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3271 (add-to-list 'tramp-inodes |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3272 (list string (length tramp-inodes)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3273 (nth 1 (assoc string tramp-inodes)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3274 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3275 (defun tramp-get-device (vec) |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3276 "Returns the virtual device number. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3277 If it doesn't exist, generate a new one." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3278 (let ((string (tramp-make-tramp-file-name |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3279 (tramp-file-name-method vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3280 (tramp-file-name-user vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3281 (tramp-file-name-host vec) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3282 ""))) |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3283 (unless (assoc string tramp-devices) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3284 (add-to-list 'tramp-devices |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
3285 (list string (length tramp-devices)))) |
97052
bed318e44ebd
* net/tramp.el (tramp-perl-directory-files-and-attributes)
Michael Albinus <michael.albinus@gmx.de>
parents:
97035
diff
changeset
|
3286 (cons -1 (nth 1 (assoc string tramp-devices))))) |
45861 | 3287 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3288 (defun tramp-equal-remote (file1 file2) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3289 "Check, whether the remote parts of FILE1 and FILE2 are identical. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3290 The check depends on method, user and host name of the files. If |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3291 one of the components is missing, the default values are used. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3292 The local file name parts of FILE1 and FILE2 are not taken into |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3293 account. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3294 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3295 Example: |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3296 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3297 (tramp-equal-remote \"/ssh::/etc\" \"/<your host name>:/home\") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3298 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3299 would yield `t'. On the other hand, the following check results in nil: |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3300 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3301 (tramp-equal-remote \"/sudo::/etc\" \"/su::/etc\")" |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
3302 (and (stringp (file-remote-p file1)) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
3303 (stringp (file-remote-p file2)) |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84985
diff
changeset
|
3304 (string-equal (file-remote-p file1) (file-remote-p file2)))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3305 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3306 (defun tramp-get-method-parameter (method param) |
53206
0c19f1a19b2b
(tramp-chunksize): Extend docstring. Suggested by
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
52401
diff
changeset
|
3307 "Return the method parameter PARAM. |
108186
3287df4f3442
Implement compression for inline methods.
Michael Albinus <albinus@detlef>
parents:
108158
diff
changeset
|
3308 If the `tramp-methods' entry does not exist, return nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3309 (let ((entry (assoc param (assoc method tramp-methods)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3310 (when entry (cadr entry)))) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
3311 |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3312 (defun tramp-mode-string-to-int (mode-string) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3313 "Converts a ten-letter `drwxrwxrwx'-style mode string into mode bits." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3314 (let* (case-fold-search |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3315 (mode-chars (string-to-vector mode-string)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3316 (owner-read (aref mode-chars 1)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3317 (owner-write (aref mode-chars 2)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3318 (owner-execute-or-setid (aref mode-chars 3)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3319 (group-read (aref mode-chars 4)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3320 (group-write (aref mode-chars 5)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3321 (group-execute-or-setid (aref mode-chars 6)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3322 (other-read (aref mode-chars 7)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3323 (other-write (aref mode-chars 8)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3324 (other-execute-or-sticky (aref mode-chars 9))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3325 (save-match-data |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3326 (logior |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3327 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3328 ((char-equal owner-read ?r) (tramp-compat-octal-to-decimal "00400")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3329 ((char-equal owner-read ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3330 (t (error "Second char `%c' must be one of `r-'" owner-read))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3331 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3332 ((char-equal owner-write ?w) (tramp-compat-octal-to-decimal "00200")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3333 ((char-equal owner-write ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3334 (t (error "Third char `%c' must be one of `w-'" owner-write))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3335 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3336 ((char-equal owner-execute-or-setid ?x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3337 (tramp-compat-octal-to-decimal "00100")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3338 ((char-equal owner-execute-or-setid ?S) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3339 (tramp-compat-octal-to-decimal "04000")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3340 ((char-equal owner-execute-or-setid ?s) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3341 (tramp-compat-octal-to-decimal "04100")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3342 ((char-equal owner-execute-or-setid ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3343 (t (error "Fourth char `%c' must be one of `xsS-'" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3344 owner-execute-or-setid))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3345 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3346 ((char-equal group-read ?r) (tramp-compat-octal-to-decimal "00040")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3347 ((char-equal group-read ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3348 (t (error "Fifth char `%c' must be one of `r-'" group-read))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3349 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3350 ((char-equal group-write ?w) (tramp-compat-octal-to-decimal "00020")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3351 ((char-equal group-write ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3352 (t (error "Sixth char `%c' must be one of `w-'" group-write))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3353 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3354 ((char-equal group-execute-or-setid ?x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3355 (tramp-compat-octal-to-decimal "00010")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3356 ((char-equal group-execute-or-setid ?S) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3357 (tramp-compat-octal-to-decimal "02000")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3358 ((char-equal group-execute-or-setid ?s) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3359 (tramp-compat-octal-to-decimal "02010")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3360 ((char-equal group-execute-or-setid ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3361 (t (error "Seventh char `%c' must be one of `xsS-'" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3362 group-execute-or-setid))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3363 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3364 ((char-equal other-read ?r) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3365 (tramp-compat-octal-to-decimal "00004")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3366 ((char-equal other-read ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3367 (t (error "Eighth char `%c' must be one of `r-'" other-read))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3368 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3369 ((char-equal other-write ?w) (tramp-compat-octal-to-decimal "00002")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3370 ((char-equal other-write ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3371 (t (error "Nineth char `%c' must be one of `w-'" other-write))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3372 (cond |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3373 ((char-equal other-execute-or-sticky ?x) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3374 (tramp-compat-octal-to-decimal "00001")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3375 ((char-equal other-execute-or-sticky ?T) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3376 (tramp-compat-octal-to-decimal "01000")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3377 ((char-equal other-execute-or-sticky ?t) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3378 (tramp-compat-octal-to-decimal "01001")) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3379 ((char-equal other-execute-or-sticky ?-) 0) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3380 (t (error "Tenth char `%c' must be one of `xtT-'" |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3381 other-execute-or-sticky))))))) |
45861 | 3382 |
82808
6e5814967ffb
* net/tramp.el (tramp-local-host-p): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
82603
diff
changeset
|
3383 (defun tramp-local-host-p (vec) |
6e5814967ffb
* net/tramp.el (tramp-local-host-p): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
82603
diff
changeset
|
3384 "Return t if this points to the local host, nil otherwise." |
87748
e958bc9885ca
* net/tramp.el (tramp-local-host-p): Use `tramp-file-name-host'
Michael Albinus <michael.albinus@gmx.de>
parents:
87649
diff
changeset
|
3385 ;; We cannot use `tramp-file-name-real-host'. A port is an |
e958bc9885ca
* net/tramp.el (tramp-local-host-p): Use `tramp-file-name-host'
Michael Albinus <michael.albinus@gmx.de>
parents:
87649
diff
changeset
|
3386 ;; indication for an ssh tunnel or alike. |
e958bc9885ca
* net/tramp.el (tramp-local-host-p): Use `tramp-file-name-host'
Michael Albinus <michael.albinus@gmx.de>
parents:
87649
diff
changeset
|
3387 (let ((host (tramp-file-name-host vec))) |
82808
6e5814967ffb
* net/tramp.el (tramp-local-host-p): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
82603
diff
changeset
|
3388 (and |
6e5814967ffb
* net/tramp.el (tramp-local-host-p): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
82603
diff
changeset
|
3389 (stringp host) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
3390 (string-match tramp-local-host-regexp host) |
105549
e7c777c6e230
* net/tramp.el (tramp-local-host-p): Function shall return nil for
Michael Albinus <michael.albinus@gmx.de>
parents:
105523
diff
changeset
|
3391 ;; The method shall be applied to one of the shell file name |
e7c777c6e230
* net/tramp.el (tramp-local-host-p): Function shall return nil for
Michael Albinus <michael.albinus@gmx.de>
parents:
105523
diff
changeset
|
3392 ;; handler. `tramp-local-host-p' is also called for "smb" and |
e7c777c6e230
* net/tramp.el (tramp-local-host-p): Function shall return nil for
Michael Albinus <michael.albinus@gmx.de>
parents:
105523
diff
changeset
|
3393 ;; alike, where it must fail. |
e7c777c6e230
* net/tramp.el (tramp-local-host-p): Function shall return nil for
Michael Albinus <michael.albinus@gmx.de>
parents:
105523
diff
changeset
|
3394 (tramp-get-method-parameter |
e7c777c6e230
* net/tramp.el (tramp-local-host-p): Function shall return nil for
Michael Albinus <michael.albinus@gmx.de>
parents:
105523
diff
changeset
|
3395 (tramp-file-name-method vec) 'tramp-login-program) |
87921
c49bc2860fd0
* net/tramp.el (tramp-remote-process-environment): Set "LC_ALL=C".
Michael Albinus <michael.albinus@gmx.de>
parents:
87748
diff
changeset
|
3396 ;; The local temp directory must be writable for the other user. |
c49bc2860fd0
* net/tramp.el (tramp-remote-process-environment): Set "LC_ALL=C".
Michael Albinus <michael.albinus@gmx.de>
parents:
87748
diff
changeset
|
3397 (file-writable-p |
c49bc2860fd0
* net/tramp.el (tramp-remote-process-environment): Set "LC_ALL=C".
Michael Albinus <michael.albinus@gmx.de>
parents:
87748
diff
changeset
|
3398 (tramp-make-tramp-file-name |
c49bc2860fd0
* net/tramp.el (tramp-remote-process-environment): Set "LC_ALL=C".
Michael Albinus <michael.albinus@gmx.de>
parents:
87748
diff
changeset
|
3399 (tramp-file-name-method vec) |
c49bc2860fd0
* net/tramp.el (tramp-remote-process-environment): Set "LC_ALL=C".
Michael Albinus <michael.albinus@gmx.de>
parents:
87748
diff
changeset
|
3400 (tramp-file-name-user vec) |
c49bc2860fd0
* net/tramp.el (tramp-remote-process-environment): Set "LC_ALL=C".
Michael Albinus <michael.albinus@gmx.de>
parents:
87748
diff
changeset
|
3401 host |
103782
c5225871ee78
* net/tramp.el (tramp-set-file-uid-gid): Handle the case the
Michael Albinus <michael.albinus@gmx.de>
parents:
103735
diff
changeset
|
3402 (tramp-compat-temporary-file-directory))) |
c5225871ee78
* net/tramp.el (tramp-set-file-uid-gid): Handle the case the
Michael Albinus <michael.albinus@gmx.de>
parents:
103735
diff
changeset
|
3403 ;; On some systems, chown runs only for root. |
c5225871ee78
* net/tramp.el (tramp-set-file-uid-gid): Handle the case the
Michael Albinus <michael.albinus@gmx.de>
parents:
103735
diff
changeset
|
3404 (or (zerop (user-uid)) |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3405 ;; This is defined in tramp-sh.el. Let's assume this is |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3406 ;; loaded already. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3407 (zerop (tramp-compat-funcall 'tramp-get-remote-uid vec 'integer)))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3408 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3409 (defun tramp-make-tramp-temp-file (vec) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3410 "Create a temporary file on the remote host identified by VEC. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3411 Return the local name of the temporary file." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3412 (let ((prefix |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3413 (tramp-make-tramp-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3414 (tramp-file-name-method vec) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3415 (tramp-file-name-user vec) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3416 (tramp-file-name-host vec) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3417 (tramp-drop-volume-letter |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3418 (expand-file-name |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3419 tramp-temp-name-prefix |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3420 ;; This is defined in tramp-sh.el. Let's assume this is |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3421 ;; loaded already. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3422 (tramp-compat-funcall 'tramp-get-remote-tmpdir vec))))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3423 result) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3424 (while (not result) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3425 ;; `make-temp-file' would be the natural choice for |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3426 ;; implementation. But it calls `write-region' internally, |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3427 ;; which also needs a temporary file - we would end in an |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3428 ;; infinite loop. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3429 (setq result (make-temp-name prefix)) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3430 (if (file-exists-p result) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3431 (setq result nil) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3432 ;; This creates the file by side effect. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3433 (set-file-times result) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3434 (set-file-modes result (tramp-compat-octal-to-decimal "0700")))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3435 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3436 ;; Return the local part. |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3437 (with-parsed-tramp-file-name result nil localname))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3438 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3439 (defun tramp-delete-temp-file-function () |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3440 "Remove temporary files related to current buffer." |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3441 (when (stringp tramp-temp-buffer-file-name) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3442 (ignore-errors (delete-file tramp-temp-buffer-file-name)))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3443 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3444 (add-hook 'kill-buffer-hook 'tramp-delete-temp-file-function) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3445 (add-hook 'tramp-cache-unload-hook |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3446 (lambda () |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3447 (remove-hook 'kill-buffer-hook |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3448 'tramp-delete-temp-file-function))) |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3449 |
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3450 ;;; Auto saving to a special directory: |
65248
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3451 |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
3452 (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
|
3453 (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
|
3454 (around tramp-advice-make-auto-save-file-name () activate) |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
3455 "Invoke `tramp-*-handle-make-auto-save-file-name' for Tramp files." |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3456 (if (tramp-tramp-file-p (buffer-file-name)) |
104807
509a5b989179
* net/tramp.el (tramp-handle-file-attributes-with-ls)
Michael Albinus <michael.albinus@gmx.de>
parents:
104673
diff
changeset
|
3457 ;; We cannot call `tramp-handle-make-auto-save-file-name' |
509a5b989179
* net/tramp.el (tramp-handle-file-attributes-with-ls)
Michael Albinus <michael.albinus@gmx.de>
parents:
104673
diff
changeset
|
3458 ;; directly, because this would bypass the locking mechanism. |
509a5b989179
* net/tramp.el (tramp-handle-file-attributes-with-ls)
Michael Albinus <michael.albinus@gmx.de>
parents:
104673
diff
changeset
|
3459 (setq ad-return-value |
509a5b989179
* net/tramp.el (tramp-handle-file-attributes-with-ls)
Michael Albinus <michael.albinus@gmx.de>
parents:
104673
diff
changeset
|
3460 (tramp-file-name-handler 'make-auto-save-file-name)) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3461 ad-do-it)) |
105907
9abdd578d117
* net/tramp.el (tramp-advice-make-auto-save-file-name)
Michael Albinus <michael.albinus@gmx.de>
parents:
105893
diff
changeset
|
3462 (add-hook |
9abdd578d117
* net/tramp.el (tramp-advice-make-auto-save-file-name)
Michael Albinus <michael.albinus@gmx.de>
parents:
105893
diff
changeset
|
3463 'tramp-unload-hook |
9abdd578d117
* net/tramp.el (tramp-advice-make-auto-save-file-name)
Michael Albinus <michael.albinus@gmx.de>
parents:
105893
diff
changeset
|
3464 (lambda () |
9abdd578d117
* net/tramp.el (tramp-advice-make-auto-save-file-name)
Michael Albinus <michael.albinus@gmx.de>
parents:
105893
diff
changeset
|
3465 (ad-remove-advice |
9abdd578d117
* net/tramp.el (tramp-advice-make-auto-save-file-name)
Michael Albinus <michael.albinus@gmx.de>
parents:
105893
diff
changeset
|
3466 'make-auto-save-file-name |
105952
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
3467 'around 'tramp-advice-make-auto-save-file-name) |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
3468 (ad-activate 'make-auto-save-file-name)))) |
45861 | 3469 |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3470 ;; In XEmacs < 21.5, autosaved remote files have permission 0666 minus |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3471 ;; umask. This is a security threat. |
57463
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
3472 |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
3473 (defun tramp-set-auto-save-file-modes () |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
3474 "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
|
3475 (let ((bfn (buffer-file-name))) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3476 (when (and (tramp-tramp-file-p bfn) |
86204
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
3477 (buffer-modified-p) |
57463
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
3478 (stringp buffer-auto-save-file-name) |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
3479 (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
|
3480 (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
|
3481 (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
|
3482 ;; 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
|
3483 ;; 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
|
3484 ;; be a security threat. |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
3485 (set-file-modes |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
3486 buffer-auto-save-file-name |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
3487 (or (file-modes bfn) (tramp-compat-octal-to-decimal "0600")))))) |
57463
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
3488 |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3489 (unless (and (featurep 'xemacs) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3490 (= emacs-major-version 21) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3491 (> emacs-minor-version 4)) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3492 (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
|
3493 (add-hook 'tramp-unload-hook |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
3494 (lambda () |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
3495 (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
|
3496 |
45861 | 3497 (defun tramp-subst-strs-in-string (alist string) |
3498 "Replace all occurrences of the string FROM with TO in STRING. | |
3499 ALIST is of the form ((FROM . TO) ...)." | |
3500 (save-match-data | |
3501 (while alist | |
3502 (let* ((pr (car alist)) | |
3503 (from (car pr)) | |
3504 (to (cdr pr))) | |
3505 (while (string-match (regexp-quote from) string) | |
3506 (setq string (replace-match to t t string))) | |
3507 (setq alist (cdr alist)))) | |
3508 string)) | |
3509 | |
110762
d6e88106c5b8
Continue reorganization of load dependencies. (Bug#7156)
Michael Albinus <michael.albinus@gmx.de>
parents:
110702
diff
changeset
|
3510 ;;; Compatibility functions section: |
45861 | 3511 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3512 (defun tramp-read-passwd (proc &optional prompt) |
45861 | 3513 "Read a password from user (compat function). |
95025
bdaea36b81dd
* net/tramp.el: Load auth-source library.
Michael Albinus <michael.albinus@gmx.de>
parents:
94975
diff
changeset
|
3514 Consults the auth-source package. |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
3515 Invokes `password-read' if available, `read-passwd' else." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3516 (let* ((key (tramp-make-tramp-file-name |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3517 tramp-current-method tramp-current-user |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3518 tramp-current-host "")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3519 (pw-prompt |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3520 (or prompt |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3521 (with-current-buffer (process-buffer proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3522 (tramp-check-for-regexp proc tramp-password-prompt-regexp) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3523 (format "%s for %s " (capitalize (match-string 1)) key))))) |
107151
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3524 (with-parsed-tramp-file-name key nil |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3525 (prog1 |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3526 (or |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3527 ;; See if auth-sources contains something useful, if it's bound. |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3528 (and (boundp 'auth-sources) |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3529 (tramp-get-connection-property v "first-password-request" nil) |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3530 ;; Try with Tramp's current method. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3531 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3532 'auth-source-user-or-password |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3533 "password" tramp-current-host tramp-current-method)) |
107151
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3534 ;; Try the password cache. |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3535 (when (functionp 'password-read) |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3536 (unless (tramp-get-connection-property |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3537 v "first-password-request" nil) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3538 (tramp-compat-funcall 'password-cache-remove key)) |
107151
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3539 (let ((password |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3540 (tramp-compat-funcall 'password-read pw-prompt key))) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3541 (tramp-compat-funcall 'password-cache-add key password) |
107151
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3542 password)) |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3543 ;; Else, get the password interactively. |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3544 (read-passwd pw-prompt)) |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3545 (tramp-set-connection-property v "first-password-request" nil))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3546 |
85508
05c8e6a18913
* net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
85428
diff
changeset
|
3547 (defun tramp-clear-passwd (vec) |
05c8e6a18913
* net/tramp.el (top): Put load of all tramp-* files into a dolist.
Michael Albinus <michael.albinus@gmx.de>
parents:
85428
diff
changeset
|
3548 "Clear password cache for connection related to VEC." |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3549 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3550 'password-cache-remove |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3551 (tramp-make-tramp-file-name |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3552 (tramp-file-name-method vec) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3553 (tramp-file-name-user vec) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3554 (tramp-file-name-host vec) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3555 ""))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3556 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3557 ;; Snarfed code from time-date.el and parse-time.el |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3558 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3559 (defconst tramp-half-a-year '(241 17024) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3560 "Evaluated by \"(days-to-time 183)\".") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3561 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3562 (defconst tramp-parse-time-months |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3563 '(("jan" . 1) ("feb" . 2) ("mar" . 3) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3564 ("apr" . 4) ("may" . 5) ("jun" . 6) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3565 ("jul" . 7) ("aug" . 8) ("sep" . 9) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3566 ("oct" . 10) ("nov" . 11) ("dec" . 12)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3567 "Alist mapping month names to integers.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3568 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3569 (defun tramp-time-less-p (t1 t2) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3570 "Say whether time value T1 is less than time value T2." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3571 (unless t1 (setq t1 '(0 0))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3572 (unless t2 (setq t2 '(0 0))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3573 (or (< (car t1) (car t2)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3574 (and (= (car t1) (car t2)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3575 (< (nth 1 t1) (nth 1 t2))))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3576 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3577 (defun tramp-time-subtract (t1 t2) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3578 "Subtract two time values. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3579 Return the difference in the format of a time value." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3580 (unless t1 (setq t1 '(0 0))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3581 (unless t2 (setq t2 '(0 0))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3582 (let ((borrow (< (cadr t1) (cadr t2)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3583 (list (- (car t1) (car t2) (if borrow 1 0)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3584 (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2))))) |
45861 | 3585 |
3586 (defun tramp-time-diff (t1 t2) | |
3587 "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
|
3588 T1 and T2 are time values (as returned by `current-time' for example)." |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3589 (cond ((and (fboundp 'subtract-time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3590 (fboundp 'float-time)) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3591 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3592 'float-time (tramp-compat-funcall 'subtract-time t1 t2))) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3593 ((and (fboundp 'subtract-time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3594 (fboundp 'time-to-seconds)) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3595 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3596 'time-to-seconds (tramp-compat-funcall 'subtract-time t1 t2))) |
45861 | 3597 ((fboundp 'itimer-time-difference) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3598 (tramp-compat-funcall |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3599 'itimer-time-difference |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3600 (if (< (length t1) 3) (append t1 '(0)) t1) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3601 (if (< (length t2) 3) (append t2 '(0)) t2))) |
45861 | 3602 (t |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3603 (let ((time (tramp-time-subtract t1 t2))) |
51603
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3604 (+ (* (car time) 65536.0) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3605 (cadr time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3606 (/ (or (nth 2 time) 0) 1000000.0)))))) |
45861 | 3607 |
3608 ;; Currently (as of Emacs 20.5), the function `shell-quote-argument' | |
3609 ;; does not deal well with newline characters. Newline is replaced by | |
3610 ;; backslash newline. But if, say, the string `a backslash newline b' | |
3611 ;; is passed to a shell, the shell will expand this into "ab", | |
3612 ;; completely omitting the newline. This is not what was intended. | |
3613 ;; It does not appear to be possible to make the function | |
3614 ;; `shell-quote-argument' work with newlines without making it | |
3615 ;; dependent on the shell used. But within this package, we know that | |
3616 ;; we will always use a Bourne-like shell, so we use an approach which | |
3617 ;; groks newlines. | |
3618 ;; | |
3619 ;; The approach is simple: we call `shell-quote-argument', then | |
3620 ;; massage the newline part of the result. | |
3621 ;; | |
3622 ;; This function should produce a string which is grokked by a Unix | |
3623 ;; shell, even if the Emacs is running on Windows. Since this is the | |
3624 ;; kludges section, we bind `system-type' in such a way that | |
3625 ;; `shell-quote-arguments' behaves as if on Unix. | |
3626 ;; | |
3627 ;; Thanks to Mario DeWeerd for the hint that it is sufficient for this | |
3628 ;; function to work with Bourne-like shells. | |
3629 ;; | |
3630 ;; CCC: This function should be rewritten so that | |
3631 ;; `shell-quote-argument' is not used. This way, we are safe from | |
3632 ;; changes in `shell-quote-argument'. | |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
3633 ;;;###tramp-autoload |
45861 | 3634 (defun tramp-shell-quote-argument (s) |
3635 "Similar to `shell-quote-argument', but groks newlines. | |
3636 Only works for Bourne-like shells." | |
3637 (let ((system-type 'not-windows)) | |
3638 (save-match-data | |
3639 (let ((result (shell-quote-argument s)) | |
3640 (nl (regexp-quote (format "\\%s" tramp-rsh-end-of-line)))) | |
3641 (when (and (>= (length result) 2) | |
3642 (string= (substring result 0 2) "\\~")) | |
3643 (setq result (substring result 1))) | |
3644 (while (string-match nl result) | |
3645 (setq result (replace-match (format "'%s'" tramp-rsh-end-of-line) | |
3646 t t result))) | |
3647 result)))) | |
3648 | |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3649 ;; Checklist for `tramp-unload-hook' |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3650 ;; - Unload all `tramp-*' packages |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3651 ;; - Reset `file-name-handler-alist' |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3652 ;; - Cleanup hooks where Tramp functions are in |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3653 ;; - Cleanup advised functions |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3654 ;; - Cleanup autoloads |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3655 ;;;###autoload |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3656 (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
|
3657 "Discard Tramp from loading remote files." |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3658 (interactive) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3659 ;; ange-ftp settings must be enabled. |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3660 (tramp-compat-funcall 'tramp-ftp-enable-ange-ftp) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
3661 ;; Maybe it's not loaded yet. |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
3662 (ignore-errors (unload-feature 'tramp 'force))) |
100216
9c5b974a0a5b
* net/tramp.el (top): Write a message, when loading Tramp.
Michael Albinus <michael.albinus@gmx.de>
parents:
99950
diff
changeset
|
3663 |
45861 | 3664 (provide 'tramp) |
3665 | |
3666 ;;; TODO: | |
3667 | |
3668 ;; * Rewrite `tramp-shell-quote-argument' to abstain from using | |
46790 | 3669 ;; `shell-quote-argument'. |
45861 | 3670 ;; * In Emacs 21, `insert-directory' shows total number of bytes used |
3671 ;; by the files in that directory. Add this here. | |
3672 ;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman) | |
3673 ;; * Make ffap.el grok Tramp filenames. (Eli Tziperman) | |
3674 ;; * abbreviate-file-name | |
104216
bf65b05e8cf1
* net/tramp.el (tramp-get-ls-command-with-dired): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
104143
diff
changeset
|
3675 ;; * Better error checking. At least whenever we see something |
45861 | 3676 ;; strange when doing zerop, we should kill the process and start |
3677 ;; again. (Greg Stark) | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
3678 ;; * Username and hostname completion. |
78887
8faf94b6c420
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
78489
diff
changeset
|
3679 ;; ** Try to avoid usage of `last-input-event' in `tramp-completion-mode-p'. |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
3680 ;; ** 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
|
3681 ;; Code is nearly identical. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3682 ;; * Make `tramp-default-user' obsolete. |
103735
d3d4dbf21c9b
* net/tramp.el (tramp-handle-write-region): Flush file properties
Michael Albinus <michael.albinus@gmx.de>
parents:
103642
diff
changeset
|
3683 ;; * Implement a general server-local-variable mechanism, as there are |
d3d4dbf21c9b
* net/tramp.el (tramp-handle-write-region): Flush file properties
Michael Albinus <michael.albinus@gmx.de>
parents:
103642
diff
changeset
|
3684 ;; probably other variables that need different values for different |
d3d4dbf21c9b
* net/tramp.el (tramp-handle-write-region): Flush file properties
Michael Albinus <michael.albinus@gmx.de>
parents:
103642
diff
changeset
|
3685 ;; servers too. The user could then configure a variable (such as |
d3d4dbf21c9b
* net/tramp.el (tramp-handle-write-region): Flush file properties
Michael Albinus <michael.albinus@gmx.de>
parents:
103642
diff
changeset
|
3686 ;; tramp-server-local-variable-alist) to define any such variables |
d3d4dbf21c9b
* net/tramp.el (tramp-handle-write-region): Flush file properties
Michael Albinus <michael.albinus@gmx.de>
parents:
103642
diff
changeset
|
3687 ;; that they need to, which would then be let bound as appropriate |
107189
a48b193e3b5f
(tramp-handle-insert-file-contents): Set always the permissions of the
Michael Albinus <michael.albinus@gmx.de>
parents:
107170
diff
changeset
|
3688 ;; in tramp functions. (Jason Rumney) |
107021
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
3689 ;; * IMHO, it's a drawback that currently Tramp doesn't support |
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
3690 ;; Unicode in Dired file names by default. Is it possible to |
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
3691 ;; improve Tramp to set LC_ALL to "C" only for commands where Tramp |
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
3692 ;; expects English? Or just to set LC_MESSAGES to "C" if Tramp |
107189
a48b193e3b5f
(tramp-handle-insert-file-contents): Set always the permissions of the
Michael Albinus <michael.albinus@gmx.de>
parents:
107170
diff
changeset
|
3693 ;; expects only English messages? (Juri Linkov) |
107021
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
3694 ;; * Make shadowfile.el grok Tramp filenames. (Bug#4526, Bug#4846) |
110121
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3695 ;; * I was wondering it it would be possible to use tramp even if I'm |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3696 ;; actually using sshfs. But when I launch a command I would like |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3697 ;; to get it executed on the remote machine where the files really |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3698 ;; are. (Andrea Crotti) |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3699 ;; * Run emerge on two remote files. Bug is described here: |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3700 ;; <http://www.mail-archive.com/tramp-devel@nongnu.org/msg01041.html>. |
5a6b4fafaa52
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
107498
diff
changeset
|
3701 ;; (Bug#6850) |
45861 | 3702 |
3703 ;; Functions for file-name-handler-alist: | |
3704 ;; diff-latest-backup-file -- in diff.el | |
3705 | |
3706 ;;; tramp.el ends here | |
93040
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
3707 |
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
3708 ;; Local Variables: |
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
3709 ;; mode: Emacs-Lisp |
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
3710 ;; coding: utf-8 |
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
3711 ;; End: |