]> git.eshelyaron.com Git - emacs.git/commitdiff
(momentary-string-display): Scroll to keep the string on the screen.
authorRichard M. Stallman <rms@gnu.org>
Sat, 14 Aug 1993 07:54:59 +0000 (07:54 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 14 Aug 1993 07:54:59 +0000 (07:54 +0000)
lisp/subr.el

index 3b0f31bdc101b0ce85128bae2e53b7ec45b01e91..b2b27e62ba479a01ce0857694b7851b70e2f0695 100644 (file)
@@ -566,7 +566,17 @@ If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there."
            ;; defeat file locking... don't try this at home, kids!
            (setq buffer-file-name nil)
            (insert-before-markers string)
-           (setq insert-end (point)))
+           (setq insert-end (point))
+           ;; If the message end is off screen, recenter now.
+           (if (> (window-end) insert-end)
+               (recenter (/ (window-height) 2)))
+           ;; If that pushed message start off the screen,
+           ;; scroll to start it at the top of the screen.
+           (move-to-window-line 0)
+           (if (> (point) pos)
+               (progn
+                 (goto-char pos)
+                 (recenter 0))))
          (message (or message "Type %s to continue editing.")
                   (single-key-description exit-char))
          (let ((char (read-event)))