I try to automatically load RefTeX for all my LaTeX files. However, when I launch Emacs I get the following error:

Error loading autoloads: (void-function defstruct)

What this error mean and how can I solve it?

(I suspect that this is the reason why RefTeX does not load automatically)

  • Does it mean that this happens if you start Emacs with an init file containing only this single line (require 'reftex)? – Arash Esbati Feb 7 '17 at 18:35
  • my init file has the following: (require 'reftex) (add-hook 'LaTeX-mode-hook 'turn-on-reftex) (setq reftex-plug-into-AUCTeX t) – Yorgos Feb 7 '17 at 18:38
  • yes, it does.... – Yorgos Feb 7 '17 at 18:42
  • Hmm, strange. The only thing comes to my mind is to put (require 'cl) before (require 'reftex). I grep'ed over the .el files from RefTeX and I don't see a defstruct. FWIW, it is a macro provided by cl library. Do you get the error if you start Emacs with emacs -q and emacs -Q? – Arash Esbati Feb 7 '17 at 19:01
  • 2
    Having no problem with emacs -q indicates something strange in your init file. My really last guess is that you start Emacs and do M-x list-load-path-shadows RET; maybe that output helps. – Arash Esbati Feb 7 '17 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.