From 0d0a859078ca7505f9e4f144efa02086d353881b Mon Sep 17 00:00:00 2001 From: Ken Manheimer Date: Thu, 14 Jan 2016 01:39:39 -0500 Subject: [PATCH] multishell - avoid duplicate completions --- multishell.el | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/multishell.el b/multishell.el index 562723d7e..509c4e0b7 100644 --- a/multishell.el +++ b/multishell.el @@ -343,22 +343,22 @@ on empty input." (remq nil (mapcar (lambda (buffer) (let* ((name (buffer-name buffer)) - (already (assoc name ntph))) - (when (with-current-buffer buffer - (derived-mode-p 'shell-mode)) - ;; Shell mode buffers. - (setq name (if (> (length name) 2) - ;; Strip asterisks. - (substring name 1 - (1- (length name))) - name)) - (if already - nil - name)))) + (already + (assoc (multishell-unbracket-asterisks name) + ntph))) + (if already + nil + (when (with-current-buffer buffer + (derived-mode-p 'shell-mode)) + ;; Shell mode buffers. + (setq name (if (> (length name) 2) + ;; Strip asterisks. + (substring name 1 + (1- (length name))) + name)))))) (buffer-list))) (mapcar #'(lambda (assoc) - (concat (multishell-unbracket-asterisks (car assoc)) - (cdr assoc))) + (concat (car assoc) (cdr assoc))) multishell-name-to-path-history))) (got (completing-read prompt ;; COLLECTION: -- 2.39.2