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:03:22 -0400 Message-ID: <87y6qvxl4l.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 1247329107 7771 80.91.229.12 (11 Jul 2009 16:18:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 11 Jul 2009 16:18:27 +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:18:19 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 1MPfHF-0003Mn-Tj for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Jul 2009 18:18:18 +0200 Original-Received: from localhost ([127.0.0.1]:48304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MPfHF-000110-18 for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Jul 2009 12:18:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MPfGZ-0000U0-SJ for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2009 12:17:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MPfGV-0000P3-19 for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2009 12:17:35 -0400 Original-Received: from [199.232.76.173] (port=32786 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MPfGU-0000Ox-TC for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2009 12:17:30 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:36504) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MPfGU-0001iz-Ey for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2009 12:17: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 n6BGHR2r021155; Sat, 11 Jul 2009 09:17:27 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n6BGA5AC019794; Sat, 11 Jul 2009 09:10:05 -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:10:05 +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.124732821618222 (code B ref 3494); Sat, 11 Jul 2009 16:10:05 +0000 Original-Received: (at 3494) by emacsbugs.donarmstrong.com; 11 Jul 2009 16:03:36 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from pantheon-po26.its.yale.edu (pantheon-po26.its.yale.edu [130.132.50.121]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6BG3VO3018216 for <3494@emacsbugs.donarmstrong.com>; Sat, 11 Jul 2009 09:03:32 -0700 Original-Received: from furry (COMPTON-FOUR-FORTY-EIGHT.MIT.EDU [18.109.6.193]) (authenticated bits=0) by pantheon-po26.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id n6BG3NeD006966 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 11 Jul 2009 12:03:24 -0400 Original-Received: by furry (Postfix, from userid 1000) id 35235C09B; Sat, 11 Jul 2009 12:03:23 -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:17:35 -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:29328 Archived-At: Does the following patch fix the problem? diff -c /home/cyd/emacs/lisp/simple.el.\~1.988.\~ /home/cyd/emacs/lisp/simple.el *** emacs/lisp/simple.el.~1.988.~ 2009-06-21 00:37:46.000000000 -0400 --- emacs/lisp/simple.el 2009-07-11 11:58:55.000000000 -0400 *************** *** 3956,3966 **** (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 "Non-nil means \\[next-line] and \\[previous-line] ignore invisible lines. --- 3956,3967 ---- (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 "Non-nil means \\[next-line] and \\[previous-line] ignore invisible lines. *************** *** 4061,4075 **** 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) --- 4062,4084 ---- x) ;; Reset temporary-goal-column, unless the previous command was a ;; line-motion command or we were called from some other command. ! (if (and (consp temporary-goal-column) ! (memq last-command `(next-line previous-line ,this-command))) ! ;; Check window-hscroll ! (if (/= (window-hscroll) (cdr temporary-goal-column)) ! (set-window-hscroll nil (cdr temporary-goal-column))) (cond ((eq (nth 1 posn) 'right-fringe) ; overflow-newline-into-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))) --- 4100,4108 ---- (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))) Diff finished. Sat Jul 11 11:58:57 2009