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

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

[elpa] externals/org 5ff5ac03b6 2/3: * lisp/ox.el (org-export-parse-incl


From: ELPA Syncer
Subject: [elpa] externals/org 5ff5ac03b6 2/3: * lisp/ox.el (org-export-parse-include-value): Remove `save-match-data'
Date: Fri, 25 Aug 2023 09:58:17 -0400 (EDT)

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

    * lisp/ox.el (org-export-parse-include-value): Remove `save-match-data'
    
    Avoid using GC-expensive `save-match-data'.
---
 lisp/ox.el | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/lisp/ox.el b/lisp/ox.el
index 5926baf158..1e7443be18 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -3463,20 +3463,17 @@ provided as the :unmatched parameter."
                  (setq value (replace-match "" nil nil value)))))
          (file
           (and (string-match "^\\(\".+?\"\\|\\S-+\\)\\(?:\\s-+\\|$\\)" value)
-               (prog1
-                   (save-match-data
-                     (let ((matched (match-string 1 value))
-                           stripped)
-                       (when (string-match "\\(::\\(.*?\\)\\)\"?\\'"
-                                           matched)
-                         (setq location (match-string 2 matched))
-                         (setq matched
-                               (replace-match "" nil nil matched 1)))
-                       (setq stripped (org-strip-quotes matched))
-                       (if (org-url-p stripped)
-                           stripped
-                         (expand-file-name stripped dir))))
-                 (setq value (replace-match "" nil nil value)))))
+               (let ((matched (match-string 1 value)) stripped)
+                 (setq value (replace-match "" nil nil value))
+                 (when (string-match "\\(::\\(.*?\\)\\)\"?\\'"
+                                     matched)
+                   (setq location (match-string 2 matched))
+                   (setq matched
+                         (replace-match "" nil nil matched 1)))
+                 (setq stripped (org-strip-quotes matched))
+                 (if (org-url-p stripped)
+                     stripped
+                   (expand-file-name stripped dir)))))
          (only-contents
           (and (string-match ":only-contents *\\([^: \r\t\n]\\S-*\\)?"
                              value)



reply via email to

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