diff --git a/font-latex.el b/font-latex.el index e852ea7f..78256ce5 100644 --- a/font-latex.el +++ b/font-latex.el @@ -1914,10 +1914,12 @@ signs to follow the point and must be 1 or 2." ;; ignore this $. However, we need to keep our %$ ;; workaround intact if there has been a valid ;; occurrence of $ in a non-math context. - (not (and - (looking-back - (concat TeX-comment-start-regexp "[ \t]*")) - (looking-at "[$][ \t]*\n")))))) + + ;; If `num' is nil, we are searching "$" (or "$$") + ;; which begins math mode. In that case, we ignore + ;; it. Otherwise, we take it as a candidate which + ;; ends math mode. + (not num)))) (skip-chars-forward "$" limit)) ;; check 2: Else, is "$" escaped? ((TeX-escaped-p)