;; Copyright (C) 2016 Free Software Foundation, Inc. and Ken Manheimer
;; Author: Ken Manheimer <ken.manheimer@gmail.com>
-;; Version: 1.1.4
+;; Version: 1.1.5
;; Created: 2016 -- first public availability
;; Keywords: processes
;; URL: https://github.com/kenmanheimer/EmacsMultishell
Initial sort is from most to least recently used:
-- First active shells, flagged with '+' a plus sign
-- Then, inactive shells, flagged with '.' a period
-- Then historical shells that currently have no buffer, flagged with 'x' an ex
+- First active shells, flagged with `+' a plus sign
+- Then, inactive shells, flagged with `.' a period
+- Then historical shells that currently have no buffer, flagged with `x' an ex
\\{multishell-list-mode-map\}"
(setq tabulated-list-format
For duplicates, we prefer the ones that have paths."
(let ((tally (make-hash-table :test #'equal))
- got name already)
+ got name name-order-reversed already)
(mapcar #'(lambda (entry)
(setq name (multishell-name-from-entry entry)
already (gethash name tally nil))
+ (when (not already)
+ (push name name-order-reversed))
(when (or (not already) (< (length already) (length entry)))
;; Add new or replace shorter prior entry for name:
(puthash name entry tally)))
entries)
- (maphash #'(lambda (key value) (push value got)) tally)
+ (dolist (name name-order-reversed)
+ (push (gethash name tally) got))
got))
;;;###autoload
"Edit your current and historic list of shell buffers.
If optional COMPLETING is nil, we present the full
-`multishell-history' list in a popped buffer named '*Shells*'.
+`multishell-history' list in a popped buffer named `*Shells*'.
In the buffer, hit ? or h for a list of commands.