bug-gnu-emacs
[Top][All Lists]
Advanced

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

[patch] 21.3 filecache.el - Use executable.el executable-command-find-un


From: Jari Aalto+mail.linux
Subject: [patch] 21.3 filecache.el - Use executable.el executable-command-find-unix-p
Date: Tue, 27 Jan 2004 15:10:54 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/20.7 (windows-nt) (i386-*-nt5.0.2195)

This patch supposes, that executable.el has been patched for new
function.

2004-01-27  Jari Aalto  <address@hidden>

        * filecache.el 
        (top level): Added autoload for `executable-command-find-unix-p'
        (file-cache-find-unix-p): Removed.
        Moved to executable.el
        (file-cache-add-directory-using-find): Use
        `executable-command-find-unix-p' 



Index: filecache.el
===================================================================
RCS file: 
/cygdrive/h/data/version-control/cvsroot/emacs/gnu-emacs/lisp213/filecache.el,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -IId: -b -w -u -r1.7 -r1.8
--- filecache.el        26 Jan 2004 19:16:23 -0000      1.7
+++ filecache.el        27 Jan 2004 13:07:32 -0000      1.8
@@ -139,6 +139,8 @@
 
 ;;; Code:
 
+(autoload 'executable-command-find-unix-p "executable")
+
 (defgroup file-cache nil
   "Find files using a pre-loaded cache."
   :group 'files
@@ -327,36 +329,14 @@
                     file-cache-alist)))
       )))
 
-(defun file-cache-find-unix-p ()
-  "Check if `file-cache-find-command' is Unix type program."
-  ;;  Pick file to search from location we know
-  (let* ((dir   (car load-path))
-         (file  (find-if
-                 (lambda (x)
-                   ;; Filter directories . and ..
-                   (not (string-match "^\\.\\.?$" x)))
-                 (directory-files dir))))
-    (with-temp-buffer
-      (call-process file-cache-find-command
-                    nil
-                    (current-buffer)
-                    nil
-                    dir
-                    "-name"
-                    file
-                    "-maxdepth"
-                    "1")
-        (goto-char (point-min))
-        (if (search-forward file nil t)
-            t))))
-
 (defun file-cache-add-directory-using-find (directory)
   "Use the `find' command to add files to the file cache.
 Find is run in DIRECTORY."
   (interactive "DAdd files under directory: ")
   (let ((dir (expand-file-name directory)))
     (if (eq file-cache-find-command-unix-flag 'not-defined)
-        (setq file-cache-find-command-unix-flag (file-cache-find-unix-p)))
+        (setq file-cache-find-command-unix-flag 
+             (executable-command-find-unix-p file-cache-find-command)))
     (set-buffer (get-buffer-create file-cache-buffer))
     (erase-buffer)
     (call-process file-cache-find-command nil




-- 
http://tiny-tools.sourceforge.net/
Swatch @time   http://www.mir.com.my/iTime/itime.htm
               http://www.ryanthiessen.com/swatch/resources.htm
Use Licenses!  http://www.linuxjournal.com/article.php?sid=6225
Which Licence? http://www.linuxjournal.com/article.php?sid=4825
OSI Licences   http://www.opensource.org/licenses/




reply via email to

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