Function: term-dynamic-list-completions

term-dynamic-list-completions is a byte-compiled function defined in term.el.gz.

Signature

(term-dynamic-list-completions COMPLETIONS)

Documentation

List in help buffer sorted COMPLETIONS.

Typing SPC flushes the help buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/term.el.gz
(defun term-dynamic-list-completions (completions)
  "List in help buffer sorted COMPLETIONS.
Typing SPC flushes the help buffer."
  (let ((conf (current-window-configuration)))
    (with-output-to-temp-buffer "*Completions*"
      (display-completion-list (sort completions 'string-lessp)))
    (message "Hit space to flush")
    (let (key first)
      (if (with-current-buffer "*Completions*"
	    (setq key (read-key-sequence nil)
		  first (aref key 0))
	    (and (consp first)
		 (eq (window-buffer (posn-window (event-start first)))
		     (get-buffer "*Completions*"))
		 (memq (key-binding key)
                       '(choose-completion))))
	  ;; If the user does choose-completion with the mouse,
	  ;; execute the command, then delete the completion window.
	  (progn
	    (choose-completion first)
	    (set-window-configuration conf))
	(if (eq first ?\s)
	    (set-window-configuration conf)
	  (setq unread-command-events
                (nconc (listify-key-sequence key)
                       unread-command-events)))))))