From: Chong Yidong Date: Thu, 3 Aug 2006 14:26:27 +0000 (+0000) Subject: * simple.el (line-move-to-column): Constrain move-to-column to X-Git-Tag: emacs-pretest-22.0.90~1125 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7abcd3e393cead48a7ac8c76e6d85b40ca48effe;p=emacs.git * simple.el (line-move-to-column): Constrain move-to-column to current field. --- 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))))