branch: externals/auctex commit a589542d9296cd18f117efbbd77e1f84d6a095a7 Author: Ikumi Keita <ik...@ikumi.que.jp> Commit: Ikumi Keita <ik...@ikumi.que.jp>
Add defensive `save-match-data' * preview.el.in (preview-set-texinputs): Follow the instruction "Simple Match Data Access" in elisp reference: A search which fails may or may not alter the match data. In the current implementation, it does not, but we may change it in the future. Don’t try to rely on the value of the match data after a failing search. --- preview.el.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/preview.el.in b/preview.el.in index b73b779..9dda658 100644 --- a/preview.el.in +++ b/preview.el.in @@ -2981,7 +2981,7 @@ With prefix argument REMOVE, remove it again." (setq pattern (regexp-quote preview-TeX-style-dir)) (dolist (env (cons "TEXINPUTS=" (copy-sequence process-environment))) (if (string-match "\\`\\(TEXINPUTS[^=]*\\)=" env) - (unless (string-match pattern env) + (unless (save-match-data (string-match pattern env)) (setenv (match-string 1 env) (concat preview-TeX-style-dir (substring env (match-end 0))))))))))