Backport changes:
[elisp/wanderlust.git] / WL-MK
diff --git a/WL-MK b/WL-MK
index ee68a7f..0227883 100644 (file)
--- a/WL-MK
+++ b/WL-MK
@@ -28,7 +28,7 @@
 (defconst wl-en-info "wl.info")
 (defconst wl-en-texi "wl.texi")
 
-(defvar wl-info-lang '("ja" "en")
+(defvar wl-info-lang (if (featurep 'mule) '("ja" "en") '("en"))
   "The language of info file (\"ja\" or \"en\").")
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -43,7 +43,7 @@
             ;; ignore broken module
             (not (featurep 'tinycustom)))
   (when (and (boundp 'emacs-major-version)
-            (eq emacs-major-version 19)
+            (= emacs-major-version 19)
             (>= emacs-minor-version 29))
     (message "%s" "
   Warning: You don't seem to have \"new custom\" package installed.
        (setq load-path (cons (expand-file-name UTILSDIR) load-path)))
     (require 'install)
     (load "./WL-ELS" nil nil t)
-    (condition-case ()
-       (require 'mime-setup)
-      (error (error "No MIME module was detected. Please install SEMI.")))
+    ;; product.el version check
+    (require 'product)
+    (if (not (fboundp 'product-version-as-string))
+       (error "Please install new APEL.  See INSTALL or INSTALL.ja"))
     ;; smtp.el version check.
     (require 'smtp)
     (if (not (fboundp 'smtp-send-buffer))
-       (error "Please install new FLIM.  See INSTALL or INSTALL.ja."))))
+       (error "Please install new FLIM.  See INSTALL or INSTALL.ja"))
+    (condition-case ()
+       (require 'mime-setup)
+      (error (error "Cannot load `mime-setup'.  Please install SEMI")))))
 
 (defun config-wl-pixmap-dir (&optional packagedir)
   "Examine pixmap directory where icon files should go."
   (config-wl-pixmap-dir)
   (princ "\n"))
 
+(defun update-version ()
+  "Update version number of documents."
+  (config-wl-package)
+  (load-file "elmo/elmo-version.el")
+  (let ((version (mapconcat
+                 'number-to-string
+                 (product-version (product-find 'elmo-version))
+                 ".")))
+    (princ (concat "Update version number to " version "\n"))
+    ;; generate version.tex
+    (with-temp-buffer
+      (insert "\\def\\versionnumber{" version "}\n")
+      (write-region (point-min) (point-max) (expand-file-name
+                                            "version.tex" "doc")))
+    ;; generate version.texi
+    (with-temp-buffer
+      (insert "@set VERSION " version "\n")
+      (write-region (point-min) (point-max) (expand-file-name
+                                            "version.texi" "doc")))))
+
 (defun test-wl ()
   "Run test suite for developer."
   (config-wl-package)
       (make-directory PIXMAPDIR t))
   (let* ((case-fold-search t)
         (icons (directory-files ICONDIR t
-                                (cond ((or (featurep 'xemacs)
-                                           (and (boundp 'emacs-major-version)
-                                                (>= emacs-major-version 21)))
+                                (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)
       (setq icon (car icons)
            icons (cdr icons)
            dest (expand-file-name (file-name-nondirectory icon) PIXMAPDIR))
-      (princ (format "%s->%s\n" icon dest))
+      (princ (format "%s -> %s\n"
+                    (file-name-nondirectory icon)
+                    (substring (file-name-directory dest) 0 -1)))
       (copy-file icon dest t))))
 
 (defun install-wl-package ()
 
 (defun config-wl-package-xmas ()
   (if (not (featurep 'xemacs))
-      (error "This directive is only for XEmacs."))
+      (error "This directive is only for XEmacs"))
   (config-wl-package-subr)
   ;; PACKAGEDIR check.
   (let (package-dir)
        )))
 
 (defun wl-texinfo-format ()
-  (unless INFODIR
-    (setq INFODIR (wl-detect-info-directory)))
-  (cond ((listp wl-info-lang)
+  (wl-detect-info-directory)
+  (cond ((null wl-info-lang))
+       ((listp wl-info-lang)
         (mapcar 'wl-texinfo-format-file wl-info-lang))
        ((stringp wl-info-lang)
         (wl-texinfo-format-file wl-info-lang))))
 
 (defun wl-texinfo-install-file (lang)
   (let ((infofile (symbol-value (intern (format "wl-%s-info" lang)))))
-    (install-file infofile DOCDIR INFODIR)))
+    (install-file infofile DOCDIR INFODIR nil 'overwrite)))
 
 (defun wl-texinfo-install ()
-  (cond ((listp wl-info-lang)
+  (cond ((null wl-info-lang))
+       ((listp wl-info-lang)
         (mapcar 'wl-texinfo-install-file wl-info-lang))
        ((stringp wl-info-lang)
         (wl-texinfo-install-file wl-info-lang))))
 
 (defun wl-primary-info-file ()
   "Get primary info file (for wl-detect-info-directory)."
-  (cond
-   ((listp wl-info-lang)
-    (let ((wl-info-lang (car wl-info-lang)))
-      (wl-primary-info-file)))
-   ((stringp wl-info-lang)
-    (symbol-value (intern (format "wl-%s-info" wl-info-lang))))))
+  (cond ((null wl-info-lang))
+       ((listp wl-info-lang)
+        (let ((wl-info-lang (car wl-info-lang)))
+          (wl-primary-info-file)))
+       ((stringp wl-info-lang)
+        (symbol-value (intern (format "wl-%s-info" wl-info-lang))))))
 
 (defun wl-detect-info-directory ()
   (config-wl-package-subr)
   ;; INFODIR check.
-  (require 'info)
-  (if (fboundp 'info-initialize)
-      (info-initialize))
-  (let ((infodir (car command-line-args-left))
-       (info (wl-primary-info-file))
-       previous INFODIR)
-    (setq INFODIR
-         (if (string= infodir "NONE")
-             (if (setq previous
-                       (exec-installed-p info Info-directory-list
-                                         COMPRESS-SUFFIX-LIST))
-                 ;;(progn
-                 ;;(condition-case nil (delete-file previous))
-                 (directory-file-name (file-name-directory previous));)
-               (car Info-directory-list))
-           infodir))
-    (setq command-line-args-left (cdr command-line-args-left))
-    (princ (format "INFODIR is %s\n\n" INFODIR))
-    INFODIR))
+  (when wl-info-lang
+    (require 'info)
+    (if (fboundp 'info-initialize)
+       (info-initialize))
+    (unless INFODIR
+      (let ((infodir (car command-line-args-left))
+           (info (wl-primary-info-file))
+           previous)
+       (setq INFODIR
+             (if (string= infodir "NONE")
+                 (if (setq previous
+                           (exec-installed-p info Info-directory-list
+                                             COMPRESS-SUFFIX-LIST))
+                     (directory-file-name (file-name-directory previous))
+                   (car Info-directory-list))
+               infodir))
+       (setq command-line-args-left (cdr command-line-args-left))))
+    (princ (format "INFODIR is %s\n\n" INFODIR))))
 
 (defun install-wl-info ()
   (wl-texinfo-format)