From 7abcd3e393cead48a7ac8c76e6d85b40ca48effe Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 3 Aug 2006 14:26:27 +0000 Subject: [PATCH] * simple.el (line-move-to-column): Constrain move-to-column to current field. --- lisp/ChangeLog | 5 +++++ lisp/simple.el | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 28c8ac15e40..d6ca6734af4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-08-03 Chong Yidong + + * simple.el (line-move-to-column): Constrain move-to-column to + current field. + 2006-08-03 Stefan Monnier * font-lock.el (font-lock-beg, font-lock-end) diff --git a/lisp/simple.el b/lisp/simple.el index 2af4bbd1d76..9288ab6bd79 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3697,7 +3697,10 @@ because what we really need is for `move-to-column' and `current-column' to be able to ignore invisible text." (if (zerop col) (beginning-of-line) - (move-to-column col)) + (let ((opoint (point))) + (move-to-column col) + ;; move-to-column doesn't respect field boundaries. + (goto-char (constrain-to-field (point) opoint)))) (when (and line-move-ignore-invisible (not (bolp)) (line-move-invisible-p (1- (point)))) -- 2.39.2