Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with some triggers in LaTeX mode #771

Open
sdban opened this issue Jul 10, 2017 · 4 comments
Open

Problem with some triggers in LaTeX mode #771

sdban opened this issue Jul 10, 2017 · 4 comments

Comments

@sdban
Copy link

sdban commented Jul 10, 2017

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

  • smartparens version: 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
@TobiasZawada
Copy link

TobiasZawada commented Jul 10, 2017

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 ''.

@Fuco1
Copy link
Owner

Fuco1 commented Jul 10, 2017

@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.

@TobiasZawada
Copy link

@Fuco1 Done: #772

@Fuco1 Fuco1 added this to the Backlog milestone Dec 4, 2017
@rommeswi
Copy link

rommeswi commented Sep 3, 2019

This problem still persists as of 2019
It also exists when typing the full \left( command, then it creates \left(()\right).

@Fuco1 Fuco1 removed this from the Backlog milestone Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To triage
Development

No branches or pull requests

4 participants