17 May, 2011

Mairix on Windows-NT Emacs

Problem -- calling Mairix under Cygwin via mairix.el on a Windows-NT Emacs 23.2 results in an error from Mairix not finding the output folder.

The Mairix setup in my Emacs init file is
(require 'mairix)
(setq mairix-file-path "~/mail"
      mairix-mail-program (quote vm)
      mairix-search-file "search")
The error message in the *mairix output* buffer shows that Mairix is looking for the output folder, search, in mail/c:/cygwin/home/robert/mail/. The first mail/ part is Mairix prefixing base to the expanded value of mairix-file-path, c:/cygwin/home/robert/mail. This prefixing is done due to the value not starting with a / or a ., see the mairixrc(5) man page.

My quick fix was to patch the function mairix-call-mairix in mairix.el to prune away the c:/cygwin part added by expand-file-name. I actually redefined the function in my Emacs init file, but also uploaded a patch for mairix.el on the EmacsWiki.

I suspect there are much nicer ways to go about this, maybe locally make expand-file-name not to expand ~ to c:/cygwin/home/robert/ but to just /home/robert/.

No comments:

Post a Comment

Post a Comment