bug-auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-AUCTeX] 11.87; Failure to insert smart quotes in some circumsta


From: Dylan Thurston
Subject: Re: [Bug-AUCTeX] 11.87; Failure to insert smart quotes in some circumstances
Date: Sat, 11 Jan 2014 00:42:29 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Jan 11, 2014 at 01:36:44AM +0100, Mosè Giordano wrote:
> 2014/1/10 Dylan Thurston <address@hidden>:
> > 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]