From 9a18ca446fc50b861e873d39d10f89f6103322ca Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 12 Mar 2001 13:15:40 +0000 Subject: [PATCH] * lisp/dgnushack.el (dgnushack-compose-package): New function. (dgnushack-make-load): Add autoload for cus-load if it is missing. * lisp/Makefile.in (compose-package): Use `dgnushack-compose-package'. (clean, clever): Remove custom-load.el. * Makefile.in (elclean): Remove custom-load.el. --- ChangeLog | 11 +++++++++++ Makefile.in | 2 +- lisp/Makefile.in | 10 +++++----- lisp/dgnushack.el | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3d25fb8..f78bce4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2001-03-12 Katsumi Yamaoka + + * lisp/dgnushack.el (dgnushack-compose-package): New function. + (dgnushack-make-load): Add autoload for cus-load if it is missing. + + * lisp/Makefile.in (compose-package): Use + `dgnushack-compose-package'. + (clean, clever): Remove custom-load.el. + + * Makefile.in (elclean): Remove custom-load.el. + 2001-03-08 Katsumi Yamaoka * lisp/gnus-art.el (gnus-article-prepare-display): Setup MIME diff --git a/Makefile.in b/Makefile.in index 7fdbdfd..9a70c03 100644 --- a/Makefile.in +++ b/Makefile.in @@ -163,7 +163,7 @@ clean: for i in lisp texi; do (cd $$i; $(MAKE) clean); done elclean: - cd lisp && rm -f *.elc auto-autoloads.el gnus-load.el + cd lisp && rm -f *.elc auto-autoloads.el custom-load.el gnus-load.el x: $(MAKE) EMACS="$(XEMACS)" diff --git a/lisp/Makefile.in b/lisp/Makefile.in index c631548..b3d796a 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -43,8 +43,8 @@ clever some: gnus-load.elc fi; \ if test $$RM_ELC = t; then \ echo " => maybe yes;" \ - "rm -f *.elc auto-autoloads.el"; \ - rm -f *.elc auto-autoloads.el; \ + "rm -f *.elc auto-autoloads.el custom-load.el"; \ + rm -f *.elc auto-autoloads.el custom-load.el; \ else \ echo " => maybe unnecessary"; \ fi; \ @@ -70,8 +70,7 @@ install-package-manifest: $(PACKAGEDIR) $(GNUS_PRODUCT_NAME) compose-package: gnus-load.elc - mv gnus-load.el auto-autoloads.el; \ - mv gnus-load.elc auto-autoloads.elc + $(EMACS_COMP) -f dgnushack-compose-package remove-extra-files-in-package: $(EMACS_COMP) -f dgnushack-remove-extra-files-in-package \ @@ -101,7 +100,8 @@ gnus-load.elc: $(EMACS_COMP) -f dgnushack-make-load clean: - rm -f *.orig *.rej *.elc *~ auto-autoloads.el gnus-load.el + rm -f *.orig *.rej *.elc *~ \ + auto-autoloads.el custom-load.el gnus-load.el distclean: clean rm -f Makefile dgnuspath.el diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index 7afd1d3..1bbf4fd 100644 --- a/lisp/dgnushack.el +++ b/lisp/dgnushack.el @@ -412,6 +412,10 @@ Modify to suit your needs.")) (search-forward ";;; Code:") (forward-line) (delete-region (point-min) (point)) + (unless (re-search-forward + "^[\t ]*(autoload[\t\n ]+\\('\\|(quote[\t\n ]+\\)custom-add-loads[\t\n ]" nil t) + (insert "\n(autoload 'custom-add-loads \"cus-load\")\n") + (goto-char (point-min))) (insert "\ ;;; gnus-load.el --- automatically extracted custom dependencies and autoload ;; @@ -459,6 +463,58 @@ Modify to suit your needs.")) (byte-compile-file dgnushack-gnus-load-file)) +(defun dgnushack-compose-package () + "Re-split the file gnus-load.el into custom-load.el and +auto-autoloads.el. It is silly, should be improved!" + (message "\ +Re-splitting gnus-load.el into custom-load.el and auto-autoloads.el...") + (let ((customload (expand-file-name "custom-load.el" srcdir)) + (autoloads (expand-file-name "auto-autoloads.el" srcdir))) + (with-temp-buffer + (insert-file-contents dgnushack-gnus-load-file) + (delete-file dgnushack-gnus-load-file) + (when (file-exists-p (concat dgnushack-gnus-load-file "c")) + (delete-file (concat dgnushack-gnus-load-file "c"))) + (while (prog1 + (looking-at "[\t ;]") + (forward-line 1))) + (delete-region (point-min) (point)) + (insert "\ +;;; custom-load.el --- automatically extracted custom dependencies\n +;;; Code:\n\n") + (goto-char (point-max)) + (while (progn + (forward-line -1) + (not (looking-at "[\t ]*(custom-add-loads[\t\n ]")))) + (forward-list 1) + (forward-line 1) + (insert "\n;;; custom-load.el ends here\n") + (write-region (point-min) (point) customload) + (while (looking-at "[\t ]*$") + (forward-line 1)) + (delete-region (point-min) (point)) + (if (re-search-forward "^[\t\n ]*(if[\t\n ]+(featurep[\t\n ]" nil t) + (let ((from (goto-char (match-beginning 0)))) + (delete-region from (progn + (forward-list 1) + (forward-line 1) + (point)))) + (while (looking-at "[\t ;]") + (forward-line 1))) + (insert "(if (featurep 'gnus-autoloads) (error \"Already loaded\"))\n") + (goto-char (point-max)) + (while (progn + (forward-line -1) + (not (looking-at "[\t ]*(provide[\t\n ]")))) + (delete-region (point) (point-max)) + (insert "(provide 'gnus-autoloads)\n") + (write-region (point-min) (point) autoloads)) + (byte-compile-file customload) + (byte-compile-file autoloads)) + (message "\ +Re-splitting gnus-load.el into custom-load.el and auto-autoloads.el...done")) + + (defconst dgnushack-info-file-regexp-en (let ((names '("gnus" "message" "emacs-mime")) regexp name) -- 1.7.10.4