diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/startup.el | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 2a85c004da1..1f545c66922 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -497,28 +497,28 @@ DIRS are relative." | |||
| 497 | (defvar startup--xdg-config-home-emacs) | 497 | (defvar startup--xdg-config-home-emacs) |
| 498 | 498 | ||
| 499 | ;; Return the name of the init file directory for Emacs, assuming | 499 | ;; Return the name of the init file directory for Emacs, assuming |
| 500 | ;; XDG-DIR is the XDG location and USER-NAME is the user name. | 500 | ;; XDG-DIR is the XDG location and USER-NAME is the user name. If |
| 501 | ;; If USER-NAME is nil or "", use the current user. | 501 | ;; USER-NAME is nil or "", use the current user. Prefer the XDG |
| 502 | ;; Prefer the XDG location unless it does does not exist and the | 502 | ;; location only if the .emacs.d location does not exist. |
| 503 | ;; .emacs.d location does exist. | ||
| 504 | (defun startup--xdg-or-homedot (xdg-dir user-name) | 503 | (defun startup--xdg-or-homedot (xdg-dir user-name) |
| 505 | (if (file-exists-p xdg-dir) | 504 | (let ((emacs-d-dir (concat "~" user-name |
| 506 | xdg-dir | 505 | (if (eq system-type 'ms-dos) |
| 507 | (let ((emacs-d-dir (concat "~" user-name | 506 | "/_emacs.d/" |
| 508 | (if (eq system-type 'ms-dos) | 507 | "/.emacs.d/")))) |
| 509 | "/_emacs.d/" | 508 | (cond |
| 510 | "/.emacs.d/")))) | 509 | ((or (file-exists-p emacs-d-dir) |
| 511 | (if (or (file-exists-p emacs-d-dir) | 510 | (if (eq system-type 'windows-nt) |
| 512 | (if (eq system-type 'windows-nt) | 511 | (if (file-directory-p (concat "~" user-name)) |
| 513 | (if (file-directory-p (concat "~" user-name)) | 512 | (directory-files (concat "~" user-name) nil |
| 514 | (directory-files (concat "~" user-name) nil | 513 | "\\`[._]emacs\\(\\.elc?\\)?\\'")) |
| 515 | "\\`[._]emacs\\(\\.elc?\\)?\\'")) | 514 | (file-exists-p (concat "~" init-file-user |
| 516 | (file-exists-p (concat "~" init-file-user | 515 | (if (eq system-type 'ms-dos) |
| 517 | (if (eq system-type 'ms-dos) | 516 | "/_emacs" |
| 518 | "/_emacs" | 517 | "/.emacs"))))) |
| 519 | "/.emacs"))))) | 518 | emacs-d-dir) |
| 520 | emacs-d-dir | 519 | ((file-exists-p xdg-dir) |
| 521 | xdg-dir)))) | 520 | xdg-dir) |
| 521 | (t emacs-d-dir)))) | ||
| 522 | 522 | ||
| 523 | (defun normal-top-level () | 523 | (defun normal-top-level () |
| 524 | "Emacs calls this function when it first starts up. | 524 | "Emacs calls this function when it first starts up. |