home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / lucid / lemacs-19.6 / lisp / prim / loadup.el < prev    next >
Encoding:
Text File  |  1993-02-05  |  7.0 KB  |  217 lines

  1. ;; Load up standardly loaded Lisp files for Emacs.
  2. ;;
  3. ;; It is not a good idea to edit this file.  Use site-init.el or site-load.el
  4. ;; instead.
  5. ;;
  6. ;; This is loaded into a bare Emacs to make a dumpable one.
  7. ;; Copyright (C) 1985, 1986, 1992, 1993 Free Software Foundation, Inc.
  8.  
  9. ;; This file is part of GNU Emacs.
  10.  
  11. ;; GNU Emacs is free software; you can redistribute it and/or modify
  12. ;; it under the terms of the GNU General Public License as published by
  13. ;; the Free Software Foundation; either version 2, or (at your option)
  14. ;; any later version.
  15.  
  16. ;; GNU Emacs is distributed in the hope that it will be useful,
  17. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. ;; GNU General Public License for more details.
  20.  
  21. ;; You should have received a copy of the GNU General Public License
  22. ;; along with GNU Emacs; see the file COPYING.  If not, write to
  23. ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  24.  
  25.  
  26. ;; We don't want to have any undo records in the dumped Emacs.
  27. (buffer-disable-undo (get-buffer "*scratch*"))
  28.  
  29. ;; lread.c has prepended "../lisp/prim" to load-path, which is how this file
  30. ;; has been found.  At this point, enough of emacs has been initialized that 
  31. ;; we can call directory-files and get the rest of the dirs (so that we can
  32. ;; dump stuff from modes/ and packages/.)
  33. ;;
  34. (setq load-path (nconc (directory-files "../lisp" t "^[^-.]" nil 'dirs-only)
  35.                (cons "../lisp" load-path)))
  36.  
  37. (setq load-warn-when-source-newer t ; set to nil at the end
  38.       load-warn-when-source-only t)
  39.  
  40. (load "subr")
  41. (garbage-collect)
  42. (load "minibuf")
  43. (load "faces")        ; must be loaded before any file that makes faces
  44. (garbage-collect)
  45. (load "loaddefs.el")  ;Don't get confused if someone compiled loaddefs by mistake.
  46. (load "keydefs.el")
  47. (garbage-collect)
  48. (load "simple")
  49. (garbage-collect)
  50. (load "help")
  51. (garbage-collect)
  52. (load "files")
  53. (garbage-collect)
  54. (load "indent")
  55. (load "window")
  56. (load "paths.el")  ;Don't get confused if someone compiled paths by mistake.
  57. (garbage-collect)
  58. (load "startup")
  59. (load "lisp")
  60. (garbage-collect)
  61. (load "page")
  62. (load "register")
  63. (garbage-collect)
  64. (load "iso8859-1") ;This must be before any modes (sets standard syntax table)
  65. (load "paragraphs")
  66. (load "lisp-mode")
  67. (garbage-collect)
  68. (load "text-mode")
  69. (load "fill")
  70. (garbage-collect)
  71. (load "c-mode")
  72. (garbage-collect)
  73. (load "isearch-mode")
  74. (garbage-collect)
  75. (load "replace")
  76. (if (eq system-type 'vax-vms)
  77.     (progn
  78.       (garbage-collect)
  79.       (load "vmsproc")))
  80. (garbage-collect)
  81. (load "abbrev")
  82. (garbage-collect)
  83. (load "buff-menu")
  84. (if (eq system-type 'vax-vms)
  85.     (progn
  86.       (garbage-collect)
  87.       (load "vms-patch")))
  88. (if (fboundp 'atan)    ; preload some constants and 
  89.     (progn        ; floating pt. functions if 
  90.       (garbage-collect)    ; we have float support.
  91.       (load "float-sup")))
  92.  
  93. (if (fboundp 'x-create-screen)    ; preload the X code, for faster startup.
  94.     (progn
  95.       (require 'screen)
  96.       (require 'menubar)
  97.       (require 'x-faces)
  98.       (require 'x-iso8859-1)
  99.       (require 'x-mouse)
  100.       (require 'xselect)
  101.       ))
  102.  
  103. (load "version.el")  ;Don't get confused if someone compiled version.el by mistake.
  104.  
  105. (load "bytecomp-runtime")  ; needs version.el to know what emacs it's in.
  106.  
  107. (if (fboundp (intern-soft "handle-energize-request"))
  108.     (load "energize/energize-load.el"))
  109.  
  110. (garbage-collect)
  111.  
  112.  
  113. (setq load-warn-when-source-newer nil ; set to t at top of file
  114.       load-warn-when-source-only nil)
  115.  
  116.  
  117. ;If you want additional libraries to be preloaded and their
  118. ;doc strings kept in the DOC file rather than in core,
  119. ;you may load them with a "site-load.el" file.
  120. ;But you must also cause them to be scanned when the DOC file
  121. ;is generated.  For VMS, you must edit ../etc/makedoc.com.
  122. ;For other systems, you must edit ../src/ymakefile.
  123. (if (load "site-load" t)
  124.     (garbage-collect))
  125.  
  126. ;; Note: all compiled Lisp files loaded above this point
  127. ;; must be among the ones parsed by make-docfile
  128. ;; to construct DOC.  Any that are not processed
  129. ;; for DOC will not have doc strings in the dumped Emacs.
  130.  
  131. ;; Don't bother with these if we're running temacs, i.e. if we're
  132. ;; just debugging don't waste time finding doc strings.
  133.  
  134. (if (or (equal (nth 3 command-line-args) "dump")
  135.     (equal (nth 4 command-line-args) "dump"))
  136.     (progn
  137.       (message "Finding pointers to doc strings...")
  138.       (if (fboundp 'dump-emacs)
  139.       (let ((name emacs-version))
  140.         (while (string-match "[^-+_.a-zA-Z0-9]+" name)
  141.           (setq name (concat
  142.               (downcase (substring name 0 (match-beginning 0)))
  143.               "-"
  144.               (substring name (match-end 0)))))
  145.         (copy-file (expand-file-name "../etc/DOC")
  146.                (concat (expand-file-name "../etc/DOC-") name)
  147.                t)
  148.         (Snarf-documentation (concat "DOC-" name)))
  149.     (Snarf-documentation "DOC"))
  150.       (message "Finding pointers to doc strings...done")
  151. ;;      (Verify-documentation)
  152.       ))
  153.  
  154. ;Note: You can cause additional libraries to be preloaded
  155. ;by writing a site-init.el that loads them.
  156. ;See also "site-load" above.
  157. (load "site-init" t)
  158.  
  159. (garbage-collect)
  160.  
  161. ;; At this point, we're ready to resume undo recording for scratch.
  162. (buffer-enable-undo "*scratch*")
  163.  
  164. (if (or (equal (nth 3 command-line-args) "dump")
  165.     (equal (nth 4 command-line-args) "dump"))
  166.     (if (eq system-type 'vax-vms)
  167.     (progn 
  168.       (message "Dumping data as file temacs.dump")
  169.       (dump-emacs "temacs.dump" "temacs")
  170.       (kill-emacs))
  171.       (let ((name (concat "emacs-" emacs-version)))
  172.     (while (string-match "[^-+_.a-zA-Z0-9]+" name)
  173.       (setq name (concat (downcase (substring name 0 (match-beginning 0)))
  174.                  "-"
  175.                  (substring name (match-end 0)))))
  176.     (message "Dumping under names xemacs and %s" name))
  177.       (condition-case ()
  178.       (delete-file "xemacs")
  179.     (file-error nil))
  180.       (if (fboundp 'really-free)
  181.       (really-free))
  182.       (dump-emacs "xemacs" "temacs")
  183.       ;; Recompute NAME now, so that it isn't set when we dump.
  184.       (let ((name (concat "emacs-" emacs-version)))
  185.     (while (string-match "[^-+_.a-zA-Z0-9]+" name)
  186.       (setq name (concat (downcase (substring name 0 (match-beginning 0)))
  187.                  "-"
  188.                  (substring name (match-end 0)))))
  189.     (add-name-to-file "xemacs" name t))
  190.       (kill-emacs)))
  191.  
  192. (if (or (equal (elt command-line-args 3) "run-temacs")
  193.     (equal (elt command-line-args 4) "run-temacs"))
  194.     (progn
  195.       (princ "\nSnarfing doc...\n" (function external-debugging-output))
  196.       (Snarf-documentation "DOC")
  197. ;;      (Verify-documentation)
  198.       (princ "\nBootstrapping from temacs...\n"
  199.          (function external-debugging-output))
  200.       (setq purify-flag nil)
  201.       (apply (function run-emacs-from-temacs)
  202.              (nthcdr (if (equal (elt command-line-args 3) "run-temacs")
  203.                          4 5)
  204.                      command-line-args))
  205.       ;; run-emacs-from-temacs doesn't actually return anyway.
  206.       (kill-emacs)))
  207.  
  208. ;; Avoid error if user loads some more libraries now.
  209. (setq purify-flag nil)
  210.  
  211. ;; For machines with CANNOT_DUMP defined in config.h,
  212. ;; this file must be loaded each time Emacs is run.
  213. ;; So run the startup code now.
  214.  
  215. (or (fboundp 'dump-emacs)
  216.     (eval top-level))
  217.