Problem with some triggers in LaTeX mode
I am using smartparens with AUCTeX in emacs. I was going through the smartparens-latex.el file and trying out some of the code in there.
Let me consider code in lines 143- 150.
Expected behavior
So in LaTeX math mode if I press \l( or \l[
I should see \left (* \right ) and \left [ * \right ] where * is the point.
Actual behavior
Instead I get \left ((*) \right ) and \left [[* \right ].
Steps to reproduce the problem
Press \l( or \l[ inside LaTeX math mode with AUCTeX activated.
Environment & version information
smartparensversion: 20170207.2239- Active major-mode: AUCTeX
- Emacs version (
M-x emacs-version):26.0.50 - Spacemacs/Evil/Other starterkit (specify which)/Vanilla: Vanilla
- OS: Linux
Maybe the problem with double-quotes described at the end of https://emacs.stackexchange.com/a/34060/2370 is related?
For reference I cite here the relevant section:
As of 2017-07-09 (melpa-version 20170708.1326), https://github.com/Fuco1/smartparens/ seems to be broken.
If I press " in the middle between Testing and quotes of the following LaTeX text
\documentclass{article}
\usepackage[ngerman]{babel}
\begin{document}
Testing quotes
\end{document}
I get the following strange auto-insertion:
\documentclass{article}
\usepackage[ngerman]{babel}
\begin{document}
Testing'' ` quotes
\end{document}
One can follow the execution of sp-insert-pair.
The trigger character " is deleted. The open part of the pair is decomposed into its prefix " and its last character `.
The last character is inserted. Then it skips backward one thing. Thereby, the thing is whatever sp-get-thing returns (here it is just space).
There it inserts the closing part ''.
@TobiasZawada What you describe is a different problem I think. I don't guard the case where the trigger is also a pair prefix :/ We should probably open a different issue for that.
@Fuco1 Done: #772
This problem still persists as of 2019 It also exists when typing the full \left( command, then it creates \left(()\right).