I've been using Gnu Emacs since it was publicly available (1985?), and have contributed some packages which are included with Emacs, notably the [Allout outliner](http://myriadicity.net/software-and-systems/craft/emacs-allout), [icomplete mode](http://www.emacswiki.org/emacs/IcompleteMode), and python-mode's [pdbtrack functionality](http://myriadicity.net/software-and-systems/craft/crafty-hacks#section-1). Like many long-time Emacs users, I've use some custom code, some of which I wouldn't do without. Here's a few items that I particularly like, and think might be useful to others - I hope to include more, as time allows.
-* **[poptoshell.el](./poptoshell.el)**
-
- I use the emacs shell a lot. I bind this to Meta-space to make it easy to:
-
- * Return to the current primary shell, in an alternate window
- * When within a shell buffer, get to the input prompt
- * Start alternate shells, and easily choose between any that are going:
- * With one universal argument, prompt for the name of the shell
- * with completion on existing names,
- * and new names to start a new shells.
- * Prefix names of new shells with paths, to specify starting directory
- * For a remote shell, use tramp-style remote path!
- * Without an explicit name following the last slash, the host name is
- used as the shell name. But the trailing name makes it easy to
- distinguish, eg, root shells: `/ssh:myserver.net|sudo:root@myserver.net:/#myserver`
- * Since the shell's current directory is used by default:
- * If the remote shell has been disconnected, it's reconnected by default, in the same directory where you left off
- * (So I exit remote shells I'm done with, but keep the buffers around - I just resume by Meta-space <shell-name>.)
- * Visiting files from a remote shell buffer visits relative to the remote host!
- * Change which shell is the session default by using a doubled
- universal argument.
- * Handy for a kind of current-project modality, easily changing
- which shell is the default as you change project focus.
+* **[multishell.el](./multishell.el)**
+
+ I use the emacs shell a *lot*. I bind this to Meta-space to make it easy to:
+
+ * Get to a shell buffer with a keystroke,
+ * ... or to the input point for the current shell buffer.
+ * Use universal arguments to launch and choose between alternate shell
+ buffers and to select which is default.
+ * Prepend a path to a new shell name to launch a shell in that directory,
+ * and use Emacs tramp path syntax to launch a remote shell.
+
+ On top of shell and tramp, this turns emacs into a versatile systems
+ management tool.
* **[xsel.el](./xsel.el)**
-;;; poptoshell.el --- manage interaction with multiple local and remote shells
+;;; multishell.el --- manage interaction with multiple local and remote shells
-;; Copyright (C) 1999-2011 Free Software Foundation, Inc. and Ken Manheimer
+;; Copyright (C) 1999-2016 Free Software Foundation, Inc. and Ken Manheimer
;; Author: Ken Manheimer <ken dot manheimer at gmail...>
;; Maintainer: Ken Manheimer <ken dot manheimer at gmail...>
;; current shell buffer. Use universal arguments to launch and choose
;; between alternate shell buffers and to select which is default. Prepend
;; a path to a new shell name to launch a shell in that directory, and use
-;; Emacs tramp path syntax to launch a remote shell.
+;; Emacs tramp path syntax to launch a remote shell. Fluidly articulate
+;; emacs shell power.
;;
;; See the pop-to-shell docstring for details.
;;
:group 'multishell)
;; Assert the customizations whenever the package is loaded:
-(with-eval-after-load "poptoshell"
+(with-eval-after-load "multishell"
(multishell:implement-command-key-choice))
(defcustom multishell:pop-to-frame nil
;; shell buffer names and paths across emacs sessions. To do so,
;; customize the `savehist' group, and:
-;; 1. Add `pop-to-shell-buffer-name-history' to Savehist Additional Variables.
+;; 1. Add `multishell:pop-to-shell-buffer-name-history' to Savehist Additional
+;; Variables.
;; 2. Activate Savehist Mode, if not already activated.
;; 3. Save.
(cond ((string= temp "") multishell:primary-name)
((string-match "^\\*\\(/.*/\\)\\(.*\\)\\*" temp)
(setq use-default-dir (match-string 1 temp))
- (bracket-asterisks
+ (multishell:bracket-asterisks
(if (string= (match-string 2 temp) "")
(let ((v (tramp-dissect-file-name
use-default-dir)))
(tramp-file-name-localname v)
use-default-dir))
(match-string 2 temp))))
- (t (bracket-asterisks temp))))
+ (t (multishell:bracket-asterisks temp))))
(curr-buff-proc (get-buffer-process from-buffer))
(target-buffer (if (and (or curr-buff-proc from-buffer-is-shell)
(not (member (buffer-name from-buffer)
(setq already-there t))
((or (not target-buffer)
- (not (setq inwin (get-visible-window-for-buffer target-buffer))))
+ (not (setq inwin
+ (multishell:get-visible-window-for-buffer target-buffer))))
;; No preexisting shell buffer, or not in a visible window:
(pop-to-buffer target-shell-buffer-name pop-up-windows))
(and (get-buffer-process from-buffer)
(goto-char (process-mark (get-buffer-process from-buffer)))))))
-(defun get-visible-window-for-buffer (buffer)
+(defun multishell:get-visible-window-for-buffer (buffer)
"Return visible window containing buffer."
(catch 'got-a-vis
(walk-windows
nil ; INITIAL-INPUT
'multishell:buffer-name-history ; HIST
)))
- (if (not (string= got "")) (bracket-asterisks got) default)))
+ (if (not (string= got "")) (multishell:bracket-asterisks got) default)))
-(defun bracket-asterisks (name)
+(defun multishell:bracket-asterisks (name)
"Return a copy of name, ensuring it has an asterisk at the beginning and end."
(if (not (string= (substring name 0 1) "*"))
(setq name (concat "*" name)))
(if (not (string= (substring name -1) "*"))
(setq name (concat name "*")))
name)
-(defun unbracket-asterisks (name)
+(defun multishell:unbracket-asterisks (name)
"Return a copy of name, removing asterisks, if any, at beginning and end."
(if (string= (substring name 0 1) "*")
(setq name (substring name 1)))
(tramp-dissect-file-name default-directory 'noexpand)
'keep-debug 'keep-password))
(setq buffer (set-buffer (apply 'make-comint
- (unbracket-asterisks buffer-name)
+ (multishell:unbracket-asterisks buffer-name)
prog
(if (file-exists-p startfile)
startfile)
'("-i")))))
(shell-mode)))
-(provide 'poptoshell)
+(provide 'multishell)