]> code.delx.au - gnu-emacs-elpa/commitdiff
multishell-start-shell-in-buffer - consolidate conditions better
authorKen Manheimer <ken.manheimer@gmail.com>
Tue, 26 Jan 2016 19:18:10 +0000 (14:18 -0500)
committerKen Manheimer <ken.manheimer@gmail.com>
Tue, 26 Jan 2016 19:18:10 +0000 (14:18 -0500)
multishell.el

index c9b10502bae4abf1860231d557517c98f12caa8f..50035c04842340bf0e44b4812cf0a2a5c94de883 100644 (file)
@@ -558,16 +558,14 @@ and path nil if none resolved."
     (set-buffer buffer)
     (setq is-active (comint-check-proc buffer))
 
-    (when (and path (file-remote-p path))
+    (when (and path (not is-active))
 
-      (when (and (derived-mode-p 'shell-mode)
-                 (not is-active))
-        ;; Returning to disconnected remote shell. Do some tidying:
+      (when (and (derived-mode-p 'shell-mode) (file-remote-p path))
+        ;; 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))