]> git.eshelyaron.com Git - emacs.git/commitdiff
Also prefer .emacs.d if .emacs exists
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 19 Sep 2019 07:59:59 +0000 (00:59 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 19 Sep 2019 08:01:35 +0000 (01:01 -0700)
Problem reported by Katsumi Yamaoka (Bug#37456).
* lisp/startup.el (startup--xdg-or-homedot): Also
prefer .emacs.d if a traditional .emacs file exists.

doc/lispref/os.texi
lisp/startup.el

index c94e96bde82eedd604c39cfafa103045acade689..ddbc8a82946f1ae0cc2d68e190fc8478c33320a3 100644 (file)
@@ -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}
index ef6234128aa7e2a789331f8b9bdaf677ac201ef3..4078f23f3a85ca84110fddf9471837e381e2a713 100644 (file)
@@ -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))))