* lisp/xdg.el (xdg--dir-home): Make it a function

This commit is contained in:
Stefan Monnier 2021-10-26 11:39:32 -04:00
parent 5861b8d027
commit 58e271fc5e

View file

@ -41,13 +41,11 @@
;; XDG Base Directory Specification
;; https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
(defmacro xdg--dir-home (environ default-path)
(declare (debug (stringp stringp)))
(let ((env (make-symbol "env")))
`(let ((,env (getenv ,environ)))
(if (or (null ,env) (not (file-name-absolute-p ,env)))
(expand-file-name ,default-path)
,env))))
(defun xdg--dir-home (environ default-path)
(let ((env (getenv environ)))
(if (or (null env) (not (file-name-absolute-p env)))
(expand-file-name default-path)
env)))
(defun xdg-config-home ()
"Return the base directory for user specific configuration files.