Some information about advices
An advice is mainly a method of last resort to customize the behavior of functions defined in other libraries. There are many variants of advice. Examples are:
overriding the function with another function (That is the extreme case where one completely replaces the original function.)
wrapping the original function with an ...
Starting from Omar's answer I've put together an interactive
function, dump-auctex-globals, that writes to the standard user's
Emacs directory a (very simple) Emacs Lisp file that sets the two
(defun dump-auctex-globals ()
"Write global LaTeX class and TeX input files to auctex-globals.el."
(let ((filename (expand-file-...
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 ...
In addition to @jagrg suggestion (to add :trigger-wrap "$") I found everything works as expected if I don't remove the $ pair from my modes
I.e., I had to comment out this line
(sp-local-pair 'latex-mode "$" nil :actions :rem)
This line alone does the trick
(sp-local-pair 'latex-mode "\\(" "\\)" :trigger "$" :trigger-wrap "$")