X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=WL-MK;h=89d7af2e22a34b86a097adce9d83630c1fe45602;hb=afaaf10e4a3c0333436dd2b6aff450379c557961;hp=a31fd19cd5cf316efda54c7bf666170445db3e4e;hpb=0bb941416b26b2b2273f846ede5e939439500ef5;p=elisp%2Fwanderlust.git diff --git a/WL-MK b/WL-MK index a31fd19..89d7af2 100644 --- 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.]* から \\([0-9.]*\\) への変更点"))) + '(("en" "^\\* Changes in \\([0-9.]*\\) from [0-9.]+x?") + ("ja" "^\\* [0-9.]+x? から \\([0-9.]*\\) への変更点"))) (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) @@ -158,7 +158,8 @@ (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 @@ -174,8 +175,8 @@ (defun test-wl () "Run test suite for developer." (config-wl-package) + (make-wl-news) (require 'lunit) - (require 'wl-news "wl-news.el.in") (let ((files (directory-files "tests" t "^test-.*\\.el$")) (suite (lunit-make-test-suite))) (while files @@ -192,8 +193,10 @@ (defun check-wl () "Check user environment. Not for developer." (config-wl-package) + ;; Avoid load error + (provide 'wl-news) + (load "wl-news.el.in") (require 'lunit) - (require 'wl-news "wl-news.el.in") (let ((files (directory-files "tests" t "^check-.*\\.el$")) (suite (lunit-make-test-suite))) (while files @@ -231,6 +234,15 @@ 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) @@ -243,23 +255,15 @@ (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 install-wl-package () (compile-wl-package) @@ -306,22 +310,12 @@ (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. @@ -373,75 +367,87 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Texinfo stuff +(defun wl-texinfo-info-file (lang) + (symbol-value (intern (format "wl-%s-info" lang)))) + +(defun wl-texinfo-texi-file (lang) + (symbol-value (intern (format "wl-%s-texi" lang)))) + +(defun wl-texinfo-check-newer (lang) + (let ((info-file (expand-file-name (wl-texinfo-info-file lang) DOCDIR))) + (and + (file-newer-than-file-p info-file + (expand-file-name "version.texi" DOCDIR)) + (file-newer-than-file-p info-file + (expand-file-name (wl-texinfo-texi-file lang) DOCDIR))))) + (defun wl-texinfo-format-file (lang) - (let ((infofile (symbol-value (intern (format "wl-%s-info" lang)))) - (texifile (symbol-value (intern (format "wl-%s-texi" lang))))) - (require 'wl-vars) ;; for 'wl-cs-local - (or (file-newer-than-file-p (expand-file-name infofile DOCDIR) - (expand-file-name texifile DOCDIR)) - (let (obuf beg) - ;; Support old texinfmt.el - (require 'ptexinfmt (expand-file-name "ptexinfmt.el" UTILSDIR)) - (find-file (expand-file-name texifile DOCDIR)) - (setq obuf (current-buffer)) - ;; We can't know file names if splitted. - (texinfo-format-buffer t) - ;; Emacs20.2's default is 'raw-text-unix. - (and (fboundp 'set-buffer-file-coding-system) - (set-buffer-file-coding-system wl-cs-local)) - (save-buffer) - (kill-buffer (current-buffer)) ;; info - (kill-buffer obuf)) ;; texi - ))) + (require 'wl-vars) ;; for 'wl-cs-local + (or (wl-texinfo-check-newer lang) + (let (obuf) + ;; Support old texinfmt.el + (require 'ptexinfmt (expand-file-name "ptexinfmt.el" UTILSDIR)) + (find-file (expand-file-name (wl-texinfo-texi-file lang) DOCDIR)) + (setq obuf (current-buffer)) + ;; We can't know file names if splitted. + (texinfo-format-buffer t) + ;; Emacs20.2's default is 'raw-text-unix. + (and (fboundp 'set-buffer-file-coding-system) + (set-buffer-file-coding-system wl-cs-local)) + (save-buffer) + (kill-buffer (current-buffer)) ;; info + (kill-buffer obuf)) ;; texi + )) (defun wl-texinfo-format () (wl-detect-info-directory) - (cond ((listp wl-info-lang) + (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))))) + (let ((infofile (wl-texinfo-info-file lang))) (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) + (wl-texinfo-info-file wl-info-lang)))) (defun wl-detect-info-directory () (config-wl-package-subr) ;; INFODIR check. - (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)) - ;;(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))) + (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) @@ -484,7 +490,14 @@ (if wl-news-lang (progn (insert "(defconst wl-news-news-alist\n '") - (prin1 (wl-news-parse-news wl-news-lang) (current-buffer)) + (let ((p (point))) + (prin1 (wl-news-parse-news wl-news-lang) (current-buffer)) + (save-excursion + (narrow-to-region p (point)) + (goto-char (1+ p)) + (while (re-search-forward "^(" nil t) + (replace-match "\\\\(")) ; avoid font-lock confusion + (widen))) (insert ")\n")) (insert "(defconst wl-news-news-alist nil)\n\n")) (let ((buffer-file-coding-system (mime-charset-to-coding-system 'x-ctext))) @@ -511,7 +524,7 @@ (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 "^\\(\\* \\| \\)" nil t) (goto-char (- (match-beginning 0) 1))