diff options
| author | Michael Albinus | 2008-05-14 19:55:11 +0000 |
|---|---|---|
| committer | Michael Albinus | 2008-05-14 19:55:11 +0000 |
| commit | 674da0287d0d10ff0eade18bf5bec2ffb8ce3dfa (patch) | |
| tree | 2b93c3b62406db33c70d05dbb3c74b26db4d1c53 | |
| parent | 192350af69a3e439251af2520cd0626689edeadc (diff) | |
| download | emacs-674da0287d0d10ff0eade18bf5bec2ffb8ce3dfa.tar.gz emacs-674da0287d0d10ff0eade18bf5bec2ffb8ce3dfa.zip | |
* net/tramp.el (tramp-echo-mark): Update docstring.
(tramp-echo-mark-marker): New defconst.
(tramp-check-for-regexp): Use it.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 19 |
2 files changed, 20 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 21fc108c895..379f2731ac5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2008-05-14 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp.el (tramp-echo-mark): Update docstring. | ||
| 4 | (tramp-echo-mark-marker): New defconst. | ||
| 5 | (tramp-check-for-regexp): Use it. | ||
| 6 | |||
| 1 | 2008-05-14 Eric S. Raymond <esr@snark.thyrsus.com> | 7 | 2008-05-14 Eric S. Raymond <esr@snark.thyrsus.com> |
| 2 | 8 | ||
| 3 | * vc.el (vc-deduce-fileset): Do the right thing when visting a | 9 | * vc.el (vc-deduce-fileset): Do the right thing when visting a |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 145cbb18581..9894c27a839 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -858,15 +858,18 @@ the info pages.") | |||
| 858 | (tramp-set-completion-function | 858 | (tramp-set-completion-function |
| 859 | "fcp" tramp-completion-function-alist-ssh))) | 859 | "fcp" tramp-completion-function-alist-ssh))) |
| 860 | 860 | ||
| 861 | (defconst tramp-echo-mark-marker "_echo" | ||
| 862 | "String marker to surround echoed commands.") | ||
| 863 | |||
| 861 | (defconst tramp-echo-mark "_echo\b\b\b\b\b" | 864 | (defconst tramp-echo-mark "_echo\b\b\b\b\b" |
| 862 | "String mark to be transmitted around shell commands. | 865 | "String mark to be transmitted around shell commands. |
| 863 | Used to separate their echo from the output they produce. This | 866 | Used to separate their echo from the output they produce. This |
| 864 | will only be used if we cannot disable remote echo via stty. | 867 | will only be used if we cannot disable remote echo via stty. |
| 865 | This string must have no effect on the remote shell except for | 868 | This string must have no effect on the remote shell except for |
| 866 | producing some echo which can later be detected by | 869 | producing some echo which can later be detected by |
| 867 | `tramp-echoed-echo-mark-regexp'. Using some characters followed | 870 | `tramp-echoed-echo-mark-regexp'. Using `tramp-echo-mark-marker', |
| 868 | by an equal number of backspaces to erase them will usually | 871 | followed by an equal number of backspaces to erase them will |
| 869 | suffice.") | 872 | usually suffice.") |
| 870 | 873 | ||
| 871 | (defconst tramp-echoed-echo-mark-regexp "_echo\\(\b\\( \b\\)?\\)\\{5\\}" | 874 | (defconst tramp-echoed-echo-mark-regexp "_echo\\(\b\\( \b\\)?\\)\\{5\\}" |
| 872 | "Regexp which matches `tramp-echo-mark' as it gets echoed by | 875 | "Regexp which matches `tramp-echo-mark' as it gets echoed by |
| @@ -5644,6 +5647,7 @@ for process communication also." | |||
| 5644 | Erase echoed commands if exists." | 5647 | Erase echoed commands if exists." |
| 5645 | (with-current-buffer (process-buffer proc) | 5648 | (with-current-buffer (process-buffer proc) |
| 5646 | (goto-char (point-min)) | 5649 | (goto-char (point-min)) |
| 5650 | |||
| 5647 | ;; Check whether we need to remove echo output. | 5651 | ;; Check whether we need to remove echo output. |
| 5648 | (when (and (tramp-get-connection-property proc "check-remote-echo" nil) | 5652 | (when (and (tramp-get-connection-property proc "check-remote-echo" nil) |
| 5649 | (re-search-forward tramp-echoed-echo-mark-regexp nil t)) | 5653 | (re-search-forward tramp-echoed-echo-mark-regexp nil t)) |
| @@ -5655,8 +5659,13 @@ Erase echoed commands if exists." | |||
| 5655 | (forward-line) | 5659 | (forward-line) |
| 5656 | (delete-region begin (point)) | 5660 | (delete-region begin (point)) |
| 5657 | (goto-char (point-min))))) | 5661 | (goto-char (point-min))))) |
| 5658 | ;; No echo to be handled, now we can look for the regexp. | 5662 | |
| 5659 | (when (not (tramp-get-connection-property proc "check-remote-echo" nil)) | 5663 | (when (or |
| 5664 | ;; No echo to be handled, now we can look for the regexp. | ||
| 5665 | (not (tramp-get-connection-property proc "check-remote-echo" nil)) | ||
| 5666 | ;; Sometimes the echo is invisible. | ||
| 5667 | (not (re-search-forward tramp-echo-mark-marker nil t))) | ||
| 5668 | (goto-char (point-min)) | ||
| 5660 | (re-search-forward regexp nil t)))) | 5669 | (re-search-forward regexp nil t)))) |
| 5661 | 5670 | ||
| 5662 | (defun tramp-wait-for-regexp (proc timeout regexp) | 5671 | (defun tramp-wait-for-regexp (proc timeout regexp) |