tm 7.27.
[elisp/tm.git] / mh-e / mk-tmh
1 ;;; -*-Emacs-Lisp-*-
2
3 (setq load-path (append
4                  (mapcar (function
5                           (lambda (path)
6                             (expand-file-name path (getenv "PWD"))
7                             ))
8                          '("." ".." "../../tl/" "../../mel/")
9                          )
10                  load-path))
11
12 (require 'mh-e)
13 (require 'emu)
14
15 (setq tm-mh-e-modules
16       (append
17        '("tm-mh-e")
18        (if (not (boundp 'mh-e-version))
19            '("tm-mh-e3")
20          )
21        ))
22
23 (setq tm-mh-e-el-files
24       (mapcar (function (lambda (module)
25                           (concat module ".el")
26                           ))
27               tm-mh-e-modules))
28
29 (setq tm-mh-e-elc-files
30       (mapcar (function (lambda (module)
31                           (concat module ".elc")
32                           ))
33               tm-mh-e-modules))
34
35 (defun compile-tm-mh-e ()
36   (require 'tm-mh-e)
37   (require 'mh-comp)
38   (require 'tm-edit)
39   (mapcar (function byte-compile-file) tm-mh-e-el-files)
40   )
41
42 (defconst el-file-mode (+ (* 64 6)(* 8 4) 4))
43
44 (defun install-el (path file)
45   (let ((full-path (expand-file-name file path)))
46     (if (file-exists-p full-path)
47         (set-file-modes full-path el-file-mode)
48       )
49     (copy-file file full-path t t)
50     (princ (format "%s -> %s\n" file path))
51     ))
52
53 (defun install-el-files (path &rest files)
54   (mapcar (function (lambda (file)
55                       (if (file-exists-p file)
56                           (install-el path file)
57                         )))
58           files))
59
60 (defun install-elc (path file)
61   (let ((full-path (expand-file-name file path)))
62     (copy-file file full-path t t)
63     (delete-file file)
64     (princ (format "%s -> %s\n" file path))
65     ))
66
67 (defun install-elc-files (path &rest files)
68   (mapcar (function (lambda (file)
69                       (if (file-exists-p file)
70                           (install-elc path file)
71                         )))
72           files))
73
74 (defun install-tm-mh-e ()
75   (let ((path (car command-line-args-left)))
76     (princ (format "%s\n" emacs-version))
77     (if (not (file-exists-p path))
78         (make-directory path t)
79       )
80     (apply (function install-el-files) path tm-mh-e-el-files)
81     (apply (function install-elc-files) path tm-mh-e-elc-files)
82     ))