0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-05 09:12:52 +00:00

* lisp/ox.el (org-export-parse-include-value): Remove `save-match-data'

Avoid using GC-expensive `save-match-data'.
This commit is contained in:
Ihor Radchenko 2023-08-25 14:12:31 +03:00
parent 0ceb562b33
commit 5ff5ac03b6
No known key found for this signature in database
GPG key ID: 6470762A7DA11D8B

View file

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