X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=WL-MK;h=c42e4f36a3bfea9c7a440f488183ce4967404953;hb=d97aa2fa9cfebeea3b00b48f2d97c140300b7922;hp=777e5e37b1e2b13738f9fa7b4740c75a50c73d30;hpb=3bec47794d63c453566800b6af97ddda21290088;p=elisp%2Fwanderlust.git diff --git a/WL-MK b/WL-MK index 777e5e3..c42e4f3 100644 --- a/WL-MK +++ b/WL-MK @@ -20,7 +20,7 @@ (defvar COMPRESS-SUFFIX-LIST '("" ".gz" ".Z" ".bz2")) (defvar wl-install-utils nil - "if Non-nil, install `wl-utils-modules'.") + "If Non-nil, install `wl-utils-modules'.") ;;; INFO (defconst wl-ja-info "wl-ja.info") @@ -28,13 +28,9 @@ (defconst wl-en-info "wl.info") (defconst wl-en-texi "wl.texi") -(defvar wl-info-lang "ja" +(defvar wl-info-lang '("ja" "en") "The language of info file (\"ja\" or \"en\").") -;; for Nemacs (dirty!) -(if (not (fboundp 'file-executable-p)) - (fset 'file-executable-p 'file-exists-p)) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'cl) @@ -47,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. @@ -60,6 +56,7 @@ (` (defvar (, symbol) (, value) (, doc)))))) (load "bytecomp" nil t) + (unless (fboundp 'byte-compile-file-form-custom-declare-variable) ;; Bind defcustom'ed variables. (put 'custom-declare-variable 'byte-hunk-handler @@ -70,11 +67,20 @@ (cons (nth 1 (nth 1 form)) byte-compile-bound-variables))) form)) +(condition-case nil + (char-after) + (wrong-number-of-arguments + ;; Optimize byte code for `char-after'. + (put 'char-after 'byte-optimizer 'byte-optimize-char-after) + (defun byte-optimize-char-after (form) + (if (null (cdr form)) + '(char-after (point)) + form)))) + (setq byte-compile-warnings '(free-vars unresolved callargs redefine)) ;; v18, v19 -(if (or (boundp 'MULE) - (fboundp 'nemacs-version)) +(if (boundp 'MULE) (setq max-lisp-eval-depth 400)) ;; FIXME: it is currently needed to byte-compile with Emacs 21. @@ -90,7 +96,6 @@ (setq load-path (cons (expand-file-name ".") load-path)) (setq load-path (cons (expand-file-name WLDIR) (cons (expand-file-name ELMODIR) load-path))) - (setq wl-icon-dir (expand-file-name ICONDIR)) ;; load custom file if exists. `WL-CFG.el' override for committer. (load "./WL-CFG" t nil nil) ;; load-path @@ -98,14 +103,17 @@ (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 or tm."))) + ;; 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 FLIM 1.14.0 or later.")) - (princ (concat "\nMIME module is " (if wl-use-semi "SEMI" "tm-8") ".\n")))) + (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." @@ -114,10 +122,7 @@ (if (string= pixmap-dir "NONE") (if packagedir (expand-file-name "etc/wl/" packagedir) - (if (or (featurep 'xemacs) - (and (boundp 'emacs-major-version) - (>= emacs-major-version 21))) - (expand-file-name "wl/icons/" data-directory))) + (expand-file-name "wl/icons/" data-directory)) pixmap-dir))) (if PIXMAPDIR (princ (format "PIXMAPDIR is %s\n" PIXMAPDIR))) @@ -136,6 +141,59 @@ (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) + (require 'lunit) + (let ((files (directory-files "tests" t "^test-.*\\.el$")) + (suite (lunit-make-test-suite))) + (while files + (if (file-regular-p (car files)) + (progn + (load-file (car files)) + (lunit-test-suite-add-test + suite (lunit-make-test-suite-from-class + (intern (file-name-sans-extension + (file-name-nondirectory (car files)))))))) + (setq files (cdr files))) + (lunit suite))) + +(defun check-wl () + "Check user environment. Not for developer." + (config-wl-package) + (require 'lunit) + (let ((files (directory-files "tests" t "^check-.*\\.el$")) + (suite (lunit-make-test-suite))) + (while files + (if (file-regular-p (car files)) + (progn + (load-file (car files)) + (lunit-test-suite-add-test + suite (lunit-make-test-suite-from-class + (intern (file-name-sans-extension + (file-name-nondirectory (car files)))))))) + (setq files (cdr files))) + (lunit suite))) (defun wl-scan-source (path) (let (ret) @@ -162,10 +220,7 @@ (defun compile-wl-package () - ;; For nemacs byte compiler's strange behavior(?). (config-wl-package) - (if (fboundp 'nemacs-version) - (load (expand-file-name "wl.el" WLDIR))) (mapcar '(lambda (x) (compile-elisp-modules (cdr x) (car x))) @@ -175,13 +230,22 @@ (if (not (file-directory-p PIXMAPDIR)) (make-directory PIXMAPDIR t)) (let* ((case-fold-search t) - (icons (directory-files ICONDIR t "\\.x[bp]m$")) + (icons (directory-files ICONDIR t + (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" 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 () @@ -225,7 +289,7 @@ (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) @@ -317,8 +381,7 @@ ))) (defun wl-texinfo-format () - (unless INFODIR - (setq INFODIR (wl-detect-info-directory))) + (wl-detect-info-directory) (cond ((listp wl-info-lang) (mapcar 'wl-texinfo-format-file wl-info-lang)) ((stringp wl-info-lang) @@ -326,7 +389,7 @@ (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) @@ -345,28 +408,26 @@ (defun wl-detect-info-directory () (config-wl-package-subr) - (if (fboundp 'nemacs-version) - (error "Cannot format info on Nemacs. Please use another formatter.")) ;; 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)) + (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)) + ;;(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))) (defun install-wl-info () (wl-texinfo-format)