]> git.eshelyaron.com Git - emacs.git/commitdiff
(line-move-1): Rename from line-move.
authorKim F. Storm <storm@cua.dk>
Sat, 22 Jan 2005 01:44:56 +0000 (01:44 +0000)
committerKim F. Storm <storm@cua.dk>
Sat, 22 Jan 2005 01:44:56 +0000 (01:44 +0000)
(line-move): New function that adjusts vscroll for partially
visible rows, and calls line-move-1 otherwise.

lisp/simple.el

index fbcb776c7dcedc6456a12a72d6bcc58a43929ba9..e2476577fe381541e51edeb55309f8c5e7b2d8b4 100644 (file)
@@ -3179,10 +3179,31 @@ Outline mode sets this."
       (or (memq prop buffer-invisibility-spec)
          (assq prop buffer-invisibility-spec)))))
 
+;; Perform vertical scrolling of tall images if necessary.
+(defun line-move (arg &optional noerror to-end)
+  (if auto-window-vscroll
+      (let ((forward (> arg 0))
+           (pvis (pos-visible-in-window-p (window-start) nil t)))
+       (if (and pvis (null (nth 2 pvis))
+                (> (nth (if forward 4 3) pvis) 0))
+           (set-window-vscroll nil
+                               (if forward
+                                   (+ (window-vscroll nil t)
+                                      (min (nth 4 pvis)
+                                           (* (frame-char-height) arg)))
+                                 (max 0
+                                      (- (window-vscroll nil t)
+                                         (min (nth 3 pvis)
+                                              (* (frame-char-height) (- arg))))))
+                               t)
+         (set-window-vscroll nil 0)
+         (line-move-1 arg noerror to-end)))
+    (line-move-1 arg noerror to-end)))
+
 ;; This is the guts of next-line and previous-line.
 ;; Arg says how many lines to move.
 ;; The value is t if we can move the specified number of lines.
-(defun line-move (arg &optional noerror to-end)
+(defun line-move-1 (arg &optional noerror to-end)
   ;; Don't run any point-motion hooks, and disregard intangibility,
   ;; for intermediate positions.
   (let ((inhibit-point-motion-hooks t)