0
votes

I tried to compile the auctex from Emacs MELPA. The version is: 11.88.4

When I first open a .tex file, compile AUCTEX, and change to "TeX-latex-mode", Emacs will work properly, the menu bar also change to latex state.

However, when I close Emacs, restart Emacs again and open a .tex file, Emacs will give:

Debugger entered--Lisp error: (error "Autoloading failed to define function TeX-latex-mode")

And auctex will not work...

It seems the problem is in autoloading certain state when initialize the auctex for a tex file.

Any help?

1
This function is located in latex.el. Does locate-library latex find it?Andrew Swann
That is the problem. After I compiling auctex, the command gives the right location, '~/.emacs.d/elpa/auctex-11.88.4/latex.elc.' But once I close and reopen Emacs again, it gives the wrong location -- the folder where I defined my own lisp. What should I do?X.Arthur
Sounds like a load-path problem. Do you set that in your init file? Or perhaps some initialisation that needs to be delayed to after the package is loaded... What is your emacs version?Andrew Swann
24.5. I have someting like (add-to-list 'load-path' "~/.emacs.d/x_lisp/"), but that should not affect the auctex, shouldn it?X.Arthur
Do you have other packages loaded and working?Andrew Swann

1 Answers

0
votes

Problem Solved! My mistake.

I modularised my init.el and separated the LaTeX settings to latex.el, which conflict with the latex.el in auctex.

I renamed the file to latex_settings and everyting works fine. (A small warning that no docstring for 'tex-start-shell', but that's fine.)