diff options
| author | Chong Yidong | 2006-09-24 21:58:12 +0000 |
|---|---|---|
| committer | Chong Yidong | 2006-09-24 21:58:12 +0000 |
| commit | 963355a469eb4b352fe605d12143fec86ec4d3fd (patch) | |
| tree | f240cc839b698489b3af7e5224a07ff2f4fed5f5 | |
| parent | 45c912f252fbfaa826f9a4174e592ae9f510aa20 (diff) | |
| download | emacs-963355a469eb4b352fe605d12143fec86ec4d3fd.tar.gz emacs-963355a469eb4b352fe605d12143fec86ec4d3fd.zip | |
* simple.el (line-move-finish): Handle corner case for fields in
continued lines.
(line-move-1): Remove flawed test for that case.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/simple.el | 21 |
2 files changed, 18 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b96270b6bf9..2d996f842fb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2006-09-24 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * simple.el (line-move-finish): Handle corner case for fields in | ||
| 4 | continued lines. | ||
| 5 | (line-move-1): Remove flawed test for that case. | ||
| 6 | |||
| 1 | 2006-09-24 Ken Manheimer <ken.manheimer@gmail.com> | 7 | 2006-09-24 Ken Manheimer <ken.manheimer@gmail.com> |
| 2 | 8 | ||
| 3 | * icomplete.el (icomplete-simple-completing-p): Use the correct | 9 | * 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." | |||
| 3604 | (let ((inhibit-field-text-motion t)) | 3604 | (let ((inhibit-field-text-motion t)) |
| 3605 | (setq line-end (line-end-position))) | 3605 | (setq line-end (line-end-position))) |
| 3606 | (goto-char (constrain-to-field line-end (point) t t)) | 3606 | (goto-char (constrain-to-field line-end (point) t t)) |
| 3607 | ;; When moving a single line, update the goal-column | ||
| 3608 | ;; if we couldn't move to the end of line due to a | ||
| 3609 | ;; field boundary. Otherwise we'll get stuck at the | ||
| 3610 | ;; original position during the column motion in | ||
| 3611 | ;; line-move-finish. | ||
| 3612 | (and (/= line-end (point)) | ||
| 3613 | (= orig-arg 1) | ||
| 3614 | (setq temporary-goal-column | ||
| 3615 | (max temporary-goal-column (current-column)))) | ||
| 3616 | ;; If there's no invisibility here, move over the newline. | 3607 | ;; If there's no invisibility here, move over the newline. |
| 3617 | (cond | 3608 | (cond |
| 3618 | ((eobp) | 3609 | ((eobp) |
| @@ -3679,6 +3670,7 @@ Outline mode sets this." | |||
| 3679 | (setq repeat nil) | 3670 | (setq repeat nil) |
| 3680 | 3671 | ||
| 3681 | (let (new | 3672 | (let (new |
| 3673 | (old (point)) | ||
| 3682 | (line-beg (save-excursion (beginning-of-line) (point))) | 3674 | (line-beg (save-excursion (beginning-of-line) (point))) |
| 3683 | (line-end | 3675 | (line-end |
| 3684 | ;; Compute the end of the line | 3676 | ;; Compute the end of the line |
| @@ -3693,6 +3685,17 @@ Outline mode sets this." | |||
| 3693 | 3685 | ||
| 3694 | ;; Move to the desired column. | 3686 | ;; Move to the desired column. |
| 3695 | (line-move-to-column column) | 3687 | (line-move-to-column column) |
| 3688 | |||
| 3689 | ;; Corner case: suppose we start out in a field boundary in | ||
| 3690 | ;; the middle of a continued line. When we get to | ||
| 3691 | ;; line-move-finish, point is at the start of a new *screen* | ||
| 3692 | ;; line but the same text line; then line-move-to-column would | ||
| 3693 | ;; move us backwards. Test using C-n with point on the "x" in | ||
| 3694 | ;; (insert "a" (propertize "x" 'field t) (make-string 89 ?y)) | ||
| 3695 | (and forward | ||
| 3696 | (< (point) old) | ||
| 3697 | (goto-char old)) | ||
| 3698 | |||
| 3696 | (setq new (point)) | 3699 | (setq new (point)) |
| 3697 | 3700 | ||
| 3698 | ;; Process intangibility within a line. | 3701 | ;; Process intangibility within a line. |