emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master 57f56f2 2/8: multishell - don't skip cd when restarting lo


From: ken manheimer
Subject: [elpa] master 57f56f2 2/8: multishell - don't skip cd when restarting local shells; note new starts
Date: Fri, 29 Jan 2016 06:41:42 +0000

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

    multishell - don't skip cd when restarting local shells; note new starts
    
    Shaking out implementation of shell launch decision tree.
---
 multishell.el |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/multishell.el b/multishell.el
index f4cfb9f..c9b1050 100644
--- a/multishell.el
+++ b/multishell.el
@@ -408,9 +408,11 @@ customize the savehist group to activate savehist."
           (not (setq inwin
                      (multishell-get-visible-window-for-buffer 
target-buffer))))
       ;; No preexisting shell buffer, or not in a visible window:
+      (when (not (get-buffer target-shell-buffer-name))
+        (message "Creating new shell buffer '%s'" target-shell-buffer-name))
       (pop-to-buffer target-shell-buffer-name pop-up-windows))
 
-       ;; Buffer exists and already has a window - jump to it:
+     ;; Buffer exists and already has a window - jump to it:
      (t (if (and multishell-pop-to-frame
                  inwin
                  (not (equal (window-frame (selected-window))
@@ -551,19 +553,21 @@ and path nil if none resolved."
 (defun multishell-start-shell-in-buffer (buffer-name path)
   "Start, restart, or continue a shell in BUFFER-NAME on PATH."
   (let* ((buffer (get-buffer buffer-name))
-         is-remote)
+         is-remote is-active)
 
     (set-buffer buffer)
+    (setq is-active (comint-check-proc buffer))
 
     (when (and path (file-remote-p path))
 
       (when (and (derived-mode-p 'shell-mode)
-                 (not (comint-check-proc (current-buffer))))
+                 (not is-active))
         ;; Returning to disconnected remote shell. Do some tidying:
         (tramp-cleanup-connection
          (tramp-dissect-file-name default-directory 'noexpand)
-         'keep-debug 'keep-password))
+         'keep-debug 'keep-password)))
 
+    (when (and path (not is-active))
       (message "Connecting to %s" path)
       (cd path))
 



reply via email to

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