changeset 4620:5474175de175

(momentary-string-display): Scroll to keep the string on the screen.
author Richard M. Stallman <rms@gnu.org>
date Sat, 14 Aug 1993 07:54:59 +0000
parents fdb92f0aa8c7
children 859d97b0f5bd
files lisp/subr.el
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Sat Aug 14 07:34:28 1993 +0000
+++ b/lisp/subr.el	Sat Aug 14 07:54:59 1993 +0000
@@ -566,7 +566,17 @@
 	    ;; 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)))