Commit d38110ef authored by Paul Eggert's avatar Paul Eggert

Also prefer .emacs.d if .emacs exists

Problem reported by Katsumi Yamaoka (Bug#37456).
* lisp/startup.el (startup--xdg-or-homedot): Also
prefer .emacs.d if a traditional .emacs file exists.
parent 30026cfe
Pipeline #3204 failed with stage
in 23 minutes and 51 seconds
......@@ -475,7 +475,8 @@ the value refers to the corresponding source file.
@defvar user-emacs-directory
This variable holds the name of the Emacs default directory.
It defaults to @file{$@{XDG_CONFIG_HOME-'~/.config'@}/emacs/}
if that directory exists and @file{~/.emacs.d/} does not exist,
if that directory exists and @file{~/.emacs.d/} and @file{~/.emacs} do
not exist,
otherwise to @file{~/.emacs.d/} on all platforms but MS-DOS@.
Here, @file{$@{XDG_CONFIG_HOME-'~/.config'@}}
stands for the value of the environment variable @env{XDG_CONFIG_HOME}
......
......@@ -508,7 +508,14 @@ DIRS are relative."
(if (eq system-type 'ms-dos)
"/_emacs.d/"
"/.emacs.d/"))))
(if (file-exists-p emacs-d-dir)
(if (or (file-exists-p emacs-d-dir)
(if (eq system-type 'windows-nt)
(directory-files (concat "~" user-name) nil
"\\`[._]emacs\\(\\.elc?\\)?\\'")
(file-exists-p (concat "~" init-file-user
(if (eq system-type 'ms-dos)
"/_emacs"
"/.emacs")))))
emacs-d-dir
xdg-dir))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment