From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Kanis Newsgroups: gmane.emacs.devel Subject: [PATCH] trivial patch, jumping cursor in term Date: Wed, 23 Sep 2009 16:01:23 +0200 Message-ID: <86d45hhia4.fsf@kanis.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1253716124 8735 80.91.229.12 (23 Sep 2009 14:28:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Sep 2009 14:28:44 +0000 (UTC) Cc: emacs-devel@gnu.org To: dann@ics.uci.edu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 23 16:28:36 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 1MqSpe-0007oe-9z for ged-emacs-devel@m.gmane.org; Wed, 23 Sep 2009 16:28:34 +0200 Original-Received: from localhost ([127.0.0.1]:34362 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqSpd-00008m-Dj for ged-emacs-devel@m.gmane.org; Wed, 23 Sep 2009 10:28:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqSQ4-0002FM-CY for emacs-devel@gnu.org; Wed, 23 Sep 2009 10:02:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqSQ3-0002Eu-Ke for emacs-devel@gnu.org; Wed, 23 Sep 2009 10:02:08 -0400 Original-Received: from [199.232.76.173] (port=35502 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqSQ3-0002En-FU for emacs-devel@gnu.org; Wed, 23 Sep 2009 10:02:07 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:21850) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MqSQ2-0000no-Tn for emacs-devel@gnu.org; Wed, 23 Sep 2009 10:02:07 -0400 Original-Received: from kanis.fr ([75.127.73.245]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MqSQ2-00024q-32 for emacs-devel@gnu.org; Wed, 23 Sep 2009 10:02:06 -0400 Original-Received: from [89.83.137.164] (helo=tao) by kanis.fr with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1MqSPs-00079H-VJ; Wed, 23 Sep 2009 10:01:57 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by mx20.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Wed, 23 Sep 2009 10:28:25 -0400 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:115549 Archived-At: --=-=-= Hello Dan, Here are the steps to reproduce the bug: M-x term C-x 2 Input a character 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? Kind regards, -- Ivan Kanis http://kanis.fr Think like a man of action, act like a man of thought. -- Henry Bergson --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=term-cursor.patch 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) "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) --=-=-=--