+2001-03-12 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * 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 <yamaoka@jpl.org>
* lisp/gnus-art.el (gnus-article-prepare-display): Setup MIME
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; \
$(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 \
$(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
(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
;;
(byte-compile-file dgnushack-gnus-load-file))
\f
+(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"))
+
+\f
(defconst dgnushack-info-file-regexp-en
(let ((names '("gnus" "message" "emacs-mime"))
regexp name)