branch: externals/org commit 9f12a1b9e496d1fcf506a92d07aebc82632b7b78 Author: Ihor Radchenko <yanta...@posteo.net> Commit: Ihor Radchenko <yanta...@posteo.net>
org-babel-map-executables: Avoid using `save-match-data' * lisp/ob-core.el (org-babel-map-executables): Drop `save-match-data' as it may be costly. --- lisp/ob-core.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 44dcf60ae7..8ba8948229 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -1367,11 +1367,12 @@ buffer." (goto-char (point-min)) (while (re-search-forward "\\(call\\|src\\)_\\|^[ \t]*#\\+\\(BEGIN_SRC\\|CALL:\\)" nil t) - (let ((,datum (save-match-data (org-element-context)))) + (let ((,datum (org-element-context))) (when (org-element-type-p ,datum '(babel-call inline-babel-call inline-src-block src-block)) - (goto-char (match-beginning 0)) + (goto-char (or (org-element-post-affiliated ,datum) + (org-element-begin ,datum))) (let ((,end (copy-marker (org-element-end ,datum)))) ,@body (goto-char ,end)