annotate lisp/setup-paths.el @ 278:90d73dddcdc4 r21-0b37

Import from CVS: tag r21-0b37
author cvs
date Mon, 13 Aug 2007 10:31:29 +0200
parents 6330739388db
children 558f606b08ae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
1 ;;; setup-paths.el --- setup various XEmacs paths
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
2
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
3 ;; Copyright (C) 1985-1986, 1990, 1992-1997 Free Software Foundation, Inc.
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
4 ;; Copyright (c) 1993, 1994 Sun Microsystems, Inc.
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
5 ;; Copyright (C) 1995 Board of Trustees, University of Illinois
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
6
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
7 ;; Author: Mike Sperber <sperber@informatik.uni-tuebingen.de>
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
8 ;; Maintainer: XEmacs Development Team
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
9 ;; Keywords: internal, dumped
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
10
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
11 ;; This file is part of XEmacs.
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
12
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
13 ;; XEmacs is free software; you can redistribute it and/or modify it
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
14 ;; under the terms of the GNU General Public License as published by
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
15 ;; the Free Software Foundation; either version 2, or (at your option)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
16 ;; any later version.
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
17
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
18 ;; XEmacs is distributed in the hope that it will be useful, but
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
21 ;; General Public License for more details.
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
22
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
24 ;; along with XEmacs; see the file COPYING. If not, write to the
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
25 ;; Free Software Foundation, 59 Temple Place - Suite 330,
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
26 ;; Boston, MA 02111-1307, USA.
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
27
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
28 ;;; Synched up with: Not in FSF.
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
29
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
30 ;;; Commentary:
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
31
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
32 ;; This file is dumped with XEmacs.
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
33
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
34 ;; This file describes and constructs the various paths into the
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
35 ;; XEmacs hierarchy from a global viewpoint.
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
36
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
37 ;; It requires find-paths.el and packages.el.
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
38
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
39 ;;; Code:
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
40
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
41 (defvar paths-load-path-depth 1
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
42 "Depth of load-path searches in core Lisp paths.")
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
43
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
44 (defvar paths-default-info-directories
278
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
45 (list (paths-construct-path '("usr" "local" "info") path-separator)
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
46 (paths-construct-path '("usr" "info") path-separator))
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
47 "Directories appended to the end of the info path by default.")
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
48
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
49 (defun paths-find-site-lisp-directory (roots)
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
50 "Find the site Lisp directory of the XEmacs hierarchy."
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
51 (paths-find-site-directory roots "site-lisp"
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
52 nil
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
53 configure-site-directory))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
54
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
55 (defun paths-find-lisp-directory (roots)
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
56 "Find the main Lisp directory of the XEmacs hierarchy."
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
57 (paths-find-version-directory roots "lisp"
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
58 nil
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
59 configure-lisp-directory))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
60
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
61 (defun paths-construct-load-path
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
62 (roots early-package-load-path late-package-load-path last-package-load-path
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
63 lisp-directory
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
64 &optional site-lisp-directory)
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
65 "Construct the load path."
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
66 (let* ((envvar-value (getenv "EMACSLOADPATH"))
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
67 (env-load-path
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
68 (and envvar-value
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
69 (paths-decode-directory-path envvar-value 'drop-empties)))
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
70 (site-lisp-load-path
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
71 (and site-lisp-directory
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
72 (paths-find-recursive-load-path (list site-lisp-directory)
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
73 paths-load-path-depth)))
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
74 (lisp-load-path
278
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
75 (and lisp-directory
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
76 (paths-find-recursive-load-path (list lisp-directory)
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
77 paths-load-path-depth))))
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
78 (append env-load-path
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
79 early-package-load-path
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
80 site-lisp-load-path
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
81 late-package-load-path
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
82 lisp-load-path
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
83 last-package-load-path)))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
84
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
85 (defun paths-construct-info-path (roots early-packages late-packages last-packages)
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
86 "Construct the info path."
274
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
87 (let ((info-path-envval (getenv "INFOPATH")))
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
88 (paths-uniq-append
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
89 (append
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
90 (let ((info-directory
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
91 (paths-find-version-directory roots "info"
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
92 nil
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
93 configure-info-directory)))
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
94 (and info-directory
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
95 (list info-directory)))
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
96 (packages-find-package-info-path early-packages)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
97 (packages-find-package-info-path late-packages)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
98 (packages-find-package-info-path last-packages)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
99 (and info-path-envval
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
100 (paths-decode-directory-path info-path-envval 'drop-empties)))
278
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
101 (and (null info-path-envval)
274
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
102 (paths-uniq-append
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
103 (paths-directories-which-exist configure-info-path)
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
104 (paths-directories-which-exist paths-default-info-directories))))))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
105
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
106 (defun paths-find-doc-directory (roots)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
107 "Find the documentation directory."
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
108 (paths-find-architecture-directory roots "lib-src"))
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
109
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
110 (defun paths-find-lock-directory (roots)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
111 "Find the lock directory."
274
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
112 (paths-find-site-directory roots "lock" "EMACSLOCKDIR" configure-lock-directory))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
113
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
114 (defun paths-find-superlock-file (lock-directory)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
115 "Find the superlock file."
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
116 (cond
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
117 ((null lock-directory)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
118 nil)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
119 ((and configure-superlock-file
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
120 (file-directory-p (file-name-directory configure-superlock-file)))
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
121 configure-superlock-file)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
122 (t
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
123 (expand-file-name "!!!SuperLock!!!" lock-directory))))
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
124
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
125 (defun paths-find-exec-directory (roots)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
126 "Find the binary directory."
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
127 (paths-find-architecture-directory roots "lib-src" configure-exec-directory))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
128
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
129 (defun paths-construct-exec-path (roots exec-directory
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
130 early-packages late-packages last-packages)
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
131 "Find the binary path."
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
132 (append
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
133 (let ((path-envval (getenv "PATH")))
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
134 (if path-envval
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
135 (paths-decode-directory-path path-envval 'drop-empties)))
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
136 (packages-find-package-exec-path early-packages)
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
137 (packages-find-package-exec-path late-packages)
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
138 (packages-find-package-exec-path last-packages)
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
139 (let ((emacspath-envval (getenv "EMACSPATH")))
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
140 (and emacspath-envval
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
141 (decode-path-internal emacspath-envval)))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
142 (and exec-directory
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
143 (list exec-directory))))
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
144
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
145 (defun paths-find-data-directory (roots)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
146 "Find the data directory."
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
147 (paths-find-version-directory roots "etc" "EMACSDATA" configure-data-directory))
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
148
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
149 (defun paths-construct-data-directory-list (data-directory
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
150 early-packages late-packages last-packages)
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
151 "Find the data path."
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
152 (append
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
153 (packages-find-package-data-path early-packages)
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
154 (packages-find-package-data-path late-packages)
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
155 (packages-find-package-data-path last-packages)
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
156 (list data-directory)))
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
157
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
158 ;;; setup-paths.el ends here