Fuco1 / smartparens

Minor mode for Emacs that deals with parens pairs and tries to be smart about it.
GNU General Public License v3.0
1.81k stars 193 forks source link

escaped $ in math mode #1065

Open slyfr opened 3 years ago

slyfr commented 3 years ago

Expected behavior

When in a math environment typing \$ should insert \$.

Actual behavior

Steps to reproduce the problem

Enter in latex-mode create the math environments en type \$

Backtraces if necessary (M-x toggle-debug-on-error)

Environment & version information

In recent enough smartparens you can call M-x sp-describe-system to generate this report. Please fill manually what we could not detect automatically. Edit the output as you see fit to protect your privacy.

Fuco1 commented 3 years ago

For me in both cases \$$ is inserted.

slyfr commented 3 years ago

I tried to modify

(sp-local-pair "$" "$")

into

(sp-local-pair "$" "$" 
                      :unless '(sp-latex-point-after-backslash ))

but it does not work... I do not see how to modify the code to obtain the right behaviour.

Fuco1 commented 3 years ago

Yea it's probably a regression caused by some changes in latex-mode.

slyfr commented 3 years ago

I guess so.

Do you have any idea on how to observe what happens en inputing '$' after '\'?