diff options
| author | Richard M. Stallman | 1993-08-14 07:54:59 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-08-14 07:54:59 +0000 |
| commit | 3eec84bf8138d70c6bb15758c9c51cbb6581d789 (patch) | |
| tree | 175bd174498b33f37d53b938d192601b58eb52a4 | |
| parent | 64c1864a888892a2e688c5b02cc605f5b19ec08c (diff) | |
| download | emacs-3eec84bf8138d70c6bb15758c9c51cbb6581d789.tar.gz emacs-3eec84bf8138d70c6bb15758c9c51cbb6581d789.zip | |
(momentary-string-display): Scroll to keep the string on the screen.
| -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 3b0f31bdc10..b2b27e62ba4 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." | |||
| 566 | ;; defeat file locking... don't try this at home, kids! | 566 | ;; defeat file locking... don't try this at home, kids! |
| 567 | (setq buffer-file-name nil) | 567 | (setq buffer-file-name nil) |
| 568 | (insert-before-markers string) | 568 | (insert-before-markers string) |
| 569 | (setq insert-end (point))) | 569 | (setq insert-end (point)) |
| 570 | ;; If the message end is off screen, recenter now. | ||
| 571 | (if (> (window-end) insert-end) | ||
| 572 | (recenter (/ (window-height) 2))) | ||
| 573 | ;; If that pushed message start off the screen, | ||
| 574 | ;; scroll to start it at the top of the screen. | ||
| 575 | (move-to-window-line 0) | ||
| 576 | (if (> (point) pos) | ||
| 577 | (progn | ||
| 578 | (goto-char pos) | ||
| 579 | (recenter 0)))) | ||
| 570 | (message (or message "Type %s to continue editing.") | 580 | (message (or message "Type %s to continue editing.") |
| 571 | (single-key-description exit-char)) | 581 | (single-key-description exit-char)) |
| 572 | (let ((char (read-event))) | 582 | (let ((char (read-event))) |