0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-07-20 03:26:28 +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)))))
(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)