summaryrefslogtreecommitdiff
path: root/multishell.el
diff options
context:
space:
mode:
authorKen Manheimer <ken.manheimer@gmail.com>2016-02-10 02:49:17 -0500
committerKen Manheimer <ken.manheimer@gmail.com>2016-02-10 02:49:17 -0500
commit4802f5736fd0ccd3db8ffc4627bb84756a8a2c2b (patch)
tree880e5984845816759c25646d859f815f9c82d1e0 /multishell.el
parent996d5347c80289d6eb97a7fc620b40e2724b14cc (diff)
Clarify scheme for using multishell-list for completions help buffer.
1.1.4 - Use a custom version of display-completion-list - Via institution via cl-letf. - Remove now unnecessary keybindings -
Diffstat (limited to 'multishell.el')
-rw-r--r--multishell.el41
1 files changed, 11 insertions, 30 deletions
diff --git a/multishell.el b/multishell.el
index fe17874..a0783ee 100644
--- a/multishell.el
+++ b/multishell.el
@@ -1,9 +1,9 @@
-;;; 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
@@ -59,6 +59,8 @@
;;
;; 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
@@ -603,32 +605,8 @@ completions."
(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*")))
@@ -645,9 +623,12 @@ Input and completion can include associated path, if any.
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)