diff options
Diffstat (limited to 'lisp/simple.el')
| -rw-r--r-- | lisp/simple.el | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 204684a3d5b..86b3af702e4 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -3697,7 +3697,10 @@ because what we really need is for `move-to-column' | |||
| 3697 | and `current-column' to be able to ignore invisible text." | 3697 | and `current-column' to be able to ignore invisible text." |
| 3698 | (if (zerop col) | 3698 | (if (zerop col) |
| 3699 | (beginning-of-line) | 3699 | (beginning-of-line) |
| 3700 | (move-to-column col)) | 3700 | (let ((opoint (point))) |
| 3701 | (move-to-column col) | ||
| 3702 | ;; move-to-column doesn't respect field boundaries. | ||
| 3703 | (goto-char (constrain-to-field (point) opoint)))) | ||
| 3701 | 3704 | ||
| 3702 | (when (and line-move-ignore-invisible | 3705 | (when (and line-move-ignore-invisible |
| 3703 | (not (bolp)) (line-move-invisible-p (1- (point)))) | 3706 | (not (bolp)) (line-move-invisible-p (1- (point)))) |
| @@ -3767,7 +3770,8 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." | |||
| 3767 | (interactive "p") | 3770 | (interactive "p") |
| 3768 | (or arg (setq arg 1)) | 3771 | (or arg (setq arg 1)) |
| 3769 | 3772 | ||
| 3770 | (let ((orig (point))) | 3773 | (let ((orig (point)) |
| 3774 | start first-vis first-vis-field-value) | ||
| 3771 | 3775 | ||
| 3772 | ;; Move by lines, if ARG is not 1 (the default). | 3776 | ;; Move by lines, if ARG is not 1 (the default). |
| 3773 | (if (/= arg 1) | 3777 | (if (/= arg 1) |
| @@ -3778,10 +3782,24 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." | |||
| 3778 | (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) | 3782 | (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) |
| 3779 | (goto-char (previous-char-property-change (point))) | 3783 | (goto-char (previous-char-property-change (point))) |
| 3780 | (skip-chars-backward "^\n")) | 3784 | (skip-chars-backward "^\n")) |
| 3781 | 3785 | (setq start (point)) | |
| 3782 | ;; Take care of fields. | 3786 | |
| 3783 | (goto-char (constrain-to-field (point) orig | 3787 | ;; Now find first visible char in the line |
| 3784 | (/= arg 1) t nil)))) | 3788 | (while (and (not (eobp)) (line-move-invisible-p (point))) |
| 3789 | (goto-char (next-char-property-change (point)))) | ||
| 3790 | (setq first-vis (point)) | ||
| 3791 | |||
| 3792 | ;; See if fields would stop us from reaching FIRST-VIS. | ||
| 3793 | (setq first-vis-field-value | ||
| 3794 | (constrain-to-field first-vis orig (/= arg 1) t nil)) | ||
| 3795 | |||
| 3796 | (goto-char (if (/= first-vis-field-value first-vis) | ||
| 3797 | ;; If yes, obey them. | ||
| 3798 | first-vis-field-value | ||
| 3799 | ;; Otherwise, move to START with attention to fields. | ||
| 3800 | ;; (It is possible that fields never matter in this case.) | ||
| 3801 | (constrain-to-field (point) orig | ||
| 3802 | (/= arg 1) t nil))))) | ||
| 3785 | 3803 | ||
| 3786 | 3804 | ||
| 3787 | ;;; Many people have said they rarely use this feature, and often type | 3805 | ;;; Many people have said they rarely use this feature, and often type |