From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.bugs Subject: Re: term.el (term-emulate-terminal) Date: Sun, 14 Apr 2002 10:17:35 +0900 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <41d773e1-833c-4052-9c08-840c211eeb8f@deisui.org> References: <87k7rb3ee1.fsf@mumon.localnet> <8962-Sat13Apr2002183653+0300-eliz@is.elta.co.il> <7fea2bbd-6176-4969-88ea-fa458a704344@deisui.org> <87elhj2zs3.fsf@mumon.localnet> <878z7r2ve0.fsf@mumon.localnet> <87u1qf1czm.fsf@mumon.localnet> <87ofgn1b8r.fsf@mumon.localnet> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1018747088 14458 127.0.0.1 (14 Apr 2002 01:18:08 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 14 Apr 2002 01:18:08 +0000 (UTC) Cc: Eli Zaretskii , bug-gnu-emacs@gnu.org Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16wYee-0003l5-00 for ; Sun, 14 Apr 2002 03:18:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16wYeg-0005FE-00; Sat, 13 Apr 2002 21:18:10 -0400 Original-Received: from g96069.scn-net.ne.jp ([210.231.96.69] helo=deisui.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16wYcT-0005Bv-00 for ; Sat, 13 Apr 2002 21:15:53 -0400 Original-Received: from deisui.org (localhost [127.0.0.1]) by deisui.org (8.12.3/8.12.3/Debian -2) with ESMTP id g3E1HZem019519; Sun, 14 Apr 2002 10:17:35 +0900 X-Now-Playing: Qururi's _TEAM ROCK_: "Bara no hana" Original-To: Harry Kuiper X-Face: ki?-"~Ovqy(#SEZ2FpdUK,3>)p.@}$.vl{eIZ-Uy43$&[S1#'y{hX&A3T@xA)u0!_4Lg.vA ^{d(.VU0(X#Zf,~9Kha_$nl7W/(b9r;]%_&:OUA@g0LF'S2<%~T In-Reply-To: <87ofgn1b8r.fsf@mumon.localnet> (Harry Kuiper's message of "14 Apr 2002 00:31:48 +0200") Original-Lines: 43 Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:652 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:652 >>>>> In <87ofgn1b8r.fsf@mumon.localnet> >>>>> Harry Kuiper 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