I often use AuCTeX to create my latex documents, so I often use the $ dollar sign.
If autopair is turned on in auxiliary mode, on insertion ( it automatically inserts ) (there are some exceptions where it is not, for example, if you insert it after \ , but I like exceptions) and place the cursor between them, so you have (<cursor>) , now if you type a + b) , you will get (a+b) , not (a+b)) .
I would like to have a similar behavior with $ , which only works in TeX-mode when I turn on autopair-mode .
I tried adding followint to my .emacs:
(add-hook 'TeX-mode-hook #'(lambda () (push '(?$ . ?$) (getf autopair-extra-pairs :everywhere))))
but for some reason this does not work.
The problem is that you usually have many $...$ expressions, and when you insert one $ , all the text before that $ gets the wrong color, which is annoying, and then after closing the initial $ text is fixed after the original $ .
Zero
source share