(PACKAGEDIR): Check for (early|late|last)-package-hierarchies and
[elisp/flim.git] / FLIM-CFG
1 ;;; -*-Emacs-Lisp-*-
2
3 ;; FLIM-CFG: installation setting about FLIM.
4
5 ;;; Code:
6
7 (defvar default-load-path load-path)
8
9 (add-to-list 'load-path
10              (expand-file-name "../../site-lisp/apel" data-directory))
11
12 (if (boundp 'LISPDIR)
13     (progn
14       (add-to-list 'default-load-path LISPDIR)
15       (add-to-list 'load-path LISPDIR)
16       (add-to-list 'load-path (expand-file-name "apel" LISPDIR))))
17
18 (if (boundp 'VERSION_SPECIFIC_LISPDIR)
19     (add-to-list 'load-path VERSION_SPECIFIC_LISPDIR))
20
21 (require 'install)
22
23 (add-latest-path "custom")
24
25 (add-path default-directory)
26
27 ;; (or (fboundp 'write-region-as-binary)
28 ;;     (error "Please install latest APEL 7.3 or later."))
29 ;; (or (fboundp 'insert-file-contents-as-binary)
30 ;;     (error "Please install latest APEL 7.3 or later."))
31
32
33 ;;; @ Please specify prefix of install directory.
34 ;;;
35
36 ;; Please specify install path prefix.
37 ;; If it is omitted, shared directory (maybe /usr/local is used).
38 (defvar PREFIX install-prefix)
39 ;;(setq PREFIX "~/")
40
41 ;; Please specify prefix for ``FLIM'' [optional]
42 (setq FLIM_PREFIX "flim")
43
44 \f
45
46 ;;; @ optional settings
47 ;;;
48
49 ;; It is generated by automatically. Please set variable `PREFIX'.
50 ;; If you don't like default directory tree, please set it.
51 (defvar LISPDIR (install-detect-elisp-directory PREFIX))
52 ;; (setq install-default-elisp-directory "~/lib/emacs/lisp")
53
54 (defvar VERSION_SPECIFIC_LISPDIR
55   (install-detect-elisp-directory PREFIX nil 'version-specific))
56
57 ;; (setq FLIM_DIR (expand-file-name FLIM_PREFIX VERSION_SPECIFIC_LISPDIR))
58 (setq FLIM_DIR (expand-file-name FLIM_PREFIX LISPDIR))
59
60 (setq FLIM_VERSION_SPECIFIC_DIR
61       (expand-file-name FLIM_PREFIX VERSION_SPECIFIC_LISPDIR))
62
63 (defvar PACKAGEDIR
64   (let ((dirs (append
65                (cond ((boundp 'early-package-hierarchies)
66                       (append (if early-package-load-path
67                                   early-package-hierarchies)
68                               (if late-package-load-path
69                                   late-package-hierarchies)
70                               (if last-package-load-path
71                                   last-package-hierarchies)))
72                      ((boundp 'early-packages)
73                       (append (if early-package-load-path
74                                   early-packages)
75                               (if late-package-load-path
76                                   late-packages)
77                               (if last-package-load-path
78                                   last-packages))))
79                (if (and (boundp 'configure-package-path)
80                         (listp configure-package-path))
81                    (delete "" configure-package-path))))
82         dir)
83     (while (not (file-exists-p (setq dir (car dirs))))
84       (setq dirs (cdr dirs)))
85     dir))
86
87 ;;; FLIM-CFG ends here