From 6cc750eec443c58c48b0fbf0ee65f2de8052cccf Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 20 Jan 2014 14:15:10 -0500 Subject: [PATCH] * lisp/simple.el (move-beginning-of-line): Make sure we don't move forward. Fixes: debbugs:16497 --- lisp/ChangeLog | 5 +++++ lisp/simple.el | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3a838762a1b..98df632bf89 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-01-20 Stefan Monnier + + * simple.el (move-beginning-of-line): Make sure we don't move forward + (bug#16497). + 2014-01-20 Juri Linkov * saveplace.el (toggle-save-place, save-place-to-alist) diff --git a/lisp/simple.el b/lisp/simple.el index ef965aa6fe5..8e23b0804ca 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5534,9 +5534,9 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." (goto-char (previous-char-property-change (point))) (skip-chars-backward "^\n")) - ;; Now find first visible char in the line - (while (and (not (eobp)) (invisible-p (point))) - (goto-char (next-char-property-change (point)))) + ;; Now find first visible char in the line. + (while (and (< (point) orig) (invisible-p (point))) + (goto-char (next-char-property-change (point) orig))) (setq first-vis (point)) ;; See if fields would stop us from reaching FIRST-VIS. -- 2.39.2