From 11c3c54d8ade69003f441918b607f073e6fa39f1 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 3 Dec 2022 12:21:00 +0200 Subject: [PATCH] Fix handling of relative directories in "--init-directory=DIR" * lisp/startup.el (command-line): Interpret non-absolute file names in '--init-directory' relative to the directory from which Emacs is started. (Bug#59795) --- lisp/startup.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/startup.el b/lisp/startup.el index d985d57d3c7..6270de2ace6 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1261,7 +1261,9 @@ please check its value") (setq user-emacs-directory (or argval (pop args)) user-emacs-directory (if (stringp user-emacs-directory) (file-name-as-directory - user-emacs-directory) + (expand-file-name + user-emacs-directory + command-line-default-directory)) user-emacs-directory) argval nil)) ((member argi '("-u" "-user")) -- 2.39.2