Improving the Emacs integration in Windows

I was trying to make Windows a little more Emacs-friendly (or was it the other way around?). First step was to enable the emacs server in my .emacs so I could make use of Emacs for quick and dirty editing tasks that require an editor better than Notepad but where the average Emacs startup time was just a little too long to make Emacs a viable alternative. A typical example would be to use Emacs as the editor for commit messages in Mercurial. A quick tweak of my global .hgrc provided me with an appropriate editor setting:

           ... other settings ...
  editor = C:\Emacsen\emacs-24.1\bin\emacsclientw.exe -c

Please note that there are no quotation marks around the emacsclientw command line, adding them will result in an error message rather than an Emacs frame. Guess how I found that out. I would also suggest to extend the command line to include the “alternate editor” parameter -a to either start Emacs or another editor if there is no Emacs server running. Given that I tend to start Emacs right after I start the browser and the email client on most machines, this would be an unnecessarily cluttered command line for my use.

I also set up Emacs as an external editor from Visual Studio as described in this blog post, so now I can hit Tools/Edit in Emacs from Visual Studio 2012. Hooray! The only tweak I made to the emacsclientw invocation described in the blog post was to make “+$(CurLine)” the first parameter of the emacsclient invocation. That way, the Emacs cursor position is synchronised with the cursor position in Visual Studio at the time you invoked “Edit in Emacs”.

The stuff you find when you’re moving home

Happy New Year to all readers.

I’ve been blogging even less recently as we’ve just moved house but unpacking all the boxes meant that I came across one of my favourite magazines:



German readers of this blog (are there any) might recognise the magazine – it’s the first issue of “c’t”, a magazine that is still going on strong almost thirty years later. The issue above is dated November/December 1983 and has moved house (and continents) with me a fair number of times.

And yes, I’m still subscribing to c’t these days, although there are fewer articles in it that require a soldering iron.