X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=WL-MK;h=1d7d0472f07d5b0c907c55c8626bc2aa42d09804;hb=refs%2Fheads%2Felmo-lunafy;hp=09cb8f7278b0d3b3b1ddc457b8978baefd3285d2;hpb=1e366a559be4aec4ad4d3cf3e954b8e62a20d2f3;p=elisp%2Fwanderlust.git diff --git a/WL-MK b/WL-MK index 09cb8f7..1d7d047 100644 --- a/WL-MK +++ b/WL-MK @@ -3,8 +3,6 @@ ;;; ;;; Original by OKUNISHI Fujikazu ;;; Modified by Yuuichi Teranishi -;;; -;;; Time-stamp: <2000-03-30 15:55:13 teranisi> ;;;;;;;;;;;;;;;;;;;;; DO NOT EDIT THIS FILE ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; INTERNAL USE ONLY ;;;;;;;;;;;;;;;;;;;;; @@ -16,7 +14,6 @@ (defvar DOCDIR "./doc") (defvar ICONDIR "./etc/icons") (defvar UTILSDIR "./utils") -(defvar SASLDIR "./utils/sasl/lisp") (defvar WL_PREFIX "wl") (defvar ELMO_PREFIX "wl") @@ -24,8 +21,6 @@ (defvar wl-install-utils nil "if Non-nil, install `wl-utils-modules'.") -(defvar wl-install-sasl nil - "if Non-nil, install sasl utilities.") ;;; INFO (defconst wl-ja-info "wl-ja.info") @@ -37,7 +32,7 @@ "The language of info file (\"ja\" or \"en\").") ;; for Nemacs (dirty!) -(or (fboundp 'file-executable-p) +(if (not (fboundp 'file-executable-p)) (fset 'file-executable-p 'file-exists-p)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -48,15 +43,32 @@ (condition-case () (require 'custom) (error nil)) ;; for wl-vars.el (unless (and (fboundp 'defgroup) - (fboundp 'defcustom) - ;; ignore broken module - (not (featurep 'tinycustom))) + (fboundp 'defcustom) + ;; ignore broken module + (not (featurep 'tinycustom))) + (when (and (boundp 'emacs-major-version) + (eq emacs-major-version 19) + (>= emacs-minor-version 29)) + (message "%s" " + Warning: You don't seem to have \"new custom\" package installed. + See README file of APEL package for more information. +")) (require 'backquote) (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) +(unless (fboundp 'byte-compile-file-form-custom-declare-variable) + ;; Bind defcustom'ed variables. + (put 'custom-declare-variable 'byte-hunk-handler + 'byte-compile-file-form-custom-declare-variable) + (defun byte-compile-file-form-custom-declare-variable (form) + (if (memq 'free-vars byte-compile-warnings) + (setq byte-compile-bound-variables + (cons (nth 1 (nth 1 form)) byte-compile-bound-variables))) + form)) (setq byte-compile-warnings '(free-vars unresolved callargs redefine)) @@ -65,33 +77,47 @@ (fboundp 'nemacs-version)) (setq max-lisp-eval-depth 400)) +;; FIXME: it is currently needed to byte-compile with Emacs 21. +(setq recursive-load-depth-limit nil) + (condition-case () (require 'easymenu) (error nil)) (defvar config-wl-package-done nil) (defun config-wl-package-subr () (unless config-wl-package-done - (setq config-wl-package-done t) - (setq load-path (cons (expand-file-name ".") load-path)) - (setq load-path (cons (expand-file-name WLDIR) - (cons (expand-file-name ELMODIR) load-path))) - (setq wl-icon-dir (expand-file-name ICONDIR)) -;;; load custom file if exists. - (load "./WL-CFG" t nil t) -;;; load-path - (if wl-install-utils - (setq load-path (cons (expand-file-name UTILSDIR) load-path))) - (if wl-install-sasl - (setq load-path (cons (expand-file-name SASLDIR) load-path))) - (require 'install) - (load "./WL-ELS") - (condition-case () - (require 'mime-setup) - (error (error "No MIME module was detected. Please install SEMI or tm."))) - (if wl-use-semi - (princ (concat "\nUse SEMI" - (if wl-use-luna " with LUNA\n" " without LUNA\n"))) - (princ "\nUse tm.\n")))) + (setq config-wl-package-done t) + (setq load-path (cons (expand-file-name ".") load-path)) + (setq load-path (cons (expand-file-name WLDIR) + (cons (expand-file-name ELMODIR) load-path))) + (setq wl-icon-dir (expand-file-name ICONDIR)) + ;; load custom file if exists. `WL-CFG.el' override for committer. + (load "./WL-CFG" t nil nil) + ;; load-path + (if wl-install-utils + (setq load-path (cons (expand-file-name UTILSDIR) load-path))) + (require 'install) + (load "./WL-ELS" nil nil t) + (condition-case () + (require 'mime-setup) + (error (error "No MIME module was detected. Please install SEMI or tm."))) + (princ (concat "\nMIME module is " (if wl-use-semi "SEMI" "tm-8") ".\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) @@ -100,8 +126,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) @@ -138,6 +167,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)) @@ -148,7 +190,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 () @@ -157,11 +201,22 @@ LISPDIR)) (elmo-install-dir (expand-file-name ELMO_PREFIX LISPDIR))) - (wl-uninstall (wl-scan-source (list WLDIR UTILSDIR SASLDIR)) + (wl-uninstall (wl-scan-source (list WLDIR UTILSDIR)) 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 () @@ -186,8 +241,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 () @@ -218,21 +276,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))) @@ -247,17 +298,10 @@ (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)) - ;; texinfmt.el 2.37 or earlier can't format @direntry - (require 'texinfmt) - (unless (fboundp 'texinfo-format-direntry) - (goto-char (point-min)) - (when (re-search-forward "^@direntry" nil t) - (replace-match "@ifinfo\nSTART-INFO-DIR-ENTRY")) - (when (re-search-forward "^@end direntry" nil t) - (replace-match "END-INFO-DIR-ENTRY\n@end ifinfo")) - (set-buffer-modified-p nil)) ;; We can't know file names if splitted. (texinfo-format-buffer t) ;; Emacs20.2's default is 'raw-text-unix. @@ -301,6 +345,8 @@ (error "Cannot format info on Nemacs. Please use another formatter.")) ;; INFODIR check. (require 'info) + (if (fboundp 'info-initialize) + (info-initialize)) (let ((infodir (car command-line-args-left)) (info (wl-primary-info-file)) previous INFODIR)