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

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

[elpa] externals/auctex a589542 15/26: Add defensive `save-match-data'


From: Tassilo Horn
Subject: [elpa] externals/auctex a589542 15/26: Add defensive `save-match-data'
Date: Thu, 12 Aug 2021 11:18:22 -0400 (EDT)

branch: externals/auctex
commit a589542d9296cd18f117efbbd77e1f84d6a095a7
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@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))))))))))



reply via email to

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