X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=WL-MK;h=0086a93080e2a84339789a73e1298d97421519b0;hb=4c1dcabda301fd3fa7d4421e7c1a6079f92e621f;hp=123db2b0eeef4c637aa615b83bbe4d7777d0afa2;hpb=cee9d5a7ba8102d58270d2b45586ce75499783ab;p=elisp%2Fwanderlust.git diff --git a/WL-MK b/WL-MK index 123db2b..0086a93 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 @@ -209,70 +210,86 @@ (setq files (cdr files))) (lunit suite))) -(defun wl-scan-source (path) - (let (ret) - (mapcar - '(lambda (x) - (mapcar '(lambda (y) - (setq ret (append (list y (concat y "c")) ret))) - (directory-files x nil "\\(.+\\)\\.el$" t))) - path) - ret)) +(defun wl-scan-path (path scanner) + (let ((dirs (if (listp path) + path + (list path)))) + (apply 'append (mapcar scanner dirs)))) +(defun wl-scan-source (path) + (wl-scan-path path + (lambda (x) + (apply 'append + (mapcar (lambda (y) + (list y (concat y "c"))) + (directory-files x nil "\\(.+\\)\\.el$" t)))))) + +(defun wl-scan-icons (path) + (wl-scan-path path + (lambda (x) + (let ((case-fold-search t)) + (directory-files x nil "\\.img$\\|\\.x[bp]m$"))))) (defun wl-uninstall (objs path) ;(message (mapconcat 'identity objs " ")) - (mapcar - '(lambda (x) - (let ((filename (expand-file-name x path))) - (if (and (file-exists-p filename) - (file-writable-p filename)) - (progn - (princ (format "%s was uninstalled.\n" filename)) - (delete-file filename))))) + (mapc + (lambda (x) + (let ((filename (expand-file-name x path))) + (if (and (file-exists-p filename) + (file-writable-p filename)) + (progn + (princ (format "%s was uninstalled.\n" filename)) + (delete-file filename))))) 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) - (mapcar - '(lambda (x) - (compile-elisp-modules (cdr x) (car x))) + (mapc + (lambda (x) + (compile-elisp-modules (cdr x) (car x))) modules-alist)) (defun install-wl-icons () (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 uninstall-wl-icons () + (if (not (file-directory-p PIXMAPDIR)) + () + (wl-uninstall (wl-scan-icons PIXMAPDIR) + PIXMAPDIR))) (defun install-wl-package () (compile-wl-package) (let ((wl-install-dir (expand-file-name WL_PREFIX LISPDIR)) (elmo-install-dir (expand-file-name ELMO_PREFIX LISPDIR))) - (mapcar - '(lambda (x) - (install-elisp-modules (cdr x) (car x) - (if (string= (car x) ELMODIR) - elmo-install-dir - wl-install-dir))) + (mapc + (lambda (x) + (install-elisp-modules (cdr x) (car x) + (if (string= (car x) ELMODIR) + elmo-install-dir + wl-install-dir))) modules-alist)) (if PIXMAPDIR (install-wl-icons))) @@ -289,17 +306,7 @@ (wl-uninstall (wl-scan-source (list ELMODIR)) elmo-install-dir)) (if PIXMAPDIR - (let* ((case-fold-search t) - (icons (directory-files PIXMAPDIR t "\\.x[bp]m$")) - icon) - (while icons - (setq icon (car icons) - icons (cdr icons)) - (if (and (file-exists-p icon) - (file-writable-p icon)) - (progn - (princ (format "%s was uninstalled.\n" icon)) - (delete-file icon))))))) + (uninstall-wl-icons))) (defun config-wl-package-xmas () @@ -308,22 +315,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. @@ -341,9 +338,9 @@ (Custom-make-dependencies) ;; WL-AUTOLOAD-MODULES (compile-elisp-modules WL-AUTOLOAD-MODULES WLDIR) - (mapcar - '(lambda (x) - (compile-elisp-modules (cdr x) (car x))) + (mapc + (lambda (x) + (compile-elisp-modules (cdr x) (car x))) modules-alist)) (defun install-wl-package-xmas () @@ -362,9 +359,9 @@ ;; copy xpm files (install-wl-icons) - (mapcar '(lambda (x) - (install-elisp-modules (cdr x) (car x) LISPDIR)) - modules-alist) + (mapc (lambda (x) + (install-elisp-modules (cdr x) (car x) LISPDIR)) + modules-alist) ;; WL-AUTOLOAD-MODULES (install-elisp-modules WL-AUTOLOAD-MODULES WLDIR LISPDIR) ;; @@ -411,7 +408,7 @@ (wl-detect-info-directory) (cond ((null wl-info-lang)) ((listp wl-info-lang) - (mapcar 'wl-texinfo-format-file wl-info-lang)) + (mapc 'wl-texinfo-format-file wl-info-lang)) ((stringp wl-info-lang) (wl-texinfo-format-file wl-info-lang)))) @@ -422,7 +419,7 @@ (defun wl-texinfo-install () (cond ((null wl-info-lang)) ((listp wl-info-lang) - (mapcar 'wl-texinfo-install-file wl-info-lang)) + (mapc 'wl-texinfo-install-file wl-info-lang)) ((stringp wl-info-lang) (wl-texinfo-install-file wl-info-lang)))) @@ -532,7 +529,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))