summaryrefslogtreecommitdiff
path: root/lisp/filecache.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2012-11-02 18:44:38 -0400
committerGlenn Morris <rgm@gnu.org>2012-11-02 18:44:38 -0400
commit00a3b041730e178fe68850b76ac4216af62ea606 (patch)
tree6eef4c5f4b9596544f4eaade0a5376fe321666b2 /lisp/filecache.el
parent11fef14abb1fdd7424295c3c50d59bf18bb6c4e7 (diff)
downloademacs-00a3b041730e178fe68850b76ac4216af62ea606.tar.gz
emacs-00a3b041730e178fe68850b76ac4216af62ea606.tar.bz2
emacs-00a3b041730e178fe68850b76ac4216af62ea606.zip
No need for filecache.el to load find-lisp when compiling
* lisp/filecache.el (find-lisp-find-files): Autoload it. (file-cache-add-directory-recursively): Don't require find-lisp.
Diffstat (limited to 'lisp/filecache.el')
-rw-r--r--lisp/filecache.el25
1 files changed, 11 insertions, 14 deletions
diff --git a/lisp/filecache.el b/lisp/filecache.el
index 10e23bddca2..2dd7c2673bf 100644
--- a/lisp/filecache.el
+++ b/lisp/filecache.el
@@ -139,9 +139,6 @@
;;; Code:
-(eval-when-compile
- (require 'find-lisp))
-
(defgroup file-cache nil
"Find files using a pre-loaded cache."
:group 'files
@@ -366,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.
@@ -374,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.