Mercurial > hg > xemacs-beta
diff 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 |
line wrap: on
line diff
--- a/lisp/tl/file-detect.el Mon Aug 13 09:08:31 2007 +0200 +++ b/lisp/tl/file-detect.el Mon Aug 13 09:09:02 2007 +0200 @@ -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.2 1996/12/28 21:03:09 steve Exp $ +;; $Id: file-detect.el,v 1.3 1997/01/30 02:22:46 steve Exp $ ;; Keywords: install, module ;; This file is part of tl (Tiny Library). @@ -65,6 +65,18 @@ )) ))) +(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.