Mercurial > hg > xemacs-beta
comparison lisp/tl/file-detect.el @ 86:364816949b59 r20-0b93
Import from CVS: tag r20-0b93
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:09:02 +0200 |
parents | c0c698873ce1 |
children | 360340f9fd5f |
comparison
equal
deleted
inserted
replaced
85:c661705957e0 | 86:364816949b59 |
---|---|
1 ;;; file-detect.el --- Emacs Lisp file detection utility | 1 ;;; file-detect.el --- Emacs Lisp file detection utility |
2 | 2 |
3 ;; Copyright (C) 1996 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1996,1997 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> | 5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp> |
6 ;; Version: | 6 ;; Version: |
7 ;; $Id: file-detect.el,v 1.2 1996/12/28 21:03:09 steve Exp $ | 7 ;; $Id: file-detect.el,v 1.3 1997/01/30 02:22:46 steve Exp $ |
8 ;; Keywords: install, module | 8 ;; Keywords: install, module |
9 | 9 |
10 ;; This file is part of tl (Tiny Library). | 10 ;; This file is part of tl (Tiny Library). |
11 | 11 |
12 ;; This program is free software; you can redistribute it and/or | 12 ;; This program is free software; you can redistribute it and/or |
61 (setq load-path | 61 (setq load-path |
62 (if (memq 'append options) | 62 (if (memq 'append options) |
63 (append load-path (list p)) | 63 (append load-path (list p)) |
64 (cons p load-path) | 64 (cons p load-path) |
65 )) | 65 )) |
66 ))) | |
67 | |
68 (defun add-latest-path (pattern &optional all-paths) | |
69 "Add latest path matched by PATTERN to `load-path' | |
70 if it exists under `default-load-path' directories | |
71 and it does not exist in `load-path'. | |
72 | |
73 If optional argument ALL-PATHS is specified, it is searched from all | |
74 of load-path instead of default-load-path. [file-detect.el]" | |
75 (let ((path (get-latest-path pattern all-paths))) | |
76 (if path | |
77 (add-to-list 'load-path path) | |
66 ))) | 78 ))) |
67 | 79 |
68 (defun get-latest-path (pat &optional all-paths) | 80 (defun get-latest-path (pat &optional all-paths) |
69 "Return latest directory in default-load-path | 81 "Return latest directory in default-load-path |
70 which is matched to regexp PAT. | 82 which is matched to regexp PAT. |