changeset 15802:1595df9ed1e8

(PC-complete): When command is repeated, scroll the completion buffer.
author Richard M. Stallman <rms@gnu.org>
date Tue, 30 Jul 1996 18:52:19 +0000
parents b0bd5de2ce82
children f214673e68a8
files lisp/complete.el
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/complete.el	Tue Jul 30 18:51:50 1996 +0000
+++ b/lisp/complete.el	Tue Jul 30 18:52:19 1996 +0000
@@ -178,7 +178,21 @@
   (interactive)
   (if (PC-was-meta-key)
       (minibuffer-complete)
-    (PC-do-completion nil)))
+    ;; If the previous command was not this one,
+    ;; never scroll, always retry completion.
+    (or (eq last-command this-command)
+	(setq minibuffer-scroll-window nil))
+    (let ((window minibuffer-scroll-window))
+      ;; If there's a fresh completion window with a live buffer,
+      ;; and this command is repeated, scroll that window.
+      (if (and window (window-buffer window)
+	       (buffer-name (window-buffer window)))
+	  (save-excursion
+	    (set-buffer (window-buffer window))
+	    (if (pos-visible-in-window-p (point-max) window)
+		(set-window-start window (point-min) nil)
+	      (scroll-other-window)))
+	(PC-do-completion nil)))))
 
 
 (defun PC-complete-word ()