tm 7.102.
[elisp/apel.git] / file-detect.el
index d5b6bb9..e7798ef 100644 (file)
@@ -1,10 +1,10 @@
 ;;; 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).
@@ -65,6 +65,18 @@ You can specify following OPTIONS:
                ))
       )))
 
+(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.