comparison lisp/find-paths.el @ 3753:a452d2a78a4e

[xemacs-hg @ 2006-12-19 15:28:43 by stephent] Document ROOT(S) arguments correctly. <87bqlzq4o4.fsf@uwakimon.sk.tsukuba.ac.jp>
author stephent
date Tue, 19 Dec 2006 15:28:45 +0000
parents 505a24c07ba9
children 9c0151d05116
comparison
equal deleted inserted replaced
3752:7da03bc36069 3753:a452d2a78a4e
124 (expand-file-name path expand-directory) 124 (expand-file-name path expand-directory)
125 path))) 125 path)))
126 126
127 (defun paths-construct-emacs-directory (root suffix base) 127 (defun paths-construct-emacs-directory (root suffix base)
128 "Construct a directory name within the XEmacs hierarchy. 128 "Construct a directory name within the XEmacs hierarchy.
129 ROOT must be a an installation root. 129 ROOT must be an installation root.
130 SUFFIX is the subdirectory from there. 130 SUFFIX is the subdirectory from there.
131 BASE is the base to look for." 131 BASE is the base to look for."
132 (file-name-as-directory 132 (file-name-as-directory
133 (expand-file-name 133 (expand-file-name
134 (concat 134 (concat
209 209
210 (defun paths-for-each-site-directory (func roots base &optional envvar default) 210 (defun paths-for-each-site-directory (func roots base &optional envvar default)
211 "Iterate over the site-specific directories in the XEmacs hierarchy. 211 "Iterate over the site-specific directories in the XEmacs hierarchy.
212 FUNC is a function that called for each directory, with the directory 212 FUNC is a function that called for each directory, with the directory
213 as the only argument. 213 as the only argument.
214 ROOT must be a an installation root. 214 ROOTS must be a list of installation roots.
215 BASE is the base to look for. 215 BASE is the base to look for.
216 ENVVAR is the name of the environment variable that might also 216 ENVVAR is the name of the environment variable that might also
217 specify the directory. 217 specify the directory.
218 DEFAULT is the preferred value." 218 DEFAULT is the preferred value."
219 (paths-for-each-emacs-directory func 219 (paths-for-each-emacs-directory func
225 base 225 base
226 envvar default)) 226 envvar default))
227 227
228 (defun paths-find-site-directory (roots base &optional envvar default) 228 (defun paths-find-site-directory (roots base &optional envvar default)
229 "Find a site-specific directory in the XEmacs hierarchy. 229 "Find a site-specific directory in the XEmacs hierarchy.
230 ROOT must be a an installation root. 230 ROOTS must be a list of installation roots.
231 BASE is the base to look for. 231 BASE is the base to look for.
232 ENVVAR is the name of the environment variable that might also 232 ENVVAR is the name of the environment variable that might also
233 specify the directory. 233 specify the directory.
234 DEFAULT is the preferred value." 234 DEFAULT is the preferred value."
235 (catch 'gotcha 235 (catch 'gotcha
238 roots base 238 roots base
239 envvar default))) 239 envvar default)))
240 240
241 (defun paths-find-site-directories (roots base &optional envvar default) 241 (defun paths-find-site-directories (roots base &optional envvar default)
242 "Find a list of site-specific directories in the XEmacs hierarchy. 242 "Find a list of site-specific directories in the XEmacs hierarchy.
243 ROOT must be a an installation root. 243 ROOTS must be a list of installation roots.
244 BASE is the base to look for. 244 BASE is the base to look for.
245 ENVVAR is the name of the environment variable that might also 245 ENVVAR is the name of the environment variable that might also
246 specify the directory. 246 specify the directory.
247 DEFAULT is the preferred value." 247 DEFAULT is the preferred value."
248 (let ((l '())) 248 (let ((l '()))
255 (defun paths-for-each-version-directory (func roots base 255 (defun paths-for-each-version-directory (func roots base
256 &optional envvar default enforce-version) 256 &optional envvar default enforce-version)
257 "Iterate over version-specific directories in the XEmacs hierarchy. 257 "Iterate over version-specific directories in the XEmacs hierarchy.
258 FUNC is a function that called for each directory, with the directory 258 FUNC is a function that called for each directory, with the directory
259 as the only argument. 259 as the only argument.
260 ROOT must be a an installation root. 260 ROOTS must be a list of installation roots.
261 BASE is the base to look for. 261 BASE is the base to look for.
262 ENVVAR is the name of the environment variable that might also 262 ENVVAR is the name of the environment variable that might also
263 specify the directory. 263 specify the directory.
264 DEFAULT is the preferred value. 264 DEFAULT is the preferred value.
265 If ENFORCE-VERSION is non-nil, the directory must contain the XEmacs version." 265 If ENFORCE-VERSION is non-nil, the directory must contain the XEmacs version."
273 envvar default)) 273 envvar default))
274 274
275 (defun paths-find-version-directory (roots base 275 (defun paths-find-version-directory (roots base
276 &optional envvar default enforce-version) 276 &optional envvar default enforce-version)
277 "Find a version-specific directory in the XEmacs hierarchy. 277 "Find a version-specific directory in the XEmacs hierarchy.
278 ROOT must be a an installation root. 278 ROOTS must be a list of installation roots.
279 BASE is the base to look for. 279 BASE is the base to look for.
280 ENVVAR is the name of the environment variable that might also 280 ENVVAR is the name of the environment variable that might also
281 specify the directory. 281 specify the directory.
282 DEFAULT is the preferred value. 282 DEFAULT is the preferred value.
283 If ENFORCE-VERSION is non-nil, the directory must contain the XEmacs version." 283 If ENFORCE-VERSION is non-nil, the directory must contain the XEmacs version."
288 envvar default))) 288 envvar default)))
289 289
290 (defun paths-find-version-directories (roots base 290 (defun paths-find-version-directories (roots base
291 &optional envvar default enforce-version) 291 &optional envvar default enforce-version)
292 "Find a list of version-specific directories in the XEmacs hierarchy. 292 "Find a list of version-specific directories in the XEmacs hierarchy.
293 ROOT must be a an installation root. 293 ROOTS must be a list of installation roots.
294 BASE is the base to look for. 294 BASE is the base to look for.
295 ENVVAR is the name of the environment variable that might also 295 ENVVAR is the name of the environment variable that might also
296 specify the directory. 296 specify the directory.
297 DEFAULT is the preferred value. 297 DEFAULT is the preferred value.
298 If ENFORCE-VERSION is non-nil, the directory must contain the XEmacs version." 298 If ENFORCE-VERSION is non-nil, the directory must contain the XEmacs version."
303 envvar default) 303 envvar default)
304 (reverse l))) 304 (reverse l)))
305 305
306 (defun paths-find-architecture-directory (roots base &optional envvar default) 306 (defun paths-find-architecture-directory (roots base &optional envvar default)
307 "Find an architecture-specific directory in the XEmacs hierarchy. 307 "Find an architecture-specific directory in the XEmacs hierarchy.
308 ROOT must be a an installation root. 308 ROOTS must be a list of installation roots.
309 BASE is the base to look for. 309 BASE is the base to look for.
310 ENVVAR is the name of the environment variable that might also 310 ENVVAR is the name of the environment variable that might also
311 specify the directory. 311 specify the directory.
312 DEFAULT is the preferred value." 312 DEFAULT is the preferred value."
313 (or 313 (or