From: Ken Manheimer Date: Tue, 26 Jan 2016 19:18:10 +0000 (-0500) Subject: multishell-start-shell-in-buffer - consolidate conditions better X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/f01cf3f72d5aa35dfdbe2a7f59e93f370a0949c2 multishell-start-shell-in-buffer - consolidate conditions better --- diff --git a/multishell.el b/multishell.el index c9b10502b..50035c048 100644 --- a/multishell.el +++ b/multishell.el @@ -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))