I like to use htmlize-file in emacs to turn clojure source files into html.
I want to use it from the linux command line instead, or programmatically from clojure itself.
I tried
$ emacs --eval "(htmlize-file \"/home/john/file.clj\" ) (kill-emacs)"
and
$ emacs -batch --eval "(htmlize-file \"/home/john/file.clj\" )"
Both work, with caveats.
The first opens an X-window, which seems a bit inelegant, but it does do exactly the same highlighting that I'd see in a buffer, which is what I want.
The second one works in batch mode, but the only syntax highlighting that it does is to italicize the strings. I hypothesise that it's not loading clojure-mode or my favourite colour scheme.
Can anyone find a way of getting the second version to give the same results as the first? They both seem to load my .emacs file before evaling the (htmli....) bit.
Also, is there any way to send the commands to an already running emacs? And thus save the startup time?