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

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

[elpa] externals/org e09ad15a71 2/2: org-babel-read: Avoid `save-match-d


From: ELPA Syncer
Subject: [elpa] externals/org e09ad15a71 2/2: org-babel-read: Avoid `save-match-data'
Date: Sat, 4 May 2024 15:58:31 -0400 (EDT)

branch: externals/org
commit e09ad15a713972795b26edd5c5897066d94187fb
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    org-babel-read: Avoid `save-match-data'
    
    * lisp/ob-core.el (org-babel-read): Avoid fiddling with match data -
    it is not used.
---
 lisp/ob-core.el | 31 +++++++++++++++----------------
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 3d975bec24..c5dd20b0ed 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -3361,22 +3361,21 @@ situations in which is it not appropriate."
          ;; FIXME: Arbitrary code evaluation.
         (eval (read cell) t))
        ((let (read-val)
-           (save-match-data
-             (and (string-match
-                   (rx bos (0+ (any space ?\n))
-                       ?\" (0+ anychar) ?\"
-                       (0+ (any space ?\n)) eos)
-                   cell)
-                  ;; CELL is a single string
-                  (with-temp-buffer
-                    (insert cell)
-                    (goto-char 1)
-                    (when (setq read-val
-                                (ignore-errors
-                                  (read (current-buffer))))
-                      (skip-chars-forward "[:space:]")
-                      (eobp)))
-                  read-val))))
+           (and (string-match-p
+                 (rx bos (0+ (any space ?\n))
+                     ?\" (0+ anychar) ?\"
+                     (0+ (any space ?\n)) eos)
+                 cell)
+                ;; CELL is a single string
+                (with-temp-buffer
+                  (insert cell)
+                  (goto-char 1)
+                  (when (setq read-val
+                              (ignore-errors
+                                (read (current-buffer))))
+                    (skip-chars-forward "[:space:]")
+                    (eobp)))
+                read-val)))
        (t (org-no-properties cell))))
 
 (defun org-babel--string-to-number (string)



reply via email to

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