summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2013-02-27 10:00:40 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2013-02-27 10:00:40 +0100
commitc086ea0832b30ff8797eedb270c247043f43abaa (patch)
treee3741b2333f7c19c3fe68f4e0366641a856067d3
parent091bf0251454d4a9e00fd7054a25b0097822253a (diff)
downloadorg-mode-c086ea0832b30ff8797eedb270c247043f43abaa.tar.gz
Fix infloop when user provides a wrong value for `org-highlight-latex-and-related'
* lisp/org.el (org-do-latex-and-related): Fix infloop when user provides a wrong value for `org-highlight-latex-and-related'. In this case, `org-latex-and-related-regexp' is the empty string and generates an infloop since matching it doesn't move point.
-rw-r--r--lisp/org.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/org.el b/lisp/org.el
index a8bccf1..729d17e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5913,7 +5913,7 @@ Result depends on variable `org-highlight-latex-and-related'."
LIMIT bounds the search for syntax to highlight. Stop at first
highlighted object, if any. Return t if some highlighting was
done, nil otherwise."
- (when org-highlight-latex-and-related
+ (when (org-string-nw-p org-latex-and-related-regexp)
(catch 'found
(while (re-search-forward org-latex-and-related-regexp limit t)
(unless (memq (car-safe (get-text-property (1+ (match-beginning 0))