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