emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110775: No need for filecache.el to


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110775: No need for filecache.el to load find-lisp when compiling
Date: Fri, 02 Nov 2012 18:44:38 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110775
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Fri 2012-11-02 18:44:38 -0400
message:
  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.
modified:
  lisp/ChangeLog
  lisp/filecache.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-11-02 22:41:35 +0000
+++ b/lisp/ChangeLog    2012-11-02 22:44:38 +0000
@@ -1,5 +1,9 @@
 2012-11-02  Glenn Morris  <address@hidden>
 
+       * 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.
 
        * emacs-lisp/bytecomp.el (byte-compile-eval):

=== modified file 'lisp/filecache.el'
--- a/lisp/filecache.el 2012-01-19 07:21:25 +0000
+++ b/lisp/filecache.el 2012-11-02 22:44:38 +0000
@@ -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)
   (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 @@
 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]