;;; file-detect.el --- Emacs Lisp file detection utility
-;; Copyright (C) 1996 Free Software Foundation, Inc.
+;; Copyright (C) 1996,1997 Free Software Foundation, Inc.
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Version:
-;; $Id: file-detect.el,v 1.6 1996/08/21 11:43:09 morioka Exp $
+;; $Id: file-detect.el,v 2.0 1997/01/11 17:19:50 morioka Exp $
;; Keywords: install, module
;; This file is part of tl (Tiny Library).
))
)))
+(defun add-latest-path (pattern &optional all-paths)
+ "Add latest path matched by PATTERN to `load-path'
+if it exists under `default-load-path' directories
+and it does not exist in `load-path'.
+
+If optional argument ALL-PATHS is specified, it is searched from all
+of load-path instead of default-load-path. [file-detect.el]"
+ (let ((path (get-latest-path pattern all-paths)))
+ (if path
+ (add-to-list 'load-path path)
+ )))
+
(defun get-latest-path (pat &optional all-paths)
"Return latest directory in default-load-path
which is matched to regexp PAT.