bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: term.el (term-emulate-terminal)


From: Daiki Ueno
Subject: Re: term.el (term-emulate-terminal)
Date: Sun, 14 Apr 2002 10:17:35 +0900

>>>>> In <address@hidden> 
>>>>>   Harry Kuiper <address@hidden> wrote:

> However the version below (eterm.el.hk) works OK for me.  The
> difference is in the way the position to resume processing is
> determined after the \032 escape is handled.

Your patch will work fine when there is no "\r" in str, but otherwise it
will be splitted up before "\n".

But well, I probably found the cause.  The match-data tends to be lost
during executing term-command-hook.  Therefore what I think the proper
fix is below:

Index: term.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term.el,v
retrieving revision 1.46
diff -u -F^( -r1.46 term.el
--- term.el     3 Feb 2002 11:25:23 -0000       1.46
+++ term.el     14 Apr 2002 00:56:23 -0000
@@ -2827,11 +2827,11 @@ (defun term-emulate-terminal (proc str)
                           ((eq char ?\^G)
                            (beep t)) ; Bell
                           ((eq char ?\032)
-                           (let ((end (string-match "\r?$" str i)))
+                           (let ((end (string-match "\r?\n" str i)))
                              (if end
-                                 (progn (funcall term-command-hook
-                                                 (substring str (1+ i) end))
-                                        (setq i (match-end 0)))
+                                 (funcall term-command-hook
+                                          (prog1 (substring str (1+ i) end)
+                                             (setq i (match-end 0))))
                                (setq term-terminal-parameter
                                      (substring str i))
                                (setq term-terminal-state 4)

Could you please try this one?

Regards,
-- 
Daiki Ueno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]