aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2019-09-19 00:59:59 -0700
committerPaul Eggert2019-09-19 01:01:35 -0700
commitd38110efa75372d4c3be702f157d3a8c6b7f37b5 (patch)
tree812c055936b551436748bd486488236cbed64e87
parent30026cfe666e9647aeef73e26df5ffca2fa2c662 (diff)
downloademacs-d38110efa75372d4c3be702f157d3a8c6b7f37b5.tar.gz
emacs-d38110efa75372d4c3be702f157d3a8c6b7f37b5.zip
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.
-rw-r--r--doc/lispref/os.texi3
-rw-r--r--lisp/startup.el9
2 files changed, 10 insertions, 2 deletions
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index c94e96bde82..ddbc8a82946 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -475,7 +475,8 @@ the value refers to the corresponding source file.
475@defvar user-emacs-directory 475@defvar user-emacs-directory
476This variable holds the name of the Emacs default directory. 476This variable holds the name of the Emacs default directory.
477It defaults to @file{$@{XDG_CONFIG_HOME-'~/.config'@}/emacs/} 477It defaults to @file{$@{XDG_CONFIG_HOME-'~/.config'@}/emacs/}
478if that directory exists and @file{~/.emacs.d/} does not exist, 478if that directory exists and @file{~/.emacs.d/} and @file{~/.emacs} do
479not exist,
479otherwise to @file{~/.emacs.d/} on all platforms but MS-DOS@. 480otherwise to @file{~/.emacs.d/} on all platforms but MS-DOS@.
480Here, @file{$@{XDG_CONFIG_HOME-'~/.config'@}} 481Here, @file{$@{XDG_CONFIG_HOME-'~/.config'@}}
481stands for the value of the environment variable @env{XDG_CONFIG_HOME} 482stands for the value of the environment variable @env{XDG_CONFIG_HOME}
diff --git a/lisp/startup.el b/lisp/startup.el
index ef6234128aa..4078f23f3a8 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -508,7 +508,14 @@ DIRS are relative."
508 (if (eq system-type 'ms-dos) 508 (if (eq system-type 'ms-dos)
509 "/_emacs.d/" 509 "/_emacs.d/"
510 "/.emacs.d/")))) 510 "/.emacs.d/"))))
511 (if (file-exists-p emacs-d-dir) 511 (if (or (file-exists-p emacs-d-dir)
512 (if (eq system-type 'windows-nt)
513 (directory-files (concat "~" user-name) nil
514 "\\`[._]emacs\\(\\.elc?\\)?\\'")
515 (file-exists-p (concat "~" init-file-user
516 (if (eq system-type 'ms-dos)
517 "/_emacs"
518 "/.emacs")))))
512 emacs-d-dir 519 emacs-d-dir
513 xdg-dir)))) 520 xdg-dir))))
514 521