comparison lisp/tl/file-detect.el @ 16:0293115a14e9 r19-15b91

Import from CVS: tag r19-15b91
author cvs
date Mon, 13 Aug 2007 08:49:20 +0200
parents 49a24b4fd526
children ec9a17fef872
comparison
equal deleted inserted replaced
15:ad457d5f7d04 16:0293115a14e9
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.3 1996/12/29 00:15:09 steve Exp $ 7 ;; $Id: file-detect.el,v 1.4 1997/02/02 05:06:17 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.