Commit 00a3b041 authored by Glenn Morris's avatar Glenn Morris
Browse files

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.
parent 11fef14a
2012-11-02 Glenn Morris <rgm@gnu.org> 2012-11-02 Glenn Morris <rgm@gnu.org>
   
* filecache.el: No need to load find-lisp when compiling.
(find-lisp-find-files): Autoload it.
(file-cache-add-directory-recursively): Don't require find-lisp.
* image.el (image-type-from-file-name): Trivial simplification. * image.el (image-type-from-file-name): Trivial simplification.
   
* emacs-lisp/bytecomp.el (byte-compile-eval): * emacs-lisp/bytecomp.el (byte-compile-eval):
......
...@@ -139,9 +139,6 @@ ...@@ -139,9 +139,6 @@
;;; Code: ;;; Code:
(eval-when-compile
(require 'find-lisp))
(defgroup file-cache nil (defgroup file-cache nil
"Find files using a pre-loaded cache." "Find files using a pre-loaded cache."
:group 'files :group 'files
...@@ -366,6 +363,8 @@ STRING is passed as an argument to the locate command." ...@@ -366,6 +363,8 @@ STRING is passed as an argument to the locate command."
string) string)
(file-cache-add-from-file-cache-buffer)) (file-cache-add-from-file-cache-buffer))
(autoload 'find-lisp-find-files "find-lisp")
;;;###autoload ;;;###autoload
(defun file-cache-add-directory-recursively (dir &optional regexp) (defun file-cache-add-directory-recursively (dir &optional regexp)
"Adds DIR and any subdirectories to the file-cache. "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 ...@@ -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 will be added to the cache. Note that the REGEXP is applied to the
files in each directory, not to the directory list itself." files in each directory, not to the directory list itself."
(interactive "DAdd directory: ") (interactive "DAdd directory: ")
(require 'find-lisp)
(mapcar (mapcar
(function (lambda (file)
(lambda (file) (or (file-directory-p file)
(or (file-directory-p file) (let (filtered)
(let (filtered) (dolist (regexp file-cache-filter-regexps)
(dolist (regexp file-cache-filter-regexps) (and (string-match regexp file)
(and (string-match regexp file) (setq filtered t)))
(setq filtered t))) filtered)
filtered) (file-cache-add-file file)))
(file-cache-add-file file)))) (find-lisp-find-files dir (or regexp "^"))))
(find-lisp-find-files dir (if regexp regexp "^"))))
(defun file-cache-add-from-file-cache-buffer (&optional regexp) (defun file-cache-add-from-file-cache-buffer (&optional regexp)
"Add any entries found in the file cache buffer. "Add any entries found in the file cache buffer.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment