branch: externals/org
commit 05064052ad0dfec93536dfcc17b460a9b2570e34
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    org-babel-map-call-lines: Avoid using `save-match-data'
    
    * lisp/ob-core.el (org-babel-map-call-lines): 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 dd82aa790f..44dcf60ae7 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -1337,9 +1337,10 @@ buffer."
         (setq ,to-be-removed (current-buffer))
         (goto-char (point-min))
         (while (re-search-forward "call_\\S-\\|^[ \t]*#\\+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))
-              (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)

Reply via email to