ptexinfmt.el; Fix last change
[elisp/wanderlust.git] / WL-MK
diff --git a/WL-MK b/WL-MK
index 123db2b..0086a93 100644 (file)
--- a/WL-MK
+++ b/WL-MK
@@ -37,8 +37,8 @@
 (defconst wl-news-news-file '(("en" "NEWS")
                              ("ja" "NEWS.ja")))
 (defconst wl-news-search-regexp
-  '(("en" "^\\* Changes in \\([0-9.]*\\) from")
-    ("ja" "^\\* [0-9.]* \e$B$+$i\e(B \\([0-9.]*\\) \e$B$X$NJQ99E@\e(B")))
+  '(("en" "^\\* Changes in \\([0-9.]*\\) from [0-9.]+x?")
+    ("ja" "^\\* [0-9.]+x? \e$B$+$i\e(B \\([0-9.]*\\) \e$B$X$NJQ99E@\e(B")))
 (defconst wl-news-filename "wl-news.el")
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -63,7 +63,7 @@
   (defmacro defgroup (&rest args))
   (defmacro defcustom (symbol value &optional doc &rest args)
     (let ((doc (concat "*" (or doc ""))))
-      (` (defvar (, symbol) (, value) (, doc))))))
+      `(defvar ,symbol ,value ,doc))))
 
 (load "bytecomp" nil t)
 
   (let ((version (mapconcat
                  'number-to-string
                  (product-version (product-find 'elmo-version))
-                 ".")))
+                 "."))
+       (coding-system-for-write 'iso-latin-1-unix))
     (princ (concat "Update version number to " version "\n"))
     ;; generate version.tex
     (with-temp-buffer
       (setq files (cdr files)))
     (lunit suite)))
 
