]> git.eshelyaron.com Git - emacs.git/commitdiff
(mouse-scroll-subr): Handle if window-end returns nil.
authorRichard M. Stallman <rms@gnu.org>
Sat, 14 Mar 1998 08:20:37 +0000 (08:20 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 14 Mar 1998 08:20:37 +0000 (08:20 +0000)
lisp/mouse.el

index 4741d5fc8f60f949c922b1b36504885b1284cdaf..2241578cffc2e71fa96a5b6d6fe1df6fea0a84ae 100644 (file)
@@ -478,11 +478,13 @@ Upon exit, point is at the far edge of the newly visible text."
                 (progn
                   (set-window-start window (point))
                   (if (natnump jump)
-                      (progn
-                        (goto-char (window-end window))
-                        ;; window-end doesn't reflect the window's new
-                        ;; start position until the next redisplay.  Hurrah.
-                        (vertical-motion (1- jump) window))
+                      (if (window-end window)
+                          (progn
+                            (goto-char (window-end window))
+                            ;; window-end doesn't reflect the window's new
+                            ;; start position until the next redisplay.
+                            (vertical-motion (1- jump) window))
+                        (vertical-motion (- (window-height window) 2)))
                     (goto-char (window-start window)))
                   (if overlay
                       (move-overlay overlay start (point)))