On Sat, Jan 11, 2014 at 01:36:44AM +0100, Mosè Giordano wrote:
> 2014/1/10 Dylan Thurston <[email protected]>:
> > AUCTeX can get confused about when to insert smart quotes. Apparently
> > this happens when a $ immediately follows a forced newline with \\. Here
> > is a minimal file:
> >
> > --------------------
> > \documentclass{article}
> > \begin{document}
> > ``test'' % Smart quotes work here as normal
> > \centerline{$a$ \\ $b$}
> > ``test'' % Still works here
> > \centerline{$a$\\$b$}
> > "test" % Smart quotes have stopped working
> > \end{document}
> > --------------------
> >
> > Note that systax highlighting works as normal, and AUCTeX is not
> > otherwise confused about whether I am in math mode.
>
> thanks for your report.  The problem is in the `texmathp' function,
> and in particular in the regexp used for searching math togglers, ie
> `texmathp-toggle-regexp'.  Its value is
> "\\([^\\\\\\$]\\|\\`\\)\\(\\$\\$\\|\\$\\)", but this doesn't match a
> dollar preceded by two escapes. ...

Can I suggest that, rather than having a regexp here, you try to match
the font-locking code? That code correctly deduces whether you are in
math mode or not, and if you figure that out once rather than twice
you are less likely to make mistakes (and get less confusing bugs as a
result).

Best,
        Dylan Thurston

_______________________________________________
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex

Reply via email to