Mercurial > emacs
annotate lisp/net/tramp.el @ 110410:f2e111723c3a
Merge changes made in Gnus trunk.
Reimplement nnimap, and do tweaks to the rest of the code to support that.
* gnus-int.el (gnus-finish-retrieve-group-infos)
(gnus-retrieve-group-data-early): New functions.
* gnus-range.el (gnus-range-nconcat): New function.
* gnus-start.el (gnus-get-unread-articles): Support early retrieval of
data.
(gnus-read-active-for-groups): Support finishing the early retrieval of
data.
* gnus-sum.el (gnus-summary-move-article): Pass the move-to group name
if the move is internal, so that nnimap can do fast internal moves.
* gnus.el (gnus-article-special-mark-lists): Add uid/active tuples, for
nnimap usage.
* nnimap.el: Rewritten.
* nnmail.el (nnmail-inhibit-default-split-group): New internal variable
to allow the mail splitting to not return a default group. This is
useful for nnimap, which will leave unmatched mail in the inbox.
* utf7.el (utf7-encode): Autoload.
Implement shell connection.
* nnimap.el (nnimap-open-shell-stream): New function.
(nnimap-open-connection): Use it.
Get the number of lines by using BODYSTRUCTURE.
(nnimap-transform-headers): Get the number of lines in each message.
(nnimap-retrieve-headers): Query for BODYSTRUCTURE so that we get the
number of lines.
Not all servers return UIDNEXT. Work past this problem.
Remove junk from end of file.
Fix typo in "bogus" section.
Make capabilties be case-insensitive.
Require cl when compiling.
Don't bug out if the LIST command doesn't have any parameters.
2010-09-17 Knut Anders Hatlen <kahatlen@gmail.com> (tiny change)
* nnimap.el (nnimap-get-groups): Don't bug out if the LIST command
doesn't have any parameters.
(mm-text-html-renderer): Document gnus-article-html.
2010-09-17 Julien Danjou <julien@danjou.info> (tiny fix)
* mm-decode.el (mm-text-html-renderer): Document gnus-article-html.
* dgnushack.el: Define netrc-credentials.
If the user doesn't have a /etc/services, supply some sensible port defaults.
Have `unseen-or-unread' select an unread unseen article first.
(nntp-open-server): Return whether the open was successful or not.
Throughout all files, replace (save-excursion (set-buffer ...)) with (with-current-buffer ... ).
Save result so that it doesn't say "failed" all the time.
Add ~/.authinfo to the default, since that's probably most useful for users.
Don't use the "finish" method when we're reading from the agent.
Add some more nnimap-relevant agent stuff to nnagent.el.
* nnimap.el (nnimap-with-process-buffer): Removed.
Revert one line that was changed by mistake in the last checkin.
(nnimap-open-connection): Don't error out when we can't make a connection
nnimap-related changes to avoid bugging out if we can't contact a server.
* gnus-start.el (gnus-get-unread-articles): Don't try to scan groups
from methods that are denied.
* nnimap.el (nnimap-possibly-change-group): Return nil if we can't log
in.
(nnimap-finish-retrieve-group-infos): Make sure we're not waiting for
nothing.
* gnus-sum.el (gnus-select-newsgroup): Indent.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Sat, 18 Sep 2010 10:02:19 +0000 |
parents | 932697ced7aa |
children | 4e901a2d3669 |
rev | line source |
---|---|
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
1 ;;; tramp.el --- Transparent Remote Access, Multiple Protocol |
45861 | 2 |
64701
34bd8e434dd7
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64559
diff
changeset
|
3 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
106815 | 4 ;; 2005, 2006, 2007, 2008, 2009, 2010 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 ;; |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
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) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
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 |
107379
3c0cd76e49ff
Fix last change to use existing comm Custom group instead of `net'.
Chong Yidong <cyd@stupidchicken.com>
parents:
107378
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 |
109563
35f14a2258f3
* net/tramp.el (tramp-methods): Move hostname to the end in all
Michael Albinus <michael.albinus@gmx.de>
parents:
109500
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. |
108702
a0b236a315d5
* net/tramp.el (tramp-methods): Add `tramp-async-args' attribute
Michael Albinus <albinus@detlef>
parents:
108540
diff
changeset
|
209 * `tramp-async-args' |
a0b236a315d5
* net/tramp.el (tramp-methods): Add `tramp-async-args' attribute
Michael Albinus <albinus@detlef>
parents:
108540
diff
changeset
|
210 When an asynchronous process is started, we know already that |
a0b236a315d5
* net/tramp.el (tramp-methods): Add `tramp-async-args' attribute
Michael Albinus <albinus@detlef>
parents:
108540
diff
changeset
|
211 the connection works. Therefore, we can pass additional |
a0b236a315d5
* net/tramp.el (tramp-methods): Add `tramp-async-args' attribute
Michael Albinus <albinus@detlef>
parents:
108540
diff
changeset
|
212 parameters to suppress diagnostic messages, in order not to |
a0b236a315d5
* net/tramp.el (tramp-methods): Add `tramp-async-args' attribute
Michael Albinus <albinus@detlef>
parents:
108540
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 |
108065
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
274 (defun tramp-detect-ssh-controlmaster () |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
275 "Call ssh to detect whether it supports the ControlMaster argument. |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
276 This function may return nil when the argument is supported, but |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
277 shouldn't return t when it isn't." |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
278 (ignore-errors |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
279 (with-temp-buffer |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
280 (call-process "ssh" nil t nil "-o" "ControlMaster") |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
281 (goto-char (point-min)) |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
282 (search-forward-regexp "Missing ControlMaster argument" nil t)))) |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
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 |
108065
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
291 ;; password caching. "scpc" is chosen if we detect that the user is |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
292 ;; running OpenSSH 4.0 or newer. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
293 (cond |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
294 ;; PuTTY is installed. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
295 ((executable-find "pscp") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
296 (if (or (fboundp 'password-read) |
105462
f6c5cf0fc0c9
* net/tramp.el (tramp-verbose): Fix docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
105351
diff
changeset
|
297 (fboundp 'auth-source-user-or-password) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
298 ;; Pageant is running. |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
299 (tramp-compat-process-running-p "Pageant")) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
300 "pscp" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
301 "plink")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
302 ;; There is an ssh installation. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
303 ((executable-find "scp") |
108065
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
304 (cond |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
305 ((tramp-detect-ssh-controlmaster) "scpc") |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
306 ((or (fboundp 'password-read) |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
307 (fboundp 'auth-source-user-or-password) |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
308 ;; ssh-agent is running. |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
309 (getenv "SSH_AUTH_SOCK") |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
310 (getenv "SSH_AGENT_PID")) |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
311 "scp") |
186cf99d4122
Detect ssh 'ControlMaster' argument automatically in some cases.
Michael Albinus <michael.albinus@gmx.de>
parents:
108064
diff
changeset
|
312 (t "ssh"))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
313 ;; Fallback. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
314 (t "ftp")) |
45861 | 315 "*Default method to use for transferring files. |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
316 See `tramp-methods' for possibilities. |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
317 Also see `tramp-default-method-alist'." |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
318 :group 'tramp |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
319 :type 'string) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
320 |
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
|
321 (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
|
322 "*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
|
323 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
|
324 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
|
325 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
|
326 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
|
327 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
|
328 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
329 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
|
330 empty string for the user name. |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
331 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
332 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
|
333 :group 'tramp |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
334 :type '(repeat (list (regexp :tag "Host regexp") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
335 (regexp :tag "User regexp") |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
336 (string :tag "Method")))) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
337 |
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
|
338 (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
|
339 "*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
|
340 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
|
341 \"~/.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
|
342 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
343 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
|
344 :group 'tramp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
345 :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
|
346 |
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
|
347 (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
|
348 "*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
|
349 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
|
350 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
|
351 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
|
352 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
|
353 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
|
354 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
355 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
|
356 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
|
357 :group 'tramp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
358 :type '(repeat (list (regexp :tag "Method regexp") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
359 (regexp :tag "Host regexp") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
360 (string :tag "User")))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
361 |
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
|
362 (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
|
363 "*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
|
364 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
|
365 :group 'tramp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
366 :type 'string) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
367 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
368 (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
|
369 "*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
|
370 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
|
371 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
|
372 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
|
373 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
|
374 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
|
375 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
|
376 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
|
377 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
|
378 |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
379 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
|
380 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
|
381 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
|
382 :group 'tramp |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
383 :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
|
384 (choice :tag "User regexp" regexp sexp) |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
385 (choice :tag "Proxy remote 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
|
386 |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
387 (defconst tramp-local-host-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
388 (concat |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
389 "^" (regexp-opt (list "localhost" (system-name) "127\.0\.0\.1" "::1") t) "$") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
390 "*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
|
391 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
392 (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
|
393 "*Alist of methods for remote files. |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
394 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
|
395 Each NAME stands for a remote access method. Each PAIR is of the form |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
396 \(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
|
397 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
|
398 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
399 * `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
|
400 * `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
|
401 * `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
|
402 * `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
|
403 * `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
|
404 * `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
|
405 * `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
|
406 * `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
|
407 * `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
|
408 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
409 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
|
410 the info pages.") |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
411 |
94975
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
412 (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
|
413 "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
|
414 |
106597
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
415 (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
|
416 "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
|
417 |
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
418 (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
|
419 (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
|
420 (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
|
421 "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
|
422 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
|
423 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
|
424 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
|
425 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
|
426 `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
|
427 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
|
428 usually suffice.") |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
429 |
106597
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
430 (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
|
431 (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
|
432 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
|
433 "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
|
434 the remote shell.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
435 |
45861 | 436 (defcustom tramp-rsh-end-of-line "\n" |
437 "*String used for end of line in rsh connections. | |
438 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
|
439 if you need to change this. |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
440 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
|
441 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
|
442 :group 'tramp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
443 :type 'string) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
444 |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
445 (defcustom tramp-default-password-end-of-line |
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
446 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
|
447 "*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
|
448 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
|
449 `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
|
450 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
451 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
|
452 \"\\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
|
453 \"\\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
|
454 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
|
455 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
456 The default value is to use the same value as `tramp-rsh-end-of-line'." |
45861 | 457 :group 'tramp |
458 :type 'string) | |
459 | |
460 (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
|
461 ".*ogin\\( .*\\)?: *" |
45861 | 462 "*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
|
463 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
|
464 |
efa862a76bc2
* net/tramp.el (tramp-login-prompt-regexp): Expand regexp in order to
Michael Albinus <michael.albinus@gmx.de>
parents:
65359
diff
changeset
|
465 Sometimes the prompt is reported to look like \"login as:\"." |
45861 | 466 :group 'tramp |
467 :type 'regexp) | |
468 | |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
469 (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
|
470 ;; Allow a prompt to start right after a ^M since it indeed would be |
108975
c4552014bea2
* net/tramp.el (tramp-remote-process-environment): Protect version
Michael Albinus <albinus@detlef>
parents:
108817
diff
changeset
|
471 ;; displayed at the beginning of the line (and Zsh uses it). This |
c4552014bea2
* net/tramp.el (tramp-remote-process-environment): Protect version
Michael Albinus <albinus@detlef>
parents:
108817
diff
changeset
|
472 ;; regexp works only for GNU Emacs. |
c4552014bea2
* net/tramp.el (tramp-remote-process-environment): Protect version
Michael Albinus <albinus@detlef>
parents:
108817
diff
changeset
|
473 (concat (if (featurep 'xemacs) "" "\\(?:^\\|\r\\)") |
c4552014bea2
* net/tramp.el (tramp-remote-process-environment): Protect version
Michael Albinus <albinus@detlef>
parents:
108817
diff
changeset
|
474 "[^#$%>\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
|
475 "Regexp to match prompts from remote shell. |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
476 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
|
477 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
|
478 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
|
479 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
|
480 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
|
481 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
|
482 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
|
483 |
9e96dbbd314e
Handle prompt rules of ksh in OpenBSD 4.5. Reported by Raphal
Michael Albinus <michael.albinus@gmx.de>
parents:
106390
diff
changeset
|
484 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
|
485 `tramp-end-of-output'." |
46998
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
486 :group 'tramp |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
487 :type 'regexp) |
9d6aef07c793
Version 2.0.14 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46992
diff
changeset
|
488 |
45861 | 489 (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
|
490 "^.*\\([pP]assword\\|[pP]assphrase\\).*:\^@? *" |
45861 | 491 "*Regexp matching password-like prompts. |
46752 | 492 The regexp should match at end of buffer. |
45861 | 493 |
494 The `sudo' program appears to insert a `^@' character into the prompt." | |
495 :group 'tramp | |
496 :type 'regexp) | |
497 | |
498 (defcustom tramp-wrong-passwd-regexp | |
46790 | 499 (concat "^.*" |
500 ;; 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
|
501 (regexp-opt '("Permission denied" |
46790 | 502 "Login incorrect" |
503 "Login Incorrect" | |
504 "Connection refused" | |
505 "Connection closed" | |
107021
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
506 "Timeout, server not responding." |
46790 | 507 "Sorry, try again." |
508 "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
|
509 "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
|
510 "No supported authentication methods left to try!") t) |
46790 | 511 ".*" |
512 "\\|" | |
513 "^.*\\(" | |
514 ;; Here comes a list of regexes, separated by \\| | |
515 "Received signal [0-9]+" | |
516 "\\).*") | |
45861 | 517 "*Regexp matching a `login failed' message. |
46752 | 518 The regexp should match at end of buffer." |
519 :group 'tramp | |
520 :type 'regexp) | |
521 | |
522 (defcustom tramp-yesno-prompt-regexp | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
523 (concat |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
524 (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
|
525 "\\s-*") |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
526 "Regular expression matching all yes/no queries which need to be confirmed. |
46752 | 527 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
|
528 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
|
529 See also `tramp-yn-prompt-regexp'." |
45861 | 530 :group 'tramp |
531 :type 'regexp) | |
532 | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
533 (defcustom tramp-yn-prompt-regexp |
74985
155a8e75cd11
Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents:
74777
diff
changeset
|
534 (concat |
155a8e75cd11
Sync with Tramp 2.0.55.
Michael Albinus <michael.albinus@gmx.de>
parents:
74777
diff
changeset
|
535 (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
|
536 "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
|
537 "\\s-*") |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
538 "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
|
539 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
|
540 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
|
541 See also `tramp-yesno-prompt-regexp'." |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
542 :group 'tramp |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
543 :type 'regexp) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
544 |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
545 (defcustom tramp-terminal-prompt-regexp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
546 (concat "\\(" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
547 "TERM = (.*)" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
548 "\\|" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
549 "Terminal type\\? \\[.*\\]" |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
550 "\\)\\s-*") |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
551 "Regular expression matching all terminal setting prompts. |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
552 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
|
553 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
|
554 :group 'tramp |
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
555 :type 'regexp) |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
556 |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
557 (defcustom tramp-operation-not-permitted-regexp |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
558 (concat "\\(" "preserving times.*" "\\|" "set mode" "\\)" ":\\s-*" |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
559 (regexp-opt '("Operation not permitted") t)) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
560 "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
|
561 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
|
562 be ignored safely." |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
563 :group 'tramp |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
564 :type 'regexp) |
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
565 |
74166
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
566 (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
|
567 (concat "\\(.+: " |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
568 (regexp-opt '("Permission denied" |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
569 "not a regular file" |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
570 "is a directory" |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
571 "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
|
572 "\\)\\s-*") |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
573 "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
|
574 :group 'tramp |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
575 :type 'regexp) |
5b973e5dc882
(tramp-default-method): Under Windows, change from plink to pscp.
Lars Hansen <larsh@soem.dk>
parents:
74052
diff
changeset
|
576 |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
577 (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
|
578 "" |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
579 "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
|
580 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
|
581 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
|
582 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
|
583 `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
|
584 :group 'tramp |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
585 :type 'regexp) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
586 |
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
|
587 (defconst tramp-temp-name-prefix "tramp." |
45861 | 588 "*Prefix to use for temporary files. |
589 If this is a relative file name (such as \"tramp.\"), it is considered | |
590 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
|
591 `tramp-compat-temporary-file-directory' (which see). It may also be an |
45861 | 592 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
|
593 part, though.") |
45861 | 594 |
96941
940a290a5646
* net/tramp.el (tramp-methods): Add "-q" for "scp", "scp1",
Michael Albinus <michael.albinus@gmx.de>
parents:
96392
diff
changeset
|
595 (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
|
596 "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
|
597 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
|
598 |
105718
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
599 (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
|
600 "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
|
601 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
|
602 (make-variable-buffer-local 'tramp-temp-buffer-file-name) |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
603 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
604 ;; 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
|
605 ;; 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
|
606 ;; 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
|
607 ;; 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
|
608 ;; 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
|
609 ;; 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
|
610 ;; 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
|
611 ;; the other places. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
612 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
613 ;; 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
|
614 ;;;###autoload |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
615 (defcustom tramp-syntax |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
616 (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
|
617 "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
|
618 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
619 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
|
620 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
621 '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
|
622 '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
|
623 '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
|
624 :group 'tramp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
625 :type (if (featurep 'xemacs) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
626 '(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
|
627 (const :tag "XEmacs" sep) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
628 (const :tag "URL" url)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
629 '(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
|
630 (const :tag "URL" url)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
631 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
632 (defconst tramp-prefix-format |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
633 (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
|
634 ((equal tramp-syntax 'sep) "/[") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
635 ((equal tramp-syntax 'url) "/") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
636 (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
|
637 "*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
|
638 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
|
639 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
640 (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
|
641 (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
|
642 "*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
|
643 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
|
644 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
645 (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
|
646 "[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
|
647 "*Regexp matching methods identifiers.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
648 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
649 (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
|
650 (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
|
651 ((equal tramp-syntax 'sep) "/") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
652 ((equal tramp-syntax 'url) "://") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
653 (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
|
654 "*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
|
655 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
|
656 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
657 (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
|
658 (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
|
659 "*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
|
660 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
|
661 |
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
|
662 (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
|
663 "*Regexp matching user names.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
664 |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
665 (defconst tramp-prefix-domain-format "%" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
666 "*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
|
667 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
668 (defconst tramp-prefix-domain-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
669 (regexp-quote tramp-prefix-domain-format) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
670 "*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
|
671 Derived from `tramp-prefix-domain-format'.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
672 |
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
|
673 (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
|
674 "*Regexp matching domain names.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
675 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
676 (defconst tramp-user-with-domain-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
677 (concat "\\(" tramp-user-regexp "\\)" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
678 tramp-prefix-domain-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
679 "\\(" tramp-domain-regexp "\\)") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
680 "*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
|
681 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
682 (defconst tramp-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
|
683 "*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
|
684 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
|
685 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
686 (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
|
687 (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
|
688 "*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
|
689 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
|
690 |
110321
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
691 (defconst tramp-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
|
692 "*Regexp matching host names.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
693 |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
694 (defconst tramp-prefix-ipv6-format |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
695 (cond ((equal tramp-syntax 'ftp) "[") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
696 ((equal tramp-syntax 'sep) "") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
697 ((equal tramp-syntax 'url) "[") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
698 (t (error "Wrong `tramp-syntax' defined"))) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
699 "*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
|
700 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
|
701 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
702 (defconst tramp-prefix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
703 (regexp-quote tramp-prefix-ipv6-format) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
704 "*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
|
705 Derived from `tramp-prefix-ipv6-format'.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
706 |
101282
986acdda4aac
* net/tramp.el (tramp-ipv6-regexp): The regexp shall cover also
Michael Albinus <michael.albinus@gmx.de>
parents:
101020
diff
changeset
|
707 ;; 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
|
708 ;; 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
|
709 ;; "::ffff:192.168.0.1". |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
710 (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
|
711 "\\(?:\\(?:[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
|
712 "*Regexp matching IPv6 addresses.") |
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-postfix-ipv6-format |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
715 (cond ((equal tramp-syntax 'ftp) "]") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
716 ((equal tramp-syntax 'sep) "") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
717 ((equal tramp-syntax 'url) "]") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
718 (t (error "Wrong `tramp-syntax' defined"))) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
719 "*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
|
720 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
|
721 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
722 (defconst tramp-postfix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
723 (regexp-quote tramp-postfix-ipv6-format) |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
724 "*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
|
725 Derived from `tramp-postfix-ipv6-format'.") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
726 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
727 (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
|
728 (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
|
729 ((equal tramp-syntax 'sep) "#") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
730 ((equal tramp-syntax 'url) ":") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
731 (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
|
732 "*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
|
733 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
734 (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
|
735 (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
|
736 "*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
|
737 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
|
738 |
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
|
739 (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
|
740 "*Regexp matching port numbers.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
741 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
742 (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
|
743 (concat "\\(" tramp-host-regexp "\\)" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
744 tramp-prefix-port-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
745 "\\(" tramp-port-regexp "\\)") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
746 "*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
|
747 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
748 (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
|
749 (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
|
750 ((equal tramp-syntax 'sep) "]") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
751 ((equal tramp-syntax 'url) "") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
752 (t (error "Wrong `tramp-syntax' defined"))) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
753 "*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
|
754 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
|
755 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
756 (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
|
757 (regexp-quote tramp-postfix-host-format) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
758 "*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
|
759 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
|
760 |
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
|
761 (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
|
762 "*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
|
763 |
45861 | 764 ;; File name format. |
765 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
766 (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
|
767 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
768 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
769 tramp-prefix-regexp |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
770 "\\(" "\\(" 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
|
771 "\\(" "\\(" 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
|
772 "\\(" "\\(" tramp-host-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
773 "\\|" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
774 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
|
775 tramp-postfix-ipv6-regexp "\\)" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
776 "\\(" 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
|
777 tramp-postfix-host-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
778 "\\(" tramp-localname-regexp "\\)") |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
779 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
|
780 |
45861 | 781 "*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
|
782 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
|
783 |
21983e7c844a
* net/tramp.el (tramp-wrong-passwd-regexp): Tune regexp.
Michael Albinus <michael.albinus@gmx.de>
parents:
85600
diff
changeset
|
784 The first element REGEXP is a regular expression matching a Tramp file |
45861 | 785 name. The regex should contain parentheses around the method name, |
786 the user name, the host name, and the file name parts. | |
787 | |
788 The second element METHOD is a number, saying which pair of | |
789 parentheses matches the method name. The third element USER is | |
790 similar, but for the user name. The fourth element HOST is similar, | |
791 but for the host name. The fifth element FILE is for the file name. | |
792 These numbers are passed directly to `match-string', which see. That | |
793 means the opening parentheses are counted to identify the pair. | |
794 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
795 See also `tramp-file-name-regexp'.") |
45861 | 796 |
797 ;;;###autoload | |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
798 (defconst tramp-file-name-regexp-unified |
109497
c40b94d7d47b
* net/tramp.el (tramp-file-name-regexp-unified)
Michael Albinus <michael.albinus@gmx.de>
parents:
109483
diff
changeset
|
799 (if (memq system-type '(cygwin windows-nt)) |
c40b94d7d47b
* net/tramp.el (tramp-file-name-regexp-unified)
Michael Albinus <michael.albinus@gmx.de>
parents:
109483
diff
changeset
|
800 "\\`/\\([^[/:]\\{2,\\}\\|[^/]\\{2,\\}]\\):" |
c40b94d7d47b
* net/tramp.el (tramp-file-name-regexp-unified)
Michael Albinus <michael.albinus@gmx.de>
parents:
109483
diff
changeset
|
801 "\\`/\\([^[/:]+\\|[^/]+]\\):") |
46306
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
802 "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
|
803 Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and |
109497
c40b94d7d47b
* net/tramp.el (tramp-file-name-regexp-unified)
Michael Albinus <michael.albinus@gmx.de>
parents:
109483
diff
changeset
|
804 Tramp. See `tramp-file-name-structure' for more explanations. |
c40b94d7d47b
* net/tramp.el (tramp-file-name-regexp-unified)
Michael Albinus <michael.albinus@gmx.de>
parents:
109483
diff
changeset
|
805 |
c40b94d7d47b
* net/tramp.el (tramp-file-name-regexp-unified)
Michael Albinus <michael.albinus@gmx.de>
parents:
109483
diff
changeset
|
806 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
|
807 |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
808 ;;;###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
|
809 (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
|
810 "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
|
811 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
|
812 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
|
813 |
66cce4969490
(tramp-default-method): New default method "sm"
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46166
diff
changeset
|
814 ;;;###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
|
815 (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
|
816 "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
|
817 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
|
818 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
819 ;;;###autoload |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
820 (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
|
821 (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
|
822 ((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
|
823 ((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
|
824 (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
|
825 "*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
|
826 This regexp should match Tramp file names but no other file names. |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
827 When tramp.el is loaded, this regular expression is prepended to |
45861 | 828 `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
|
829 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
|
830 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
|
831 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
|
832 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
833 Please note that the entry in `file-name-handler-alist' is made when |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
834 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
|
835 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
|
836 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
|
837 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
838 Also see `tramp-file-name-structure'.") |
45861 | 839 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
840 ;;;###autoload |
92982
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
841 (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
|
842 (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
|
843 "\\`\\([a-zA-Z]:\\)?/" |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
844 "\\`/") |
92982
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
845 "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
|
846 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
|
847 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
|
848 |
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
849 ;;;###autoload |
afa7a7913261
* tramp.el (tramp-root-regexp): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
91689
diff
changeset
|
850 (defconst tramp-completion-file-name-regexp-unified |
109497
c40b94d7d47b
* net/tramp.el (tramp-file-name-regexp-unified)
Michael Albinus <michael.albinus@gmx.de>
parents:
109483
diff
changeset
|
851 (if (memq system-type '(cygwin windows-nt)) |
c40b94d7d47b
* net/tramp.el (tramp-file-name-regexp-unified)
Michael Albinus <michael.albinus@gmx.de>
parents:
109483
diff
changeset
|
852 (concat tramp-root-regexp "[^/]\\{2,\\}\\'") |
c40b94d7d47b
* net/tramp.el (tramp-file-name-regexp-unified)
Michael Albinus <michael.albinus@gmx.de>
parents:
109483
diff
changeset
|
853 (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
|
854 "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
|
855 GNU Emacs uses a unified filename syntax for Tramp and Ange-FTP. |
109497
c40b94d7d47b
* net/tramp.el (tramp-file-name-regexp-unified)
Michael Albinus <michael.albinus@gmx.de>
parents:
109483
diff
changeset
|
856 See `tramp-file-name-structure' for more explanations. |
c40b94d7d47b
* net/tramp.el (tramp-file-name-regexp-unified)
Michael Albinus <michael.albinus@gmx.de>
parents:
109483
diff
changeset
|
857 |
c40b94d7d47b
* net/tramp.el (tramp-file-name-regexp-unified)
Michael Albinus <michael.albinus@gmx.de>
parents:
109483
diff
changeset
|
858 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
|
859 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
860 ;;;###autoload |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
861 (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
|
862 (concat tramp-root-regexp "\\([[][^]]*\\)?\\'") |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
863 "Value for `tramp-completion-file-name-regexp' for separate remoting. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
864 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
|
865 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
|
866 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
867 ;;;###autoload |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
868 (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
|
869 (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
|
870 "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
|
871 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
|
872 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
873 ;;;###autoload |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
874 (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
|
875 (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
|
876 ((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
|
877 ((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
|
878 (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
|
879 "*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
|
880 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
|
881 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
882 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
|
883 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
|
884 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
|
885 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
|
886 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
887 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
|
888 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
889 ;; 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
|
890 ;; 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
|
891 ;; 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
|
892 ;; 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
|
893 ;; 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
|
894 (defcustom tramp-chunksize |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
895 (when (and (not (featurep 'xemacs)) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
896 (memq system-type '(hpux))) |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
897 500) |
66561
742e40a6bf3c
* net/tramp.el (tramp-chunksize): Escape parentheses in docstring
Michael Albinus <michael.albinus@gmx.de>
parents:
66496
diff
changeset
|
898 ;; 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
|
899 ;; 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
|
900 ;; `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
|
901 "*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
|
902 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
|
903 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
|
904 checked via the following code: |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
905 |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
906 (with-temp-buffer |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
907 (let* ((user \"xxx\") (host \"yyy\") |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
908 (init 0) (step 50) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
909 (sent init) (received init)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
910 (while (= sent received) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
911 (setq sent (+ sent step)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
912 (erase-buffer) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
913 (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
|
914 \"ssh\" \"-l\" user host \"wc\" \"-c\"))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
915 (when (memq (process-status proc) '(run open)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
916 (process-send-string proc (make-string sent ?\\ )) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
917 (process-send-eof proc) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
918 (process-send-eof proc)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
919 (while (not (progn (goto-char (point-min)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
920 (re-search-forward \"\\\\w+\" (point-max) t))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
921 (accept-process-output proc 1)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
922 (when (memq (process-status proc) '(run open)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
923 (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
|
924 (delete-process proc) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
925 (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
|
926 (sit-for 0)))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
927 (if (> sent (+ init step)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
928 (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
|
929 (- sent step)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
930 (message \"Test does not work\") |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
931 (display-buffer (current-buffer)) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
932 (sit-for 30)))) |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
933 |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
934 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
|
935 \(replace \"xxx\" and \"yyy\" by the remote user and host name, |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
936 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
|
937 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
|
938 last closing parenthesis. Note that it works only if you have configured |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
939 \"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
|
940 |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
941 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
|
942 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
|
943 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
|
944 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
945 When it is necessary to set `tramp-chunksize', you might consider to |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
946 use an out-of-the-band method \(like \"scp\"\) instead of an internal one |
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
947 \(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
|
948 performance. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
949 |
65925
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
950 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
|
951 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
|
952 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
|
953 in the third line of the code. |
da00cdf6de37
Sync with Tramp 2.0.51.
Michael Albinus <michael.albinus@gmx.de>
parents:
65792
diff
changeset
|
954 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
955 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
|
956 this variable to be set as well." |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
957 :group 'tramp |
50338
155b4b78aa3b
* tramp.el: Version 2.0.31 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49995
diff
changeset
|
958 :type '(choice (const nil) integer)) |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
959 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
960 ;; 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
|
961 ;; 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
|
962 ;; 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
|
963 ;; 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
|
964 (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
|
965 "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
|
966 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
|
967 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
|
968 :group 'tramp |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
969 :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
|
970 |
86204
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
971 (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
|
972 "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
|
973 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
|
974 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
|
975 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
|
976 more than `tramp-completion-reread-directory-timeout' seconds |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
977 have been gone since last remote command execution. A value of 0 |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
978 would require an immediate reread during filename completion, nil |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
979 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
|
980 :group 'tramp |
7d7472ea9c0a
* net/tramp.el (tramp-completion-reread-directory-timeout): New
Michael Albinus <michael.albinus@gmx.de>
parents:
86048
diff
changeset
|
981 :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
|
982 |
45861 | 983 ;;; Internal Variables: |
984 | |
985 (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
|
986 "Connection method for this *tramp* buffer.") |
45861 | 987 |
988 (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
|
989 "Remote login name for this *tramp* buffer.") |
45861 | 990 |
991 (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
|
992 "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
|
993 |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
994 ;;;###autoload |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
995 (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
|
996 '((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
|
997 (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
|
998 "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
|
999 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
|
1000 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
|
1001 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
|
1002 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1003 ;; 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
|
1004 ;;;###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
|
1005 (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
|
1006 "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
|
1007 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
|
1008 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
|
1009 |
87648
7ae99e295dfd
* vc-git.el (vc-git--call): Apply `process-file' instead of
Michael Albinus <michael.albinus@gmx.de>
parents:
87368
diff
changeset
|
1010 ;;; Internal functions which must come first: |
45861 | 1011 |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1012 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1013 ;; ------------------------------------------------------------ |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1014 ;; -- Tramp file names -- |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1015 ;; ------------------------------------------------------------ |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1016 ;; 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
|
1017 ;; 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
|
1018 ;; data structure. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1019 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1020 (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
|
1021 "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
|
1022 (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
|
1023 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1024 (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
|
1025 "Return method component of VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1026 (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
|
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-user (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1029 "Return user component of VEC." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1030 (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
|
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-host (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1033 "Return host 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 2))) |
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-localname (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1037 "Return localname 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 3))) |
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 ;; 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
|
1041 ;; "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
|
1042 (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
|
1043 "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
|
1044 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1045 (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
|
1046 (if (and (stringp user) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1047 (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
|
1048 (match-string 1 user) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1049 user)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1050 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1051 (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
|
1052 "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
|
1053 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1054 (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
|
1055 (and (stringp user) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1056 (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
|
1057 (match-string 2 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 ;; 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
|
1060 ;; "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
|
1061 (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
|
1062 "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
|
1063 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1064 (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
|
1065 (if (and (stringp host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1066 (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
|
1067 (match-string 1 host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1068 host)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1069 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1070 (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
|
1071 "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
|
1072 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1073 (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
|
1074 (and (stringp host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1075 (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
|
1076 (string-to-number (match-string 2 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 ;;;###tramp-autoload |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1079 (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
|
1080 "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
|
1081 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1082 (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
|
1083 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1084 (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
|
1085 "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
|
1086 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
|
1087 `tramp-default-method-alist'." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1088 (or method |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1089 (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
|
1090 lmethod item) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1091 (while choices |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1092 (setq item (pop choices)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1093 (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
|
1094 (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
|
1095 (setq lmethod (nth 2 item)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1096 (setq choices nil))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1097 lmethod) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1098 tramp-default-method)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1099 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1100 (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
|
1101 "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
|
1102 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
|
1103 `tramp-default-user-alist'." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1104 (or user |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1105 (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
|
1106 luser item) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1107 (while choices |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1108 (setq item (pop choices)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1109 (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
|
1110 (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
|
1111 (setq luser (nth 2 item)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1112 (setq choices nil))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1113 luser) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1114 tramp-default-user)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1115 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1116 (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
|
1117 "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
|
1118 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
|
1119 (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
|
1120 tramp-default-host)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1121 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1122 (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
|
1123 "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
|
1124 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
|
1125 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
|
1126 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
|
1127 values." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1128 (save-match-data |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1129 (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
|
1130 (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
|
1131 (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
|
1132 (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
|
1133 (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
|
1134 (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
|
1135 (when host |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1136 (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
|
1137 (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
|
1138 (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
|
1139 (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
|
1140 (if nodefault |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1141 (vector method user host localname) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1142 (vector |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1143 (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
|
1144 (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
|
1145 (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
|
1146 localname)))))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1147 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1148 (defun tramp-buffer-name (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1149 "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
|
1150 ;; 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
|
1151 ;; 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
|
1152 ;; tamper the name. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1153 (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
|
1154 (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
|
1155 (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
|
1156 (if (not (zerop (length user))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1157 (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
|
1158 (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
|
1159 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1160 (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
|
1161 "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
|
1162 (concat tramp-prefix-format |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1163 (when (not (zerop (length method))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1164 (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
|
1165 (when (not (zerop (length user))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1166 (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
|
1167 (when host |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1168 (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
|
1169 (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
|
1170 host)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1171 tramp-postfix-host-format |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1172 (when localname localname))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1173 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1174 (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
|
1175 "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
|
1176 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
|
1177 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
|
1178 (concat tramp-prefix-format |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1179 (when (not (zerop (length method))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1180 (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
|
1181 (when (not (zerop (length user))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1182 (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
|
1183 (when (not (zerop (length host))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1184 (concat |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1185 (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
|
1186 (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
|
1187 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
|
1188 host) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1189 tramp-postfix-host-format)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1190 (when localname localname))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1191 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1192 (defun tramp-get-buffer (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1193 "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
|
1194 (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
|
1195 (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
|
1196 (setq buffer-undo-list t) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1197 (setq default-directory |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1198 (tramp-make-tramp-file-name |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1199 (tramp-file-name-method vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1200 (tramp-file-name-user vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1201 (tramp-file-name-host vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1202 "/")) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1203 (current-buffer)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1204 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1205 (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
|
1206 "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
|
1207 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
|
1208 from `tramp-get-buffer'." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1209 (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
|
1210 (tramp-get-buffer vec))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1211 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1212 (defun tramp-get-connection-process (vec) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1213 "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
|
1214 In case a second asynchronous communication has been started, it is different |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1215 from the default one." |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1216 (get-process |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1217 (or (tramp-get-connection-property vec "process-name" nil) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1218 (tramp-buffer-name vec)))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1219 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1220 (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
|
1221 "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
|
1222 ;; 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
|
1223 ;; 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
|
1224 ;; tamper the name. |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1225 (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
|
1226 (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
|
1227 (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
|
1228 (if (not (zerop (length user))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1229 (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
|
1230 (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
|
1231 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1232 (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
|
1233 "[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
|
1234 "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
|
1235 |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1236 (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
|
1237 "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
|
1238 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
|
1239 |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
1240 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
|
1241 (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
|
1242 |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1243 (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
|
1244 "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
|
1245 (with-current-buffer |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1246 (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
|
1247 (when (bobp) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1248 (setq buffer-undo-list t) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1249 ;; 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
|
1250 ;; `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
|
1251 ;; 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
|
1252 ;; 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
|
1253 ;; 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
|
1254 (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
|
1255 (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
|
1256 (outline-mode)) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1257 (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
|
1258 (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
|
1259 (current-buffer))) |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1260 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1261 (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
|
1262 "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
|
1263 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
|
1264 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
|
1265 (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
|
1266 (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
|
1267 (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
|
1268 ;; Headline. |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1269 (when (bobp) |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1270 (insert |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1271 (format |
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1272 ";; %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
|
1273 (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
|
1274 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
|
1275 (unless (bolp) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1276 (insert "\n")) |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1277 ;; Timestamp. |
104125
fd4d8124e329
* net/tramp.el (tramp-debug-message): Print also microseconds.
Michael Albinus <michael.albinus@gmx.de>
parents:
104097
diff
changeset
|
1278 (let ((now (current-time))) |
fd4d8124e329
* net/tramp.el (tramp-debug-message): Print also microseconds.
Michael Albinus <michael.albinus@gmx.de>
parents:
104097
diff
changeset
|
1279 (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
|
1280 (insert (format "%06d " (nth 2 now)))) |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
1281 ;; Calling function. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1282 (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
|
1283 (while (not fn) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1284 (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
|
1285 (if (not btf) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1286 (setq fn "") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1287 (when (symbolp btf) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1288 (setq fn (symbol-name btf)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1289 (unless (and (string-match "^tramp" fn) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1290 (not (string-match |
108817
a90103f99eea
* net/tramp.el (tramp-debug-message): Add `tramp-compat-funcall'
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1291 "^tramp\\(-debug\\)?\\(-message\\|-error\\|-compat-funcall\\)$" |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1292 fn))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1293 (setq fn nil))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1294 (setq btn (1+ btn)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1295 ;; 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
|
1296 ;; 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
|
1297 ;; consuming. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1298 ; (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
|
1299 ; (insert |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1300 ; (format |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1301 ; "%s:%d: " |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1302 ; (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
|
1303 ; (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
|
1304 ; (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
|
1305 (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
|
1306 ;; The message. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1307 (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
|
1308 |
104642
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1309 (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
|
1310 "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
|
1311 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
|
1312 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
|
1313 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1314 (defsubst tramp-message (vec-or-proc level fmt-string &rest args) |
45861 | 1315 "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
|
1316 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
|
1317 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
|
1318 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
|
1319 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
|
1320 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1321 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
|
1322 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
|
1323 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1324 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
|
1325 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
|
1326 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
|
1327 (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
|
1328 (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
|
1329 ;; 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
|
1330 (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
|
1331 ;; 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
|
1332 (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
|
1333 (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
|
1334 (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
|
1335 (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
|
1336 ((= 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
|
1337 ((= 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
|
1338 ((= 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
|
1339 (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
|
1340 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
|
1341 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
|
1342 ;; 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
|
1343 (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
|
1344 (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
|
1345 (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
|
1346 (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
|
1347 (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
|
1348 ;; 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
|
1349 (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
|
1350 (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
|
1351 (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
|
1352 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
|
1353 (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
|
1354 args))))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1355 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1356 (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
|
1357 "Emit an error. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1358 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
|
1359 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
|
1360 `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
|
1361 (let (tramp-message-show-message) |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1362 (tramp-message |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1363 vec-or-proc 1 "%s" |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1364 (error-message-string |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1365 (list signal |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1366 (get signal 'error-message) |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1367 (apply 'format fmt-string args)))) |
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1368 (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
|
1369 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1370 (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
|
1371 (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
|
1372 "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
|
1373 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
|
1374 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
|
1375 (save-window-excursion |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1376 (unwind-protect |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1377 (apply 'tramp-error vec-or-proc signal fmt-string args) |
107870
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1378 (when (and vec-or-proc |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1379 (not (zerop tramp-verbose)) |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1380 (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
|
1381 (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
|
1382 (pop-to-buffer |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1383 (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
|
1384 (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
|
1385 (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
|
1386 (sit-for 30)))))) |
45861 | 1387 |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1388 (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
|
1389 "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
|
1390 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1391 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
|
1392 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
|
1393 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
|
1394 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
|
1395 `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
|
1396 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
|
1397 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1398 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
|
1399 `progn'). |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1400 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1401 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
|
1402 `host', `localname' to the components." |
46009
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1403 `(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
|
1404 (,(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
|
1405 (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
|
1406 (,(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
|
1407 (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
|
1408 (,(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
|
1409 (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
|
1410 (,(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
|
1411 (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
|
1412 ,@body)) |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1413 |
72200622ada8
(tramp-ftp-method): New user option.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
45861
diff
changeset
|
1414 (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
|
1415 (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
|
1416 (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
|
1417 '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
|
1418 |
108775
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
1419 (defun tramp-progress-reporter-update (reporter &optional value) |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
1420 (let* ((parameters (cdr reporter)) |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
1421 (message (aref parameters 3))) |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
1422 (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
|
1423 (tramp-compat-funcall 'progress-reporter-update reporter value)))) |
108775
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
1424 |
108066
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1425 (defmacro with-progress-reporter (vec level message &rest body) |
108817
a90103f99eea
* net/tramp.el (tramp-debug-message): Add `tramp-compat-funcall'
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1426 "Executes BODY, spinning a progress reporter with MESSAGE. |
a90103f99eea
* net/tramp.el (tramp-debug-message): Add `tramp-compat-funcall'
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1427 If LEVEL does not fit for visible messages, or if this is a |
a90103f99eea
* net/tramp.el (tramp-debug-message): Add `tramp-compat-funcall'
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1428 nested call of the macro, there are only traces without a visible |
a90103f99eea
* net/tramp.el (tramp-debug-message): Add `tramp-compat-funcall'
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1429 progress reporter." |
108066
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1430 `(let (pr tm) |
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1431 (tramp-message ,vec ,level "%s..." ,message) |
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1432 ;; We start a pulsing progress reporter after 3 seconds. Feature |
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1433 ;; introduced in Emacs 24.1. |
108540
bfc1be04834c
* net/tramp.el (with-progress-reporter): Create reporter object
Michael Albinus <albinus@detlef>
parents:
108469
diff
changeset
|
1434 (when (and tramp-message-show-message |
bfc1be04834c
* net/tramp.el (with-progress-reporter): Create reporter object
Michael Albinus <albinus@detlef>
parents:
108469
diff
changeset
|
1435 ;; Display only when there is a minimum level. |
bfc1be04834c
* net/tramp.el (with-progress-reporter): Create reporter object
Michael Albinus <albinus@detlef>
parents:
108469
diff
changeset
|
1436 (<= ,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
|
1437 (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
|
1438 (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
|
1439 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
|
1440 (run-at-time 3 0.1 'tramp-progress-reporter-update pr))))) |
108066
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1441 (unwind-protect |
108817
a90103f99eea
* net/tramp.el (tramp-debug-message): Add `tramp-compat-funcall'
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1442 ;; Execute the body. Unset `tramp-message-show-message' when |
a90103f99eea
* net/tramp.el (tramp-debug-message): Add `tramp-compat-funcall'
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1443 ;; the timer object is created, in order to suppress |
a90103f99eea
* net/tramp.el (tramp-debug-message): Add `tramp-compat-funcall'
Michael Albinus <michael.albinus@gmx.de>
parents:
108816
diff
changeset
|
1444 ;; concurrent timers. |
108540
bfc1be04834c
* net/tramp.el (with-progress-reporter): Create reporter object
Michael Albinus <albinus@detlef>
parents:
108469
diff
changeset
|
1445 (let ((tramp-message-show-message |
bfc1be04834c
* net/tramp.el (with-progress-reporter): Create reporter object
Michael Albinus <albinus@detlef>
parents:
108469
diff
changeset
|
1446 (and tramp-message-show-message (not tm)))) |
bfc1be04834c
* net/tramp.el (with-progress-reporter): Create reporter object
Michael Albinus <albinus@detlef>
parents:
108469
diff
changeset
|
1447 ,@body) |
108066
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1448 ;; Stop progress reporter. |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1449 (if tm (tramp-compat-funcall 'cancel-timer tm)) |
108066
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1450 (tramp-message ,vec ,level "%s...done" ,message)))) |
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1451 |
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1452 (put 'with-progress-reporter 'lisp-indent-function 3) |
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1453 (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
|
1454 (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
|
1455 'emacs-lisp-mode '("\\<with-progress-reporter\\>")) |
108066
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1456 |
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1457 (eval-and-compile ;; Silence compiler. |
93566
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1458 (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
|
1459 (defun tramp-drop-volume-letter (name) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1460 "Cut off unnecessary drive letter from file NAME. |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1461 The function `tramp-handle-expand-file-name' calls `expand-file-name' |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1462 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
|
1463 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
|
1464 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
|
1465 (save-match-data |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1466 (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
|
1467 (replace-match "/" nil t name) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1468 name))) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1469 |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1470 (defalias 'tramp-drop-volume-letter 'identity))) |
61bf6b37b78d
(tramp-drop-volume-letter): Move definition before use.
Glenn Morris <rgm@gnu.org>
parents:
93539
diff
changeset
|
1471 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1472 ;;; Config Manipulation Functions: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1473 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1474 (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
|
1475 "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
|
1476 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
|
1477 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
|
1478 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
|
1479 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
|
1480 `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
|
1481 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
|
1482 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1483 Example: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1484 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1485 (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
|
1486 \"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
|
1487 '((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
|
1488 (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
|
1489 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1490 (let ((r function-list) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1491 (v function-list)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1492 (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
|
1493 (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
|
1494 tramp-completion-function-alist)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1495 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1496 (while v |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1497 ;; Remove double entries. |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1498 (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
|
1499 (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
|
1500 ;; 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
|
1501 (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
|
1502 (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
|
1503 ;; Windows registry. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1504 (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
|
1505 (zerop |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1506 (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
|
1507 "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
|
1508 ;; Configuration file. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1509 (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
|
1510 (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
|
1511 (setq v (cdr v))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1512 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
1513 (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
|
1514 (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
|
1515 (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
|
1516 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1517 (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
|
1518 "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
|
1519 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
|
1520 (cons |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1521 ;; 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
|
1522 `(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
|
1523 ;; The method related defaults. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1524 (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
|
1525 |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1526 |
87648
7ae99e295dfd
* vc-git.el (vc-git--call): Apply `process-file' instead of
Michael Albinus <michael.albinus@gmx.de>
parents:
87368
diff
changeset
|
1527 ;;; 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
|
1528 |
7ae99e295dfd
* vc-git.el (vc-git--call): Apply `process-file' instead of
Michael Albinus <michael.albinus@gmx.de>
parents:
87368
diff
changeset
|
1529 ;; 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
|
1530 (defvar tramp-rfn-eshadow-overlay) |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1531 (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
|
1532 |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1533 (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
|
1534 "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
|
1535 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
|
1536 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
|
1537 (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
|
1538 (setq tramp-rfn-eshadow-overlay |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1539 (tramp-compat-funcall |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1540 'make-overlay |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1541 (tramp-compat-funcall 'minibuffer-prompt-end) |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1542 (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
|
1543 ;; Copy rfn-eshadow-overlay properties. |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1544 (let ((props (tramp-compat-funcall |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1545 '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
|
1546 (while props |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1547 (tramp-compat-funcall |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1548 '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
|
1549 |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1550 (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
|
1551 (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
|
1552 'tramp-rfn-eshadow-setup-minibuffer) |
926453fe3d68
* net/tramp.el (top): Quote feature names. Remove
Michael Albinus <michael.albinus@gmx.de>
parents:
95067
diff
changeset
|
1553 (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
|
1554 (lambda () |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1555 (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
|
1556 '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
|
1557 |
104137
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1558 (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
|
1559 (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
|
1560 |
84739
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1561 (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
|
1562 "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
|
1563 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
|
1564 `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
|
1565 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
|
1566 ;; In remote files name, there is a shadowing just for the local part. |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1567 (let ((end (or (tramp-compat-funcall |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1568 'overlay-end (symbol-value 'rfn-eshadow-overlay)) |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1569 (tramp-compat-funcall 'minibuffer-prompt-end)))) |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1570 (when |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1571 (file-remote-p |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1572 (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
|
1573 (save-excursion |
ad84adc0e027
From_ Johan Bockgrd, <http://article.gmane.org/gmane.emacs.devel/81056>
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
85126
diff
changeset
|
1574 (save-restriction |
ad84adc0e027
From_ Johan Bockgrd, <http://article.gmane.org/gmane.emacs.devel/81056>
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
85126
diff
changeset
|
1575 (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
|
1576 (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
|
1577 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
|
1578 end)) |
974fca280203
* net/tramp.el (tramp-rfn-eshadow-update-overlay-regexp) New
Michael Albinus <michael.albinus@gmx.de>
parents:
104125
diff
changeset
|
1579 (point-max)) |
85428
ad84adc0e027
From_ Johan Bockgrd, <http://article.gmane.org/gmane.emacs.devel/81056>
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
85126
diff
changeset
|
1580 (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
|
1581 (rfn-eshadow-update-overlay-hook nil)) |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1582 (tramp-compat-funcall |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1583 'move-overlay rfn-eshadow-overlay (point-max) (point-max)) |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1584 (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
|
1585 |
ed643c57fe39
* rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook)
Michael Albinus <michael.albinus@gmx.de>
parents:
84406
diff
changeset
|
1586 (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
|
1587 (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
|
1588 '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
|
1589 (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
|
1590 (lambda () |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
1591 (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
|
1592 '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
|
1593 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1594 ;; 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
|
1595 ;; 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
|
1596 ;; 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
|
1597 ;; 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
|
1598 ;; take time. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1599 (defvar tramp-inodes nil |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1600 "Keeps virtual inodes numbers.") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1601 |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
1602 ;; 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
|
1603 ;; 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
|
1604 ;; 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
|
1605 ;; 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
|
1606 ;; (-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
|
1607 (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
|
1608 "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
|
1609 |
102851
5cc9a4c776e8
* net/tramp.el (tramp-default-file-modes) New defun. Replace all
Michael Albinus <michael.albinus@gmx.de>
parents:
102287
diff
changeset
|
1610 (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
|
1611 "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
|
1612 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
|
1613 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
|
1614 (or (file-modes filename) |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
1615 (logand (default-file-modes) (tramp-compat-octal-to-decimal "0666")))) |
102851
5cc9a4c776e8
* net/tramp.el (tramp-default-file-modes) New defun. Replace all
Michael Albinus <michael.albinus@gmx.de>
parents:
102287
diff
changeset
|
1616 |
94395
f020c9568544
* net/tramp.el (tramp-replace-environment-variables): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
94333
diff
changeset
|
1617 (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
|
1618 "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
|
1619 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
|
1620 (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
|
1621 (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
|
1622 ;; `$' 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
|
1623 (when (and idx |
33df72cf19f1
* net/tramp.el (tramp-replace-environment-variables): Do not fail
Michael Albinus <michael.albinus@gmx.de>
parents:
105549
diff
changeset
|
1624 (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
|
1625 (getenv (match-string 1 filename))) |
94436
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1626 (setq filename |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1627 (replace-match |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1628 (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
|
1629 t nil filename))) |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1630 filename))) |
94395
f020c9568544
* net/tramp.el (tramp-replace-environment-variables): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
94333
diff
changeset
|
1631 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1632 ;; 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
|
1633 ;; 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
|
1634 (when (fboundp 'minibuffer-electric-separator) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
1635 (mapc |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1636 (lambda (x) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1637 (eval |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1638 `(defadvice ,x |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1639 (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
|
1640 "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
|
1641 (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
|
1642 (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
|
1643 ;; 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
|
1644 ;; 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
|
1645 (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
|
1646 (string last-command-char)))) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1647 (delete-region (point-min) (point)) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1648 (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
|
1649 (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
|
1650 ad-do-it))) |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1651 (eval |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1652 `(add-hook |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1653 'tramp-unload-hook |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1654 (lambda () |
c3e434f0d02f
* net/tramp.el (tramp-advice-minibuffer-electric-separator)
Michael Albinus <michael.albinus@gmx.de>
parents:
105907
diff
changeset
|
1655 (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
|
1656 (ad-activate ',x))))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1657 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1658 '(minibuffer-electric-separator |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1659 minibuffer-electric-tilde))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1660 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1661 (defvar tramp-handle-file-local-copy-hook nil |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1662 "Normal hook to be run at the end of `tramp-handle-file-local-copy'.") |
45861 | 1663 |
93938
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1664 (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
|
1665 "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
|
1666 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
|
1667 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
|
1668 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
|
1669 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
|
1670 (let (result) |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1671 (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
|
1672 (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
|
1673 ;; 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
|
1674 ;; 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
|
1675 ;; as regexp. |
3c06445e714c
* net/tramp.el (tramp-find-file-name-coding-system-alist): New
Michael Albinus <michael.albinus@gmx.de>
parents:
93829
diff
changeset
|
1676 (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
|
1677 '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
|
1678 |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1679 ;;;###autoload |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1680 (progn (defun tramp-run-real-handler (operation args) |
45861 | 1681 "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
|
1682 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
|
1683 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
|
1684 (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
|
1685 `(tramp-file-name-handler |
104642
67bdc8713158
* net/tramp.el (tramp-methods): New method "rsyncc".
Michael Albinus <michael.albinus@gmx.de>
parents:
104314
diff
changeset
|
1686 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
|
1687 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
|
1688 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
|
1689 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
|
1690 . |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1691 ,(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
|
1692 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
|
1693 (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
|
1694 (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
|
1695 |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1696 ;;;###autoload |
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1697 (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
|
1698 "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
|
1699 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
|
1700 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
|
1701 (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
|
1702 `(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
|
1703 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
|
1704 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
|
1705 . |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1706 ,(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
|
1707 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
|
1708 (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
|
1709 (apply operation args)))) |
45861 | 1710 |
48973
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1711 ;; 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
|
1712 ;; 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
|
1713 ;; 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
|
1714 ;; 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
|
1715 ;; 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
|
1716 ;; 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
|
1717 ;; 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
|
1718 (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
|
1719 "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
|
1720 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
|
1721 (cond |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1722 ;; 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
|
1723 ((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
|
1724 (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
|
1725 '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
|
1726 '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
|
1727 '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
|
1728 '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
|
1729 'file-directory-p 'file-executable-p 'file-exists-p |
108064
589643be353e
* net/tramp.el (tramp-handle-copy-file): Add new optional
Michael Albinus <michael.albinus@gmx.de>
parents:
108059
diff
changeset
|
1730 'file-local-copy 'file-remote-p 'file-modes |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1731 '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
|
1732 '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
|
1733 '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
|
1734 '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
|
1735 '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
|
1736 '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
|
1737 'load 'make-directory 'make-directory-internal |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
1738 '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
|
1739 'unhandled-file-name-directory 'vc-registered |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1740 ;; 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
|
1741 'set-file-times |
108064
589643be353e
* net/tramp.el (tramp-handle-copy-file): Add new optional
Michael Albinus <michael.albinus@gmx.de>
parents:
108059
diff
changeset
|
1742 ;; Emacs 24+ only. |
589643be353e
* net/tramp.el (tramp-handle-copy-file): Add new optional
Michael Albinus <michael.albinus@gmx.de>
parents:
108059
diff
changeset
|
1743 'file-selinux-context 'set-file-selinux-context |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1744 ;; 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
|
1745 '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
|
1746 '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
|
1747 '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
|
1748 '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
|
1749 '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
|
1750 '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
|
1751 (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
|
1752 (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
|
1753 (expand-file-name (nth 0 args)))) |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1754 ;; 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
|
1755 ((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
|
1756 (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
|
1757 '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
|
1758 'file-newer-than-file-p 'make-symbolic-link 'rename-file |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1759 ;; Emacs 23+ only. |
105462
f6c5cf0fc0c9
* net/tramp.el (tramp-verbose): Fix docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
105351
diff
changeset
|
1760 'copy-directory |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1761 ;; 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
|
1762 '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
|
1763 '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
|
1764 (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
|
1765 (cond |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1766 ((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
|
1767 ((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
|
1768 (t (buffer-file-name (current-buffer)))))) |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1769 ;; 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
|
1770 ((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
|
1771 (nth 2 args)) |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1772 ;; 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
|
1773 ((member operation |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1774 (list 'set-visited-file-modtime 'verify-visited-file-modtime |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1775 ;; Emacs 22+ only. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1776 'make-auto-save-file-name |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1777 ;; 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
|
1778 '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
|
1779 (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
|
1780 (if (bufferp (nth 0 args)) (nth 0 args) (current-buffer)))) |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1781 ;; 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
|
1782 ((member operation |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1783 (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
|
1784 'dired-call-process |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1785 ;; Emacs only. |
60287
865aec6814c3
(tramp-file-name-for-operation): Fix misapplied
Andreas Schwab <schwab@suse.de>
parents:
60156
diff
changeset
|
1786 'shell-command |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1787 ;; 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
|
1788 'process-file |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1789 ;; Emacs 23+ only. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1790 'start-file-process |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1791 ;; XEmacs only. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
1792 'dired-print-file 'dired-shell-call-process |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1793 ;; nowhere yet. |
108975
c4552014bea2
* net/tramp.el (tramp-remote-process-environment): Protect version
Michael Albinus <albinus@detlef>
parents:
108817
diff
changeset
|
1794 'executable-find 'start-process |
c4552014bea2
* net/tramp.el (tramp-remote-process-environment): Protect version
Michael Albinus <albinus@detlef>
parents:
108817
diff
changeset
|
1795 '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
|
1796 default-directory) |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1797 ;; 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
|
1798 (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
|
1799 |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
1800 (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
|
1801 "Return foreign file name handler if exists." |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
1802 (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
|
1803 (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
|
1804 (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
|
1805 elt res) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1806 ;; 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
|
1807 ;; 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
|
1808 (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
|
1809 (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
|
1810 (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
|
1811 (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
|
1812 (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
|
1813 (while handler |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1814 (setq elt (car handler) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1815 handler (cdr handler)) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1816 (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
|
1817 (setq handler nil |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1818 res (cdr elt)))) |
fa9dd0b54e54
* net/tramp.el (with-file-property, with-connection-property):
Michael Albinus <michael.albinus@gmx.de>
parents:
84942
diff
changeset
|
1819 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
|
1820 |
45861 | 1821 ;; Main function. |
1822 ;;;###autoload | |
1823 (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
|
1824 "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
|
1825 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
|
1826 (if tramp-mode |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1827 (save-match-data |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1828 (let* ((filename |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1829 (tramp-replace-environment-variables |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1830 (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
|
1831 (completion (tramp-completion-mode-p)) |
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1832 (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
|
1833 (with-parsed-tramp-file-name filename nil |
107870
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1834 ;; Call the backend function. |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1835 (if foreign |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1836 (condition-case err |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1837 (apply foreign operation args) |
109479
a2fe058b3eb2
* net/tramp.el (tramp-file-name-handler): Trace 'quit.
Michael Albinus <albinus@detlef>
parents:
109474
diff
changeset
|
1838 |
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
|
1839 ;; Trace, that somebody has interrupted the operation. |
109479
a2fe058b3eb2
* net/tramp.el (tramp-file-name-handler): Trace 'quit.
Michael Albinus <albinus@detlef>
parents:
109474
diff
changeset
|
1840 (quit |
a2fe058b3eb2
* net/tramp.el (tramp-file-name-handler): Trace 'quit.
Michael Albinus <albinus@detlef>
parents:
109474
diff
changeset
|
1841 (let (tramp-message-show-message) |
a2fe058b3eb2
* net/tramp.el (tramp-file-name-handler): Trace 'quit.
Michael Albinus <albinus@detlef>
parents:
109474
diff
changeset
|
1842 (tramp-message |
a2fe058b3eb2
* net/tramp.el (tramp-file-name-handler): Trace 'quit.
Michael Albinus <albinus@detlef>
parents:
109474
diff
changeset
|
1843 v 1 "Interrupt received in operation %s" |
a2fe058b3eb2
* net/tramp.el (tramp-file-name-handler): Trace 'quit.
Michael Albinus <albinus@detlef>
parents:
109474
diff
changeset
|
1844 (append (list operation) args))) |
a2fe058b3eb2
* net/tramp.el (tramp-file-name-handler): Trace 'quit.
Michael Albinus <albinus@detlef>
parents:
109474
diff
changeset
|
1845 ;; Propagate the quit signal. |
a2fe058b3eb2
* net/tramp.el (tramp-file-name-handler): Trace 'quit.
Michael Albinus <albinus@detlef>
parents:
109474
diff
changeset
|
1846 (signal (car err) (cdr err))) |
a2fe058b3eb2
* net/tramp.el (tramp-file-name-handler): Trace 'quit.
Michael Albinus <albinus@detlef>
parents:
109474
diff
changeset
|
1847 |
a2fe058b3eb2
* net/tramp.el (tramp-file-name-handler): Trace 'quit.
Michael Albinus <albinus@detlef>
parents:
109474
diff
changeset
|
1848 ;; When we are in completion mode, some failed |
a2fe058b3eb2
* net/tramp.el (tramp-file-name-handler): Trace 'quit.
Michael Albinus <albinus@detlef>
parents:
109474
diff
changeset
|
1849 ;; operations shall return at least a default value |
a2fe058b3eb2
* net/tramp.el (tramp-file-name-handler): Trace 'quit.
Michael Albinus <albinus@detlef>
parents:
109474
diff
changeset
|
1850 ;; in order to give the user a chance to correct the |
a2fe058b3eb2
* net/tramp.el (tramp-file-name-handler): Trace 'quit.
Michael Albinus <albinus@detlef>
parents:
109474
diff
changeset
|
1851 ;; file name in the minibuffer. |
107870
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1852 (error |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1853 (cond |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1854 ((and completion (zerop (length localname)) |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1855 (memq operation '(file-exists-p file-directory-p))) |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1856 t) |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1857 ((and completion (zerop (length localname)) |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1858 (memq operation |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1859 '(expand-file-name file-name-as-directory))) |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1860 filename) |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1861 ;; Propagate the error. |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1862 (t (signal (car err) (cdr err)))))) |
109479
a2fe058b3eb2
* net/tramp.el (tramp-file-name-handler): Trace 'quit.
Michael Albinus <albinus@detlef>
parents:
109474
diff
changeset
|
1863 |
107870
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1864 ;; Nothing to do for us. |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1865 (tramp-run-real-handler operation args))))) |
973ae1d72536
* net/tramp.el (tramp-error-with-buffer): Don't show the
Michael Albinus <albinus@detlef>
parents:
107858
diff
changeset
|
1866 |
94436
0918f4a758d2
* net/tramp.el (tramp-mode): New defcustom.
Michael Albinus <michael.albinus@gmx.de>
parents:
94401
diff
changeset
|
1867 ;; 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
|
1868 (tramp-run-real-handler operation args))) |
45861 | 1869 |
56460
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1870 ;; 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
|
1871 ;; 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
|
1872 ;; 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
|
1873 ;; 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
|
1874 ;; 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
|
1875 ;; 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
|
1876 ;; 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
|
1877 ;; `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
|
1878 ;; (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
|
1879 ;; 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
|
1880 ;; 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
|
1881 ;; -- 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
|
1882 ;; 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
|
1883 ;; 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
|
1884 ;; 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
|
1885 ;; 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
|
1886 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1887 (defvar tramp-locked nil |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1888 "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
|
1889 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
|
1890 preventing reentrant calls of Tramp.") |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1891 |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1892 (defvar tramp-locker nil |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1893 "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
|
1894 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
|
1895 preventing reentrant calls of Tramp.") |
9459300bf43b
Sync with Tramp 2.0.43.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
56424
diff
changeset
|
1896 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1897 ;;;###autoload |
70255
d57fb8c98714
* net/tramp.el (tramp-completion-file-name-handler): Disable
Michael Albinus <michael.albinus@gmx.de>
parents:
70191
diff
changeset
|
1898 (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
|
1899 "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
|
1900 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
|
1901 ;; 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
|
1902 ;; would otherwise use backslash. |
93082
7e079018403b
* net/tramp.el (tramp-let-maybe): Removed.
Michael Albinus <michael.albinus@gmx.de>
parents:
93062
diff
changeset
|
1903 (let ((directory-sep-char ?/) |
7e079018403b
* net/tramp.el (tramp-let-maybe): Removed.
Michael Albinus <michael.albinus@gmx.de>
parents:
93062
diff
changeset
|
1904 (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
|
1905 (if (and |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1906 ;; 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
|
1907 fn tramp-mode |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1908 ;; 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
|
1909 ;; 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
|
1910 ;; 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
|
1911 ;; 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
|
1912 ;; 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
|
1913 (or (eq tramp-syntax 'sep) |
108066
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1914 (featurep 'tramp) ;; If it's loaded, we may as well use it. |
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1915 ;; `partial-completion-mode' does not exist in XEmacs. |
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1916 ;; It is obsoleted with Emacs 24.1. |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1917 (and (boundp 'partial-completion-mode) |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
1918 (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
|
1919 ;; 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
|
1920 ;; intended to use them. |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1921 (featurep 'ido) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1922 (featurep 'icicles))) |
93082
7e079018403b
* net/tramp.el (tramp-let-maybe): Removed.
Michael Albinus <michael.albinus@gmx.de>
parents:
93062
diff
changeset
|
1923 (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
|
1924 (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
|
1925 |
45861 | 1926 ;;;###autoload |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1927 (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
|
1928 "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
|
1929 ;; 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
|
1930 ;; 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
|
1931 (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
|
1932 (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
|
1933 (let ((a1 (rassq |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1934 '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
|
1935 (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
|
1936 ;; Add the handlers. |
70318
77201b466c80
* net/tramp.el (tramp-completion-file-name-handler-alist)
Michael Albinus <michael.albinus@gmx.de>
parents:
70276
diff
changeset
|
1937 (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
|
1938 (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
|
1939 (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
|
1940 (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
|
1941 (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
|
1942 'tramp-completion-file-name-handler)) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1943 (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
|
1944 ;; 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
|
1945 ;; 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
|
1946 (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
|
1947 (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
|
1948 (when entry |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1949 (setq file-name-handler-alist |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1950 (cons 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
|
1951 |
d55ab93ab5bf
* net/tramp.el (tramp-register-file-name-handler)
Michael Albinus <michael.albinus@gmx.de>
parents:
76326
diff
changeset
|
1952 ;; `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
|
1953 ;; 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
|
1954 ;; already, f.e. files kept via recentf-mode. |
104673
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1955 ;;;###autoload(tramp-register-file-name-handlers) |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
1956 (tramp-register-file-name-handlers) |
45861 | 1957 |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1958 ;;;###autoload |
70191
3a3093f77da8
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
70073
diff
changeset
|
1959 (defun tramp-unload-file-name-handlers () |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1960 (setq file-name-handler-alist |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1961 (delete (rassoc 'tramp-file-name-handler |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1962 file-name-handler-alist) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1963 (delete (rassoc 'tramp-completion-file-name-handler |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1964 file-name-handler-alist) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1965 file-name-handler-alist)))) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
1966 |
70191
3a3093f77da8
* net/tramp.el (tramp-register-file-name-handlers): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
70073
diff
changeset
|
1967 (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
|
1968 |
87648
7ae99e295dfd
* vc-git.el (vc-git--call): Apply `process-file' instead of
Michael Albinus <michael.albinus@gmx.de>
parents:
87368
diff
changeset
|
1969 ;;; 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
|
1970 |
66496
63563507d684
(tramp-completion-mode): defvar moved up.
Richard M. Stallman <rms@gnu.org>
parents:
66135
diff
changeset
|
1971 (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
|
1972 "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
|
1973 |
ef0a2673bf5e
* net/tramp.el (tramp-completion-mode): Extend doc-string.
Michael Albinus <michael.albinus@gmx.de>
parents:
78887
diff
changeset
|
1974 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
|
1975 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
|
1976 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
|
1977 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
|
1978 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
1979 ;; 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
|
1980 ;; `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
|
1981 ;; 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
|
1982 ;; 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
|
1983 ;; `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
|
1984 ;; 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
|
1985 ;; 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
|
1986 ;; 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
|
1987 ;; 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
|
1988 ;; 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
|
1989 ;; 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
|
1990 ;;;###tramp-autoload |
84833
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
1991 (defun tramp-completion-mode-p () |
108066
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
1992 "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
|
1993 (or |
107858 | 1994 ;; Signal from outside. `non-essential' has been introduced in Emacs 24. |
1995 (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
|
1996 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
|
1997 ;; Emacs. |
85024
ef71cdab0d5c
* net/tramp.el (top): Add tramp-compat to `tramp-unload-hook'.
Michael Albinus <michael.albinus@gmx.de>
parents:
84985
diff
changeset
|
1998 (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
|
1999 (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
|
2000 (or |
85067
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
2001 ;; ?\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
|
2002 (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
|
2003 (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
|
2004 (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
|
2005 (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
|
2006 ;; XEmacs. |
84833
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2007 (and (featurep 'xemacs) |
b8f420afb6df
* net/tramp.el (tramp-completion-mode-p): Rename from
Michael Albinus <michael.albinus@gmx.de>
parents:
84739
diff
changeset
|
2008 ;; `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
|
2009 (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
|
2010 ;; `last-input-event' may have no character approximation. |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
2011 (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
|
2012 (or |
85067
4636000015c5
* net/tramp.el (top): Move loading of tramp-util.el and
Michael Albinus <michael.albinus@gmx.de>
parents:
85041
diff
changeset
|
2013 ;; ?\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
|
2014 (equal |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
2015 (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
|
2016 (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
|
2017 (or (equal |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
2018 (tramp-compat-funcall 'event-to-character last-input-event) |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
2019 ?\?) |
93036
50a5f7c885c1
(tramp-completion-mode-p): Don't use char-equal for
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
92982
diff
changeset
|
2020 (equal |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
2021 (tramp-compat-funcall 'event-to-character last-input-event) |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
2022 ?\ ))))))) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2023 |
108033 | 2024 (defun tramp-connectable-p (filename) |
2025 "Check, whether it is possible to connect the remote host w/o side-effects. | |
2026 This is true, if either the remote host is already connected, or if we are | |
2027 not in completion mode." | |
2028 (and (tramp-tramp-file-p filename) | |
2029 (with-parsed-tramp-file-name filename nil | |
2030 (or (get-buffer (tramp-buffer-name v)) | |
2031 (not (tramp-completion-mode-p)))))) | |
2032 | |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2033 ;; 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
|
2034 ;; `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
|
2035 ;; 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
|
2036 ;;;###autoload |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2037 (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
|
2038 "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
|
2039 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2040 (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
|
2041 (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
|
2042 ;; Possible completion structures. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2043 (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
|
2044 result result1) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2045 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2046 (while v |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2047 (let* ((car (car v)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2048 (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
|
2049 (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
|
2050 (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
|
2051 (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
|
2052 (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
|
2053 (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
|
2054 all-user-hosts) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2055 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2056 (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
|
2057 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2058 (if (or user host) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2059 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2060 ;; 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
|
2061 (progn |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2062 (mapc |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2063 (lambda (x) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2064 (setq all-user-hosts |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2065 (append all-user-hosts |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2066 (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
|
2067 (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
|
2068 |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2069 (setq result |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2070 (append result |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2071 (mapcar |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2072 (lambda (x) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2073 (tramp-get-completion-user-host |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2074 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
|
2075 (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
|
2076 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2077 ;; Possible methods. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2078 (setq result |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2079 (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
|
2080 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2081 (setq v (cdr v)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2082 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2083 ;; 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
|
2084 (while result |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2085 (let ((car (car result))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2086 (when car |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2087 (add-to-list |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2088 'result1 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2089 (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
|
2090 (setq result (cdr result)))) |
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 ;; Complete local parts. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2093 (append |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2094 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
|
2095 (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
|
2096 (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
|
2097 '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
|
2098 '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
|
2099 '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
|
2100 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2101 ;; 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
|
2102 ;;;###autoload |
74766
ca4412906dbd
* net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
74739
diff
changeset
|
2103 (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
|
2104 (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
|
2105 "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
|
2106 (try-completion |
ca4412906dbd
* net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
74739
diff
changeset
|
2107 filename |
ca4412906dbd
* net/ange-ftp.el (ange-ftp-file-name-completion): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
74739
diff
changeset
|
2108 (mapcar 'list (file-name-all-completions filename directory)) |
108033 | 2109 (when (and predicate |
2110 (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
|
2111 (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
|
2112 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2113 ;; 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
|
2114 ;; 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
|
2115 ;; 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
|
2116 ;; 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
|
2117 ;; 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
|
2118 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2119 ;; Expected results: |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2120 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2121 ;; "/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
|
2122 ;; [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
|
2123 ;; [nil "x" nil nil] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2124 ;; ["x" nil nil nil] |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2125 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2126 ;; "/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
|
2127 ;; [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
|
2128 ;; "/[x/" "/[x/y" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2129 ;; ["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
|
2130 ;; ["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
|
2131 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2132 ;; "/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
|
2133 ;; [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
|
2134 ;; "/[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
|
2135 ;; ["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
|
2136 (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
|
2137 "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
|
2138 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
|
2139 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2140 (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
|
2141 (x-nil "\\|\\(\\)") |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2142 (tramp-completion-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2143 (format |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2144 "[^%s]*" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2145 (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
|
2146 tramp-postfix-host-format |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2147 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
|
2148 ;; "/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
|
2149 (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
|
2150 (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
|
2151 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
|
2152 ;; "/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
|
2153 (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
|
2154 (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
|
2155 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
|
2156 ;; "/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
|
2157 (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
|
2158 (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
|
2159 nil nil 1 nil)) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2160 ;; "/[ipv6" "/[ipv6" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2161 (tramp-completion-file-name-structure4 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2162 (list (concat tramp-prefix-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2163 tramp-prefix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2164 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2165 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
|
2166 ;; "/user@host" "/[user@host" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2167 (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
|
2168 (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
|
2169 "\\(" 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
|
2170 "\\(" 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
|
2171 nil 1 2 nil)) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2172 ;; "/user@[ipv6" "/[user@ipv6" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2173 (tramp-completion-file-name-structure6 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2174 (list (concat tramp-prefix-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2175 "\\(" 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
|
2176 tramp-prefix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2177 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2178 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
|
2179 ;; "/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
|
2180 (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
|
2181 (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
|
2182 "\\(" 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
|
2183 "\\(" tramp-user-regexp x-nil "\\)$") |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2184 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
|
2185 ;; "/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
|
2186 (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
|
2187 (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
|
2188 "\\(" 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
|
2189 "\\(" 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
|
2190 1 nil 2 nil)) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2191 ;; "/method:[ipv6" "/[method/ipv6" "/method://[ipv6" |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2192 (tramp-completion-file-name-structure9 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2193 (list (concat tramp-prefix-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2194 "\\(" 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
|
2195 tramp-prefix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2196 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2197 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
|
2198 ;; "/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
|
2199 (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
|
2200 (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
|
2201 "\\(" 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
|
2202 "\\(" 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
|
2203 "\\(" 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
|
2204 1 2 3 nil)) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2205 ;; "/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
|
2206 (tramp-completion-file-name-structure11 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2207 (list (concat tramp-prefix-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2208 "\\(" 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
|
2209 "\\(" 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
|
2210 tramp-prefix-ipv6-regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2211 "\\(" tramp-completion-ipv6-regexp x-nil "\\)$") |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2212 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
|
2213 ;; "/method: "/method:/" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2214 (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
|
2215 (list |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2216 (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
|
2217 (concat tramp-prefix-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2218 "\\(" tramp-method-regexp "\\)" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2219 "\\(" (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
|
2220 "\\|" (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
|
2221 "\\(" "\\)$") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2222 ;; 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
|
2223 (concat tramp-prefix-regexp "/$")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2224 1 3 nil nil)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2225 ;; "/method: "/method:/" |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2226 (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
|
2227 (list |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2228 (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
|
2229 (concat tramp-prefix-regexp |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2230 "\\(" tramp-method-regexp "\\)" |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2231 "\\(" (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
|
2232 "\\|" (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
|
2233 "\\(" "\\)$") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2234 ;; 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
|
2235 (concat tramp-prefix-regexp "/$")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2236 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
|
2237 |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2238 (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
|
2239 (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
|
2240 (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
|
2241 (list |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2242 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
|
2243 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
|
2244 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
|
2245 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
|
2246 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
|
2247 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
|
2248 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
|
2249 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
|
2250 tramp-completion-file-name-structure9 |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2251 tramp-completion-file-name-structure10 |
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 tramp-completion-file-name-structure12 |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2254 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
|
2255 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
|
2256 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2257 (delq nil result))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2258 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2259 (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
|
2260 "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
|
2261 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
|
2262 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
|
2263 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2264 (save-match-data |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2265 (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
|
2266 (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
|
2267 (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
|
2268 (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
|
2269 (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
|
2270 (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
|
2271 (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
|
2272 (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
|
2273 (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
|
2274 (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
|
2275 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2276 ;; 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
|
2277 ;; trailing method delimeter. |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2278 (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
|
2279 "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
|
2280 (mapcar |
09acf3f65bb5
* net/tramp*.el: Sync with upstream version 2.0.28. Bugfixes.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47771
diff
changeset
|
2281 (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
|
2282 (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
|
2283 (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
|
2284 (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
|
2285 (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
|
2286 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2287 ;; 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
|
2288 (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
|
2289 "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
|
2290 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
|
2291 (cond |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2292 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2293 ((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
|
2294 (if (and host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2295 (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
|
2296 (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
|
2297 (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
|
2298 (setq user nil |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2299 host nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2300 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2301 (partial-user |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2302 (setq host nil) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2303 (unless |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2304 (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
|
2305 (setq user nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2306 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2307 (partial-host |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2308 (setq user nil) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2309 (unless |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2310 (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
|
2311 (setq host nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2312 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2313 (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
|
2314 host nil))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2315 |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2316 (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
|
2317 (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
|
2318 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2319 (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
|
2320 "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
|
2321 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
|
2322 ;; 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
|
2323 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2324 (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
|
2325 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
|
2326 (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
|
2327 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2328 (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
|
2329 (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
|
2330 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2331 (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
|
2332 res)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2333 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2334 (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
|
2335 "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
|
2336 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
|
2337 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2338 (regexp |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2339 (concat |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2340 "^\\(" tramp-host-regexp "\\)" |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2341 "\\([ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?"))) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2342 (narrow-to-region (point) (tramp-compat-line-end-position)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2343 (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
|
2344 (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
|
2345 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2346 (forward-line 1) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2347 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2348 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2349 (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
|
2350 "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
|
2351 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
|
2352 ;; 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
|
2353 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2354 (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
|
2355 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
|
2356 (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
|
2357 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2358 (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
|
2359 (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
|
2360 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2361 (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
|
2362 res)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2363 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2364 (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
|
2365 "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
|
2366 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
|
2367 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2368 (regexp (concat "^\\(" tramp-host-regexp "\\)"))) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2369 (narrow-to-region (point) (tramp-compat-line-end-position)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2370 (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
|
2371 (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
|
2372 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2373 (or |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2374 (> (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
|
2375 (forward-line 1)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2376 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2377 |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2378 (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
|
2379 "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
|
2380 User is always nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2381 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2382 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2383 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2384 res) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2385 (when (file-readable-p filename) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2386 (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
|
2387 (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
|
2388 (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
|
2389 (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
|
2390 (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
|
2391 res)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2392 |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2393 (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
|
2394 "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
|
2395 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
|
2396 (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
|
2397 (regexp (concat "^[ \t]*Host[ \t]+" "\\(" tramp-host-regexp "\\)"))) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2398 (narrow-to-region (point) (tramp-compat-line-end-position)) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2399 (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
|
2400 (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
|
2401 (widen) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2402 (or |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2403 (> (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
|
2404 (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
|
2405 result)) |
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2406 |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2407 (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
|
2408 "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
|
2409 User is always nil." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2410 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2411 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2412 (let* ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2413 (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
|
2414 (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
|
2415 result) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2416 (while files |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2417 (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
|
2418 (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
|
2419 (setq files (cdr files))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2420 result)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2421 |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2422 (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
|
2423 "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
|
2424 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
|
2425 ;; 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
|
2426 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2427 (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
|
2428 (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
|
2429 "\\)\\.ssh-\\(dss\\|rsa\\)\\.pub$")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2430 (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
|
2431 result) |
54198
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2432 (while files |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2433 (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
|
2434 (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
|
2435 (setq files (cdr files))) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2436 result)) |
c1bfc266f10a
Tramp: sync with upstream version 2.0.39.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
53206
diff
changeset
|
2437 |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2438 (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
|
2439 "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
|
2440 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
|
2441 ;; 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
|
2442 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2443 (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
|
2444 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
|
2445 (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
|
2446 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2447 (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
|
2448 (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
|
2449 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2450 (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
|
2451 res)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2452 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2453 (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
|
2454 "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
|
2455 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
|
2456 (let ((result) |
100856
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2457 (regexp |
49bc8bb7a597
* net/tramp.el (tramp-local-host-regexp)
Michael Albinus <michael.albinus@gmx.de>
parents:
100634
diff
changeset
|
2458 (concat "^\\(" tramp-ipv6-regexp "\\|" tramp-host-regexp "\\)"))) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2459 (narrow-to-region (point) (tramp-compat-line-end-position)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2460 (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
|
2461 (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
|
2462 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2463 (or |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2464 (> (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
|
2465 (forward-line 1)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2466 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2467 |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2468 ;; 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
|
2469 ;; 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
|
2470 ;; 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
|
2471 ;; 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
|
2472 (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
|
2473 "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
|
2474 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
|
2475 ;; 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
|
2476 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2477 (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
|
2478 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
|
2479 (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
|
2480 '(("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
|
2481 (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
|
2482 (with-temp-buffer |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2483 (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
|
2484 (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
|
2485 (while (not (eobp)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2486 (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
|
2487 res))) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2488 |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2489 (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
|
2490 "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
|
2491 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
|
2492 (let ((result) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2493 (regexp (concat "^\\(" tramp-user-regexp "\\):"))) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2494 (narrow-to-region (point) (tramp-compat-line-end-position)) |
47576
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2495 (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
|
2496 (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
|
2497 (widen) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2498 (forward-line 1) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2499 result)) |
b31c8ab7336a
Sync with version 2.0.20. Lengthy ChangeLog follows:
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47205
diff
changeset
|
2500 |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2501 (defun tramp-parse-netrc (filename) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2502 "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
|
2503 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
|
2504 ;; On Windows, there are problems in completion when |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2505 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2506 (let ((default-directory (tramp-compat-temporary-file-directory)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2507 res) |
49612
407d6516031a
2003-02-05 Kai Gro?ohann <kai.grossjohann@uni-duisburg.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49598
diff
changeset
|
2508 (when (file-readable-p filename) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2509 (with-temp-buffer |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2510 (insert-file-contents filename) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2511 (goto-char (point-min)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2512 (while (not (eobp)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2513 (push (tramp-parse-netrc-group) res)))) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2514 res)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2515 |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2516 (defun tramp-parse-netrc-group () |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2517 "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
|
2518 User may be nil." |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2519 (let ((result) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2520 (regexp |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2521 (concat |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2522 "^[ \t]*machine[ \t]+" "\\(" tramp-host-regexp "\\)" |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2523 "\\([ \t]+login[ \t]+" "\\(" tramp-user-regexp "\\)" "\\)?"))) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2524 (narrow-to-region (point) (tramp-compat-line-end-position)) |
47578
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2525 (when (re-search-forward regexp nil t) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2526 (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
|
2527 (widen) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2528 (forward-line 1) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2529 result)) |
6e910ba94c42
Version 2.0.22 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47577
diff
changeset
|
2530 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2531 (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
|
2532 "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
|
2533 User is always nil." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2534 ;; 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
|
2535 ;; `default-directory' is remote. |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2536 (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
|
2537 res) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2538 (with-temp-buffer |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
2539 (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
|
2540 (goto-char (point-min)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2541 (while (not (eobp)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2542 (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
|
2543 res)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2544 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2545 (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
|
2546 "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
|
2547 User is always nil." |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2548 (let ((result) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2549 (regexp (concat (regexp-quote registry) "\\\\\\(.+\\)"))) |
84985
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2550 (narrow-to-region (point) (tramp-compat-line-end-position)) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2551 (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
|
2552 (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
|
2553 (widen) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2554 (forward-line 1) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2555 result)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2556 |
105718
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
2557 (defun tramp-delete-temp-file-function () |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
2558 "Remove temporary files related to current buffer." |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
2559 (when (stringp tramp-temp-buffer-file-name) |
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
|
2560 (ignore-errors (delete-file tramp-temp-buffer-file-name)))) |
105718
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
2561 |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
2562 (add-hook 'kill-buffer-hook 'tramp-delete-temp-file-function) |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
2563 (add-hook 'tramp-cache-unload-hook |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
2564 (lambda () |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
2565 (remove-hook 'kill-buffer-hook |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
2566 'tramp-delete-temp-file-function))) |
828d51e45d15
* net/tramp.el (top): Remove `tramp-rfn-eshadow-update-overlay'
Michael Albinus <michael.albinus@gmx.de>
parents:
105615
diff
changeset
|
2567 |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
2568 ;; ------------------------------------------------------------ |
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
2569 ;; -- Functions for establishing connection -- |
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
2570 ;; ------------------------------------------------------------ |
45861 | 2571 |
46752 | 2572 ;; The following functions are actions to be taken when seeing certain |
2573 ;; prompts from the remote host. See the variable | |
2574 ;; `tramp-actions-before-shell' for usage of these functions. | |
2575 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2576 (defun tramp-action-login (proc vec) |
46752 | 2577 "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
|
2578 (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
|
2579 (save-window-excursion |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2580 (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
|
2581 (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
|
2582 (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
|
2583 (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
|
2584 (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
|
2585 (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
|
2586 (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
|
2587 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2588 (defun tramp-action-password (proc vec) |
46752 | 2589 "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
|
2590 (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
|
2591 (tramp-check-for-regexp proc tramp-password-prompt-regexp) |
109807
88276a8b38b9
* net/tramp.el (tramp-handle-make-symbolic-link): Flush file
Michael Albinus <albinus@detlef>
parents:
109738
diff
changeset
|
2592 (tramp-message vec 3 "Sending %s" (match-string 1)) |
88276a8b38b9
* net/tramp.el (tramp-handle-make-symbolic-link): Flush file
Michael Albinus <albinus@detlef>
parents:
109738
diff
changeset
|
2593 (tramp-enter-password proc) |
88276a8b38b9
* net/tramp.el (tramp-handle-make-symbolic-link): Flush file
Michael Albinus <albinus@detlef>
parents:
109738
diff
changeset
|
2594 ;; Hide password prompt. |
88276a8b38b9
* net/tramp.el (tramp-handle-make-symbolic-link): Flush file
Michael Albinus <albinus@detlef>
parents:
109738
diff
changeset
|
2595 (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
|
2596 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2597 (defun tramp-action-succeed (proc vec) |
46752 | 2598 "Signal success in finding shell prompt." |
2599 (throw 'tramp-action 'ok)) | |
2600 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2601 (defun tramp-action-permission-denied (proc vec) |
46752 | 2602 "Signal permission denied." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2603 (kill-process proc) |
46752 | 2604 (throw 'tramp-action 'permission-denied)) |
2605 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2606 (defun tramp-action-yesno (proc vec) |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
2607 "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
|
2608 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
|
2609 See also `tramp-action-yn'." |
46752 | 2610 (save-window-excursion |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2611 (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
|
2612 (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
|
2613 (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
|
2614 (kill-process proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2615 (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
|
2616 (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
|
2617 (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
|
2618 (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
|
2619 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2620 (defun tramp-action-yn (proc vec) |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
2621 "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
|
2622 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
|
2623 See also `tramp-action-yesno'." |
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
2624 (save-window-excursion |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2625 (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
|
2626 (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
|
2627 (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
|
2628 (kill-process proc) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2629 (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
|
2630 (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
|
2631 (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
|
2632 (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
|
2633 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2634 (defun tramp-action-terminal (proc vec) |
47771
ac3dfc909b56
Version 2.0.25 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
47683
diff
changeset
|
2635 "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
|
2636 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
|
2637 (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
|
2638 (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
|
2639 (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
|
2640 (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
|
2641 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2642 (defun tramp-action-process-alive (proc vec) |
108066
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
2643 "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
|
2644 (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
|
2645 (throw 'tramp-action 'process-died))) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
2646 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2647 (defun tramp-action-out-of-band (proc vec) |
108066
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
2648 "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
|
2649 (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
|
2650 (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
|
2651 (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
|
2652 (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
|
2653 ((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
|
2654 (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
|
2655 (memq (process-status proc) '(signal))) |
59582
92796330257a
Sync with Tramp 2.0.47.
Michael Albinus <michael.albinus@gmx.de>
parents:
59031
diff
changeset
|
2656 ;; `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
|
2657 ;; 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
|
2658 (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
|
2659 (goto-char (point-min)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2660 (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
|
2661 (progn |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2662 (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
|
2663 (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
|
2664 (throw 'tramp-action 'ok)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2665 (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
|
2666 (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
|
2667 (t nil))) |
c44f9de543e3
2004-05-07 Kai Grossjohann <kai@emptydomain.de>
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
54198
diff
changeset
|
2668 |
46752 | 2669 ;; Functions for processing the actions. |
2670 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2671 (defun tramp-process-one-action (proc vec actions) |
46752 | 2672 "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
|
2673 (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
|
2674 (while (not found) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2675 ;; 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
|
2676 ;; 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
|
2677 (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
|
2678 (setq todo actions) |
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
2679 (while todo |
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
2680 (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
|
2681 (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
|
2682 (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
|
2683 (tramp-message |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2684 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
|
2685 (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
|
2686 (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
|
2687 (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
|
2688 found)) |
bdffb0038313
* net/tramp.el: (tramp-process-one-action): Remove `with-timeout'.
Michael Albinus <michael.albinus@gmx.de>
parents:
75007
diff
changeset
|
2689 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2690 (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
|
2691 "Perform actions until success or TIMEOUT." |
108775
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2692 ;; 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
|
2693 (tramp-compat-with-temp-message "" |
108775
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2694 ;; Enable auth-source and password-cache. |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2695 (tramp-set-connection-property vec "first-password-request" t) |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2696 (let (exit) |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2697 (while (not exit) |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2698 (tramp-message proc 3 "Waiting for prompts from remote shell") |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2699 (setq exit |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2700 (catch 'tramp-action |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2701 (if timeout |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2702 (with-timeout (timeout) |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2703 (tramp-process-one-action proc vec actions)) |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2704 (tramp-process-one-action proc vec actions))))) |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2705 (with-current-buffer (tramp-get-connection-buffer vec) |
109807
88276a8b38b9
* net/tramp.el (tramp-handle-make-symbolic-link): Flush file
Michael Albinus <albinus@detlef>
parents:
109738
diff
changeset
|
2706 (widen) |
108775
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2707 (tramp-message vec 6 "\n%s" (buffer-string))) |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2708 (unless (eq exit 'ok) |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2709 (tramp-clear-passwd vec) |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2710 (tramp-error-with-buffer |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2711 nil vec 'file-error |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2712 (cond |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2713 ((eq exit 'permission-denied) "Permission denied") |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2714 ((eq exit 'process-died) "Process died") |
481bba2e11df
* net/tramp.el (tramp-progress-reporter-update): New defun.
Michael Albinus <michael.albinus@gmx.de>
parents:
108739
diff
changeset
|
2715 (t "Login failed"))))))) |
45861 | 2716 |
2717 ;; Utility functions. | |
2718 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2719 (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
|
2720 "Like `accept-process-output' for Tramp processes. |
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
2721 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
|
2722 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
|
2723 (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
|
2724 (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
|
2725 (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
|
2726 ;; 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
|
2727 ;; 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
|
2728 (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
|
2729 (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
|
2730 (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
|
2731 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2732 (defun tramp-check-for-regexp (proc regexp) |
108066
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
2733 "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
|
2734 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
|
2735 (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
|
2736 (goto-char (point-min)) |
94975
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
2737 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2738 ;; 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
|
2739 (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
|
2740 (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
|
2741 (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
|
2742 (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
|
2743 ;; 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
|
2744 (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
|
2745 (tramp-message proc 5 "echo-mark found") |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
2746 (forward-line 1) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2747 (delete-region begin (point)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2748 (goto-char (point-min))))) |
94975
5bb8f7b3f835
* net/tramp.el (tramp-echo-mark): Update docstring.
Michael Albinus <michael.albinus@gmx.de>
parents:
94677
diff
changeset
|
2749 |
106597
b0e5aae20733
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
Michael Albinus <michael.albinus@gmx.de>
parents:
106508
diff
changeset
|
2750 (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
|
2751 ;; 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
|
2752 (not (string-equal |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
2753 (tramp-compat-funcall |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
2754 '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
|
2755 0 (min tramp-echo-mark-marker-length (1- (point-max)))) |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
2756 (tramp-compat-funcall |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
2757 '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
|
2758 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
|
2759 ;; 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
|
2760 (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
|
2761 (re-search-forward regexp nil t)))) |
64772
060177e931f8
Sync with Tramp 2.0.50.
Michael Albinus <michael.albinus@gmx.de>
parents:
64701
diff
changeset
|
2762 |
45861 | 2763 (defun tramp-wait-for-regexp (proc timeout regexp) |
2764 "Wait for a REGEXP to appear from process PROC within TIMEOUT seconds. | |
2765 Expects the output of PROC to be sent to the current buffer. Returns | |
2766 the string that matched, or nil. Waits indefinitely if TIMEOUT is | |
2767 nil." | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2768 (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
|
2769 (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
|
2770 (start-time (current-time))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2771 (cond (timeout |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2772 ;; 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
|
2773 ;; 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
|
2774 ;; 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
|
2775 (while (and (not found) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2776 (< (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
|
2777 timeout)) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2778 (with-timeout (timeout) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2779 (while (not found) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2780 (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
|
2781 (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
|
2782 (tramp-error-with-buffer |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2783 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
|
2784 (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
|
2785 (t |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2786 (while (not found) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2787 (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
|
2788 (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
|
2789 (tramp-error-with-buffer |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2790 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
|
2791 (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
|
2792 (tramp-message proc 6 "\n%s" (buffer-string)) |
45861 | 2793 (when (not found) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2794 (if timeout |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2795 (tramp-error |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2796 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
|
2797 regexp timeout) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2798 (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
|
2799 found))) |
51177
6234a4fe96f9
Version 2.0.34 (of Tramp) released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
50494
diff
changeset
|
2800 |
85553
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
2801 ;; 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
|
2802 ;; 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
|
2803 ;; string. |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
2804 (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
|
2805 "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
|
2806 (process-send-string |
85553
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
2807 proc (concat (tramp-read-passwd proc) |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
2808 (or (tramp-get-method-parameter |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
2809 tramp-current-method |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
2810 'tramp-password-end-of-line) |
4ccd437aad2e
* net/tramp.el (tramp-find-shell)
Michael Albinus <michael.albinus@gmx.de>
parents:
85542
diff
changeset
|
2811 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
|
2812 |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2813 ;; 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
|
2814 ;; 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
|
2815 ;; `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
|
2816 ;; 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
|
2817 (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
|
2818 "Send the STRING via connection VEC. |
49995
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2819 |
a0e8a85259ed
Version 2.0.30 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
49612
diff
changeset
|
2820 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
|
2821 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
|
2822 `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
|
2823 (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
|
2824 (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
|
2825 (unless p |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2826 (tramp-error |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2827 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
|
2828 (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
|
2829 (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
|
2830 (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
|
2831 ;; 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
|
2832 ;; 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
|
2833 (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
|
2834 ;; 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
|
2835 (setq string |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2836 (mapconcat 'identity |
103527
d820807ffab7
* net/tramp.el (top): Require tramp-gvfs. Catch `tramp-loading',
Michael Albinus <michael.albinus@gmx.de>
parents:
103333
diff
changeset
|
2837 (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
|
2838 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
|
2839 (unless (or (string= string "") |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2840 (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
|
2841 (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
|
2842 ;; Send the string. |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2843 (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
|
2844 (let ((pos 0) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2845 (end (length string))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2846 (while (< pos end) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2847 (tramp-message |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2848 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
|
2849 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
|
2850 (process-send-string |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2851 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
|
2852 (setq pos (+ pos chunksize)))) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2853 (process-send-string p string))))) |
45861 | 2854 |
81938
26330ef1aa46
* net/tramp.el (tramp-handle-file-remote-p): Handle optional
Michael Albinus <michael.albinus@gmx.de>
parents:
81758
diff
changeset
|
2855 (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
|
2856 "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
|
2857 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
|
2858 (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
|
2859 (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
|
2860 (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
|
2861 (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
|
2862 ""))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2863 (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
|
2864 (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
|
2865 (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
|
2866 (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
|
2867 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2868 (defun tramp-get-device (vec) |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2869 "Returns the virtual device number. |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2870 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
|
2871 (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
|
2872 (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
|
2873 (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
|
2874 (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
|
2875 ""))) |
58540
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2876 (unless (assoc string tramp-devices) |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2877 (add-to-list 'tramp-devices |
d3f76ef9ad46
(tramp-handle-directory-files-and-attributes): New function.
Lars Hansen <larsh@soem.dk>
parents:
58005
diff
changeset
|
2878 (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
|
2879 (cons -1 (nth 1 (assoc string tramp-devices))))) |
45861 | 2880 |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2881 (defun tramp-equal-remote (file1 file2) |
108066
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
2882 "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
|
2883 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
|
2884 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
|
2885 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
|
2886 account. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2887 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2888 Example: |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2889 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2890 (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
|
2891 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2892 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
|
2893 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2894 (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
|
2895 (and (stringp (file-remote-p file1)) |
f7642749252b
* net/tramp-compat.el: New file.
Michael Albinus <michael.albinus@gmx.de>
parents:
84966
diff
changeset
|
2896 (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
|
2897 (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
|
2898 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2899 (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
|
2900 "Return the method parameter PARAM. |
108186
3287df4f3442
Implement compression for inline methods.
Michael Albinus <albinus@detlef>
parents:
108158
diff
changeset
|
2901 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
|
2902 (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
|
2903 (when entry (cadr entry)))) |
51968
e4c4c45ea013
Tramp 2.0.36 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51603
diff
changeset
|
2904 |
45861 | 2905 ;; Auto saving to a special directory. |
2906 | |
65304
379e08762d65
* net/tramp.el (tramp-handle-make-auto-save-file-name): Deactivate
Michael Albinus <michael.albinus@gmx.de>
parents:
65254
diff
changeset
|
2907 (defun tramp-exists-file-name-handler (operation &rest args) |
108066
47a124b50bbf
Synchronize with Tramp repository.
Michael Albinus <michael.albinus@gmx.de>
parents:
108065
diff
changeset
|
2908 "Check, whether OPERATION runs a file name handler." |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2909 ;; The file name handler is determined on base of either an |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2910 ;; argument, `buffer-file-name', or `default-directory'. |
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
|
2911 (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
|
2912 (let* ((buffer-file-name "/") |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2913 (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
|
2914 (fnha file-name-handler-alist) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2915 (check-file-name-operation operation) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2916 (file-name-handler-alist |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2917 (list |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2918 (cons "/" |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2919 (lambda (operation &rest 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
|
2920 "Returns OPERATION if it is the one to be checked." |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2921 (if (equal check-file-name-operation operation) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2922 operation |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2923 (let ((file-name-handler-alist fnha)) |
4b26adbef9a2
Major code cleanup. Split tramp.el into tramp.el and tramp-sh.el.
Michael Albinus <michael.albinus@gmx.de>
parents:
110319
diff
changeset
|
2924 (apply operation 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
|
2925 (equal (apply operation args) operation)))) |
65248
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
2926 |
0f994edbec5e
Make `make-auto-save-file-name' a magic operation.
Michael Albinus <michael.albinus@gmx.de>
parents:
64772
diff
changeset
|
2927 (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
|
2928 (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
|
2929 (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
|
2930 "Invoke `tramp-*-handle-make-auto-save-file-name' for Tramp files." |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
2931 (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
|
2932 ;; 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
|
2933 ;; 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
|
2934 (setq ad-return-value |
509a5b989179
* net/tramp.el (tramp-handle-file-attributes-with-ls)
Michael Albinus <michael.albinus@gmx.de>
parents:
104673
diff
changeset
|
2935 (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
|
2936 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
|
2937 (add-hook |
9abdd578d117
* net/tramp.el (tramp-advice-make-auto-save-file-name)
Michael Albinus <michael.albinus@gmx.de>
parents:
105893
diff
changeset
|
2938 'tramp-unload-hook |
9abdd578d117
* net/tramp.el (tramp-advice-make-auto-save-file-name)
Michael Albinus <michael.albinus@gmx.de>
parents:
105893
diff
changeset
|
2939 (lambda () |
9abdd578d117
* net/tramp.el (tramp-advice-make-auto-save-file-name)
Michael Albinus <michael.albinus@gmx.de>
parents:
105893
diff
changeset
|
2940 (ad-remove-advice |
9abdd578d117
* net/tramp.el (tramp-advice-make-auto-save-file-name)
Michael Albinus <michael.albinus@gmx.de>
parents:
105893
diff
changeset
|
2941 '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
|
2942 '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
|
2943 (ad-activate 'make-auto-save-file-name)))) |
45861 | 2944 |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
2945 ;; In XEmacs < 21.5, autosaved remote files have permission 0666 minus |
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
2946 ;; umask. This is a security threat. |
57463
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
2947 |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
2948 (defun tramp-set-auto-save-file-modes () |
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
2949 "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
|
2950 (let ((bfn (buffer-file-name))) |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
2951 (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
|
2952 (buffer-modified-p) |
57463
40298ea4d83f
Sync with Tramp 2.0.45.
Michael Albinus <michael.albinus@gmx.de>
parents:
56644
diff
changeset
|
2953 (stringp buffer-auto-save-file-name) |
60763
3ba8f94e9cfa
Sync with Tramp 2.0.48.
Michael Albinus <michael.albinus@gmx.de>
parents:
60287
diff
changeset
|
2954 (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
|
2955 (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
|
2956 (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
|
2957 ;; 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
|
2958 ;; 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
|
2959 ;; be a security threat. |
110264
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
2960 (set-file-modes |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
2961 buffer-auto-save-file-name |
ec526909f60b
Migrate to Tramp 2.2. Rearrange load dependencies.
Michael Albinus <michael.albinus@gmx.de>
parents:
109993
diff
changeset
|
2962 (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
|
2963 |
107820
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
2964 (unless (and (featurep 'xemacs) |
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
2965 (= emacs-major-version 21) |
e97568b31550
Synchronize with Tramp repository.
Michael Albinus <albinus@detlef>
parents:
107538
diff
changeset
|
2966 (> emacs-minor-version 4)) |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
2967 (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
|
2968 (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
|
2969 (lambda () |
317dde5b902b
* net/tramp.el (all): Replace "'(lambda" by "(lambda".
Michael Albinus <michael.albinus@gmx.de>
parents:
104642
diff
changeset
|
2970 (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
|
2971 |
45861 | 2972 (defun tramp-subst-strs-in-string (alist string) |
2973 "Replace all occurrences of the string FROM with TO in STRING. | |
2974 ALIST is of the form ((FROM . TO) ...)." | |
2975 (save-match-data | |
2976 (while alist | |
2977 (let* ((pr (car alist)) | |
2978 (from (car pr)) | |
2979 (to (cdr pr))) | |
2980 (while (string-match (regexp-quote from) string) | |
2981 (setq string (replace-match to t t string))) | |
2982 (setq alist (cdr alist)))) | |
2983 string)) | |
2984 | |
2985 ;; ------------------------------------------------------------ | |
2986 ;; -- Compatibility functions section -- | |
2987 ;; ------------------------------------------------------------ | |
2988 | |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2989 (defun tramp-read-passwd (proc &optional prompt) |
45861 | 2990 "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
|
2991 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
|
2992 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
|
2993 (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
|
2994 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
|
2995 tramp-current-host "")) |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2996 (pw-prompt |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2997 (or prompt |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
2998 (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
|
2999 (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
|
3000 (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
|
3001 (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
|
3002 (prog1 |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3003 (or |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3004 ;; 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
|
3005 (and (boundp 'auth-sources) |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3006 (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
|
3007 ;; Try with Tramp's current method. |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3008 (tramp-compat-funcall |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3009 'auth-source-user-or-password |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3010 "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
|
3011 ;; Try the password cache. |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3012 (when (functionp 'password-read) |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3013 (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
|
3014 v "first-password-request" nil) |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3015 (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
|
3016 (let ((password |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3017 (tramp-compat-funcall 'password-read pw-prompt key))) |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3018 (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
|
3019 password)) |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3020 ;; 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
|
3021 (read-passwd pw-prompt)) |
7e66e7efd47d
* net/tramp.el (tramp-process-actions, tramp-read-passwd):
Michael Albinus <michael.albinus@gmx.de>
parents:
107085
diff
changeset
|
3022 (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
|
3023 |
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
|
3024 (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
|
3025 "Clear password cache for connection related to VEC." |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3026 (tramp-compat-funcall |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3027 'password-cache-remove |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3028 (tramp-make-tramp-file-name |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3029 (tramp-file-name-method vec) |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3030 (tramp-file-name-user vec) |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3031 (tramp-file-name-host vec) |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3032 ""))) |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3033 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3034 ;; 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
|
3035 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3036 (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
|
3037 "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
|
3038 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3039 (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
|
3040 '(("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
|
3041 ("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
|
3042 ("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
|
3043 ("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
|
3044 "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
|
3045 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3046 (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
|
3047 "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
|
3048 (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
|
3049 (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
|
3050 (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
|
3051 (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
|
3052 (< (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
|
3053 |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3054 (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
|
3055 "Subtract two time values. |
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3056 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
|
3057 (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
|
3058 (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
|
3059 (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
|
3060 (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
|
3061 (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2))))) |
45861 | 3062 |
3063 (defun tramp-time-diff (t1 t2) | |
3064 "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
|
3065 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
|
3066 (cond ((and (fboundp 'subtract-time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3067 (fboundp 'float-time)) |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3068 (tramp-compat-funcall |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3069 '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
|
3070 ((and (fboundp 'subtract-time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3071 (fboundp 'time-to-seconds)) |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3072 (tramp-compat-funcall |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3073 'time-to-seconds (tramp-compat-funcall 'subtract-time t1 t2))) |
45861 | 3074 ((fboundp 'itimer-time-difference) |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3075 (tramp-compat-funcall |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3076 'itimer-time-difference |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3077 (if (< (length t1) 3) (append t1 '(0)) t1) |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3078 (if (< (length t2) 3) (append t2 '(0)) t2))) |
45861 | 3079 (t |
81758
f03856eb136b
* files.el (file-remote-p): Introduce optional parameter CONNECTED.
Michael Albinus <michael.albinus@gmx.de>
parents:
77986
diff
changeset
|
3080 (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
|
3081 (+ (* (car time) 65536.0) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3082 (cadr time) |
978e262c8f3a
Version 2.0.35 of Tramp released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
51177
diff
changeset
|
3083 (/ (or (nth 2 time) 0) 1000000.0)))))) |
45861 | 3084 |
3085 (defun tramp-coding-system-change-eol-conversion (coding-system eol-type) | |
3086 "Return a coding system like CODING-SYSTEM but with given EOL-TYPE. | |
3087 EOL-TYPE can be one of `dos', `unix', or `mac'." | |
3088 (cond ((fboundp 'coding-system-change-eol-conversion) | |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3089 (tramp-compat-funcall |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3090 'coding-system-change-eol-conversion coding-system eol-type)) |
45861 | 3091 ((fboundp 'subsidiary-coding-system) |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3092 (tramp-compat-funcall |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3093 'subsidiary-coding-system coding-system |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3094 (cond ((eq eol-type 'dos) 'crlf) |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3095 ((eq eol-type 'unix) 'lf) |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3096 ((eq eol-type 'mac) 'cr) |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3097 (t |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3098 (error "Unknown EOL-TYPE `%s', must be %s" |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3099 eol-type |
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3100 "`dos', `unix', or `mac'"))))) |
45861 | 3101 (t (error "Can't change EOL conversion -- is MULE missing?")))) |
3102 | |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3103 (defun tramp-set-process-query-on-exit-flag (process flag) |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3104 "Specify if query is needed for process when Emacs is exited. |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3105 If the second argument flag is non-nil, Emacs will query the user before |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3106 exiting if process is running." |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3107 (if (fboundp 'set-process-query-on-exit-flag) |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3108 (tramp-compat-funcall 'set-process-query-on-exit-flag process flag) |
108975
c4552014bea2
* net/tramp.el (tramp-remote-process-environment): Protect version
Michael Albinus <albinus@detlef>
parents:
108817
diff
changeset
|
3109 (tramp-compat-funcall 'process-kill-without-query process flag))) |
55844
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3110 |
4bc6cb45c326
Version 2.0.41 of Tramp released.
Michael Albinus <michael.albinus@gmx.de>
parents:
55420
diff
changeset
|
3111 |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
3112 ;; ------------------------------------------------------------ |
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
3113 ;; -- Kludges section -- |
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
59582
diff
changeset
|
3114 ;; ------------------------------------------------------------ |
45861 | 3115 |
3116 ;; Currently (as of Emacs 20.5), the function `shell-quote-argument' | |
3117 ;; does not deal well with newline characters. Newline is replaced by | |
3118 ;; backslash newline. But if, say, the string `a backslash newline b' | |
3119 ;; is passed to a shell, the shell will expand this into "ab", | |
3120 ;; completely omitting the newline. This is not what was intended. | |
3121 ;; It does not appear to be possible to make the function | |
3122 ;; `shell-quote-argument' work with newlines without making it | |
3123 ;; dependent on the shell used. But within this package, we know that | |
3124 ;; we will always use a Bourne-like shell, so we use an approach which | |
3125 ;; groks newlines. | |
3126 ;; | |
3127 ;; The approach is simple: we call `shell-quote-argument', then | |
3128 ;; massage the newline part of the result. | |
3129 ;; | |
3130 ;; This function should produce a string which is grokked by a Unix | |
3131 ;; shell, even if the Emacs is running on Windows. Since this is the | |
3132 ;; kludges section, we bind `system-type' in such a way that | |
3133 ;; `shell-quote-arguments' behaves as if on Unix. | |
3134 ;; | |
3135 ;; Thanks to Mario DeWeerd for the hint that it is sufficient for this | |
3136 ;; function to work with Bourne-like shells. | |
3137 ;; | |
3138 ;; CCC: This function should be rewritten so that | |
3139 ;; `shell-quote-argument' is not used. This way, we are safe from | |
3140 ;; 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
|
3141 ;;;###tramp-autoload |
45861 | 3142 (defun tramp-shell-quote-argument (s) |
3143 "Similar to `shell-quote-argument', but groks newlines. | |
3144 Only works for Bourne-like shells." | |
3145 (let ((system-type 'not-windows)) | |
3146 (save-match-data | |
3147 (let ((result (shell-quote-argument s)) | |
3148 (nl (regexp-quote (format "\\%s" tramp-rsh-end-of-line)))) | |
3149 (when (and (>= (length result) 2) | |
3150 (string= (substring result 0 2) "\\~")) | |
3151 (setq result (substring result 1))) | |
3152 (while (string-match nl result) | |
3153 (setq result (replace-match (format "'%s'" tramp-rsh-end-of-line) | |
3154 t t result))) | |
3155 result)))) | |
3156 | |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3157 ;; Checklist for `tramp-unload-hook' |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3158 ;; - Unload all `tramp-*' packages |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3159 ;; - Reset `file-name-handler-alist' |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3160 ;; - Cleanup hooks where Tramp functions are in |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3161 ;; - Cleanup advised functions |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3162 ;; - Cleanup autoloads |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3163 ;;;###autoload |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3164 (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
|
3165 "Discard Tramp from loading remote files." |
68335
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3166 (interactive) |
118ceefc8263
Sync with Tramp 2.0.52.
Michael Albinus <michael.albinus@gmx.de>
parents:
66630
diff
changeset
|
3167 ;; ange-ftp settings must be enabled. |
108377
7827d5a5c826
* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
Michael Albinus <albinus@detlef>
parents:
108269
diff
changeset
|
3168 (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
|
3169 ;; 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
|
3170 (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
|
3171 |
45861 | 3172 (provide 'tramp) |
3173 | |
3174 ;;; TODO: | |
3175 | |
3176 ;; * Rewrite `tramp-shell-quote-argument' to abstain from using | |
46790 | 3177 ;; `shell-quote-argument'. |
45861 | 3178 ;; * In Emacs 21, `insert-directory' shows total number of bytes used |
3179 ;; by the files in that directory. Add this here. | |
3180 ;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman) | |
3181 ;; * Make ffap.el grok Tramp filenames. (Eli Tziperman) | |
3182 ;; * 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
|
3183 ;; * Better error checking. At least whenever we see something |
45861 | 3184 ;; strange when doing zerop, we should kill the process and start |
3185 ;; again. (Greg Stark) | |
46992
6529728ddf05
Version 2.0.13 released.
Kai Großjohann <kgrossjo@eu.uu.net>
parents:
46835
diff
changeset
|
3186 ;; * 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
|
3187 ;; ** 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
|
3188 ;; ** 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
|
3189 ;; 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
|
3190 ;; * 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
|
3191 ;; * 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
|
3192 ;; 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
|
3193 ;; 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
|
3194 ;; 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
|
3195 ;; 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
|
3196 ;; in tramp functions. (Jason Rumney) |
107021
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
3197 ;; * IMHO, it's a drawback that currently Tramp doesn't support |
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
3198 ;; Unicode in Dired file names by default. Is it possible to |
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
3199 ;; 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
|
3200 ;; 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
|
3201 ;; expects only English messages? (Juri Linkov) |
107021
b38ac2be4408
Fix some busybox annoyances.
Michael Albinus <albinus@detlef>
parents:
106895
diff
changeset
|
3202 ;; * Make shadowfile.el grok Tramp filenames. (Bug#4526, Bug#4846) |
107858 | 3203 ;; * Load ~/.emacs_SHELLNAME on the remote host for `shell'. |
109993
2192a4648d21
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
109807
diff
changeset
|
3204 ;; * I was wondering it it would be possible to use tramp even if I'm |
2192a4648d21
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
109807
diff
changeset
|
3205 ;; actually using sshfs. But when I launch a command I would like |
2192a4648d21
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
109807
diff
changeset
|
3206 ;; to get it executed on the remote machine where the files really |
2192a4648d21
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
109807
diff
changeset
|
3207 ;; are. (Andrea Crotti) |
2192a4648d21
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
109807
diff
changeset
|
3208 ;; * Run emerge on two remote files. Bug is described here: |
2192a4648d21
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
109807
diff
changeset
|
3209 ;; <http://www.mail-archive.com/tramp-devel@nongnu.org/msg01041.html>. |
2192a4648d21
Sync with Tramp 2.1.19.
Michael Albinus <michael.albinus@gmx.de>
parents:
109807
diff
changeset
|
3210 ;; (Bug#6850) |
45861 | 3211 |
3212 ;; Functions for file-name-handler-alist: | |
3213 ;; diff-latest-backup-file -- in diff.el | |
3214 | |
93103
19a32f437b65
Fix up encoding.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
93082
diff
changeset
|
3215 ;; arch-tag: 3a21a994-182b-48fa-b0cd-c1d9fede424a |
45861 | 3216 ;;; tramp.el ends here |
93040
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
3217 |
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
3218 ;; Local Variables: |
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
3219 ;; mode: Emacs-Lisp |
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
3220 ;; coding: utf-8 |
ba82da0cb626
* net/tramp.el (tramp-root-regexp): Simplify.
Michael Albinus <michael.albinus@gmx.de>
parents:
93036
diff
changeset
|
3221 ;; End: |