diff options
author | Richard M. Stallman <[email protected]> | 1993-08-14 07:54:59 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1993-08-14 07:54:59 +0000 |
commit | 3eec84bf8138d70c6bb15758c9c51cbb6581d789 (patch) | |
tree | 175bd174498b33f37d53b938d192601b58eb52a4 /lisp/subr.el | |
parent | 64c1864a888892a2e688c5b02cc605f5b19ec08c (diff) |
(momentary-string-display): Scroll to keep the string on the screen.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r-- | lisp/subr.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 3b0f31bdc1..b2b27e62ba 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -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))) |