diff options
| -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 69db58a985c..bbba4fd129e 100644 --- a/lisp/complete.el +++ b/lisp/complete.el | |||
| @@ -178,7 +178,21 @@ Word-delimiters for the purposes of Partial Completion are \"-\", \"_\", | |||
| 178 | (interactive) | 178 | (interactive) |
| 179 | (if (PC-was-meta-key) | 179 | (if (PC-was-meta-key) |
| 180 | (minibuffer-complete) | 180 | (minibuffer-complete) |
| 181 | (PC-do-completion nil))) | 181 | ;; If the previous command was not this one, |
| 182 | ;; never scroll, always retry completion. | ||
| 183 | (or (eq last-command this-command) | ||
| 184 | (setq minibuffer-scroll-window nil)) | ||
| 185 | (let ((window minibuffer-scroll-window)) | ||
| 186 | ;; If there's a fresh completion window with a live buffer, | ||
| 187 | ;; and this command is repeated, scroll that window. | ||
| 188 | (if (and window (window-buffer window) | ||
| 189 | (buffer-name (window-buffer window))) | ||
| 190 | (save-excursion | ||
| 191 | (set-buffer (window-buffer window)) | ||
| 192 | (if (pos-visible-in-window-p (point-max) window) | ||
| 193 | (set-window-start window (point-min) nil) | ||
| 194 | (scroll-other-window))) | ||
| 195 | (PC-do-completion nil))))) | ||
| 182 | 196 | ||
| 183 | 197 | ||
| 184 | (defun PC-complete-word () | 198 | (defun PC-complete-word () |