major emacs rewrite, now with customize