From 77aeb573abe6f55ebf83f75149a0ea5b9b0791c7 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 2 Oct 2000 12:42:08 +0000 Subject: [PATCH] (config-wl-pixmap-dir): New function. (config-wl-package, config-wl-package-xmas): Use it. (install-wl-icons): New function. (install-wl-package, install-wl-package-xmas): Use it. (uninstall-wl-package): Uninstall icons as well. --- WL-MK | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 59 insertions(+), 18 deletions(-) diff --git a/WL-MK b/WL-MK index 61b1db5..970513b 100644 --- a/WL-MK +++ b/WL-MK @@ -87,10 +87,26 @@ (require 'mime-setup) (error (error "No MIME module was detected. Please install SEMI or tm."))) (if wl-use-semi - (princ (concat "\nUse SEMI" + (princ (concat "\nUse SEMI" (if wl-use-luna " with LUNA\n" " without LUNA\n"))) (princ "\nUse tm.\n")))) +(defun config-wl-pixmap-dir (&optional packagedir) + "Examine pixmap directory where icon files should go." + (let ((pixmap-dir (car command-line-args-left))) + (defvar PIXMAPDIR + (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))) + pixmap-dir))) + (if PIXMAPDIR + (princ (format "PIXMAPDIR is %s\n" PIXMAPDIR))) + (setq command-line-args-left (cdr command-line-args-left))) + (defun config-wl-package () (config-wl-package-subr) ;; LISPDIR check. @@ -98,8 +114,11 @@ (if (string= elispdir "NONE") (defvar LISPDIR (install-detect-elisp-directory)) (defvar LISPDIR elispdir))) - (princ (format "LISPDIR is %s\n\n" LISPDIR)) - (setq command-line-args-left (cdr command-line-args-left))) + (princ (format "LISPDIR is %s\n" LISPDIR)) + (setq command-line-args-left (cdr command-line-args-left)) + ;; PIXMAPDIR check. + (config-wl-pixmap-dir) + (princ "\n")) (defun wl-scan-source (path) @@ -136,6 +155,19 @@ (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 "\\.x[bp]m$")) + 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" icon dest)) + (copy-file icon dest t)))) + (defun install-wl-package () (compile-wl-package) (let ((wl-install-dir (expand-file-name WL_PREFIX LISPDIR)) @@ -146,7 +178,9 @@ (if (string= (car x) ELMODIR) elmo-install-dir wl-install-dir))) - modules-alist))) + modules-alist)) + (if PIXMAPDIR + (install-wl-icons))) (defun uninstall-wl-package () @@ -158,8 +192,19 @@ (wl-uninstall (wl-scan-source (list WLDIR UTILSDIR SASLDIR)) wl-install-dir) (wl-uninstall (wl-scan-source (list ELMODIR)) - elmo-install-dir) - )) + 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))))))) (defun config-wl-package-xmas () @@ -184,8 +229,11 @@ (setq dirs (cdr dirs))) dir))) (defvar PACKAGEDIR package-dir))) - (princ (format "PACKAGEDIR is %s\n\n" PACKAGEDIR)) - (setq command-line-args-left (cdr command-line-args-left)))) + (princ (format "PACKAGEDIR is %s\n" PACKAGEDIR)) + (setq command-line-args-left (cdr command-line-args-left))) + ;; PIXMAPDIR check. + (config-wl-pixmap-dir PACKAGEDIR) + (princ "\n")) ;; from SEMI-MK (defun compile-wl-package-xmas () @@ -216,21 +264,14 @@ (or (file-exists-p INFODIR) (make-directory INFODIR t)) ;; copy xpm files - (mapcar '(lambda (x) - (let* ((src-file-nondirectory (file-name-nondirectory x)) - (dst-file (expand-file-name src-file-nondirectory - DATADIR))) - (princ (format "%s->%s\n" - x ; fullpath - dst-file)) - (copy-file x dst-file t))) - (directory-files "etc/icons" t "xpm")) + (install-wl-icons) + (mapcar '(lambda (x) (install-elisp-modules (cdr x) (car x) LISPDIR)) modules-alist) ;; WL-AUTOLOAD-MODULES (install-elisp-modules WL-AUTOLOAD-MODULES WLDIR LISPDIR) - ;; + ;; (wl-texinfo-format) (wl-texinfo-install))) -- 1.7.10.4