PigPog: Portable Emacs-onna-Stick – USB Geekiness

Update: Moving this to a new platform, as it still gets a few clicks, and hopefully still works. Removing links to the site I got the method from, as it seems to have gone.

I had quite a phase of using Emacs a while ago. One problem I hit was that I’d find a great trick for using it for PHP and JavaScript stuff at work, then forget to copy the stuff to home. Then, I found a nice code-folding trick at home, and forgot to copy that to work. Once I realised, I had to fiddle about working out what bits I needed to copy between the two installations to make everything work the same.

I’m back with Emacs now, and trying to use PlannerMode for basic ‘GTD stuff’. If I can’t take my lists to work with me, though, it’s a bit less convenient. It’s much easier to have access to the lists there than to have to email stuff to work that I need to do there, or to home that I need to do there.

Today, though, I found what seems like the answer. I already tend to carry a USB stick drive thing around with me. Now, I can run Emacs from there, with all its data stored on a ‘home’ folder on there too. I got the idea of how to do it from this (gone!) blog post from clmemo@aka. It relates to doing the same thing with a version of Emacs set up for AUCTeX, but it works just the same with standard GNU Emacs.

What you need to do is…

(defvar usb-drive-letter (substring data-directory 0 3))
(defvar usb-home-dir (concat usb-drive-letter "home/"))
(setenv "HOME" usb-home-dir)

This solves a bit of a problem for me, and I’m sure I can’t be the only one with that problem – thank to clmemo@aka for showing me the answer.


Recent posts