Unique shell helper for Emacs

To launch a shell in Emacs, you can use M-x shell. However, when you want to launch another one, you have to name the second shell.

I usually don’t care much about naming shells, so I use this bit of code to launch a new shell. It creates a new shell and gives it a unique name. I named it “newsh”, so you can run it with M-x newsh. Here’s the function:

(defun newsh ()
"Run a new shell and rename it uniquely."
(interactive)
(save-excursion
  (shell)
  (rename-uniquely)))

One Response Subscribe to comments


  1. thad

    Andy, send me an email when you have time. I’d like to catch up. I intended to follow up on my drive by back in December and, well, now I have.

    Feb 17, 2009 @ 1:20 am

Reply