]> code.delx.au - gnu-emacs/blobdiff - lisp/filecache.el
(ibuffer-compressed-file-name-regexp): Avoid loading
[gnu-emacs] / lisp / filecache.el
index ea8bdaaf23207492f44ada2442474f7d83f0d91f..c0e9e9e5f5d2b6877b763588b5befba3cee21630 100644 (file)
@@ -4,7 +4,8 @@
 ;; Created: Sun Nov 10 1996
 ;; Keywords: convenience
 ;;
-;; Copyright (C) 1996, 2000 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2000, 2002, 2003, 2004,
+;;   2005, 2006 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -20,8 +21,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 ;;
@@ -310,7 +311,7 @@ in each directory, not to the directory list itself."
   "Add FILE to the file cache."
   (interactive "fAdd File: ")
   (if (not (file-exists-p file))
-      (message "File %s does not exist" file)
+      (message "Filecache: file %s does not exist" file)
     (let* ((file-name (file-name-nondirectory file))
           (dir-name  (file-name-directory    file))
           (the-entry (assoc-string
@@ -337,21 +338,20 @@ in each directory, not to the directory list itself."
 Find is run in DIRECTORY."
   (interactive "DAdd files under directory: ")
   (let ((dir (expand-file-name directory)))
-    (if (eq file-cache-find-command-posix-flag 'not-defined)
-        (setq file-cache-find-command-posix-flag
-             (executable-command-find-posix-p file-cache-find-command)))
+    (when (memq system-type '(windows-nt cygwin))
+      (if (eq file-cache-find-command-posix-flag 'not-defined)
+         (setq file-cache-find-command-posix-flag
+               (executable-command-find-posix-p file-cache-find-command))))
     (set-buffer (get-buffer-create file-cache-buffer))
     (erase-buffer)
     (call-process file-cache-find-command nil
                  (get-buffer file-cache-buffer) nil
                  dir "-name"
-                  (cond
-                   (file-cache-find-command-posix-flag
-                    "\\*")
-                   ((eq system-type 'windows-nt)
-                    "'*'")
-                   (t
-                    "*"))
+                 (if (memq system-type '(windows-nt cygwin))
+                     (if file-cache-find-command-posix-flag
+                         "\\*"
+                       "'*'")
+                   "*")
                  "-print")
     (file-cache-add-from-file-cache-buffer)))
 
@@ -441,7 +441,8 @@ or the optional REGEXP argument."
                    (setq delete-list (cons (car elt) delete-list))))
            file-cache-alist)
     (file-cache-delete-file-list delete-list)
-    (message "Deleted %d files from file cache" (length delete-list))))
+    (message "Filecache: deleted %d files from file cache"
+             (length delete-list))))
 
 (defun file-cache-delete-directory (directory)
   "Delete DIRECTORY from the file cache."
@@ -454,8 +455,8 @@ or the optional REGEXP argument."
            (setq result (1+ result))))
      file-cache-alist)
     (if (zerop result)
-       (error "No entries containing %s found in cache" directory)
-      (message "Deleted %d entries" result))))
+       (error "Filecache: no entries containing %s found in cache" directory)
+      (message "Filecache: deleted %d entries" result))))
 
 (defun file-cache-do-delete-directory (dir entry)
   (let ((directory-list (cdr entry))
@@ -488,14 +489,14 @@ or the optional REGEXP argument."
         (num)
         )
     (if (not (listp directory-list))
-       (error "Unknown type in file-cache-alist for key %s" file))
+       (error "Filecache: unknown type in file-cache-alist for key %s" file))
     (cond
      ;; Single element
      ((eq 1 len)
       (setq directory (elt directory-list 0)))
      ;; No elements
      ((eq 0 len)
-      (error "No directory found for key %s" file))
+      (error "Filecache: no directory found for key %s" file))
      ;; Multiple elements
      (t
       (let* ((minibuffer-dir (file-name-directory (minibuffer-contents)))
@@ -606,7 +607,7 @@ the name is considered already unique; only the second substitution
                            completion-setup-hook)))
                    )
                (with-output-to-temp-buffer file-cache-completions-buffer
-                 (display-completion-list completion-list))
+                 (display-completion-list completion-list string))
                )
              )
          (setq file-cache-string (file-cache-file-name completion-string))
@@ -699,7 +700,7 @@ the name is considered already unique; only the second substitution
           )
          (t
           (with-output-to-temp-buffer "*Completions*"
-            (display-completion-list all))
+            (display-completion-list all pattern))
           ))
     ))