X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=WL-MK;h=e6462bf3b85da039fe3025c87e57a3c5031fd1d7;hb=cbb96e16fce1a19bfbf5c617570ec3b9852f9d65;hp=a3080caa2340b6d597225b9bcc3108cf3b640ae2;hpb=806725e3db0748ddc973ba045053a6681e840287;p=elisp%2Fwanderlust.git diff --git a/WL-MK b/WL-MK index a3080ca..e6462bf 100644 --- a/WL-MK +++ b/WL-MK @@ -14,16 +14,13 @@ (defvar DOCDIR "./doc") (defvar ICONDIR "./etc/icons") (defvar UTILSDIR "./utils") -(defvar SASLDIR "./utils/sasl/lisp") (defvar WL_PREFIX "wl") (defvar ELMO_PREFIX "wl") (defvar COMPRESS-SUFFIX-LIST '("" ".gz" ".Z" ".bz2")) (defvar wl-install-utils nil - "if Non-nil, install `wl-utils-modules'.") -(defvar wl-install-sasl nil - "if Non-nil, install sasl utilities.") + "If Non-nil, install `wl-utils-modules'.") ;;; INFO (defconst wl-ja-info "wl-ja.info") @@ -31,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!) -(or (fboundp 'file-executable-p) - (fset 'file-executable-p 'file-exists-p)) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (require 'cl) @@ -54,17 +47,16 @@ (>= emacs-minor-version 29)) (message "%s" " Warning: You don't seem to have \"new custom\" package installed. - It is recommended to use \"new custom\" package if you are using - old Emacs, such as Mule 2.3. - Get it from http://www.dina.kvl.dk/~abraham/custom/ and then apply - the patch which is included in README file of APEL package. + See README file of APEL package for more information. ")) + (require 'backquote) (defmacro defgroup (&rest args)) (defmacro defcustom (symbol value &optional doc &rest args) (let ((doc (concat "*" (or doc "")))) (` (defvar (, symbol) (, value) (, doc)))))) -(require 'bytecomp) +(load "bytecomp" nil t) + (unless (fboundp 'byte-compile-file-form-custom-declare-variable) ;; Bind defcustom'ed variables. (put 'custom-declare-variable 'byte-hunk-handler @@ -75,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. @@ -91,27 +92,24 @@ (defun config-wl-package-subr () (unless config-wl-package-done - (setq config-wl-package-done t) - (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. - (load "./WL-CFG" t nil t) -;;; load-path - (if wl-install-utils - (setq load-path (cons (expand-file-name UTILSDIR) load-path))) - (if wl-install-sasl - (setq load-path (cons (expand-file-name SASLDIR) load-path))) - (require 'install) - (load "./WL-ELS") - (condition-case () - (require 'mime-setup) - (error (error "No MIME module was detected. Please install SEMI or tm."))) - (if wl-use-semi - (princ (concat "\nUse SEMI" - (if wl-use-luna " with LUNA\n" " without LUNA\n"))) - (princ "\nUse tm.\n")))) + (setq config-wl-package-done t) + (setq load-path (cons (expand-file-name ".") load-path)) + (setq load-path (cons (expand-file-name WLDIR) + (cons (expand-file-name ELMODIR) load-path))) + ;; load custom file if exists. `WL-CFG.el' override for committer. + (load "./WL-CFG" t nil nil) + ;; load-path + (if wl-install-utils + (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."))) + ;; smtp.el version check. + (require 'smtp) + (if (not (fboundp 'smtp-send-buffer)) + (error "Please install new FLIM. See INSTALL or INSTALL.ja.")))) (defun config-wl-pixmap-dir (&optional packagedir) "Examine pixmap directory where icon files should go." @@ -120,10 +118,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))) @@ -142,6 +137,39 @@ (config-wl-pixmap-dir) (princ "\n")) +(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) @@ -168,10 +196,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))) @@ -181,7 +206,14 @@ (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) @@ -211,7 +243,7 @@ LISPDIR)) (elmo-install-dir (expand-file-name ELMO_PREFIX LISPDIR))) - (wl-uninstall (wl-scan-source (list WLDIR UTILSDIR SASLDIR)) + (wl-uninstall (wl-scan-source (list WLDIR UTILSDIR)) wl-install-dir) (wl-uninstall (wl-scan-source (list ELMODIR)) elmo-install-dir)) @@ -289,8 +321,8 @@ (install-wl-icons) (mapcar '(lambda (x) - (install-elisp-modules (cdr x) (car x) LISPDIR)) - modules-alist) + (install-elisp-modules (cdr x) (car x) LISPDIR)) + modules-alist) ;; WL-AUTOLOAD-MODULES (install-elisp-modules WL-AUTOLOAD-MODULES WLDIR LISPDIR) ;; @@ -351,10 +383,10 @@ (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)