From: Ken Manheimer Date: Tue, 19 Jan 2016 06:47:32 +0000 (-0500) Subject: Merge commit '2c5d608ddfeb2dc1acc15d645d94cac087f001d4' X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/7e7d7bbea8bbe625bb38e29502c47b42245fcbd7?hp=445258b7156a22c83cc2a4d206ee907bb2b3db09 Merge commit '2c5d608ddfeb2dc1acc15d645d94cac087f001d4' --- diff --git a/packages/multishell/multishell.el b/packages/multishell/multishell.el index e6924e811..e23813d25 100644 --- a/packages/multishell/multishell.el +++ b/packages/multishell/multishell.el @@ -1,4 +1,4 @@ -;;; multishell.el --- facilitate use of multiple local and remote shell buffers +;;; multishell.el --- facilitate multiple local and remote shell buffers ;; Copyright (C) 1999-2016 Free Software Foundation, Inc. and Ken Manheimer @@ -175,11 +175,18 @@ emacs sessions." (defun multishell-register-name-to-path (name path) "Add or replace entry associating NAME with PATH in `multishell-history'. -Promote to added/changed entry to the front of the list." +If NAME already had a PATH and new PATH is empty, retain old 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))) + (becomes (concat name path)) + oldpath) (dolist (entry entries) + (when (or (not path) (string= path "")) + ;; Retain explicit established path. + (setq path (cadr (multishell-split-entry-name-and-tramp entry)) + becomes (concat name path))) (setq multishell-history (delete entry multishell-history))) (setq multishell-history (push becomes multishell-history))))