annotate lisp/setup-paths.el @ 329:58bac07dfa74 r21-0-62

Import from CVS: tag r21-0-62
author cvs
date Mon, 13 Aug 2007 10:48:41 +0200
parents 33bdb3d4b97f
children 182f72e8cd0d
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
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 278
diff changeset
45 (list (paths-construct-path '("usr" "local" "info")
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 278
diff changeset
46 (char-to-string directory-sep-char))
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 278
diff changeset
47 (paths-construct-path '("usr" "info")
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 278
diff changeset
48 (char-to-string directory-sep-char)))
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
49 "Directories appended to the end of the info path by default.")
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
50
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
51 (defun paths-find-site-lisp-directory (roots)
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
52 "Find the site Lisp directory of the XEmacs hierarchy."
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
53 (paths-find-site-directory roots "site-lisp"
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
54 nil
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
55 configure-site-directory))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
56
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
57 (defun paths-find-lisp-directory (roots)
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
58 "Find the main Lisp directory of the XEmacs hierarchy."
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
59 (paths-find-version-directory roots "lisp"
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
60 nil
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
61 configure-lisp-directory))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
62
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
63 (defun paths-construct-load-path
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
64 (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
65 lisp-directory
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
66 &optional site-lisp-directory)
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
67 "Construct the load path."
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
68 (let* ((envvar-value (getenv "EMACSLOADPATH"))
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
69 (env-load-path
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
70 (and envvar-value
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
71 (paths-decode-directory-path envvar-value 'drop-empties)))
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
72 (site-lisp-load-path
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
73 (and site-lisp-directory
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
74 (paths-find-recursive-load-path (list site-lisp-directory)
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
75 paths-load-path-depth)))
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
76 (lisp-load-path
278
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
77 (and lisp-directory
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
78 (paths-find-recursive-load-path (list lisp-directory)
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
79 paths-load-path-depth))))
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
80 (append env-load-path
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
81 early-package-load-path
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
82 site-lisp-load-path
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
83 late-package-load-path
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
84 lisp-load-path
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
85 last-package-load-path)))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
86
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
87 (defun paths-construct-info-path (roots early-packages late-packages last-packages)
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
88 "Construct the info path."
274
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
89 (let ((info-path-envval (getenv "INFOPATH")))
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
90 (paths-uniq-append
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
91 (append
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
92 (let ((info-directory
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
93 (paths-find-version-directory roots "info"
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
94 nil
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
95 configure-info-directory)))
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
96 (and info-directory
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
97 (list info-directory)))
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
98 (packages-find-package-info-path early-packages)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
99 (packages-find-package-info-path late-packages)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
100 (packages-find-package-info-path last-packages)
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
101 (and info-path-envval
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
102 (paths-decode-directory-path info-path-envval 'drop-empties)))
278
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
103 (and (null info-path-envval)
274
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
104 (paths-uniq-append
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
105 (paths-directories-which-exist configure-info-path)
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
106 (paths-directories-which-exist paths-default-info-directories))))))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
107
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
108 (defun paths-find-doc-directory (roots)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
109 "Find the documentation directory."
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
110 (paths-find-architecture-directory roots "lib-src"))
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
111
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
112 (defun paths-find-lock-directory (roots)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
113 "Find the lock directory."
274
ca9a9ec9c1c1 Import from CVS: tag r21-0b35
cvs
parents: 272
diff changeset
114 (paths-find-site-directory roots "lock" "EMACSLOCKDIR" configure-lock-directory))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
115
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
116 (defun paths-find-superlock-file (lock-directory)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
117 "Find the superlock file."
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
118 (cond
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
119 ((null lock-directory)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
120 nil)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
121 ((and configure-superlock-file
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
122 (file-directory-p (file-name-directory configure-superlock-file)))
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
123 configure-superlock-file)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
124 (t
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
125 (expand-file-name "!!!SuperLock!!!" lock-directory))))
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
126
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
127 (defun paths-find-exec-directory (roots)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
128 "Find the binary directory."
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
129 (paths-find-architecture-directory roots "lib-src" configure-exec-directory))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
130
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
131 (defun paths-construct-exec-path (roots exec-directory
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
132 early-packages late-packages last-packages)
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
133 "Find the binary path."
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
134 (append
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
135 (let ((path-envval (getenv "PATH")))
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
136 (if path-envval
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
137 (paths-decode-directory-path path-envval 'drop-empties)))
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
138 (packages-find-package-exec-path early-packages)
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
139 (packages-find-package-exec-path late-packages)
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
140 (let ((emacspath-envval (getenv "EMACSPATH")))
276
6330739388db Import from CVS: tag r21-0b36
cvs
parents: 274
diff changeset
141 (and emacspath-envval
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 278
diff changeset
142 (split-path emacspath-envval)))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
143 (and exec-directory
308
33bdb3d4b97f Import from CVS: tag r21-0b52
cvs
parents: 284
diff changeset
144 (list exec-directory))
33bdb3d4b97f Import from CVS: tag r21-0b52
cvs
parents: 284
diff changeset
145 (packages-find-package-exec-path last-packages)))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
146
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
147 (defun paths-find-data-directory (roots)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
148 "Find the data directory."
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
149 (paths-find-version-directory roots "etc" "EMACSDATA" configure-data-directory))
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
150
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
151 (defun paths-construct-data-directory-list (data-directory
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
152 early-packages late-packages last-packages)
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
153 "Find the data path."
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
154 (append
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
155 (packages-find-package-data-path early-packages)
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
156 (packages-find-package-data-path late-packages)
308
33bdb3d4b97f Import from CVS: tag r21-0b52
cvs
parents: 284
diff changeset
157 (list data-directory)
33bdb3d4b97f Import from CVS: tag r21-0b52
cvs
parents: 284
diff changeset
158 (packages-find-package-data-path last-packages)))
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
159
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents:
diff changeset
160 ;;; setup-paths.el ends here