;; Source file: http://www.dd.chalmers.se/~bojohan/emacs/lisp/my-htmlize.el ;; Output: http://www.dd.chalmers.se/~bojohan/emacs/out.html ;; Make sure the the htmlize library is in load-path. ;; You might want to load ~/.emacs ;; USAGE: ;; emacs -batch -l my-htmlize.el INFILE > OUTFILE ;; Example: (custom-set-faces '(default ((t (:foreground "#ffffff" :background "black")))) '(font-lock-builtin-face ((t (:foreground "#ff0000")))) '(font-lock-comment-face ((t (:bold t :foreground "#333300")))) '(font-lock-constant-face ((t (:foreground "magenta")))) '(font-lock-function-name-face ((t (:bold t :foreground "Blue")))) '(font-lock-keyword-face ((t (:foreground "yellow3")))) '(font-lock-string-face ((t (:foreground "light blue")))) '(font-lock-type-face ((t (:foreground "green")))) '(font-lock-variable-name-face ((t (:foreground "cyan" :bold t)))) '(font-lock-warning-face ((t (:foreground "red" :weight bold))))) (setq htmlize-use-rgb-map 'force) (require 'htmlize) (find-file (pop command-line-args-left)) (font-lock-fontify-buffer) (with-current-buffer (htmlize-buffer) (princ (buffer-string)))