From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#3494: 23.0.94; line-move-visual: temporary goal column confused by hscrolling Date: Sat, 11 Jul 2009 12:31:39 -0400 Message-ID: <87vdlzxjtg.fsf@stupidchicken.com> Reply-To: Chong Yidong , 3494@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1247330287 10639 80.91.229.12 (11 Jul 2009 16:38:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Jul 2009 16:38:07 +0000 (UTC) Cc: 3494@emacsbugs.donarmstrong.com, Kees Bakker , Teemu Likonen To: Johan =?UTF-8?Q?Bockg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 11 18:38:00 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MPfaJ-0001Lt-S5 for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Jul 2009 18:38:00 +0200 Original-Received: from localhost ([127.0.0.1]:41838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MPfaJ-0003FN-8A for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Jul 2009 12:37:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MPfZv-0002nY-Hj for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2009 12:37:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MPfZq-0002dd-Lt for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2009 12:37:34 -0400 Original-Received: from [199.232.76.173] (port=36230 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MPfZq-0002dN-9I for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2009 12:37:30 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:49216) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MPfZp-0004e0-MK for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2009 12:37:30 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6BGbRF1024142; Sat, 11 Jul 2009 09:37:28 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n6BGZ6j2023552; Sat, 11 Jul 2009 09:35:06 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Chong Yidong Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 11 Jul 2009 16:35:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3494 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3494-submit@emacsbugs.donarmstrong.com id=B3494.124732991223417 (code B ref 3494); Sat, 11 Jul 2009 16:35:06 +0000 Original-Received: (at 3494) by emacsbugs.donarmstrong.com; 11 Jul 2009 16:31:52 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from pantheon-po29.its.yale.edu (pantheon-po29.its.yale.edu [130.132.50.124]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6BGVlZc023412 for <3494@emacsbugs.donarmstrong.com>; Sat, 11 Jul 2009 09:31:48 -0700 Original-Received: from furry (DORRANCE-THREE-SEVENTY-NINE.MIT.EDU [18.55.6.124]) (authenticated bits=0) by pantheon-po29.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id n6BGVdWc012979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 11 Jul 2009 12:31:40 -0400 Original-Received: by furry (Postfix, from userid 1000) id D7C3CC09B; Sat, 11 Jul 2009 12:31:39 -0400 (EDT) X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sat, 11 Jul 2009 12:37:34 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:29330 Archived-At: Please test this patch instead of the one I previously sent (I'll install it on the trunk as well, for additional testing). *** emacs/lisp/simple.el.~1.988.~ 2009-06-21 00:37:46.000000000 -0400 --- emacs/lisp/simple.el 2009-07-11 12:30:05.000000000 -0400 *************** *** 3956,3965 **** (defvar temporary-goal-column 0 "Current goal column for vertical motion. It is the column where point was at the start of the current run ! of vertical motion commands. It is a floating point number when ! moving by visual lines via `line-move-visual'; this is the ! x-position, in pixels, divided by the default column width. When ! the `track-eol' feature is doing its job, the value is `most-positive-fixnum'.") (defcustom line-move-ignore-invisible t --- 3956,3969 ---- (defvar temporary-goal-column 0 "Current goal column for vertical motion. It is the column where point was at the start of the current run ! of vertical motion commands. ! ! When moving by visual lines via `line-move-visual', it is a cons ! cell (COL . HSCROLL), where COL is the x-position, in pixels, ! divided by the default column width, and HSCROLL is the number of ! columns by which window is scrolled from left margin. ! ! When the `track-eol' feature is doing its job, the value is `most-positive-fixnum'.") (defcustom line-move-ignore-invisible t *************** *** 4059,4075 **** (let ((posn (posn-at-point)) (opoint (point)) x) ! ;; Reset temporary-goal-column, unless the previous command was a ! ;; line-motion command or we were called from some other command. ! (unless (and (floatp temporary-goal-column) ! (memq last-command `(next-line previous-line ,this-command))) ! (cond ((eq (nth 1 posn) 'right-fringe) ; overflow-newline-into-fringe ! (setq temporary-goal-column (- (window-width) 1))) ! ((setq x (car (posn-x-y posn))) ! (setq temporary-goal-column (/ (float x) (frame-char-width)))))) ;; Move using `vertical-motion'. (or (and (= (vertical-motion ! (cons (or goal-column (truncate temporary-goal-column)) arg)) arg) (or (>= arg 0) (/= (point) opoint) --- 4063,4095 ---- (let ((posn (posn-at-point)) (opoint (point)) x) ! ;; Check if the previous command was a line-motion command or we ! ;; were called from some other command. ! (cond ((and (consp temporary-goal-column) ! (memq last-command `(next-line previous-line ,this-command))) ! ;; If so, there's no need to reset `temporary-goal-column', ! ;; unless the window hscroll has changed. ! (when (/= (window-hscroll) (cdr temporary-goal-column)) ! (set-window-hscroll nil 0) ! (setq temporary-goal-column ! (cons (+ (car temporary-goal-column) ! (cdr temporary-goal-column)) 0)))) ! ;; Otherwise, we should reset `temporary-goal-column'. ! ;; Handle the `overflow-newline-into-fringe' case: ! ((eq (nth 1 posn) 'right-fringe) ! (setq temporary-goal-column (cons (- (window-width) 1) ! (window-hscroll)))) ! ((setq x (car (posn-x-y posn))) ! (setq temporary-goal-column ! (cons (/ (float x) (frame-char-width)) ! (window-hscroll))))) ;; Move using `vertical-motion'. (or (and (= (vertical-motion ! (cons (or goal-column ! (if (consp temporary-goal-column) ! (truncate (car temporary-goal-column)) ! temporary-goal-column)) ! arg)) arg) (or (>= arg 0) (/= (point) opoint) *************** *** 4091,4098 **** (let ((inhibit-point-motion-hooks t) (opoint (point)) (orig-arg arg)) ! (if (floatp temporary-goal-column) ! (setq temporary-goal-column (truncate temporary-goal-column))) (unwind-protect (progn (if (not (memq last-command '(next-line previous-line))) --- 4111,4119 ---- (let ((inhibit-point-motion-hooks t) (opoint (point)) (orig-arg arg)) ! (if (consp temporary-goal-column) ! (setq temporary-goal-column (+ (car temporary-goal-column) ! (cdr temporary-goal-column)))) (unwind-protect (progn (if (not (memq last-command '(next-line previous-line)))