* lisp/simple.el (move-beginning-of-line): Make sure we don't move forward.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 20 Jan 2014 19:15:10 +0000 (14:15 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 20 Jan 2014 19:15:10 +0000 (14:15 -0500)
Fixes: debbugs:16497

lisp/ChangeLog
lisp/simple.el

index 3a83876..98df632 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * simple.el (move-beginning-of-line): Make sure we don't move forward
+       (bug#16497).
+
 2014-01-20  Juri Linkov  <juri@jurta.org>
 
        * saveplace.el (toggle-save-place, save-place-to-alist)
index ef965aa..8e23b08 100644 (file)
@@ -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.