Persistent emacs server sessions

emacs

In my spare time, I’ve been working on two tools to make emacs more useful to me by leveraging two key features: the ability to save the desktop state and the ability to have emacs clients connect to an emacs server.

For the former, I wrote an emacs-lisp package called desktop-autosave. Once initiated, the package will periodically save the desktop under the name of your choice. The benefit of this is that you do not have to remember to save the desktop explictly yourself before you exit emacs or before you experience an emacs or system crash. Moreover, the next time you start desktop-autosave with that same name, the corresponding desktop is automatically loaded into your emacs workspace.

For the latter, I wrote a bash shell script called ee that will allow you to connect to a named emacs server (bringing up the server if it is not already running). The value of this package is that you can now invoke ee wherever you would normally have invoked emacs, and by just specifying the name of the desired server, you can easily set up as many emacs sessions as you have concurrent projects.

The real benefit comes when you use both packages together. In this case, you can use ee to bring up a named emacs server, and that server will save its desktop to disk periodically. As long as emacs stays running, you can keep connecting to the same server from as many clients as you wish. After your emacs server terminates (by exiting normally, by crashing, or by the machine being reset), you can use ee to once again bring up a server with the same name. In this case, emacs will load the automatically-saved desktop file from disk and you will have in memory all the files that you were working on previously on that particular emacs server. Nifty, no?

Feel fry to try these packages out. They are available on GitHub. If you find them useful or if you find bugs, let me know. Enjoy!

Painful upgrade

For the past couple of months, I’ve been trying to upgrade to Fedora 12, but the process has not been working. The chkconfig package, in particular, has been refusing to install. This left my system in a not quite perfect state, where occasionally all programs would begin to crash until I rebooted in rescue mode and did a chroot /mnt/sysimage /usr/sbin/prelink -ua. A major pain. I could not find a solution online.

I was eagerly awaiting Fedora 13, hoping that installing that would go off without a hitch. No such luck. The solution, as it turned out, was to try to install the problematic rpm directly and resolve the issues manually (in my case, a directory was supposed to become a symlink). But then a couple of other packages had issues, and I just decided to bite the bullet and reinstall. Luckily, my /home was in a different partition than /, so it wasn’t excruciating.

Things I needed to restore upon successful installation were

  • /etc/{passwd,shadow,group,sudoers}
  • mount points listed in fstabs, and links to same
  • fonts
  • printer, samba
  • Chrome
  • NX
  • Picasa (still in progress due to a package dependency conflict)
  • crontabs

I still like Fedora alright, but this upgrade process was painful (though possibly my fault for not cleaning around properly after mucking around in my system). I’m glad I’m on FC13; I got some cool customizations finally done, about which I’ll write later. I am, however, starting to wonder whether any of these would be easier on Ubuntu. Stay tuned…