X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=path-util.el;h=8e371152c9b92cb265bfc25dd42fdb663d979d82;hb=feb5abeb62b119c2dd1d327af07c1aaa2b18a341;hp=bfdf7bb63f22716f79e2bbea59794cc297d6ecbc;hpb=aa798d204a904b8054634b37c9bcc6e9a7298fd5;p=elisp%2Fapel.git diff --git a/path-util.el b/path-util.el index bfdf7bb..8e37115 100644 --- a/path-util.el +++ b/path-util.el @@ -38,7 +38,7 @@ directories and it does not exist in `load-path'. You can use following PATH styles: load-path relative: \"PATH/\" - (it is searched from `defaul-load-path') + (it is searched from `default-load-path') home directory relative: \"~/PATH/\" \"~USER/PATH/\" absolute path: \"/HOO/BAR/BAZ/\" @@ -54,18 +54,16 @@ You can specify following OPTIONS: (while rest (setq p (expand-file-name path (car rest))) (if (file-directory-p p) - (throw 'tag p) - ) - (setq rest (cdr rest)) - )) - (not (member p load-path)) - ) + (throw 'tag p)) + (setq rest (cdr rest)))) + (not (or (member p load-path) + (if (string-match "/$" p) + (member (substring p 0 (1- (length p))) load-path) + (member (file-name-as-directory p) load-path))))) (setq load-path (if (memq 'append options) (append load-path (list p)) - (cons p load-path) - )) - ))) + (cons p load-path)))))) ;;;###autoload (defun add-latest-path (pattern &optional all-paths) @@ -197,6 +195,7 @@ If PATHS is omitted, `load-path' is used." ;;; @ end ;;; -(provide 'path-util) +(require 'product) +(product-provide (provide 'path-util) (require 'apel-ver)) ;;; path-util.el ends here