diff options
| author | Chong Yidong | 2006-09-19 21:34:01 +0000 |
|---|---|---|
| committer | Chong Yidong | 2006-09-19 21:34:01 +0000 |
| commit | fef11f1549c7eb79892c09b096d8edb11656c9ae (patch) | |
| tree | 1f5e8074bedf8514dfb96d2a4fedfa805a1c47b3 | |
| parent | e9ae308cb4b9eb12cf587e8e810fc25a455987a1 (diff) | |
| download | emacs-fef11f1549c7eb79892c09b096d8edb11656c9ae.tar.gz emacs-fef11f1549c7eb79892c09b096d8edb11656c9ae.zip | |
* simple.el (line-move-1): Escape field boundaries occurring
exactly at point. Update goal column if constrained to a field.
(line-move-finish): Escape field boundaries occurring exactly at
point.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/simple.el | 25 |
2 files changed, 26 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e1272eae91e..977660407b8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2006-09-19 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * simple.el (line-move-1): Escape field boundaries occurring | ||
| 4 | exactly at point. Update goal column if constrained to a field. | ||
| 5 | (line-move-finish): Escape field boundaries occurring exactly at | ||
| 6 | point. | ||
| 7 | |||
| 1 | 2006-09-19 Stefan Monnier <monnier@iro.umontreal.ca> | 8 | 2006-09-19 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 9 | ||
| 3 | * mouse.el (mouse-on-link-p): Tentatively fix last change. | 10 | * mouse.el (mouse-on-link-p): Tentatively fix last change. |
diff --git a/lisp/simple.el b/lisp/simple.el index 5a30471ca49..8f954c281a1 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -3561,7 +3561,7 @@ Outline mode sets this." | |||
| 3561 | ;; for intermediate positions. | 3561 | ;; for intermediate positions. |
| 3562 | (let ((inhibit-point-motion-hooks t) | 3562 | (let ((inhibit-point-motion-hooks t) |
| 3563 | (opoint (point)) | 3563 | (opoint (point)) |
| 3564 | (forward (> arg 0))) | 3564 | (orig-arg arg)) |
| 3565 | (unwind-protect | 3565 | (unwind-protect |
| 3566 | (progn | 3566 | (progn |
| 3567 | (if (not (memq last-command '(next-line previous-line))) | 3567 | (if (not (memq last-command '(next-line previous-line))) |
| @@ -3594,14 +3594,27 @@ Outline mode sets this." | |||
| 3594 | 'end-of-buffer) | 3594 | 'end-of-buffer) |
| 3595 | nil))) | 3595 | nil))) |
| 3596 | ;; Move by arg lines, but ignore invisible ones. | 3596 | ;; Move by arg lines, but ignore invisible ones. |
| 3597 | (let (done) | 3597 | (let (done line-end) |
| 3598 | (while (and (> arg 0) (not done)) | 3598 | (while (and (> arg 0) (not done)) |
| 3599 | ;; If the following character is currently invisible, | 3599 | ;; If the following character is currently invisible, |
| 3600 | ;; skip all characters with that same `invisible' property value. | 3600 | ;; skip all characters with that same `invisible' property value. |
| 3601 | (while (and (not (eobp)) (line-move-invisible-p (point))) | 3601 | (while (and (not (eobp)) (line-move-invisible-p (point))) |
| 3602 | (goto-char (next-char-property-change (point)))) | 3602 | (goto-char (next-char-property-change (point)))) |
| 3603 | ;; Now move a line. | 3603 | ;; Move a line. |
| 3604 | (end-of-line) | 3604 | ;; We don't use `end-of-line', since we want to escape |
| 3605 | ;; from field boundaries ocurring exactly at point. | ||
| 3606 | (let ((inhibit-field-text-motion t)) | ||
| 3607 | (setq line-end (line-end-position))) | ||
| 3608 | (goto-char (constrain-to-field line-end (point) t t)) | ||
| 3609 | ;; When moving a single line, update the goal-column | ||
| 3610 | ;; if we couldn't move to the end of line due to a | ||
| 3611 | ;; field boundary. Otherwise we'll get stuck at the | ||
| 3612 | ;; original position during the column motion in | ||
| 3613 | ;; line-move-finish. | ||
| 3614 | (and (/= line-end (point)) | ||
| 3615 | (= orig-arg 1) | ||
| 3616 | (setq temporary-goal-column | ||
| 3617 | (max temporary-goal-column (current-column)))) | ||
| 3605 | ;; If there's no invisibility here, move over the newline. | 3618 | ;; If there's no invisibility here, move over the newline. |
| 3606 | (cond | 3619 | (cond |
| 3607 | ((eobp) | 3620 | ((eobp) |
| @@ -3659,7 +3672,7 @@ Outline mode sets this." | |||
| 3659 | (beginning-of-line)) | 3672 | (beginning-of-line)) |
| 3660 | (t | 3673 | (t |
| 3661 | (line-move-finish (or goal-column temporary-goal-column) | 3674 | (line-move-finish (or goal-column temporary-goal-column) |
| 3662 | opoint forward)))))) | 3675 | opoint (> orig-arg 0))))))) |
| 3663 | 3676 | ||
| 3664 | (defun line-move-finish (column opoint forward) | 3677 | (defun line-move-finish (column opoint forward) |
| 3665 | (let ((repeat t)) | 3678 | (let ((repeat t)) |
| @@ -3721,7 +3734,7 @@ Outline mode sets this." | |||
| 3721 | (goto-char opoint) | 3734 | (goto-char opoint) |
| 3722 | (let ((inhibit-point-motion-hooks nil)) | 3735 | (let ((inhibit-point-motion-hooks nil)) |
| 3723 | (goto-char | 3736 | (goto-char |
| 3724 | (constrain-to-field new opoint nil t | 3737 | (constrain-to-field new opoint t t |
| 3725 | 'inhibit-line-move-field-capture))) | 3738 | 'inhibit-line-move-field-capture))) |
| 3726 | 3739 | ||
| 3727 | ;; If all this moved us to a different line, | 3740 | ;; If all this moved us to a different line, |