multishell-list-active-flag)
(t multishell-list-inactive-flag)))
(rest (cadr splat))
- (dir (or (file-remote-p rest 'localname)
+ (dir (or (file-remote-p (or rest "") 'localname)
rest))
- (hops (and (file-remote-p rest 'localname)
+ (hops (and dir
+ (file-remote-p rest 'localname)
(substring
rest 0 (- (length rest) (length dir))))))
(when (not name)
(tabulated-list-init-header))
;;;###autoload
-(defun multishell-list ()
+(defun multishell-list (&optional buffer-name)
"Edit your current and historic list of shell buffers.
Hit ? for a list of commands.
(let ((from-entry (car (multishell-history-entries
(multishell-unbracket (buffer-name
(current-buffer))))))
- (buffer (get-buffer-create "*Shells*")))
- (pop-to-buffer buffer)
+ (buffer (get-buffer-create (or buffer-name "*Shells*"))))
+ (if buffer-name
+ (set-buffer buffer)
+ (pop-to-buffer buffer))
(multishell-list-mode)
(tabulated-list-print)
(when from-entry
(require 'multishell)
;;; multishell-list.el ends here
+o
\ No newline at end of file
(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)))
+ "Present COMPLETIONS using multishell-list for `display-completion-list'.
+
+This currently doesn't work, because `tabulated-list-mode' isn't
+meant for transient buffers."
+ (let ((multishell-history (mapcar 'substring-no-properties completions)))
+ (multishell-list "*Completions*")))
(defun multishell-read-unbracketed-entry (prompt &optional initial no-record)
"PROMPT for shell buffer name, sans asterisks.
Return what's provided, if anything, else nil."
(let* ((was-multishell-history multishell-history)
(candidates (multishell-all-entries 'active-duplicated))
-;; (minibuffer-local-must-match-map multishell-local-must-match-map)
(got (flet ((display-completion-list
(completions)
(multishell-display-completion-list completions)))