aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2008-01-23 20:45:03 +0000
committerMichael Albinus2008-01-23 20:45:03 +0000
commita0a5183aa32e2c8e4e69f954194822b150c3b6a0 (patch)
tree4db784b622bb21d4e7457aff9eca5988718ad909
parent3b3cb3369582bf9ab53425b40b64373a2ce576cc (diff)
downloademacs-a0a5183aa32e2c8e4e69f954194822b150c3b6a0.tar.gz
emacs-a0a5183aa32e2c8e4e69f954194822b150c3b6a0.zip
* net/tramp.el (tramp-remote-process-environment): Set "LC_ALL=C".
(tramp-end-of-output): Add `tramp-rsh-end-of-line' into the regexp. (tramp-find-shell, tramp-open-connection-setup-interactive-shell): Don't send `tramp-rsh-end-of-line' additionally, when setting the prompt. (tramp-wait-for-output): Distinguish different prompt formats. (tramp-get-test-nt-command): Don't check for "\n" in the prompt. (tramp-local-host-p): Check whether temp directory is writable.
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/net/tramp.el50
2 files changed, 37 insertions, 27 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index acfe79e8b38..62c718c8a61 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,4 +1,16 @@
12008-01-23 Dan Nicolaescu <dann@ics.uci.edu> 12008-01-23 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (tramp-remote-process-environment): Set "LC_ALL=C".
4 (tramp-end-of-output): Add `tramp-rsh-end-of-line' into the
5 regexp.
6 (tramp-find-shell, tramp-open-connection-setup-interactive-shell):
7 Don't send `tramp-rsh-end-of-line' additionally, when setting the
8 prompt.
9 (tramp-wait-for-output): Distinguish different prompt formats.
10 (tramp-get-test-nt-command): Don't check for "\n" in the prompt.
11 (tramp-local-host-p): Check whether temp directory is writable.
12
1322008-01-23 Dan Nicolaescu <dann@ics.uci.edu>
2 14
3 * vc.el: Add TODO items. 15 * vc.el: Add TODO items.
4 16
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 3969f992a8c..7c3153fc0be 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -914,7 +914,7 @@ directories for POSIX compatible commands."
914 (string :tag "Directory")))) 914 (string :tag "Directory"))))
915 915
916(defcustom tramp-remote-process-environment 916(defcustom tramp-remote-process-environment
917 `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "LC_CTYPE=C" "LC_TIME=C" 917 `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "LC_ALL=C"
918 ,(concat "TERM=" tramp-terminal-type) 918 ,(concat "TERM=" tramp-terminal-type)
919 "CDPATH=" "HISTORY=" "MAIL=" "MAILCHECK=" "MAILPATH=" 919 "CDPATH=" "HISTORY=" "MAIL=" "MAILCHECK=" "MAILPATH="
920 "autocorrect=" "correct=") 920 "autocorrect=" "correct=")
@@ -1433,9 +1433,11 @@ means to use always cached values for the directory contents."
1433;;; Internal Variables: 1433;;; Internal Variables:
1434 1434
1435(defvar tramp-end-of-output 1435(defvar tramp-end-of-output
1436 (concat 1436 (format
1437 "///" (md5 (concat 1437 "%s///%s%s"
1438 (prin1-to-string process-environment) (current-time-string)))) 1438 tramp-rsh-end-of-line
1439 (md5 (concat (prin1-to-string process-environment) (current-time-string)))
1440 tramp-rsh-end-of-line)
1439 "String used to recognize end of output.") 1441 "String used to recognize end of output.")
1440 1442
1441(defvar tramp-current-method nil 1443(defvar tramp-current-method nil
@@ -5360,22 +5362,14 @@ file exists and nonzero exit status otherwise."
5360 vec 5362 vec
5361 (format "PROMPT_COMMAND='' PS1='$ ' PS2='' PS3='' exec %s" shell) 5363 (format "PROMPT_COMMAND='' PS1='$ ' PS2='' PS3='' exec %s" shell)
5362 t)) 5364 t))
5365 ;; Setting prompts.
5363 (tramp-message vec 5 "Setting remote shell prompt...") 5366 (tramp-message vec 5 "Setting remote shell prompt...")
5364 ;; Douglas Gray Stephens <DGrayStephens@slb.com> says that we 5367 (tramp-send-command vec (format "PS1='%s'" tramp-end-of-output) t)
5365 ;; must use "\n" here, not tramp-rsh-end-of-line. Kai left the
5366 ;; last tramp-rsh-end-of-line, Douglas wanted to replace that,
5367 ;; as well.
5368 (tramp-send-command
5369 vec
5370 (format "PS1='%s%s%s'"
5371 tramp-rsh-end-of-line
5372 tramp-end-of-output
5373 tramp-rsh-end-of-line)
5374 t)
5375 (tramp-send-command vec "PS2=''" t) 5368 (tramp-send-command vec "PS2=''" t)
5376 (tramp-send-command vec "PS3=''" t) 5369 (tramp-send-command vec "PS3=''" t)
5377 (tramp-send-command vec "PROMPT_COMMAND=''" t) 5370 (tramp-send-command vec "PROMPT_COMMAND=''" t)
5378 (tramp-message vec 5 "Setting remote shell prompt...done")) 5371 (tramp-message vec 5 "Setting remote shell prompt...done"))
5372
5379 (t (tramp-message 5373 (t (tramp-message
5380 vec 5 "Remote `%s' groks tilde expansion, good" 5374 vec 5 "Remote `%s' groks tilde expansion, good"
5381 (tramp-get-method-parameter 5375 (tramp-get-method-parameter
@@ -5668,13 +5662,7 @@ process to set up. VEC specifies the connection."
5668 ;; We can set $PS1 to `tramp-end-of-output' only when the echo has 5662 ;; We can set $PS1 to `tramp-end-of-output' only when the echo has
5669 ;; been disabled. Otherwise, the echo of the command would be 5663 ;; been disabled. Otherwise, the echo of the command would be
5670 ;; regarded as prompt already. 5664 ;; regarded as prompt already.
5671 (tramp-send-command 5665 (tramp-send-command vec (format "PS1='%s'" tramp-end-of-output) t)
5672 vec
5673 (format "PS1='%s%s%s'"
5674 tramp-rsh-end-of-line
5675 tramp-end-of-output
5676 tramp-rsh-end-of-line)
5677 t)
5678 (tramp-send-command vec "PS2=''" t) 5666 (tramp-send-command vec "PS2=''" t)
5679 (tramp-send-command vec "PS3=''" t) 5667 (tramp-send-command vec "PS3=''" t)
5680 (tramp-send-command vec "PROMPT_COMMAND=''" t) 5668 (tramp-send-command vec "PROMPT_COMMAND=''" t)
@@ -6249,7 +6237,11 @@ function waits for output unless NOOUTPUT is set."
6249 (with-current-buffer (process-buffer proc) 6237 (with-current-buffer (process-buffer proc)
6250 ;; Initially, `tramp-end-of-output' is "$ ". There might be 6238 ;; Initially, `tramp-end-of-output' is "$ ". There might be
6251 ;; leading escape sequences, which must be ignored. 6239 ;; leading escape sequences, which must be ignored.
6252 (let* ((regexp (format "^[^$\n]*%s\r?$" (regexp-quote tramp-end-of-output))) 6240 (let* ((regexp
6241 (if (string-match (regexp-quote "\n") tramp-end-of-output)
6242 (mapconcat
6243 'identity (split-string tramp-end-of-output "\n") "\r?\n")
6244 (format "^[^$\n]*%s\r?$" (regexp-quote tramp-end-of-output))))
6253 (found (tramp-wait-for-regexp proc timeout regexp))) 6245 (found (tramp-wait-for-regexp proc timeout regexp)))
6254 (if found 6246 (if found
6255 (let (buffer-read-only) 6247 (let (buffer-read-only)
@@ -6737,7 +6729,14 @@ necessary only. This function will be used in file name completion."
6737 (and 6729 (and
6738 (stringp host) 6730 (stringp host)
6739 (string-match 6731 (string-match
6740 (concat "^" (regexp-opt (list "localhost" (system-name)) t) "$") host)))) 6732 (concat "^" (regexp-opt (list "localhost" (system-name)) t) "$") host)
6733 ;; The local temp directory must be writable for the other user.
6734 (file-writable-p
6735 (tramp-make-tramp-file-name
6736 (tramp-file-name-method vec)
6737 (tramp-file-name-user vec)
6738 host
6739 (tramp-compat-temporary-file-directory))))))
6741 6740
6742;; Variables local to connection. 6741;; Variables local to connection.
6743 6742
@@ -6833,8 +6832,7 @@ necessary only. This function will be used in file name completion."
6833 vec (format "( %s / -nt / )" (tramp-get-test-command vec))) 6832 vec (format "( %s / -nt / )" (tramp-get-test-command vec)))
6834 (with-current-buffer (tramp-get-buffer vec) 6833 (with-current-buffer (tramp-get-buffer vec)
6835 (goto-char (point-min)) 6834 (goto-char (point-min))
6836 (when (looking-at 6835 (when (looking-at (regexp-quote tramp-end-of-output))
6837 (format "\n%s\r?\n" (regexp-quote tramp-end-of-output)))
6838 (format "%s %%s -nt %%s" (tramp-get-test-command vec))))) 6836 (format "%s %%s -nt %%s" (tramp-get-test-command vec)))))
6839 (progn 6837 (progn
6840 (tramp-send-command 6838 (tramp-send-command