Wednesday, 4 May 2011

Putting comments next to paragraphs in latex and emacs (fix fill-paragraph)

Again, this is just to save this for the edification of my future self.  For the rest of you, do avoid using 30 year old technology if you value achieving anything on a Wednesday.

So, I like to put little comments by my paragraphs in papers I'm writing:

% this is rubbish
blah blah blah

% this is just plain wrong
blah blah blah

% I have checked this and it is ok
dobedobedo bedadadada

Which is very useful, because this is the way to annotate the latex source so that I can understand why I've written what I did.  Now, the annoying thing is that I also like to bounce on M-q when I can't think of anything else to say, so my lovely paragraphs get turned into comments by the default emacs fill-paragraph command:

% I have checked this and it is ok debedobedo
% bedadadada

At which point the text disappears from my output, and I get cranky.

The solution is, of course, very simple but impossible to actually find (get it together google, you are now officially beyond being useless):

Get filladapt.el

Put it into site_lisp

And put this into ~/.emacs:

(require 'filladapt)
(add-hook 'text-mode-hook 'turn-on-filladapt-mode)

Also useful, discovered in an aside, is to associate files not with 'runemacs.exe', but with 'emacsclientw.exe' but then you have to set the environment variable to 'ALTERNATE_EDITOR' to 'path\to\runemacs.exe' OR IT WILL LAUGH AT YOU.

1 comment:

  1. I never know what you are talking about. But you always make me laugh.