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