; Try not to affect match data
* lisp/xdg.el (xdg-user-dir): Use save-match-data.
This commit is contained in:
parent
01a82957d2
commit
da3e101634
1 changed files with 4 additions and 3 deletions
|
@ -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))))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue