From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] trivial patch, jumping cursor in term Date: Wed, 23 Sep 2009 18:41:20 -0700 (PDT) Message-ID: <200909240141.n8O1fKOc003383@godzilla.ics.uci.edu> References: <86d45hhia4.fsf@kanis.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1253756606 7893 80.91.229.12 (24 Sep 2009 01:43:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Sep 2009 01:43:26 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ivan Kanis Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 24 03:43:19 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MqdMc-000420-Mq for ged-emacs-devel@m.gmane.org; Thu, 24 Sep 2009 03:43:18 +0200 Original-Received: from localhost ([127.0.0.1]:60253 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqdMb-0006S1-Td for ged-emacs-devel@m.gmane.org; Wed, 23 Sep 2009 21:43:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqdMW-0006QO-AZ for emacs-devel@gnu.org; Wed, 23 Sep 2009 21:43:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqdMQ-0006Mv-LG for emacs-devel@gnu.org; Wed, 23 Sep 2009 21:43:11 -0400 Original-Received: from [199.232.76.173] (port=40516 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqdMQ-0006Mk-HT for emacs-devel@gnu.org; Wed, 23 Sep 2009 21:43:06 -0400 Original-Received: from sallyv2.ics.uci.edu ([128.195.1.120]:55083) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1MqdMP-00066f-V7 for emacs-devel@gnu.org; Wed, 23 Sep 2009 21:43:06 -0400 Original-Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by sallyv2.ics.uci.edu (8.13.8+Sun/8.13.8) with ESMTP id n8O1fKVQ006674; Wed, 23 Sep 2009 18:41:20 -0700 (PDT) Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n8O1fKOc003383; Wed, 23 Sep 2009 18:41:20 -0700 (PDT) In-Reply-To: <86d45hhia4.fsf@kanis.fr> (Ivan Kanis's message of "Wed, 23 Sep 2009 16:01:23 +0200") Original-Lines: 79 X-ICS-MailScanner-Information: Please contact the ISP for more information X-ICS-MailScanner-ID: n8O1fKVQ006674 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115569 Archived-At: Ivan Kanis writes: > Hello Dan, > > Here are the steps to reproduce the bug: > > M-x term > C-x 2 > Input a character I can't reproduce this. Can you please file a bug, including the patch, with a step description on how to reproduce this starting from emacs -Q? (making sure things like this work correctly is non-trivial, and I might not get to it soon). If you can do the same in an "xterm" and point what M-x term does different than "xterm", that would help a lot. > You'll see the cursor move to the top left when it shouldn't. I have > tracked the problem to the following call stack. > > term-emulate-terminal > term-check-size > term-set-scroll-region > term-set-scroll-region > > The cursor should move when receiving ESC [ R, so I've added a parameter Why? > to term-set-scroll-region which will move the cursor if set to t. > Could you, please, apply the patch? > > Kind regards, > -- > Ivan > Kanis http://kanis.fr > > Think like a man of action, act like a man of thought. > -- Henry Bergson Please include a changeLog with the patch, to make it easier to understand. > > diff -r b9b27a5565ff lisp/misc/term.el > --- a/lisp/misc/term.el Wed Sep 23 15:50:43 2009 +0200 > +++ b/lisp/misc/term.el Wed Sep 23 15:52:10 2009 +0200 > @@ -3377,10 +3377,11 @@ > ((eq char ?r) > (term-set-scroll-region > (1- term-terminal-previous-parameter) > - (1- term-terminal-parameter))) > + (1- term-terminal-parameter) > + t)) > (t))) > > -(defun term-set-scroll-region (top bottom) > +(defun term-set-scroll-region (top bottom &optional esc-bracket-r) ^^^^^^^^^^^^^ This should be called move-point or similar. > "Set scrolling region. > TOP is the top-most line (inclusive) of the new scrolling region, > while BOTTOM is the line following the new scrolling region (e.g. exclusive). > @@ -3398,7 +3399,8 @@ > (not (and (= term-scroll-start 0) > (= term-scroll-end term-height))))) > (term-move-columns (- (term-current-column))) > - (term-goto 0 0)) > + (if esc-bracket-r > + (term-goto 0 0))) > > ;; (defun term-switch-to-alternate-sub-buffer (set) > ;; ;; If asked to switch to (from) the alternate sub-buffer, and already (not)