[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ef022b1 8/8: multishell - merge latest updates
[elpa] master ef022b1 8/8: multishell - merge latest updates
Fri, 29 Jan 2016 06:41:47 +0000
Merge: a136ff8 6e308f9
Author: Ken Manheimer <address@hidden>
Commit: Ken Manheimer <address@hidden>
multishell - merge latest updates
Still at 1.0.8.
packages/multishell/multishell.el | 68 +++++++++++++++++++++++++------------
1 files changed, 46 insertions(+), 22 deletions(-)
diff --git a/packages/multishell/multishell.el
index dc20308..2f43752 100644
@@ -57,6 +57,20 @@
;; Change Log:
+;; * XXX 1.0.9 Ken Manheimer:
+;; - Allow existing shell buffers names as completions, even though they
+;; duplicate the names with paths. The different behavior for entries
+;; with existing buffers is actually useful. And in accord with actual
+;; behavior, where changing path for existing shells doesn't, actually.
+;; - Add paths to buffers started without one, if multishell history dir
+;; tracking is enabled.
+;; - Substantial code cleanup:
+;; - simplify multishell-start-shell-in-buffer, in particular using
+;; shell function, rather than unnecessarily going underneath it.
+;; - fallback to eval-after-load in emacs, that lack
+;; with-eval-after-load (eg, emacs 23).
+;; - save-match-data, where match-string is used
+;; - resituate some helpers
;; * 2016-01-24 1.0.8 Ken Manheimer:
;; - Work around the shell/tramp mishandling of remote+sudo+homedir problem!
;; The work around is clean and simple, basically using high-level `cd'
@@ -88,7 +102,7 @@
;; * 2016-01-04 1.0.4 Ken Manheimer - Released to ELPA
;; * 2016-01-02 Ken Manheimer - working on this in public, but not yet
+;; TODO and Known Issues:
;; * Find suitable, internally consistent ways to tidy completions, eg:
;; - first list completions for active shells, then present but inactive,
@@ -100,9 +114,18 @@
;; - minibuffer-local-completion-map, minibuffer-local-must-match-map
;; - setup minibuffer with these vars just before doing completions
;; - minibuffer exit reverts these vars, if necessary
-;; - toggles between name and name/path if last command was one of them
-;; - and an instruction in the completion buffer
-;; - "complete again immediately to toggle name vs name/path completions"
+;; - toggles between name and name/path if repeat count provided
+;; - and an instruction about toggling in the completion buffer
+;; - eventually? "multishell-list-all", based on tabulated-list-mode
+;; - list-environment package is small, tidy, may be an easy template?
+;; - sort based on existing vs just historical
+;; - launch
+;; - rename, change path, and remove history entries
+;; - could we use it as the transient completions help window?
+;; * Investigate whether we can recognize and provide for failed hops.
+;; - Tramp doesn't provide useful reactions for any hop but the first
+;; - Might be stuff we can do to detect and convey failures?
+;; - Might be no recourse but to seek tramp changes.
;; * Add custom shell launch prep actions
;; - shell commands to execute when shell name or path matches a regexp
;; - list of [regexp, which (name, path, or both), command]
@@ -337,14 +360,14 @@ For example:
buffer will be named \"*interior*\". You could append a sudo
hop to the path, combining the previous example, and so on.
-Thanks to tramp, file visits from the shell, and many common
-emacs activities, like dired, will seamlessly be in the auspices
-of the target account, and relative to the current directory, on
-the host where the shell is running.
+File visits from the shell, and many common emacs activities like
+dired, will be on the host where the shell is running, in the
+auspices of the target account, and relative to the current
You can change the startup path for a shell buffer by editing it
-at the completion prompt. The new path will be preserved in
-history but will not take effect for an already-running shell.
+at the completion prompt. The new path will not take effect for
+an already-running shell.
To remove a shell buffer's history entry, kill the buffer and
affirm removal of the entry when prompted.
@@ -408,9 +431,11 @@ customize the savehist group to activate savehist."
(not (setq inwin
;; 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
(not (equal (window-frame (selected-window))
@@ -494,8 +519,8 @@ Return the supplied name, if provided, else return nil."
(and (buffer-live-p buffer)
;; Shell mode buffers.
- (derived-mode-p 'shell-mode))
- (not (multishell-history-entries name))
+ (and (derived-mode-p 'shell-mode)
+ (comint-check-proc (current-buffer))))
@@ -551,15 +576,15 @@ 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-active)
+ (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 (comint-check-proc (current-buffer))))
- ;; 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-dissect-file-name default-directory 'noexpand)
@@ -575,7 +600,7 @@ and path nil if none resolved."
(dolist (entry entries)
(let* ((name-path (multishell-split-entry entry))
(name (car name-path))
- (path (cadr name-path)))
+ (path (or (cadr name-path) "")))
(let* ((is-remote (file-remote-p path))
(vec (and is-remote (tramp-dissect-file-name path nil)))
@@ -601,7 +626,7 @@ and path nil if none resolved."
(aref vec 2)
(aref vec 4))
(newentry (concat name newpath))
(membership (member entry multishell-history)))
@@ -619,8 +644,7 @@ and path nil if none resolved."
- (when (and multishell-was-default-directory
- (not (string= curdir multishell-was-default-directory)))
+ (when (not (string= curdir (or multishell-was-default-directory "")))
- [elpa] master updated (a136ff8 -> ef022b1), ken manheimer, 2016/01/29
- [elpa] master 0eb0987 1/8: multishell - refine some docstring bumpiness, ken manheimer, 2016/01/29
- [elpa] master f01cf3f 3/8: multishell-start-shell-in-buffer - consolidate conditions better, ken manheimer, 2016/01/29
- [elpa] master 77c698c 6/8: multishell - add pending 1.0.9 changes, revise TODO/known issues, ken manheimer, 2016/01/29
- [elpa] master 57f56f2 2/8: multishell - don't skip cd when restarting local shells; note new starts, ken manheimer, 2016/01/29
- [elpa] master 8cea630 4/8: multishell - don't inhibit buffer names from completions., ken manheimer, 2016/01/29
- [elpa] master 81c9e3e 5/8: multishell - add paths to shells started without one, when dir tracking, ken manheimer, 2016/01/29
- [elpa] master 6e308f9 7/8: multishell - include active shell buffers names along with history entries., ken manheimer, 2016/01/29
- [elpa] master ef022b1 8/8: multishell - merge latest updates,
ken manheimer <=