[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 96c6843 3/7: multishell - simplify multishell-start-shell-
From: |
ken manheimer |
Subject: |
[elpa] master 96c6843 3/7: multishell - simplify multishell-start-shell-in-buffer |
Date: |
Tue, 26 Jan 2016 16:58:17 +0000 |
branch: master
commit 96c68433cd0ad705f30d07c30c355548312249d8
Author: Ken Manheimer <address@hidden>
Commit: Ken Manheimer <address@hidden>
multishell - simplify multishell-start-shell-in-buffer
Apparently we don't need to go beneath the shell command to set the path
and tidy prior connections.
---
multishell.el | 54 ++++++++++++++++++------------------------------------
1 files changed, 18 insertions(+), 36 deletions(-)
diff --git a/multishell.el b/multishell.el
index 9dfa093..09635f9 100644
--- a/multishell.el
+++ b/multishell.el
@@ -575,43 +575,25 @@ and path nil if none resolved."
name)
(defun multishell-start-shell-in-buffer (buffer-name path)
- "Ensure a shell is started, with name NAME and PATH."
- ;; We work around shell-mode's bracketing of the buffer name, and do
- ;; some tramp-mode hygiene for remote connections.
-
- (let* ((buffer buffer-name)
- (prog (or explicit-shell-file-name
- (getenv "ESHELL")
- (getenv "SHELL")
- "/bin/sh"))
- (name (file-name-nondirectory prog))
- (startfile (concat "~/.emacs_" name))
- (xargs-name (intern-soft (concat "explicit-" name "-args")))
+ "Start, restart, or continue a shell in BUFFER-NAME on PATH."
+ (let* ((buffer (get-buffer buffer-name))
is-remote)
- (set-buffer buffer-name)
- (setq is-remote (and path (file-remote-p path)))
- (when (and is-remote
- (derived-mode-p 'shell-mode)
- (not (comint-check-proc (current-buffer))))
- ;; We're returning to an already established but disconnected remote
- ;; shell, tidy it:
- (tramp-cleanup-connection
- (tramp-dissect-file-name default-directory 'noexpand)
- 'keep-debug 'keep-password))
- (when is-remote
- (message "Connecting to %s" path))
- (if (and path (not (string= path "")))
- (cd path))
- (setq buffer (set-buffer (apply 'make-comint
- (multishell-unbracket-asterisks
buffer-name)
- prog
- (if (file-exists-p startfile)
- startfile)
- (if (and xargs-name
- (boundp xargs-name))
- (symbol-value xargs-name)
- '("-i")))))
- (shell-mode)))
+
+ (set-buffer buffer)
+
+ (when (and path (file-remote-p path))
+
+ (when (and (derived-mode-p 'shell-mode)
+ (not (comint-check-proc (current-buffer))))
+ ;; Returning to disconnected remote shell. Do some tidying:
+ (tramp-cleanup-connection
+ (tramp-dissect-file-name default-directory 'noexpand)
+ 'keep-debug 'keep-password))
+
+ (message "Connecting to %s" path)
+ (cd path))
+
+ (shell buffer)))
(defun multishell-track-dirchange (name newpath)
"Change multishell history entry to track current directory."
- [elpa] master updated (ad2214a -> e7f3aa4), ken manheimer, 2016/01/26
- [elpa] master 0341f3e 1/7: multishell README.md - Add link to ELPA package entry., ken manheimer, 2016/01/26
- [elpa] master 96c6843 3/7: multishell - simplify multishell-start-shell-in-buffer,
ken manheimer <=
- [elpa] master bd088d0 2/7: multishell - Refine documentation a bit., ken manheimer, 2016/01/26
- [elpa] master 423c41a 4/7: multishell - use eval-after-load when with-eval-after-load isn't around., ken manheimer, 2016/01/26
- [elpa] master 4d6a16a 5/7: multishell - save match-data whenever; relocate some helper funcs, ken manheimer, 2016/01/26
- [elpa] master f05c908 6/7: multishell - reduce multishell-primary-name savehist extra fuss, ken manheimer, 2016/01/26
- [elpa] master e7f3aa4 7/7: multishell - merge code tidying, still on 1.0.8., ken manheimer, 2016/01/26