I am using org-mode for generating a static website for my notes. For this, I followed the tutoriala at:


And this is the relevant part on my .emacs file:

;; Org-mode html publish
(require 'ox-publish)
(setq org-publish-project-alist
        :base-directory "~/org/"
        :base-extension "org"
        :publishing-directory "~/public_html/"
        :recursive t
        :publishing-function org-html-publish-to-html
        :headline-levels 4             ; Just the default for this project.
        :auto-preamble t
        :base-directory "~/org/"
        :base-extension "css\\|js\\|php\\|jpg\\|png\\"
        :publishing-directory "~/public_html/"
        :recursive t
        :publishing-function org-publish-attachment
    ("org" :components ("org-notes" "org-static"))

And I used this one for quite some time now. But lately, when I do M-x org-publish-project and pick org-static, it fails with the error message Invalid regexp: "Unmatched ( or \\(". I wonder where is the problem in my config and how this started failing all of a sudden. The project org-notes still works fine.

  • 1
    You should make sure that debug-on-error is set (by using M-x toggle-debug-on-error or ortherwise) and add the backtrace to the question. My guess is that the base-extension regexp should be "css\\|js\\|php\\|jpg\\|png" - the final (escaped) backslash looks out of place.
    – NickD
    Commented Sep 27, 2020 at 12:46

1 Answer 1


Check the comment from @NickD, regex:

:base-extension "css\\|js\\|php\\|jpg\\|png\\"

is indeed wrong if we follow the tutorial exactly. I removed the last \\. Still, as I said, this was working before. The actual error was that a package named cl is not supported by Emacs anymore. For that, I had to see which packages are depending on it and I evaluated following on *scratch*:

(require 'loadhist)
(file-dependents (feature-file 'cl))

and saw that the package htmlize, which I use for org publishing was depending on it. The newer versions of this package are updated to work without the cl package. So, I had to reinstall htmlize basically and things started working again.

  • +1 for the way to check dependencies. What version of emacs are you running? I can still find cl.el in upstream emacs and it is installed (and found) under /usr/local/share/emacs/28.0.50/lisp/obsolete/cl.elc.
    – NickD
    Commented Sep 28, 2020 at 11:39
  • I upgraded to emacs28 and started getting the error related to cl. Previously I was using emacs26. Maybe difference is because I am using some Windows builds?
    – meguli
    Commented Oct 2, 2020 at 9:07

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.