For some reason I cannot export certain org-mode files to html. Org-files without headers work fine. However, if I have a file with

#+TITLE: This is the title of my website
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="css/stylesheet.css" />
#+OPTIONS: toc:t tex:t default TOC
#+STARTUP: inlineimages
This is my personal website.

I get the following error message make-htmlize-fstruct: Symbol’s function definition is void: record, and this is the debugger result.

Debugger entered--Lisp error: (void-function record)
  record(htmlize-fstruct "#e1e1e0" "#2d3743" nil nil nil nil nil nil nil)
  make-htmlize-fstruct(:foreground "#e1e1e0" :background "#2d3743")
  htmlize-make-face-map((default underline font-lock-variable-name-face font-lock-string-face font-lock-type-face matlab-cellbreak-face font-lock-keyword-face font-lock-constant-face font-lock-comment-face))
  htmlize-region(1 3566)
  org-html-htmlize-region-for-paste(1 3566)
  org-export-as(html nil nil nil (:output-file "index.html"))
  org-export-to-file(html "index.html" nil nil nil nil nil)
  org-html-export-to-html(nil nil nil nil)
  funcall-interactively(org-export-dispatch nil)
  call-interactively(org-export-dispatch nil nil)

Note that I had to remove some portion in the middle of the output, because it was very long and it had non-ASCII characters. I was able to found a similar issue here but don't know how they solved it. My emacs version is 25.2.2 and org-mode is v9.2. I am on a Linux Mint 19.1 machine.

  • 1
    record was added in Emacs 26.1, maybe your htmlize.el is compiled with Emacs 26.1? if that's true, you can try to recompile htlmize.el with your current version of Emacs to fix the issue. – xuchunyang Jan 26 at 14:44
  • Previously I was using emacs 27 from the emacs-snapshot repository. Since the downgrade to 25, and In order to avoid issues, I have deleted and reinstalled most of my packages with melpa. Can you tell me how should I proceed to recompile htmlize.el then? Thanks – Andre Jan 26 at 14:50
  • 1
    I use (setq package-user-dir (concat "~/.emacs.d/elpa-" emacs-version)) to avoid sharing packages across different versions of Emacs. – xuchunyang Jan 26 at 17:27

Using melpa requires that M-x package-reinstall RET and then type htmlize. Thanks xuchunyang

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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