]> git.eshelyaron.com Git - emacs.git/commitdiff
(line-move-partial): Optimize.
authorKim F. Storm <storm@cua.dk>
Wed, 13 Sep 2006 22:28:03 +0000 (22:28 +0000)
committerKim F. Storm <storm@cua.dk>
Wed, 13 Sep 2006 22:28:03 +0000 (22:28 +0000)
lisp/simple.el

index c0f9d61636167ce976cc5b4d9bc9f8eac5b54d31..f87b2c49589e20af91877474cd0e29e1f05986cf 100644 (file)
@@ -3487,28 +3487,27 @@ Outline mode sets this."
          (set-window-vscroll nil (- vs (frame-char-height)) t)))
 
     ;; Move forward (down).
-    (let* ((ppos (posn-at-point))
-          (py (cdr (or (posn-actual-col-row ppos)
-                       (posn-col-row ppos))))
-          (vs (window-vscroll nil t))
-          (evis (or (pos-visible-in-window-p (window-end nil t) nil t)
+    (let* ((evis (or (pos-visible-in-window-p (window-end nil t) nil t)
                     (pos-visible-in-window-p (1- (window-end nil t)) nil t)))
           (rbot (nth 3 evis))
-          (vpos (nth 5 evis)))
+          (vpos (nth 5 evis))
+          ppos py vs)
       (cond
-       ;; (0) Last window line should be visible - fail if not.
+       ;; Last window line should be visible - fail if not.
        ((null evis)
        nil)
        ;; If last line of window is fully visible, move forward.
        ((null rbot)
        nil)
        ;; If cursor is not in the bottom scroll margin, move forward.
-       ((< py (min (- (window-text-height) scroll-margin 1)
-                  (1- vpos)))
+       ((< (setq ppos (posn-at-point)
+                py (cdr (or (posn-actual-col-row ppos)
+                            (posn-col-row ppos))))
+          (min (- (window-text-height) scroll-margin 1) (1- vpos)))
        nil)
        ;; When already vscrolled, we vscroll some more if we can,
        ;; or clear vscroll and move forward at end of tall image.
-       ((> vs 0)
+       ((> (setq vs (window-vscroll nil t)) 0)
        (when (> rbot 0)
          (set-window-vscroll nil (+ vs (min rbot (frame-char-height))) t)))
        ;; If cursor just entered the bottom scroll margin, move forward,