+(defvar multishell-local-must-match-map
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map minibuffer-local-must-match-map)
+ (define-key map (kbd "?") 'multishell-minibuffer-completion-help)
+ (define-key map (kbd " ") 'multishell-minibuffer-complete-word)
+ (define-key map [tab] 'multishell-read-minibuffer-complete)
+ map))
+
+(defun multishell-minibuffer-completion-help (&optional start end)
+ "Multishell version of `minibuffer-completion-help'."
+ (interactive)
+ ;; Call all-completions on minibuffer-completion-table and
+ ;; minibuffer-completion-predicate
+ ;; Display using (with-output-to-temp-buffer "*Completions*"
+ ;; ... <multishell-list stuff>)
+ (minibuffer-completion-help start end))
+(defun multishell-minibuffer-complete-word ()
+ "Multishell version of `minibuffer-completion-help'."
+ (interactive)
+ (minibuffer-complete-word))
+
+(defun multishell-display-completion-list (completions)
+ (let* ((completions-extracted
+ (mapcar #'(lambda (text)
+ (set-text-properties 0 (length text) nil text)
+ text)
+ completions))
+ (multishell-history completions-extracted))
+ (multishell-list-mode)))
+