X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/ce07fa9adcea121b5515f98e161e257d1210c9b0..96e055075d7c73cf189038db1b15f9369888ea41:/lisp/filecache.el diff --git a/lisp/filecache.el b/lisp/filecache.el index b4b1e8bd95..2dd7c2673b 100644 --- a/lisp/filecache.el +++ b/lisp/filecache.el @@ -1,7 +1,6 @@ ;;; filecache.el --- find files using a pre-loaded cache -;; Copyright (C) 1996, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, -;; 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1996, 2000-2012 Free Software Foundation, Inc. ;; Author: Peter Breton ;; Created: Sun Nov 10 1996 @@ -140,9 +139,6 @@ ;;; Code: -(eval-when-compile - (require 'find-lisp)) - (defgroup file-cache nil "Find files using a pre-loaded cache." :group 'files @@ -207,7 +203,7 @@ should be t." :group 'file-cache) (defcustom file-cache-completion-ignore-case - (if (memq system-type (list 'ms-dos 'windows-nt 'cygwin)) + (if (memq system-type '(ms-dos windows-nt cygwin)) t completion-ignore-case) "If non-nil, file-cache completion should ignore case. @@ -216,7 +212,7 @@ Defaults to the value of `completion-ignore-case'." :group 'file-cache) (defcustom file-cache-case-fold-search - (if (memq system-type (list 'ms-dos 'windows-nt 'cygwin)) + (if (memq system-type '(ms-dos windows-nt cygwin)) t case-fold-search) "If non-nil, file-cache completion should ignore case. @@ -225,7 +221,7 @@ Defaults to the value of `case-fold-search'." :group 'file-cache) (defcustom file-cache-ignore-case - (memq system-type (list 'ms-dos 'windows-nt 'cygwin)) + (memq system-type '(ms-dos windows-nt cygwin)) "Non-nil means ignore case when checking completions in the file cache. Defaults to nil on DOS and Windows, and t on other systems." :type 'boolean @@ -367,6 +363,8 @@ STRING is passed as an argument to the locate command." string) (file-cache-add-from-file-cache-buffer)) +(autoload 'find-lisp-find-files "find-lisp") + ;;;###autoload (defun file-cache-add-directory-recursively (dir &optional regexp) "Adds DIR and any subdirectories to the file-cache. @@ -375,18 +373,16 @@ If the optional REGEXP argument is non-nil, only files which match it will be added to the cache. Note that the REGEXP is applied to the files in each directory, not to the directory list itself." (interactive "DAdd directory: ") - (require 'find-lisp) (mapcar - (function - (lambda (file) - (or (file-directory-p file) - (let (filtered) - (dolist (regexp file-cache-filter-regexps) - (and (string-match regexp file) - (setq filtered t))) - filtered) - (file-cache-add-file file)))) - (find-lisp-find-files dir (if regexp regexp "^")))) + (lambda (file) + (or (file-directory-p file) + (let (filtered) + (dolist (regexp file-cache-filter-regexps) + (and (string-match regexp file) + (setq filtered t))) + filtered) + (file-cache-add-file file))) + (find-lisp-find-files dir (or regexp "^")))) (defun file-cache-add-from-file-cache-buffer (&optional regexp) "Add any entries found in the file cache buffer. @@ -687,5 +683,4 @@ match REGEXP." (provide 'filecache) -;; arch-tag: 433d3ca4-4af2-47ce-b2cf-1f727460f538 ;;; filecache.el ends here