From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] trivial patch, jumping cursor in term Date: Wed, 23 Sep 2009 22:15:22 -0400 Message-ID: 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 1253758591 12108 80.91.229.12 (24 Sep 2009 02:16:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Sep 2009 02:16:31 +0000 (UTC) Cc: dann@ics.uci.edu, emacs-devel@gnu.org To: Ivan Kanis Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 24 04:16:23 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 1Mqdsc-0004Rx-Mp for ged-emacs-devel@m.gmane.org; Thu, 24 Sep 2009 04:16:23 +0200 Original-Received: from localhost ([127.0.0.1]:43282 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mqdsc-0000DD-2G for ged-emacs-devel@m.gmane.org; Wed, 23 Sep 2009 22:16:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mqdrk-0008BM-LI for emacs-devel@gnu.org; Wed, 23 Sep 2009 22:15:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mqdrg-00089j-3w for emacs-devel@gnu.org; Wed, 23 Sep 2009 22:15:28 -0400 Original-Received: from [199.232.76.173] (port=40488 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mqdrf-00089e-QA for emacs-devel@gnu.org; Wed, 23 Sep 2009 22:15:23 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:58761 helo=ironport2-out.pppoe.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mqdrf-0001nn-Id for emacs-devel@gnu.org; Wed, 23 Sep 2009 22:15:23 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar4EAANzukpFpYEz/2dsb2JhbACBUdRehBsFh34 X-IronPort-AV: E=Sophos;i="4.44,442,1249272000"; d="scan'208";a="46462824" Original-Received: from 69-165-129-51.dsl.teksavvy.com (HELO pastel.home) ([69.165.129.51]) by ironport2-out.pppoe.ca with ESMTP; 23 Sep 2009 22:15:22 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 1E9C8807A; Wed, 23 Sep 2009 22:15:22 -0400 (EDT) In-Reply-To: <86d45hhia4.fsf@kanis.fr> (Ivan Kanis's message of "Wed, 23 Sep 2009 16:01:23 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:115570 Archived-At: >>>>> "Ivan" == Ivan Kanis writes: > Hello Dan, > Here are the steps to reproduce the bug: > M-x term > C-x 2 > Input a character The C-x 2 doesn't do anything here, so I don't know how to reproduce your problem. > 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 > to term-set-scroll-region which will move the cursor if set to t. > Could you, please, apply the patch? I've installed the patch below instead. Can you confirm it works as well? Stefan --- term.el.~1.120.~ 2009-09-23 22:02:59.000000000 -0400 +++ term.el 2009-09-23 22:09:37.000000000 -0400 @@ -3369,7 +3369,8 @@ ((eq char ?r) (term-set-scroll-region (1- term-terminal-previous-parameter) - (1- term-terminal-parameter))) + (1- term-terminal-parameter)) + (term-goto 0 0)) (t))) (defun term-set-scroll-region (top bottom) @@ -3389,8 +3390,7 @@ (or (term-using-alternate-sub-buffer) (not (and (= term-scroll-start 0) (= term-scroll-end term-height))))) - (term-move-columns (- (term-current-column))) - (term-goto 0 0)) + (term-move-columns (- (term-current-column)))) ;; (defun term-switch-to-alternate-sub-buffer (set) ;; ;; If asked to switch to (from) the alternate sub-buffer, and already (not)