changeset 62987:5378f1ac43f4

(line-move): Only call sit-for when moving backwards.
author Kim F. Storm <storm@cua.dk>
date Fri, 03 Jun 2005 23:48:21 +0000
parents dec671a87173
children 3ca414a25103
files lisp/simple.el
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Fri Jun 03 23:47:56 2005 +0000
+++ b/lisp/simple.el	Fri Jun 03 23:48:21 2005 +0000
@@ -3351,25 +3351,25 @@
       (let ((forward (> arg 0))
 	    (part (nth 2 (pos-visible-in-window-p (point) nil t))))
 	(if (and (consp part)
-		 (> (setq part (if forward (cdr part) (car part))) 0))
+		 (> (if forward (cdr part) (car part)) 0))
 	    (set-window-vscroll nil
 				(if forward
 				    (+ (window-vscroll nil t)
-				       (min part
+				       (min (cdr part)
 					    (* (frame-char-height) arg)))
 				  (max 0
 				       (- (window-vscroll nil t)
-					  (min part
+					  (min (car part)
 					       (* (frame-char-height) (- arg))))))
 				t)
 	  (set-window-vscroll nil 0)
 	  (when (line-move-1 arg noerror to-end)
-	    (sit-for 0)
-	    (if (and (not forward)
-		     (setq part (nth 2 (pos-visible-in-window-p
-					(line-beginning-position) nil t)))
-		     (> (cdr part) 0))
-		(set-window-vscroll nil (cdr part) t))
+	    (when (not forward)
+	      (sit-for 0)
+	      (if (and (setq part (nth 2 (pos-visible-in-window-p
+					  (line-beginning-position) nil t)))
+		       (> (cdr part) 0))
+		  (set-window-vscroll nil (cdr part) t)))
 	    t)))
     (line-move-1 arg noerror to-end)))