[Top][All Lists]

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

[Emacs-diffs] master da3e101: ; Try not to affect match data

From: Mark Oteiza
Subject: [Emacs-diffs] master da3e101: ; Try not to affect match data
Date: Wed, 6 Sep 2017 11:21:01 -0400 (EDT)

branch: master
commit da3e1016349b2f552f149ccf577b60e377c3095a
Author: Mark Oteiza <address@hidden>
Commit: Mark Oteiza <address@hidden>

    ; Try not to affect match data
    * lisp/xdg.el (xdg-user-dir): Use save-match-data.
 lisp/xdg.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/xdg.el b/lisp/xdg.el
index 4973065..916de00 100644
--- a/lisp/xdg.el
+++ b/lisp/xdg.el
@@ -140,9 +140,10 @@ This should be called at the beginning of a line."
 (defun xdg-user-dir (name)
   "Return the path of user directory referred to by NAME."
   (when (null xdg-user-dirs)
-    (setq xdg-user-dirs
-          (xdg--user-dirs-parse-file
-           (expand-file-name "user-dirs.dirs" (xdg-config-home)))))
+    (save-match-data
+      (setq xdg-user-dirs
+            (xdg--user-dirs-parse-file
+             (expand-file-name "user-dirs.dirs" (xdg-config-home))))))
   (let ((dir (cdr (assoc name xdg-user-dirs))))
     (when dir (expand-file-name dir))))

reply via email to

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