]> code.delx.au - gnu-emacs-elpa/commitdiff
multishell - list active the present then historical buffers
authorKen Manheimer <ken.manheimer@gmail.com>
Sat, 30 Jan 2016 07:12:32 +0000 (02:12 -0500)
committerKen Manheimer <ken.manheimer@gmail.com>
Sat, 30 Jan 2016 07:12:32 +0000 (02:12 -0500)
and identify them in multishell-list as "+" = active, "." = present, and
"x" = past/not present.

multishell-list.el
multishell.el

index 5dab00a64e066da9d9660867a166d0698c5f3e6a..ae72f9217a205ab4718eb1558d5f6ab79e671b2a 100644 (file)
@@ -72,9 +72,9 @@
                        (buffer (and name
                                     (get-buffer
                                      (multishell-bracket name))))
-                       (status (cond ((not buffer) " ")
+                       (status (cond ((not buffer) "x")
                                      ((comint-check-proc buffer) "+")
-                                     (t "-")))
+                                     (t ".")))
                        (rest (cadr splat))
                        (dissected (and rest (file-remote-p rest)
                                        (tramp-dissect-file-name rest t)))
index 422c55f502a141070da07f4806f10b2bd7b9de27..7aa4b462d47d22fec776e81fdbf3b76ef5851fb9 100644 (file)
@@ -540,19 +540,20 @@ Optional ACTIVE-DUPLICATED will return a copy of
 `multishell-history' with unbracketed names of active buffers,
 sans paths, appended to the list, so they have short and long
 completions."
-  ;; Reorder so active buffers are listed first:
-  (let (active-entries active-names historicals splat name path buffer)
+  ;; Reorder so active lead present lead historical entries:
+  (let (active-entries active-names present past splat name path buffer)
     (dolist (entry multishell-history)
       (setq splat (multishell-split-entry entry)
             name (car splat)
             path (cadr splat)
             buffer (and name (get-buffer (multishell-bracket name))))
-      (if (and (buffer-live-p buffer)
-               (comint-check-proc buffer))
-          (setq active-entries (push entry active-entries)
-                active-names (push name active-names))
-        (setq historicals (push entry historicals))))
-    (setq multishell-history (append active-entries historicals))
+      (if (buffer-live-p buffer)
+          (if (comint-check-proc buffer)
+              (setq active-entries (push entry active-entries)
+                    active-names (push name active-names))
+            (setq present (push entry present)))
+        (setq past (push entry past))))
+    (setq multishell-history (append active-entries present past))
     (if active-duplicated
         (append multishell-history active-names)
       multishell-history)))