* ptexinfmt.el: Use lexical binding.
[elisp/wanderlust.git] / WL-MK
diff --git a/WL-MK b/WL-MK
index d7ab2d6..0086a93 100644 (file)
--- a/WL-MK
+++ b/WL-MK
       (setq files (cdr files)))
     (lunit suite)))
 
-(defun wl-scan-source (path)
-  (let (ret)
-    (mapc
-     (lambda (x)
-       (mapc (lambda (y)
-              (setq ret (append (list y (concat y "c")) ret)))
-            (directory-files x nil "\\(.+\\)\\.el$" t)))
-     path)
-    ret))
+(defun wl-scan-path (path scanner)
+  (let ((dirs (if (listp path)
+                 path
+               (list path))))
+    (apply 'append (mapcar scanner dirs))))
 
+(defun wl-scan-source (path)
+  (wl-scan-path path
+               (lambda (x)
+                 (apply 'append
+                        (mapcar (lambda (y)
+                                  (list y (concat y "c")))
+                                (directory-files x nil "\\(.+\\)\\.el$" t))))))
+
+(defun wl-scan-icons (path)
+  (wl-scan-path path
+               (lambda (x)
+                 (let ((case-fold-search t))
+                   (directory-files x nil "\\.img$\\|\\.x[bp]m$")))))
 
 (defun wl-uninstall (objs path)
   ;(message (mapconcat 'identity objs " "))
                                        "\\.img$\\|\\.xbm$")))))
     (install-files icons ICONDIR PIXMAPDIR nil 'overwrite)))
 
+(defun uninstall-wl-icons ()
+  (if (not (file-directory-p PIXMAPDIR))
+      ()
+    (wl-uninstall (wl-scan-icons PIXMAPDIR)
+                 PIXMAPDIR)))
+
 (defun install-wl-package ()
   (compile-wl-package)
   (let ((wl-install-dir (expand-file-name WL_PREFIX LISPDIR))
     (wl-uninstall (wl-scan-source (list ELMODIR))
                  elmo-install-dir))
   (if PIXMAPDIR
-      (let* ((case-fold-search t)
-            (icons (directory-files PIXMAPDIR t "\\.x[bp]m$"))
-            icon)
-       (while icons
-         (setq icon (car icons)
-               icons (cdr icons))
-         (if (and (file-exists-p icon)
-                  (file-writable-p icon))
-             (progn
-               (princ (format "%s was uninstalled.\n" icon))
-               (delete-file icon)))))))
+      (uninstall-wl-icons)))
 
 
 (defun config-wl-package-xmas ()