diff options
| author | Paul Eggert | 2019-09-19 00:59:59 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-09-19 01:01:35 -0700 |
| commit | d38110efa75372d4c3be702f157d3a8c6b7f37b5 (patch) | |
| tree | 812c055936b551436748bd486488236cbed64e87 | |
| parent | 30026cfe666e9647aeef73e26df5ffca2fa2c662 (diff) | |
| download | emacs-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.texi | 3 | ||||
| -rw-r--r-- | lisp/startup.el | 9 |
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 |
| 476 | This variable holds the name of the Emacs default directory. | 476 | This variable holds the name of the Emacs default directory. |
| 477 | It defaults to @file{$@{XDG_CONFIG_HOME-'~/.config'@}/emacs/} | 477 | It defaults to @file{$@{XDG_CONFIG_HOME-'~/.config'@}/emacs/} |
| 478 | if that directory exists and @file{~/.emacs.d/} does not exist, | 478 | if that directory exists and @file{~/.emacs.d/} and @file{~/.emacs} do |
| 479 | not exist, | ||
| 479 | otherwise to @file{~/.emacs.d/} on all platforms but MS-DOS@. | 480 | otherwise to @file{~/.emacs.d/} on all platforms but MS-DOS@. |
| 480 | Here, @file{$@{XDG_CONFIG_HOME-'~/.config'@}} | 481 | Here, @file{$@{XDG_CONFIG_HOME-'~/.config'@}} |
| 481 | stands for the value of the environment variable @env{XDG_CONFIG_HOME} | 482 | stands 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 | ||