X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=WL-MK;h=4c8a1022a18fa29bdc20afdee70bbfa1981d61d4;hb=0d64eab9812f57ea1b4e1b291aa6d4c8fe9feedc;hp=6467e1ab2ceef5dc1ba4a5ce8e44743f1f14b1f7;hpb=2f2a2ca7241fe8f04a07d4850fb1fcea9e3f181b;p=elisp%2Fwanderlust.git diff --git a/WL-MK b/WL-MK index 6467e1a..4c8a102 100644 --- a/WL-MK +++ b/WL-MK @@ -28,11 +28,11 @@ (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\").") ;;; NEWS -(defvar wl-news-lang '("ja" "en") +(defvar wl-news-lang (if (featurep 'mule) '("ja" "en") '("en")) "The language of news file (\"ja\" or \"en\").") (defconst wl-news-news-file '(("en" "NEWS") ("ja" "NEWS.ja"))) @@ -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,6 +175,7 @@ (defun test-wl () "Run test suite for developer." (config-wl-package) + (make-wl-news) (require 'lunit) (let ((files (directory-files "tests" t "^test-.*\\.el$")) (suite (lunit-make-test-suite))) @@ -191,6 +193,9 @@ (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) (let ((files (directory-files "tests" t "^check-.*\\.el$")) (suite (lunit-make-test-suite))) @@ -329,6 +334,7 @@ ;; from SEMI-MK (defun compile-wl-package-xmas () (config-wl-package-xmas) + (make-wl-news) (setq autoload-package-name "wl") (add-to-list 'command-line-args-left WLDIR) (batch-update-directory) @@ -370,75 +376,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) @@ -478,12 +496,19 @@ (unless (re-search-forward "^;;; -\\*- news-list -\\*-" nil t) (error "Invalid wl-news.el.in")) (forward-line 2) - (insert "(defvar wl-news-lang '") - (prin1 wl-news-lang (current-buffer)) - (insert ")\n") - (insert "(defconst wl-news-news-alist\n '") - (prin1 (wl-news-parse-news wl-news-lang) (current-buffer)) - (insert ")\n") + (if wl-news-lang + (progn + (insert "(defconst wl-news-news-alist\n '") + (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))) (write-region (point-min) (point-max) out-filename)))))))