X-Git-Url: http://git.chise.org/gitweb/?p=elisp%2Fwanderlust.git;a=blobdiff_plain;f=WL-MK;h=0086a93080e2a84339789a73e1298d97421519b0;hp=99f9256244673790fde30b47117cc4e09e9c0c77;hb=HEAD;hpb=3498ab2a49b1048d1d8c1359afcabc6b06fe99b3 diff --git a/WL-MK b/WL-MK index 99f9256..0086a93 100644 --- a/WL-MK +++ b/WL-MK @@ -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) @@ -210,27 +210,36 @@ (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)) @@ -246,9 +255,9 @@ (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 () @@ -265,16 +274,22 @@ "\\.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))) @@ -291,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 () @@ -310,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. @@ -343,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 () @@ -364,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) ;; @@ -413,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)))) @@ -424,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)))) @@ -534,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))