diff options
| author | Michael Albinus | 2009-12-15 21:11:39 +0000 |
|---|---|---|
| committer | Michael Albinus | 2009-12-15 21:11:39 +0000 |
| commit | 68712eb605d18afa6bbcc68bbd0183bd75d01ebc (patch) | |
| tree | 67875e930956218ea0e00f9714e326e747e8401f /lisp | |
| parent | fa8e045a8a4cbf2463d3848a038e2863fb38c55c (diff) | |
| download | emacs-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.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 20 |
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 @@ | |||
| 1 | 2009-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 | |||
| 1 | 2009-12-14 Chong Yidong <cyd@stupidchicken.com> | 8 | 2009-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. |
| 953 | Used to separate their echo from the output they produce. This | 958 | Used to separate their echo from the output they produce. This |
| 954 | will only be used if we cannot disable remote echo via stty. | 959 | will only be used if we cannot disable remote echo via stty. |
| @@ -958,7 +963,9 @@ producing some echo which can later be detected by | |||
| 958 | followed by an equal number of backspaces to erase them will | 963 | followed by an equal number of backspaces to erase them will |
| 959 | usually suffice.") | 964 | usually 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 |
| 963 | the remote shell.") | 970 | the 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)))) |