changeset 60619:e51f0754a4c4

(move-beginning-of-line): Use vertical-motion.
author Kim F. Storm <storm@cua.dk>
date Tue, 15 Mar 2005 23:15:05 +0000
parents 787ef18f07ec
children ffb5c0421a14 42406ecdf5bf
files lisp/simple.el
diffstat 1 files changed, 3 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Tue Mar 15 22:48:11 2005 +0000
+++ b/lisp/simple.el	Tue Mar 15 23:15:05 2005 +0000
@@ -3536,17 +3536,9 @@
   (or arg (setq arg 1))
   (if (/= arg 1)
       (line-move (1- arg) t))
-  (let (done pos)
-    (while (not done)
-      (beginning-of-line 1)
-      ;; (not bolp) means that it stopped at a field boundary.
-      (if (or (bobp) (not (bolp)))
-	  (setq done t)
-	(sit-for 0)
-	(if (and (consp (setq pos (pos-visible-in-window-p (point) nil t)))
-		 (= (car pos) 0))
-	    (setq done t)
-	  (backward-char 1))))))
+  (let ((orig (point)))
+    (vertical-motion 0)
+    (goto-char (constrain-to-field (point) orig (/= arg 1) t nil))))
 
 
 ;;; Many people have said they rarely use this feature, and often type