[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 996d534 2/9: multishell - roughly working draft using mult

From: ken manheimer
Subject: [elpa] master 996d534 2/9: multishell - roughly working draft using multishell-list for completions
Date: Fri, 12 Feb 2016 09:21:24 +0000

branch: master
commit 996d5347c80289d6eb97a7fc620b40e2724b14cc
Author: Ken Manheimer <address@hidden>
Commit: Ken Manheimer <address@hidden>

    multishell - roughly working draft using multishell-list for completions
    Workable, need to resolve pending issues:
    - depends on flet - what do i need to do about that?
    - adaptation of multishell-list to purpose needs doc update, maybe rethink
    - likewise hacking of multishell-list-entries
    - inhibit duplicates from organized listing, preferring detailed one
    - get mouse click so it ~properly concludes minibuffer activity
 multishell-list.el |   14 +++++++++-----
 multishell.el      |   14 ++++++--------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/multishell-list.el b/multishell-list.el
index 69299f2..6b8680c 100644
--- a/multishell-list.el
+++ b/multishell-list.el
@@ -158,9 +158,10 @@ The already existing original entry is left untouched."
                                      (t multishell-list-inactive-flag)))
                        (rest (cadr splat))
-                       (dir (or (file-remote-p rest 'localname)
+                       (dir (or (file-remote-p (or rest "") 'localname)
-                       (hops (and (file-remote-p rest 'localname)
+                       (hops (and dir
+                                  (file-remote-p rest 'localname)
                                    rest 0 (- (length rest) (length dir))))))
                   (when (not name)
@@ -235,7 +236,7 @@ Initial sort is from most to least recently used:
-(defun multishell-list ()
+(defun multishell-list (&optional buffer-name)
   "Edit your current and historic list of shell buffers.
 Hit ? for a list of commands.
@@ -247,8 +248,10 @@ recursively invoking \\[multishell-pop-to-shell] at either 
of the
   (let ((from-entry (car (multishell-history-entries
                           (multishell-unbracket (buffer-name
-        (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))
     (when from-entry
@@ -258,3 +261,4 @@ recursively invoking \\[multishell-pop-to-shell] at either 
of the
 (require 'multishell)
 ;;; multishell-list.el ends here
\ No newline at end of file
diff --git a/multishell.el b/multishell.el
index 8e19029..fe17874 100644
--- a/multishell.el
+++ b/multishell.el
@@ -625,13 +625,12 @@ completions."
 (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.
@@ -646,7 +645,6 @@ 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))
-;;         (minibuffer-local-must-match-map multishell-local-must-match-map)
          (got (flet ((display-completion-list
                       (multishell-display-completion-list completions)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]