Having Cygwin, NTEmacs and SVN to all play nice

Let’s just say that my development environment it is a little messed up.

The Company has an ancient Cygwin version installed that is somewhat broken and not all the tools are there.  That said, it has bash and I can’t complain.  But I can’t install any other Cygwin packages on it, because I don’t have permissions to their directories. I need Emacs, so I installed NTEmacs to go with it.  Then I wanted to use SVN to keep some scripts, and other work-related project in. I couldn’t install Cygwin’s SVN package, of course, so I installed the Win32 build.  But I ran into a big problem in the fact that SVN uses Windows paths to make it’s temporary comments file instead of Unix-like path.  Also, NTEmacs doesn’t understand full Cygwin paths (it knows “src/java/file.java” but not “/cygdrive/c/src/java/file.java”).  So something needed to be done.

I ended up getting gnuserv to work on Windows — not an easy feat.  I put gnuserv.exe, gnuclient.exe, and gnuclientw.exe in my $HOME/bin directory.  Of course, Windows doesn’t really understand ~/bin very well.  So I put the whole mixed Windows path name in as EDITOR in my .bashrc.  Like so:

EDITOR="h:/bin/gnuclient"

Then I make sure that the following is in my $HOME/.emacs file:

(require 'gnuserv)
(setq gnuserv-frame (car (frame-list)))
(gnuserv-start)

As you probably guessed h:\ is my home directory.

Now then, when I want to edit a file from the command-line, or when I do an svn commit, it opens up in my already-running NTEmacs. When I’m done with the file, I save it and do C-x # and then I get my command-line back.

Leave a Reply

You must be logged in to post a comment.