]> code.delx.au - gnu-emacs/blobdiff - lisp/loadup.el
Merge branch 'emacs-25-merge'
[gnu-emacs] / lisp / loadup.el
index b69005f0c01ce4b1c335f075be10140a27803375..e3e0eb7762267e1b01f17d481fbc2df2e0170698 100644 (file)
 
 ;; This is loaded into a bare Emacs to make a dumpable one.
 
-;; If you add/remove Lisp files to be loaded here, consider the
-;; following issues:
+;; If you add a file to be loaded here, keep the following points in mind:
 
-;; i) Any file loaded on any platform should appear in src/lisp.mk.
-;; Use the .el or .elc version as appropriate.
+;; i) If the file is no-byte-compile, explicitly load the .el version.
+;; Such files should (where possible) obey the doc-string conventions
+;; expected by make-docfile.  They should also be added to the
+;; uncompiled[] list in make-docfile.c.
 
+;; ii) If the file is dumped with Emacs (on any platform), put the
+;; load statement at the start of a line (leading whitespace is ok).
+
+;; iii) If the file is _not_ dumped with Emacs, make sure the load
+;; statement is _not_ at the start of a line.  See pcase for an example.
+
+;; These rules are so that src/Makefile can construct lisp.mk automatically.
 ;; This ensures both that the Lisp files are compiled (if necessary)
 ;; before the emacs executable is dumped, and that they are passed to
 ;; make-docfile.  (Any that are not processed for DOC will not have
-;; doc strings in the dumped Emacs.)  Because of this:
-
-;; ii) If the file is loaded uncompiled, it should (where possible)
-;; obey the doc-string conventions expected by make-docfile.  It
-;; should also be added to the uncompiled[] list in make-docfile.c.
+;; doc strings in the dumped Emacs.)
 
 ;;; Code:
 
     (let ((dir (car load-path)))
       ;; We'll probably overflow the pure space.
       (setq purify-flag nil)
+      ;; Value of max-lisp-eval-depth when compiling initially.
+      ;; During bootstrapping the byte-compiler is run interpreted when
+      ;; compiling itself, which uses a lot more stack than usual.
+      (setq max-lisp-eval-depth 2200)
       (setq load-path (list (expand-file-name "." dir)
                            (expand-file-name "emacs-lisp" dir)
                            (expand-file-name "language" dir)
@@ -69,7 +77,7 @@
 
 (if (eq t purify-flag)
     ;; Hash consing saved around 11% of pure space in my tests.
-    (setq purify-flag (make-hash-table :test 'equal :size 70000)))
+    (setq purify-flag (make-hash-table :test 'equal :size 80000)))
 
 (message "Using load-path %s" load-path)
 
   ;; Since loaddefs is not yet loaded, macroexp's uses of pcase will simply
   ;; fail until pcase is explicitly loaded.  This also means that we have to
   ;; disable eager macro-expansion while loading pcase.
-  (let ((macroexp--pending-eager-loads '(skip)))
-    (load "emacs-lisp/pcase"))
+  (let ((macroexp--pending-eager-loads '(skip))) (load "emacs-lisp/pcase"))
   ;; Re-load macroexp so as to eagerly macro-expand its uses of pcase.
   (let ((max-lisp-eval-depth (* 2 max-lisp-eval-depth)))
     (load "emacs-lisp/macroexp")))
 ;; should be updated by overwriting it with an up-to-date copy of
 ;; loaddefs.el that is uncorrupted by local changes.
 ;; autogen/update_autogen can be used to periodically update ldefs-boot.
-(condition-case nil
-    ;; Don't get confused if someone compiled this by mistake.
-    (load "loaddefs.el")
+(condition-case nil (load "loaddefs.el")
   ;; In case loaddefs hasn't been generated yet.
   (file-error (load "ldefs-boot.el")))
 
 (load "emacs-lisp/nadvice")
 (load "emacs-lisp/cl-preloaded")
 (load "minibuffer")            ;After loaddefs, for define-minor-mode.
+(load "obarray")        ;abbrev.el is implemented in terms of obarrays.
 (load "abbrev")         ;lisp-mode.el and simple.el use define-abbrev-table.
 (load "simple")
 
 (if (featurep 'ns)
     (progn
       (load "term/common-win")
-      (load "term/ns-win")))
+      ;; Don't load ucs-normalize.el unless uni-*.el files were
+      ;; already produced, because it needs uni-*.el files that might
+      ;; not be built early enough during bootstrap.
+      (when (load-history-filename-element "charprop\\.el")
+        (load "international/ucs-normalize")
+        (load "term/ns-win"))))
 (if (fboundp 'x-create-frame)
     ;; Do it after loading term/foo-win.el since the value of the
     ;; mouse-wheel-*-event vars depends on those files being loaded or not.
 (load "electric")
 (load "emacs-lisp/eldoc")
 (load "cus-start") ;Late to reduce customize-rogue (needs loaddefs.el anyway)
-(if (not (eq system-type 'ms-dos)) (load "tooltip"))
+(if (not (eq system-type 'ms-dos))
+    (load "tooltip"))
 
 ;; This file doesn't exist when building a development version of Emacs
 ;; from the repository.  It is generated just after temacs is built.