aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2009-12-15 21:11:39 +0000
committerMichael Albinus2009-12-15 21:11:39 +0000
commit68712eb605d18afa6bbcc68bbd0183bd75d01ebc (patch)
tree67875e930956218ea0e00f9714e326e747e8401f
parentfa8e045a8a4cbf2463d3848a038e2863fb38c55c (diff)
downloademacs-68712eb605d18afa6bbcc68bbd0183bd75d01ebc.tar.gz
emacs-68712eb605d18afa6bbcc68bbd0183bd75d01ebc.zip
* net/tramp.el (tramp-echo-mark-marker-length): New defconst.
(tramp-echo-mark, tramp-echoed-echo-mark-regexp): Use it. (tramp-check-for-regexp): Check also, when an echoing shell stops to echo sent commands.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/net/tramp.el20
2 files changed, 24 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 671f792a4da..26ff5d4c7ce 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12009-12-15 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (tramp-echo-mark-marker-length): New defconst.
4 (tramp-echo-mark, tramp-echoed-echo-mark-regexp): Use it.
5 (tramp-check-for-regexp): Check also, when an echoing shell stops
6 to echo sent commands.
7
12009-12-14 Chong Yidong <cyd@stupidchicken.com> 82009-12-14 Chong Yidong <cyd@stupidchicken.com>
2 9
3 * Makefile.in: Revert last change (Bug#5191). 10 * Makefile.in: Revert last change (Bug#5191).
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 8bc010d29b2..6d3465c6a19 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -948,7 +948,12 @@ the info pages.")
948(defconst tramp-echo-mark-marker "_echo" 948(defconst tramp-echo-mark-marker "_echo"
949 "String marker to surround echoed commands.") 949 "String marker to surround echoed commands.")
950 950
951(defconst tramp-echo-mark "_echo\b\b\b\b\b" 951(defconst tramp-echo-mark-marker-length (length tramp-echo-mark-marker)
952 "String length of `tramp-echo-mark-marker'.")
953
954(defconst tramp-echo-mark
955 (concat tramp-echo-mark-marker
956 (make-string tramp-echo-mark-marker-length ?\b))
952 "String mark to be transmitted around shell commands. 957 "String mark to be transmitted around shell commands.
953Used to separate their echo from the output they produce. This 958Used to separate their echo from the output they produce. This
954will only be used if we cannot disable remote echo via stty. 959will only be used if we cannot disable remote echo via stty.
@@ -958,7 +963,9 @@ producing some echo which can later be detected by
958followed by an equal number of backspaces to erase them will 963followed by an equal number of backspaces to erase them will
959usually suffice.") 964usually suffice.")
960 965
961(defconst tramp-echoed-echo-mark-regexp "_echo\\(\b\\( \b\\)?\\)\\{5\\}" 966(defconst tramp-echoed-echo-mark-regexp
967 (format "%s\\(\b\\( \b\\)?\\)\\{%d\\}"
968 tramp-echo-mark-marker tramp-echo-mark-marker-length)
962 "Regexp which matches `tramp-echo-mark' as it gets echoed by 969 "Regexp which matches `tramp-echo-mark' as it gets echoed by
963the remote shell.") 970the remote shell.")
964 971
@@ -6562,7 +6569,14 @@ Erase echoed commands if exists."
6562 (delete-region begin (point)) 6569 (delete-region begin (point))
6563 (goto-char (point-min))))) 6570 (goto-char (point-min)))))
6564 6571
6565 (when (not (tramp-get-connection-property proc "check-remote-echo" nil)) 6572 (when (or (not (tramp-get-connection-property proc "check-remote-echo" nil))
6573 ;; Sometimes, the echo string is suppressed on the remote side.
6574 (not (string-equal
6575 (substring-no-properties
6576 tramp-echo-mark-marker
6577 0 (min tramp-echo-mark-marker-length (1- (point-max))))
6578 (buffer-substring-no-properties
6579 1 (min (1+ tramp-echo-mark-marker-length) (point-max))))))
6566 ;; No echo to be handled, now we can look for the regexp. 6580 ;; No echo to be handled, now we can look for the regexp.
6567 (goto-char (point-min)) 6581 (goto-char (point-min))
6568 (re-search-forward regexp nil t)))) 6582 (re-search-forward regexp nil t))))