Mercurial > hg > xemacs-beta
comparison lisp/find-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 | 7df0dd720c89 |
comparison
equal
deleted
inserted
replaced
277:cfdf3ff11843 | 278:90d73dddcdc4 |
---|---|
241 (setq reverse-survivors (cons (car list-2) reverse-survivors))) | 241 (setq reverse-survivors (cons (car list-2) reverse-survivors))) |
242 (setq list-2 (cdr list-2))) | 242 (setq list-2 (cdr list-2))) |
243 (append list-1 | 243 (append list-1 |
244 (reverse reverse-survivors)))) | 244 (reverse reverse-survivors)))) |
245 | 245 |
246 (defun paths-delete (predicate list) | 246 (defun paths-filter (predicate list) |
247 "Delete all matches of PREDICATE from LIST." | 247 "Delete all matches of PREDICATE from LIST." |
248 (let ((reverse-result '())) | 248 (let ((reverse-result '())) |
249 (while list | 249 (while list |
250 (if (not (funcall predicate (car list))) | 250 (if (funcall predicate (car list)) |
251 (setq reverse-result (cons (car list) reverse-result))) | 251 (setq reverse-result (cons (car list) reverse-result))) |
252 (setq list (cdr list))) | 252 (setq list (cdr list))) |
253 (nreverse reverse-result))) | 253 (nreverse reverse-result))) |
254 | 254 |
255 (defun paths-decode-directory-path (string &optional drop-empties) | 255 (defun paths-decode-directory-path (string &optional drop-empties) |
263 (if (string-equal "" component) | 263 (if (string-equal "" component) |
264 component | 264 component |
265 (file-name-as-directory component))) | 265 (file-name-as-directory component))) |
266 components))) | 266 components))) |
267 (if drop-empties | 267 (if drop-empties |
268 (paths-delete #'(lambda (component) | 268 (paths-filter #'(lambda (component) |
269 (string-equal "" component)) | 269 (null (string-equal "" component))) |
270 directories) | 270 directories) |
271 directories))) | 271 directories))) |
272 | 272 |
273 (defun paths-find-emacs-roots (invocation-directory | 273 (defun paths-find-emacs-roots (invocation-directory |
274 invocation-name) | 274 invocation-name) |
275 "Find all plausible installation roots for XEmacs." | 275 "Find all plausible installation roots for XEmacs." |
276 (let ((invocation-root | 276 (let* ((potential-invocation-root |
277 (paths-find-emacs-root invocation-directory invocation-name)) | 277 (paths-find-emacs-root invocation-directory invocation-name)) |
278 (installation-root | 278 (invocation-roots |
279 (and configure-prefix-directory | 279 (and potential-invocation-root |
280 (file-directory-p configure-prefix-directory) | 280 (list potential-invocation-root))) |
281 (file-name-as-directory configure-prefix-directory)))) | 281 (potential-installation-roots |
282 (append (and invocation-root | 282 (paths-uniq-append |
283 (list invocation-root)) | 283 (and configure-exec-prefix-directory |
284 (and installation-root | 284 (list (file-name-as-directory |
285 (paths-emacs-root-p installation-root) | 285 configure-exec-prefix-directory))) |
286 (list installation-root))))) | 286 (and configure-prefix-directory |
287 (list (file-name-as-directory | |
288 configure-prefix-directory))))) | |
289 (installation-roots | |
290 (paths-filter #'paths-emacs-root-p potential-installation-roots))) | |
291 (paths-uniq-append invocation-roots | |
292 installation-roots))) | |
287 | 293 |
288 ;;; find-paths.el ends here | 294 ;;; find-paths.el ends here |