aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/startup.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/startup.el')
-rw-r--r--lisp/startup.el45
1 files changed, 29 insertions, 16 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index 4dbf41d3ac6..765ca1540ee 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -392,6 +392,15 @@ Warning Warning!!! Pure space overflow !!!Warning Warning
392 :type 'directory 392 :type 'directory
393 :initialize 'custom-initialize-delay) 393 :initialize 'custom-initialize-delay)
394 394
395(defconst package-subdirectory-regexp
396 "\\([^.].*?\\)-\\([0-9]+\\(?:[.][0-9]+\\|\\(?:pre\\|beta\\|alpha\\)[0-9]+\\)*\\)"
397 "Regular expression matching the name of a package subdirectory.
398The first subexpression is the package name.
399The second subexpression is the version string.
400
401The regexp should not contain a starting \"\\`\" or a trailing
402 \"\\'\"; those are added automatically by callers.")
403
395(defun normal-top-level-add-subdirs-to-load-path () 404(defun normal-top-level-add-subdirs-to-load-path ()
396 "Add all subdirectories of current directory to `load-path'. 405 "Add all subdirectories of current directory to `load-path'.
397More precisely, this uses only the subdirectories whose names 406More precisely, this uses only the subdirectories whose names
@@ -1006,19 +1015,23 @@ opening the first frame (e.g. open a connection to an X server).")
1006 (if init-file-user 1015 (if init-file-user
1007 (let ((user-init-file-1 1016 (let ((user-init-file-1
1008 (cond 1017 (cond
1009 ((eq system-type 'ms-dos) 1018 ((eq system-type 'ms-dos)
1010 (concat "~" init-file-user "/_emacs")) 1019 (concat "~" init-file-user "/_emacs"))
1011 ((eq system-type 'windows-nt) 1020 ((not (eq system-type 'windows-nt))
1012 ;; Prefer .emacs on Windows. 1021 (concat "~" init-file-user "/.emacs"))
1013 (if (directory-files "~" nil "^\\.emacs\\(\\.elc?\\)?$") 1022 ;; Else deal with the Windows situation
1014 "~/.emacs" 1023 ((directory-files "~" nil "^\\.emacs\\(\\.elc?\\)?$")
1015 ;; Also support _emacs for compatibility. 1024 ;; Prefer .emacs on Windows.
1016 (if (directory-files "~" nil "^_emacs\\(\\.elc?\\)?$") 1025 "~/.emacs")
1017 "~/_emacs" 1026 ((directory-files "~" nil "^_emacs\\(\\.elc?\\)?$")
1018 ;; But default to .emacs if _emacs does not exist. 1027 ;; Also support _emacs for compatibility, but warn about it.
1019 "~/.emacs"))) 1028 (display-warning
1020 (t 1029 'initialization
1021 (concat "~" init-file-user "/.emacs"))))) 1030 "`_emacs' init file is deprecated, please use `.emacs'"
1031 :warning)
1032 "~/_emacs")
1033 (t ;; But default to .emacs if _emacs does not exist.
1034 "~/.emacs"))))
1022 ;; This tells `load' to store the file name found 1035 ;; This tells `load' to store the file name found
1023 ;; into user-init-file. 1036 ;; into user-init-file.
1024 (setq user-init-file t) 1037 (setq user-init-file t)
@@ -1190,9 +1203,9 @@ the `--debug-init' option to view a complete error backtrace."
1190 (when (file-directory-p dir) 1203 (when (file-directory-p dir)
1191 (dolist (subdir (directory-files dir)) 1204 (dolist (subdir (directory-files dir))
1192 (when (and (file-directory-p (expand-file-name subdir dir)) 1205 (when (and (file-directory-p (expand-file-name subdir dir))
1193 ;; package-subdirectory-regexp from package.el 1206 (string-match
1194 (string-match "^\\([^.].*\\)-\\([0-9]+\\(?:[.][0-9]+\\)*\\)$" 1207 (concat "\\`" package-subdirectory-regexp "\\'")
1195 subdir)) 1208 subdir))
1196 (throw 'package-dir-found t))))))) 1209 (throw 'package-dir-found t)))))))
1197 (package-initialize)) 1210 (package-initialize))
1198 1211