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.8k stars 193 forks source link

strange quote insertion in latex comments #1199

Open dankessler opened 3 months ago

dankessler commented 3 months ago

Expected behavior

Suppose I am editing a comment in a latex file, e.g.,

Blah blah
% here is a comment (|)
blah blah

where point is at (|).

If I strike ", I expect the insertion of a plain ", or perhaps a pair like either "(|)" or like ``(|)''

Actual behavior

Instead, I get this

Blah blah
% here is a comment`(|)'''
blah blah

Steps to reproduce the problem

  1. Install smartparens
  2. Configure with (require 'smartparens-config)
  3. Open a LaTeX file
  4. Activate smartparens: (smartparens-mode)
  5. Put cursor in a commented line (one that starts with %)
  6. Strike "

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

Environment & version information

I first noticed this in spacemacs, but I reproduced this in Vanilla emacs with only smartparens installed (using straight installed commit 3ed34cb67e3cabfb90e4271da3b581887d8b2d78). This issue appears whether I use LaTeX-mode as provided by auctex, or just the latex-mode that ships with emacs.

Commentary

I'm not sure what's going all batty, but I suspect this could be fixed by adding sp-in-comment-p here

Fuco1 commented 2 months ago

I can reproduce this, will look into it. It must be some of the recent changes I did