diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2014-03-14 19:38:08 +0100 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2014-03-14 19:41:06 +0100 |
commit | 8012443bc8ee054b579314dab30fa7b4f4e12016 (patch) | |
tree | a4fcdfd7cda714e1486f4887813629241b390b1d | |
parent | e3fa9355f39dbcfc38d5919d03e29035eed2525f (diff) | |
download | org-mode-8012443bc8ee054b579314dab30fa7b4f4e12016.tar.gz |
org-element: Speed up parsing
* lisp/org-element.el (org-element-inline-babel-call-successor):
Improve speed.
-rw-r--r-- | lisp/org-element.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/org-element.el b/lisp/org-element.el index 275b013..467616e 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -2880,8 +2880,12 @@ CONTENTS is nil." Return value is a cons cell whose CAR is `inline-babel-call' and CDR is beginning position." (save-excursion - (when (re-search-forward org-babel-inline-lob-one-liner-regexp nil t) - (cons 'inline-babel-call (match-end 1))))) + (catch 'exit + (while (search-forward "call_" nil t) + (save-excursion + (goto-char (match-beginning 0)) + (when (looking-at org-babel-inline-lob-one-liner-regexp) + (throw 'exit (cons 'inline-babel-call (point))))))))) ;;;; Inline Src Block |