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