From: Chong Yidong Date: Sun, 24 Sep 2006 21:58:12 +0000 (+0000) Subject: * simple.el (line-move-finish): Handle corner case for fields in X-Git-Tag: emacs-pretest-22.0.90~353 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=963355a469eb4b352fe605d12143fec86ec4d3fd;p=emacs.git * simple.el (line-move-finish): Handle corner case for fields in continued lines. (line-move-1): Remove flawed test for that case. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b96270b6bf9..2d996f842fb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2006-09-24 Chong Yidong + + * simple.el (line-move-finish): Handle corner case for fields in + continued lines. + (line-move-1): Remove flawed test for that case. + 2006-09-24 Ken Manheimer * icomplete.el (icomplete-simple-completing-p): Use the correct diff --git a/lisp/simple.el b/lisp/simple.el index b2d7ff29257..16670d4f70b 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3604,15 +3604,6 @@ Outline mode sets this." (let ((inhibit-field-text-motion t)) (setq line-end (line-end-position))) (goto-char (constrain-to-field line-end (point) t t)) - ;; When moving a single line, update the goal-column - ;; if we couldn't move to the end of line due to a - ;; field boundary. Otherwise we'll get stuck at the - ;; original position during the column motion in - ;; line-move-finish. - (and (/= line-end (point)) - (= orig-arg 1) - (setq temporary-goal-column - (max temporary-goal-column (current-column)))) ;; If there's no invisibility here, move over the newline. (cond ((eobp) @@ -3679,6 +3670,7 @@ Outline mode sets this." (setq repeat nil) (let (new + (old (point)) (line-beg (save-excursion (beginning-of-line) (point))) (line-end ;; Compute the end of the line @@ -3693,6 +3685,17 @@ Outline mode sets this." ;; Move to the desired column. (line-move-to-column column) + + ;; Corner case: suppose we start out in a field boundary in + ;; the middle of a continued line. When we get to + ;; line-move-finish, point is at the start of a new *screen* + ;; line but the same text line; then line-move-to-column would + ;; move us backwards. Test using C-n with point on the "x" in + ;; (insert "a" (propertize "x" 'field t) (make-string 89 ?y)) + (and forward + (< (point) old) + (goto-char old)) + (setq new (point)) ;; Process intangibility within a line.