home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / emacs-18.59-src.tgz / emacs-18.59-src.tar / fsf / emacs18 / lisp / loadup.el < prev    next >
Lisp/Scheme  |  1996-09-28  |  5KB  |  154 lines

  1. ;Load up standardly loaded Lisp files for Emacs.
  2. ;; This is loaded into a bare Emacs to make a dumpable one.
  3. ;; Copyright (C) 1985, 1986 Free Software Foundation, Inc.
  4.  
  5. ;; This file is part of GNU Emacs.
  6.  
  7. ;; GNU Emacs is free software; you can redistribute it and/or modify
  8. ;; it under the terms of the GNU General Public License as published by
  9. ;; the Free Software Foundation; either version 1, or (at your option)
  10. ;; any later version.
  11.  
  12. ;; GNU Emacs is distributed in the hope that it will be useful,
  13. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. ;; GNU General Public License for more details.
  16.  
  17. ;; You should have received a copy of the GNU General Public License
  18. ;; along with GNU Emacs; see the file COPYING.  If not, write to
  19. ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. ;;; Disable undo in the *scratch* buffer so it doesn't get dumped.
  22. (buffer-flush-undo (get-buffer "*scratch*"))
  23.  
  24. (load "subr")
  25. (garbage-collect)
  26. (load "loaddefs.el")  ;Don't get confused if someone compiled loaddefs by mistake.
  27. (garbage-collect)
  28. (load "simple")
  29. (garbage-collect)
  30. (load "help")
  31. (load "files")
  32. (garbage-collect)
  33. (load "indent")
  34. (load "window")
  35. (load "paths.el")  ;Don't get confused if someone compiled paths by mistake.
  36. (garbage-collect)
  37. (load "startup")
  38. (load "lisp")
  39. (garbage-collect)
  40. (load "page")
  41. (load "register")
  42. (garbage-collect)
  43. (load "paragraphs")
  44. (load "lisp-mode")
  45. (garbage-collect)
  46. (load "text-mode")
  47. (load "fill")
  48. (garbage-collect)
  49. (load "c-mode")
  50. (garbage-collect)
  51. (load "isearch")
  52. (garbage-collect)
  53. (load "replace")
  54. (if (eq system-type 'vax-vms)
  55.     (progn
  56.       (garbage-collect)
  57.       (load "vmsproc")))
  58. (garbage-collect)
  59. (load "abbrev")
  60. (garbage-collect)
  61. (load "buff-menu")
  62. (if (eq system-type 'vax-vms)
  63.     (progn
  64.       (garbage-collect)
  65.       (load "vms-patch")))
  66. (if (eq system-type 'amigaos)
  67.     (progn
  68.       (garbage-collect)
  69.       (load "amiga-init")))
  70.  
  71. ;If you want additional libraries to be preloaded and their
  72. ;doc strings kept in the DOC file rather than in core,
  73. ;you may load them with a "site-load.el" file.
  74. ;But you must also cause them to be scanned when the DOC file
  75. ;is generated.  For VMS, you must edit ../etc/makedoc.com.
  76. ;For other systems, you must edit ../src/ymakefile.
  77. (if (load "site-load" t)
  78.     (garbage-collect))
  79.  
  80. (load "version.el")  ;Don't get confused if someone compiled version.el by mistake.
  81.  
  82. ;; Note: all compiled Lisp files loaded above this point
  83. ;; must be among the ones parsed by make-docfile
  84. ;; to construct DOC.  Any that are not processed
  85. ;; for DOC will not have doc strings in the dumped Emacs.
  86.  
  87. (message "Finding pointers to doc strings...")
  88. (if (fboundp 'dump-emacs)
  89.     (let ((name emacs-version))
  90.       (while (string-match "[^-+_.a-zA-Z0-9]+" name)
  91.     (setq name (concat (downcase (substring name 0 (match-beginning 0)))
  92.                "-"
  93.                (substring name (match-end 0)))))
  94.       (copy-file (expand-file-name "../etc/DOC")
  95.          (concat (expand-file-name "../etc/DOC-") name)
  96.          t)
  97.       (Snarf-documentation (concat "DOC-" name)))
  98.     (Snarf-documentation "DOC"))
  99. (message "Finding pointers to doc strings...done")
  100.  
  101. ;Note: You can cause additional libraries to be preloaded
  102. ;by writing a site-init.el that loads them.
  103. ;See also "site-load" above.
  104. (load "site-init" t)
  105. (garbage-collect)
  106.  
  107. ;;; Re-enable undo in the *scratch* buffer, so the dumped Emacs will
  108. ;;; start up that way.
  109. (buffer-enable-undo (get-buffer "*scratch*"))
  110.  
  111. (if (or (equal (nth 3 command-line-args) "dump")
  112.     (equal (nth 4 command-line-args) "dump"))
  113.     (if (eq system-type 'vax-vms)
  114.     (progn 
  115.       (message "Dumping data as file temacs.dump")
  116.       (dump-emacs "temacs.dump" "temacs")
  117.       (kill-emacs))
  118.       (if (fboundp 'dump-emacs-data)
  119.       ;; Handle the IBM RS/6000, and perhaps eventually other machines.
  120.       (progn
  121.         ;; This strange nesting is so that the variable `name'
  122.         ;; is not bound when the data is dumped.
  123.         (message "Dumping data as file ../etc/EMACS-DATA")
  124.         (dump-emacs-data "../etc/EMACS-DATA")
  125.         (kill-emacs))
  126.     (let ((name (concat "emacs-" emacs-version)))
  127.       (while (string-match "[^-+_.a-zA-Z0-9]+" name)
  128.         (setq name (concat (downcase (substring name 0 (match-beginning 0)))
  129.                    "-"
  130.                    (substring name (match-end 0)))))
  131.       (message "Dumping under names xemacs and %s" name))
  132.     (condition-case ()
  133.         (delete-file "xemacs")
  134.       (file-error nil))
  135.     (dump-emacs "xemacs" "temacs")
  136.     ;; Recompute NAME now, so that it isn't set when we dump.
  137.     (let ((name (concat "emacs-" emacs-version)))
  138.       (while (string-match "[^-+_.a-zA-Z0-9]+" name)
  139.         (setq name (concat (downcase (substring name 0 (match-beginning 0)))
  140.                    "-"
  141.                    (substring name (match-end 0)))))
  142.       (add-name-to-file "xemacs" name t))
  143.     (kill-emacs))))
  144.  
  145. ;; Avoid error if user loads some more libraries now.
  146. (setq purify-flag nil)
  147.  
  148. ;; For machines with CANNOT_DUMP defined in config.h,
  149. ;; this file must be loaded each time Emacs is run.
  150. ;; So run the startup code now.
  151.  
  152. (or (fboundp 'dump-emacs)
  153.     (eval top-level))
  154.