Merge apel-shubit.
[elisp/apel.git] / EMU-ELS
1 ;;; EMU-ELS --- list of EMU modules to install. -*-Emacs-Lisp-*-
2
3 ;;; Commentary:
4
5 ;; APEL-MK imports `emu-modules' and `emu-modules-to-compile' from here.
6
7 ;;; Code:
8
9 (defvar emu-modules-not-to-compile nil)
10 (defvar emu-modules-to-compile nil)
11
12 ;; We use compile-time evaluation heavily.  So, order of compilation is
13 ;; very significant.  For example, loading some module before compiling
14 ;; it will cause "compile-time" evaluation many times.
15 (defvar emu-modules
16   (nconc
17    ;; modules are sorted by compilation order.
18    '(static broken)
19    ;; coming soon.
20    ;; '(product)
21
22    ;; poe modules; poe modules depend on static.
23    '(pym)
24    (cond
25     ;; XEmacs.
26     ((featurep 'xemacs)
27      '(poe-xemacs poe))
28     ;; Emacs 19.29 and earlier. (yes, includes Emacs 19.29.)
29     ((and (= emacs-major-version 19)
30           (<= emacs-minor-version 29))
31      '(localhook poe))
32     ;; Emacs 19.30 and later.
33     ((>= emacs-major-version 19)
34      '(poe))
35     (t
36      ;; v18.
37      '(localhook env poe-18 poe)))
38
39    ;; pcustom modules; pcustom modules depend on poe.
40    (if (and (module-installed-p 'custom)
41             ;; new custom requires widget.
42             (module-installed-p 'widget))
43        ;; if both 'custom and 'widget are found, we have new custom.
44        '(pcustom)
45      ;; pcustom does (require 'custom) at compile-time, and tinycustom
46      ;; need to test existence of some custom macros at compile-time!
47      ;; so, we must compile tinycustom first.
48      '(tinycustom pcustom))
49
50    ;; pccl modules; pccl modules depend on broken.
51    (cond
52     ((featurep 'mule)
53      (cond
54       ;; XEmacs 21 w/ mule.
55       ((and (featurep 'xemacs)
56             (>= emacs-major-version 21))
57        '(pccl-20 pccl))
58       ;; Emacs 20.
59       ((>= emacs-major-version 20)
60        '(pccl-20 pccl))
61       (t
62        ;; Mule 1.* and 2.*.
63        '(pccl-om pccl)))))
64
65    ;; pces modules; pces modules depend on poe.
66    (cond
67     ((featurep 'xemacs)
68      (cond
69       ((featurep 'mule)
70        ;; XEmacs w/ mule.
71        ;; pces-xfc depends pces-20, so we compile pces-20 first.
72        '(pces-20 pces-xm pces-xfc pces))
73       ((featurep 'file-coding)
74        ;; XEmacs w/ file-coding.
75        ;; pces-xfc depends pces-20, so we compile pces-20 first.
76        '(pces-20 pces-xfc pces))
77       (t
78        '(pces-raw pces))))
79     ((featurep 'mule)
80      (cond
81       ;; Emacs 20.3 and later.
82       ((and (fboundp 'set-buffer-multibyte)
83             (subrp (symbol-function 'set-buffer-multibyte)))
84        ;; pces-e20 depends pces-20, so we compile pces-20 first.
85        '(pces-20 pces-e20 pces))
86       ;; Emacs 20.1 and 20.2.
87       ((= emacs-major-version 20)
88        ;; pces-e20 depends pces-20, so we compile pces-20 first.
89        '(pces-20 pces-e20_2 pces-e20 pces))
90       (t
91        ;; Mule 1.* and 2.*.
92        '(pces-om pces))))
93     ((boundp 'NEMACS)
94      ;; Nemacs.
95      '(pces-nemacs pces))
96     (t
97      '(pces-raw pces)))
98
99    ;; poem modules; poem modules depend on pces.
100    (cond
101     ((featurep 'mule)
102      (cond
103       ((featurep 'xemacs)
104        ;; XEmacs w/ mule.
105        '(poem-xm poem))
106       ((>= emacs-major-version 20)
107        (if (and (fboundp 'set-buffer-multibyte)
108                 (subrp (symbol-function 'set-buffer-multibyte)))
109            ;; Emacs 20.3 and later.
110            '(poem-e20_3 poem-e20 poem)
111          ;; Emacs 20.1 and 20.2.
112          '(poem-e20_2 poem-e20 poem)))
113       (t
114        ;; Mule 1.* and 2.*.
115        '(poem-om poem))))
116     ((boundp 'NEMACS)
117      '(poem-nemacs poem))
118     (t
119      '(poem-ltn1 poem)))
120
121    ;; mcharset modules; mcharset modules depend on poem and pcustom.
122    (cond
123     ((featurep 'mule)
124      (cond
125       ((featurep 'xemacs)
126        ;; XEmacs w/ mule.
127        (if (featurep 'utf-2000)
128            ;; XEmacs w/ UTF-2000.
129            (setq emu-modules-not-to-compile
130                  (cons 'mcs-xmu emu-modules-not-to-compile)))
131        ;; mcs-xm depends mcs-20, so we compile mcs-20 first.
132        '(mcs-20 mcs-xmu mcs-xm mcharset))
133       ((>= emacs-major-version 20)
134        ;; Emacs 20 and later.
135        ;; mcs-e20 depends mcs-20, so we compile mcs-20 first.
136        '(mcs-20 mcs-e20 mcharset))
137       (t
138        ;; Mule 1.* and 2.*.
139        '(mcs-om mcharset))))
140     ((boundp 'NEMACS)
141      ;; Nemacs.
142      '(mcs-nemacs mcharset))
143     (t
144      '(mcs-ltn1 mcharset)))
145
146    ;; time-stamp.el; First appeared in Emacs 19.16.
147    (if (and (not (featurep 'xemacs))
148             (or (< emacs-major-version 19)
149                 (and (= emacs-major-version 19)
150                      (< emacs-minor-version 16))))
151        '(time-stamp))
152
153    ;; timezone.el; Some versions have Y2K problem.
154    ;; coming soon.
155
156    ;; invisible modules; provided for backward compatibility with old "tm".
157    (cond
158     ((featurep 'xemacs)
159      ;; XEmacs.
160      '(inv-xemacs invisible))
161     ((>= emacs-major-version 19)
162      ;; Emacs 19 and later.
163      '(inv-19 invisible))
164     (t
165      ;; v18.
166      '(inv-18 invisible)))
167
168    ;; emu modules; provided for backward compatibility with old "tm".
169    (if (and (featurep 'mule)
170             (< emacs-major-version 20))
171        ;; Mule 1.* and 2.*.
172        '(emu-mule emu)
173      '(emu))
174
175    ;; emu submodules; text/richtext and text/enriched support.
176    (if (if (featurep 'xemacs)
177            (or (>= emacs-major-version 20)
178                (and (= emacs-major-version 19)
179                     (>= emacs-minor-version 14)))
180          (or (>= emacs-major-version 20)
181              (and (= emacs-major-version 19)
182                   (>= emacs-minor-version 29))))
183        ;; XEmacs 19.14 and later, or Emacs 19.29 and later.
184        '(richtext)
185      '(tinyrich))
186
187    ;; mule-caesar.el; part of apel-modules, but it is version-dependent.
188    '(mule-caesar)))
189
190 ;; Generate `emu-modules-to-compile' from `emu-modules-not-to-compile'
191 ;; and `emu-modules'.
192 (let ((modules emu-modules-not-to-compile))
193   (setq emu-modules-to-compile (copy-sequence emu-modules))
194   (while modules
195     (setq emu-modules-to-compile (delq (car modules) emu-modules-to-compile)
196           modules (cdr modules))))
197
198 ;;; EMU-ELS ends here