emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org 9f12a1b9e4 4/4: org-babel-map-executables: Avoid us


From: ELPA Syncer
Subject: [elpa] externals/org 9f12a1b9e4 4/4: org-babel-map-executables: Avoid using `save-match-data'
Date: Sun, 27 Aug 2023 06:58:10 -0400 (EDT)

branch: externals/org
commit 9f12a1b9e496d1fcf506a92d07aebc82632b7b78
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]