Thank you for asking this question! This has been bothering me for a
long time, but I never did anything about it until your question gave
me a little extra motivation.
Turns out it's pretty simple to make the cache by hand. You just need
to arrange to assign values to two variables after AUCTeX is loaded:
(setq LaTeX-global-class-files '("List of document classes"))
(setq TeX-global-input-files '("List of packages"))
(Those, of course, are placeholders: I'll explain one way to get the
correct lists below.)
So, if in your init file you have some configuration for AUCTeX, just
stick in those assignments (for example, I have a (use-package 'latex
:ensure auctex ...)
form in my init file and I put the assignments
after :config
). If you currently don't have any configuration for
AUCTeX, you can wrap those assignments in a with-eval-after-load
form, just be aware that the feature AUCTeX provides is called
latex
(and not auctex
or something like that), so you'd do:
(with-eval-after-load 'latex
(setq LaTeX-global-class-files '("List of document classes"))
(setq TeX-global-input-files '("List of packages")))
OK, so to generate the lists what I did was simply start a new LaTeX
file, insert a document environment and a package, and then use
describe-variable
(bound to C-h v
) to see the help for those
variables. The help buffer that pops up also includes the current
value of the variable and you can yank it from there to the proper
place in your init file (don't forget to add the single quote at the
beginning).
And, to be honest, I didn't want to clutter my init file with those
huge lists (I have 185 document classes and 2934 packages), so I put
the assignments in their own file that I load from my init file.