diff options
| author | Richard M. Stallman | 1996-07-30 18:52:19 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-07-30 18:52:19 +0000 |
| commit | 95c0d3a7dd4238b8bb68fade83006eda950b8da3 (patch) | |
| tree | b9323d6fe91df46f721109ebefcc9f9898cd2a6c /lisp | |
| parent | 6fec5601a25f970f3f03b591c297b3521fd22243 (diff) | |
| download | emacs-95c0d3a7dd4238b8bb68fade83006eda950b8da3.tar.gz emacs-95c0d3a7dd4238b8bb68fade83006eda950b8da3.zip | |
(PC-complete): When command is repeated,
scroll the completion buffer.
Diffstat (limited to 'lisp')
| -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 () |