From d003d56eaf5ffb8c2106ef69cbbc6bbee57b7e00 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 8 Sep 2013 23:24:42 +0200 Subject: [PATCH] org-element: Fix paragraph parsing * lisp/org-element.el (org-element-paragraph-parser): Small fixes to paragraph parsing. --- lisp/org-element.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index 28148b7c2..b1b8f2f37 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -2172,20 +2172,21 @@ Assume point is at the beginning of the paragraph." (re-search-forward "^[ \t]*#\\+END:?[ \t]*$" limit t))) ;; Stop at valid blocks. - (and (looking-at - "[ \t]*#\\+BEGIN_\\(\\S-+\\)") + (and (looking-at "[ \t]*#\\+BEGIN_\\(\\S-+\\)") (save-excursion (re-search-forward (format "^[ \t]*#\\+END_%s[ \t]*$" - (match-string 1)) + (regexp-quote + (match-string-no-properties 1))) limit t))) ;; Stop at valid latex environments. (and (looking-at - "^[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}[ \t]*$") + "[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}") (save-excursion (re-search-forward (format "^[ \t]*\\\\end{%s}[ \t]*$" - (match-string 1)) + (regexp-quote + (match-string-no-properties 1))) limit t))) ;; Stop at valid keywords. (looking-at "[ \t]*#\\+\\S-+:") -- 2.11.4.GIT