2014/1/12 Ralf Angeli <[email protected]>:
> * Mosč Giordano (2014-01-11) writes:
>
>> 2014/1/11 Ralf Angeli <[email protected]>:
>>>
>>> "\\([^\\$]\\|[^\\]\\(\\\\\\\\\\)*\\\\\\$\\|[^\\]\\(\\\\\\\\\\)+\\|\\`\\)\\(\\$\\$\\|\\$\\)"
>>>
>>
>> Thanks for your suggestions!  Unfortunately, this regexp doesn't match
>> the opening dollar in
>>     \\$something$
>
> Hm, in my case it does.  Though, point has to be at least one character
> before the first backslash for it to work.

I applied the attached patch to test your regexp, but the reported bug
is still there.  Am I missing something?

Bye,
Mosè
diff --git a/texmathp.el b/texmathp.el
index 350406b..d4fa648 100644
--- a/texmathp.el
+++ b/texmathp.el
@@ -171,7 +171,8 @@ customize (customize calls it when setting the variable)."
 		  (mapconcat 'regexp-quote switches "\\|")
 		  "\\)")
 	  texmathp-toggle-regexp
-	  (concat "\\([^\\\\\\$]\\|\\`\\)\\("
+	  (concat "\\([^\\$]\\|[^\\]\\(\\\\\\\\\\)*\\\\\\$\\|"
+		  "[^\\]\\(\\\\\\\\\\)+\\|\\`\\)\\("
 		  (mapconcat 'regexp-quote togglers "\\|")
 		  "\\)"))))
 
@@ -286,7 +287,7 @@ See the variable `texmathp-tex-commands' about which commands are checked."
 	  (goto-char (cdr match))
 	  (while (re-search-forward texmathp-toggle-regexp pos t)
 	    (if (setq math-on (not math-on))
-		(setq sw-match (cons (match-string 2) (match-beginning 2)))
+		(setq sw-match (cons (match-string 4) (match-beginning 4)))
 	      (setq sw-match nil)))
 	  (and math-on sw-match (setq match sw-match))))
 
_______________________________________________
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex

Reply via email to