26
|
1 ;;; site-load.el --- Template file for site-wide XEmacs customization
|
|
2
|
|
3 ;; Author: Steven L. Baur <steve@altair.xemacs.org>
|
|
4 ;; Keywords: internal
|
|
5
|
|
6 ;; This file is part of XEmacs.
|
|
7
|
|
8 ;;; Commentary:
|
|
9
|
|
10 ;; This is a prototype site-load.el file.
|
|
11 ;; The site-load.el mechanism is provided so XEmacs installers can easily
|
|
12 ;; dump lisp packages with XEmacs that do not get dumped standardly.
|
|
13
|
|
14 ;; The file `site-packages' if it exists should look something like:
|
|
15 ;; (setq site-load-packages '(
|
|
16 ;; "../lisp/modes/cc-mode"
|
|
17 ;; "../lisp/utils/redo"
|
|
18 ;; "../lisp/packages/scroll-in-place"
|
|
19 ;; )
|
|
20 ;; )
|
|
21
|
|
22 ;; The first line and the last line must be exact. Each of the packages
|
|
23 ;; listed must be double quoted, have either an absolute path, or a relative
|
|
24 ;; to the build src directory path *and* be bytecompiled prior to the attempt
|
|
25 ;; to dump.
|
|
26
|
|
27 ;; Because this is a trial implementation and the file is shared with
|
|
28 ;; make-docfiles, syntax is strict and unforgiving. So sue me. It
|
|
29 ;; is still better than the way it used to be.
|
|
30
|
104
|
31 ;; Also note that site-packages belongs in the top level directory not the
|
|
32 ;; lisp directory for use with --srcdir configurations.
|
|
33
|
26
|
34 ;;; Code:
|
104
|
35 (defvar site-load-package-file "../site-packages"
|
26
|
36 "File name containing the list of extra packages to dump with XEmacs.")
|
|
37 (defvar site-load-packages nil
|
|
38 "A list of .elc files that should be dumped with XEmacs.
|
|
39 This variable should be set by `site-load-package-file'.")
|
|
40
|
|
41 ;; Load site specific packages for dumping with the XEmacs binary.
|
|
42 (when (file-exists-p site-load-package-file)
|
|
43 (let ((file))
|
|
44 (load site-load-package-file t t t)
|
|
45 ;; The `load-gc' macro is provided as a clue that a package is being loaded
|
|
46 ;; in preparation of being dumped into XEmacs.
|
|
47 (defmacro load-gc (file)
|
|
48 (list 'prog1 (list 'load file) '(garbage-collect)))
|
|
49 (message "Loading site-wide packages for dumping...")
|
|
50 (while site-load-packages
|
|
51 (setq file (car site-load-packages))
|
|
52 (load-gc file)
|
|
53 (setq site-load-packages (cdr site-load-packages)))
|
|
54 (message "Loading site-wide packages for dumping...done")
|
|
55 (fmakunbound 'load-gc)))
|
|
56
|
|
57 ;; This file is intended for end user additions.
|
|
58 ;; Put other initialization here, like setting of language-environment, etc.
|
|
59 ;; Perhaps this should really be in the site-init.el.
|
|
60
|
|
61 ;;; site-load.el ends here
|