From 46bdd13d97357cd624de91fb19e5a602aabfa8e6 Mon Sep 17 00:00:00 2001 From: Ken Manheimer Date: Sat, 30 Jan 2016 02:12:32 -0500 Subject: [PATCH] multishell - list active the present then historical buffers and identify them in multishell-list as "+" = active, "." = present, and "x" = past/not present. --- multishell-list.el | 4 ++-- multishell.el | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/multishell-list.el b/multishell-list.el index 5dab00a64..ae72f9217 100644 --- a/multishell-list.el +++ b/multishell-list.el @@ -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))) diff --git a/multishell.el b/multishell.el index 422c55f50..7aa4b462d 100644 --- a/multishell.el +++ b/multishell.el @@ -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))) -- 2.39.2