I have following function as part of my emacs configuration.org settings for publishing org to html.

(defvar website-html-preamble
 <ul class="nav nav-tabs">
   <li role="presentation" class="active"><a href="/">Home</a></li>
   <li role="presentation"><a href="#">Profile</a></li>
   <li role="presentation"><a href="#">Messages</a></li>

 (defvar website-html-postamble 
     "<div class='footer'> Copyright 2016 %a (%v HTML).<br>Last updated %C. <br>   </div>")

  (setq org-publish-project-alist
      ("website" :components ("orgfiles"))
       :base-directory  ,org-mode-websrc-directory
       :base-extension "org"
       :publishing-directory  ,org-mode-publishing-directory
       :exclude "*/excluded/*" 
       :recursive t
       :publishing-function org-twbs-publish-to-html
       :headline-levels 3
   :section-numbers nil
       :with-toc nil
   :html-preamble ,website-html-preamble
   :Html-postamble ,website-html-postamble

",var-name" (eg: ,website-html-preamble) causes following problems (using org-babel-load-file to load config)

Debugger entered--Lisp error: (invalid-read-syntax "#") eval-buffer(# nil "c:/rahuketu/programming/EMAC/Emacs_Config/.emacs.d/configuration.el" nil t) ; Reading at buffer position 4284
load-with-code-conversion("c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/configuration.el" "c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/configuration.el" nil nil)
load("c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/configuration.el" nil nil t)
load-file("c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/configuration.el") org-babel-load-file("c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/configuration.org") eval-buffer(# nil "c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/init.el" nil t) ; Reading at buffer position 422
load-with-code-conversion("c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/init.el" "c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/init.el" t t)
load("c:/rahuketu/programming/EMACS/Emacs_Config/.emacs.d/init" t t)

[0 "\205\262 \306=\203 command-line() normal-top-level()

1 Answer 1


You need to use a back quote if you want the variables with commas to be replaced. See here.

But that's not where the error is coming from. You don't appear to have escaped the quote characters inside your preamble string. Reference

  • Thanks I have modified code to fix for quote inside the preamble string. However `backquote bit was the tricky one. Thanks for your help
    – Rahuketu86
    Dec 19, 2016 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.