multishell-list-active-flag)
(t multishell-list-inactive-flag)))
(rest (cadr splat))
- (dir (or (file-remote-p (or rest "") 'localname)
- rest))
+ (dir (and rest (or (file-remote-p rest 'localname)
+ rest)))
(hops (and dir
(file-remote-p rest 'localname)
(substring
(defun multishell-list (&optional buffer-name)
"Edit your current and historic list of shell buffers.
-Hit ? for a list of commands.
+Optional BUFFER-NAME specifies buffer to use for list. When a
+buffer is specified, we do not select the buffer, just fill
+it. Otherwise, we pop to the *Shells* buffer.
-You can get to this shell listing manager by
-recursively invoking \\[multishell-pop-to-shell] at either of the
-`multishell-pop-to-shell' universal argument prompts."
+In the buffer, hit ? or h for a list of commands.
+
+You can get to the shell listing manager by recursively invoking
+\\[multishell-pop-to-shell] at the `multishell-pop-to-shell'
+`universal-argument' prompts."
(interactive)
(let ((from-entry (car (multishell-history-entries
(multishell-unbracket (buffer-name
(require 'multishell)
;;; multishell-list.el ends here
-o
\ No newline at end of file
-;;; multishell.el --- facilitate multiple local and remote shell buffers
+;;; multishell.el --- Easily use multiple shell buffers, local and remote.
;; Copyright (C) 1999-2016 Free Software Foundation, Inc.
;; Author: Ken Manheimer <ken.manheimer@gmail.com>
-;; Version: 1.1.3
+;; Version: 1.1.4
;; Created: 1999 -- first public availability
;; Keywords: processes
;; URL: https://github.com/kenmanheimer/EmacsMultishell
;;
;; Change Log:
;;
+;; * 2016-02-10 1.1.4 Ken Manheimer:
+;; - hookup multishell-list as completion help buffer.
;; * 2016-02-09 1.1.3 Ken Manheimer:
;; multishell-list:
;; - add some handy operations, like cloning new entry from existing
(append multishell-history active-names)
multishell-history)))
-(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)
- "Present COMPLETIONS using multishell-list for `display-completion-list'.
-
-This currently doesn't work, because `tabulated-list-mode' isn't
-meant for transient buffers."
+ "Present COMPLETIONS using multishell-list for `display-completion-list'."
(let ((multishell-history (mapcar 'substring-no-properties completions)))
(multishell-list "*Completions*")))
Return what's provided, if anything, else nil."
(let* ((was-multishell-history multishell-history)
(candidates (multishell-all-entries 'active-duplicated))
- (got (flet ((display-completion-list
- (completions)
- (multishell-display-completion-list completions)))
+ (got (cl-letf
+ ;; Engage our custom display-completion-list, for
+ ;; minibuffer-completion-help. `cl-letf' for dynamic
+ ;; binding; cl-flet's lexical doesn't do what's needed.
+ (((symbol-function 'display-completion-list)
+ #'multishell-display-completion-list))
(completing-read prompt
;; COLLECTION:
(reverse candidates)