-(defun wl-scan-source (path)
-  (let (ret)
-    (mapcar
-     '(lambda (x)
-       (mapcar '(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 " "))
-  (mapcar
-   '(lambda (x)
-      (let ((filename (expand-file-name x path)))
-       (if (and (file-exists-p filename)
-                (file-writable-p filename))
-           (progn
-             (princ (format "%s was uninstalled.\n" filename))
-             (delete-file filename)))))
+  (mapc
+   (lambda (x)
+     (let ((filename (expand-file-name x path)))
+       (if (and (file-exists-p filename)
+               (file-writable-p filename))
+          (progn
+            (princ (format "%s was uninstalled.\n" filename))
+            (delete-file filename)))))
    objs))
 
 
+(defun wl-examine-modules ()
+  "Examine wl modules should be byte-compile'd."
+  (config-wl-package-subr)
+  (make-wl-news)
+  (dolist (module modules-alist)
+    (dolist (filename (cdr module))
+      (princ (format "%s/%s.elc " (car module) filename)))))
+
+
 (defun compile-wl-package ()
   (config-wl-package)
   (make-wl-news)
-  (mapcar
-   '(lambda (x)
-      (compile-elisp-modules (cdr x) (car x)))
+  (mapc
+   (lambda (x)
+     (compile-elisp-modules (cdr x) (car x)))
    modules-alist))
 
 (defun install-wl-icons ()
   (if (not (file-directory-p PIXMAPDIR))
       (make-directory PIXMAPDIR t))
   (let* ((case-fold-search t)
-        (icons (directory-files ICONDIR t
+        (icons (directory-files ICONDIR nil
                                 (cond ((featurep 'xemacs)
                                        "\\.x[bp]m$")
                                       ((and (boundp 'emacs-major-version)
                                             (>= emacs-major-version 21))
                                        "\\.img$\\|\\.x[bp]m$")
                                       ((featurep 'mule)
-                                       "\\.img$\\|\\.xbm$"))))
-        icon dest)
-    (while icons
-      (setq icon (car icons)
-           icons (cdr icons)
-           dest (expand-file-name (file-name-nondirectory icon) PIXMAPDIR))
-      (princ (format "%s -> %s\n"
-                    (file-name-nondirectory icon)
-                    (substring (file-name-directory dest) 0 -1)))
-      (copy-file icon dest t))))
+                                       "\\.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))
        (elmo-install-dir (expand-file-name ELMO_PREFIX LISPDIR)))
-    (mapcar
-     '(lambda (x)
-       (install-elisp-modules (cdr x) (car x)
-                              (if (string= (car x) ELMODIR)
-                                  elmo-install-dir
-                                wl-install-dir)))
+    (mapc
+     (lambda (x)
+       (install-elisp-modules (cdr x) (car x)
+                             (if (string= (car x) ELMODIR)
+                                 elmo-install-dir
+                               wl-install-dir)))
      modules-alist))
   (if PIXMAPDIR
       (install-wl-icons)))
     (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 ()
   (config-wl-package-subr)
   ;; PACKAGEDIR check.
   (let (package-dir)
-    (and (setq package-dir (car command-line-args-left))
-        (if (string= "NONE" package-dir)
-            (defvar PACKAGEDIR
-              (if (boundp 'early-packages)
-                  (let ((dirs (append (if early-package-load-path
-                                          early-packages)
-                                      (if late-package-load-path
-                                          late-packages)
-                                      (if last-package-load-path
-                                          last-packages)))
-                        dir)
-                    (while (not (file-exists-p
-                                 (setq dir (car dirs))))
-                      (setq dirs (cdr dirs)))
-                    dir)))
-          (defvar PACKAGEDIR package-dir)))
+    (defvar PACKAGEDIR
+      (if (and (setq package-dir (car command-line-args-left))
+              (not (string= "NONE" package-dir)))
+         package-dir
+       (require 'install)
+       (install-get-default-package-directory)))
     (princ (format "PACKAGEDIR is %s\n" PACKAGEDIR))
     (setq command-line-args-left (cdr command-line-args-left)))
   ;; PIXMAPDIR check.
   (Custom-make-dependencies)
   ;; WL-AUTOLOAD-MODULES
   (compile-elisp-modules WL-AUTOLOAD-MODULES WLDIR)
-  (mapcar
-   '(lambda (x)
-      (compile-elisp-modules (cdr x) (car x)))
+  (mapc
+   (lambda (x)
+     (compile-elisp-modules (cdr x) (car x)))
    modules-alist))
 
 (defun install-wl-package-xmas ()
     ;; copy xpm files
     (install-wl-icons)
 
-    (mapcar '(lambda (x)
-              (install-elisp-modules (cdr x) (car x) LISPDIR))
-           modules-alist)
+    (mapc (lambda (x)
+           (install-elisp-modules (cdr x) (car x) LISPDIR))
+         modules-alist)
     ;; WL-AUTOLOAD-MODULES
     (install-elisp-modules WL-AUTOLOAD-MODULES WLDIR LISPDIR)
     ;;
   (wl-detect-info-directory)
   (cond ((null wl-info-lang))
        ((listp wl-info-lang)
-        (mapcar 'wl-texinfo-format-file wl-info-lang))
+        (mapc 'wl-texinfo-format-file wl-info-lang))
        ((stringp wl-info-lang)
         (wl-texinfo-format-file wl-info-lang))))
 
 (defun wl-texinfo-install ()
   (cond ((null wl-info-lang))
        ((listp wl-info-lang)
-        (mapcar 'wl-texinfo-install-file wl-info-lang))
+        (mapc 'wl-texinfo-install-file wl-info-lang))
        ((stringp wl-info-lang)
         (wl-texinfo-install-file wl-info-lang))))
 
                  (version-tmp (split-string (match-string 1) "\\."))
                  version news-string end)
              (while version-tmp
-               (setq version (append version (list (string-to-int (car version-tmp)))))
+               (setq version (append version (list (string-to-number (car version-tmp)))))
                (setq version-tmp (cdr version-tmp)))
              (re-search-forward "^\\(\\* \\|\f\\)" nil t)
              (goto-char (- (match-beginning 0) 1))