Hi Dylan, 2014/1/10 Dylan Thurston <dpthu...@indiana.edu>: > 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. "\\(\\\\\\\\\\|[^\\\\\\$]\\|\\`\\)\\(\\$\\$\\|\\$\\)" should do the trick, but I'd like a confirmation by someone more experienced in regexps than me. Actually we should make sure there is an even number of escapes, not just two, then perhaps something like `TeX-escaped-p' might be needed. Bye, Mosè _______________________________________________ bug-auctex mailing list bug-auctex@gnu.org https://lists.gnu.org/mailman/listinfo/bug-auctex