[Top][All Lists]

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

[elpa] master d128c7d 3/5: multishell - Clarify multishell-register-name

From: ken manheimer
Subject: [elpa] master d128c7d 3/5: multishell - Clarify multishell-register-name-to-path.
Date: Tue, 19 Jan 2016 19:59:02 +0000

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

    multishell - Clarify multishell-register-name-to-path.
 multishell.el |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/multishell.el b/multishell.el
index ea8958e..1d10b94 100644
--- a/multishell.el
+++ b/multishell.el
@@ -183,20 +183,19 @@ emacs sessions."
 (defun multishell-register-name-to-path (name path)
   "Add or replace entry associating NAME with PATH in `multishell-history'.
-If NAME already had a PATH and new PATH is empty, retain old one.
+If NAME already had a PATH and new PATH is empty, retain the prior one.
 Promote added/changed entry to the front of the list."
   ;; Add or promote to the front, tracking path changes in the process.
   (let* ((entries (multishell-history-entries name))
-         (becomes (concat name path))
-         oldpath)
+         (path (or path "")))
     (dolist (entry entries)
-      (when (or (not path) (string= path ""))
+      (when (string= path "")
         ;; Retain explicit established path.
-        (setq path (cadr (multishell-split-entry-name-and-tramp entry))
-              becomes (concat name path)))
+        (setq path (cadr (multishell-split-entry-name-and-tramp entry))))
       (setq multishell-history (delete entry multishell-history)))
-    (setq multishell-history (push becomes multishell-history))))
+    (setq multishell-history (push (concat name path)
+                                   multishell-history))))
 (defun multishell-history-entries (name)
   "Return `multishell-history' entry that starts with NAME, or nil if none."

reply via email to

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