[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 378b866 1/9: Rough stab at using tabulated-list-mode for m
From: |
ken manheimer |
Subject: |
[elpa] master 378b866 1/9: Rough stab at using tabulated-list-mode for minibuffer-completion-help |
Date: |
Fri, 12 Feb 2016 09:20:57 +0000 |
branch: master
commit 378b866d860092bef7c75153bd6150612131a817
Author: Ken Manheimer <address@hidden>
Commit: Ken Manheimer <address@hidden>
Rough stab at using tabulated-list-mode for minibuffer-completion-help
A few big problems with what's implemented here:
- looks like tabulated-list-mode is incongruous with temp display
operation.
- using flet is no good - it's deprecated - but cl-flet lexical scoping
doesn't have needed effect.
---
multishell.el | 56 +++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 45 insertions(+), 11 deletions(-)
diff --git a/multishell.el b/multishell.el
index 8d19a05..8e19029 100644
--- a/multishell.el
+++ b/multishell.el
@@ -603,6 +603,36 @@ 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)
+ (let* ((completions-extracted
+ (mapcar #'(lambda (text)
+ (set-text-properties 0 (length text) nil text)
+ text)
+ completions))
+ (multishell-history completions-extracted))
+ (multishell-list-mode)))
+
(defun multishell-read-unbracketed-entry (prompt &optional initial no-record)
"PROMPT for shell buffer name, sans asterisks.
@@ -616,17 +646,21 @@ 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 (completing-read prompt
- ;; COLLECTION:
- (reverse candidates)
- ;; PREDICATE:
- nil
- ;; REQUIRE-MATCH:
- 'confirm
- ;; INITIAL-INPUT
- initial
- ;; HIST:
- 'multishell-history)))
+;; (minibuffer-local-must-match-map multishell-local-must-match-map)
+ (got (flet ((display-completion-list
+ (completions)
+ (multishell-display-completion-list completions)))
+ (completing-read prompt
+ ;; COLLECTION:
+ (reverse candidates)
+ ;; PREDICATE:
+ nil
+ ;; REQUIRE-MATCH:
+ 'confirm
+ ;; INITIAL-INPUT
+ initial
+ ;; HIST:
+ 'multishell-history))))
(when no-record
(setq multishell-history was-multishell-history))
(if (not (string= got ""))
- [elpa] master updated (1abce8e -> b19288e), ken manheimer, 2016/02/12
- [elpa] master 378b866 1/9: Rough stab at using tabulated-list-mode for minibuffer-completion-help,
ken manheimer <=
- [elpa] master 996d534 2/9: multishell - roughly working draft using multishell-list for completions, ken manheimer, 2016/02/12
- [elpa] master 4802f57 3/9: Clarify scheme for using multishell-list for completions help buffer., ken manheimer, 2016/02/12
- [elpa] master fd514d3 4/9: multishell - method to conclude minibuffer interaction from multishell-list, ken manheimer, 2016/02/12
- [elpa] master 7b66048 5/9: multishell - Use better names for completing read and dispatch provisions., ken manheimer, 2016/02/12
- [elpa] master 1220cdc 6/9: multishell - Be more specific about why we use tramp-cleanup-connection., ken manheimer, 2016/02/12
- [elpa] master d68099d 7/9: multishell - Suppress trivial duplicates in completions list presentation., ken manheimer, 2016/02/12
- [elpa] master f245821 8/9: multishell - 1.1.4, resolves several TODO items., ken manheimer, 2016/02/12
- [elpa] master b19288e 9/9: Merge commit 'f2458211bc25749f07e0d70addde7c7745dcc79d', ken manheimer, 2016/02/12