diff options
author | Richard M. Stallman <[email protected]> | 1996-07-30 18:52:19 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1996-07-30 18:52:19 +0000 |
commit | 95c0d3a7dd4238b8bb68fade83006eda950b8da3 (patch) | |
tree | b9323d6fe91df46f721109ebefcc9f9898cd2a6c /lisp/complete.el | |
parent | 6fec5601a25f970f3f03b591c297b3521fd22243 (diff) |
(PC-complete): When command is repeated,
scroll the completion buffer.
Diffstat (limited to 'lisp/complete.el')
-rw-r--r-- | lisp/complete.el | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lisp/complete.el b/lisp/complete.el index 69db58a985..bbba4fd129 100644 --- a/lisp/complete.el +++ b/lisp/complete.el @@ -178,7 +178,21 @@ Word-delimiters for the purposes of Partial Completion are \"-\", \"_\", (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 () |