From 775c54d313e41a257012eaf3f11d0d30e1cb5f79 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 3 Oct 2002 22:52:12 +0000 Subject: [PATCH] * install.el (install-elisp-module): Delete an elc file if the optional 5th argument `del-elc' is given. (install-elisp-modules): Allow the optional 5th argument `del-elc' and pass it to `install-elisp-module'. --- ChangeLog | 7 +++++++ install.el | 13 +++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 32f073d..ab83d6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-10-03 Morishima + + * install.el (install-elisp-module): Delete an elc file if the + optional 5th argument `del-elc' is given. + (install-elisp-modules): Allow the optional 5th argument `del-elc' + and pass it to `install-elisp-module'. + 2002-10-02 Katsumi Yamaoka * mcs-ltn1.el (mime-charset-to-coding-system): Allow the 2nd arg. diff --git a/install.el b/install.el index 2da8a78..84b63d6 100644 --- a/install.el +++ b/install.el @@ -88,7 +88,7 @@ ;;; @@ install Emacs Lisp files ;;; -(defun install-elisp-module (module src dest &optional just-print) +(defun install-elisp-module (module src dest &optional just-print del-elc) (let (el-file elc-file) (let ((name (symbol-name module))) (setq el-file (concat name ".el")) @@ -106,7 +106,12 @@ (princ (format "%s -> %s\n" el-file dest))))) (setq src-file (expand-file-name elc-file src)) (if (not (file-exists-p src-file)) - nil + (let ((full-path (expand-file-name elc-file dest))) + (if (and del-elc (file-exists-p full-path)) + (if just-print + (princ (format "%s -> to be deleted\n" full-path)) + (delete-file full-path) + (princ (format "%s -> deleted\n" full-path))))) (if just-print (princ (format "%s -> %s\n" elc-file dest)) (let ((full-path (expand-file-name elc-file dest))) @@ -123,14 +128,14 @@ (error (princ (format "%s\n" (nth 1 err))))))) (princ (format "%s -> %s\n" elc-file dest)))))))) -(defun install-elisp-modules (modules src dest &optional just-print) +(defun install-elisp-modules (modules src dest &optional just-print del-elc) (or just-print (file-exists-p dest) (make-directory dest t)) (mapcar (function (lambda (module) - (install-elisp-module module src dest just-print))) + (install-elisp-module module src dest just-print del-elc))) modules)) -- 1.7.10.4