Move publishing code into separate Emacs Lisp script