Open TobiasZawada opened 7 years ago
Perhaps related: in the following document
\documentclass{article}
\begin{document}
Insert quotes here:
$f' = 0$
\end{document}
typing "
before the math formula inserts opening quotes at the point (which is okay) but also "closes" the pair by inserting an apostrophe '
right after the one already in the file, which is not okay.
@nidrissi Not sure if related but this bug is hilarious either way :D I think it would be better if you started a new issue, thanks!
The issue from OP actually seems to be already fixed on master, at least I can't reproduce it with the given setup.
@TobiasZawada could you please verify that this is fixed?
I am getting the same problem.
I had the same problem, but after some experimenting, I managed to fix it. Note that this only applies to german quotes, not to french ones. It seems this issue is caused by Smartparens and AUCTeX disagreeing over the type of quotes to be inserted. I configured AUCTeX to automatically expand "
into the correct opening quote, which, in turn, triggers Smartparens to insert the correct closing quote. Now everything seems to work as expected.
I first registered german quote syntax as a new pair. Note the lack of a :trigger
. (I'm not entirely sure what the function of the post-handler does, so I left it in)
(sp-with-modes '(tex-mode
plain-tex-mode
latex-mode
LaTeX-mode)
(sp-local-pair "\"`" "\"'"
:unless '(sp-latex-point-after-backslash sp-in-math-p)
:post-handlers '(sp-latex-skip-double-quote)))
Then I configured AUCTeX to automatically insert the german opening quote, when "
is pressed. The corresponding entry in my custom-set-variables
looks like this:
'(TeX-quote-language-alist (quote (("ngerman" "\"`" "\"'" nil))))
Expected behavior
If I press " in the middle between
Testing
andquotes
of the following LaTeX textI expect to get
with point placed between
`
and'
.Actual behavior
I get the following strange auto-insertion:
Steps to reproduce the problem
Run
(require 'smartparens-latex)
open the above text file, activatesmartparens-mode
and type " in the middle betweenTesting
andquotes
.Environment & version information
smartparens
version: melpa, 20170708.1326latex-mode
from AucTeXM-x emacs-version
): 25.1 on linux and GNU Emacs 25.2.1 (x86_64-unknown-cygwin, GTK+ Version 3.22.10) of 2017-04-21