1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-02-02 20:16:25 +00:00

(PC-complete): When command is repeated,

scroll the completion buffer.
This commit is contained in:
Richard M. Stallman 1996-07-30 18:52:19 +00:00
parent 6fec5601a2
commit 95c0d3a7dd

View File

@ -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 ()