Permalink
Browse files

* w3mhack.el: Create w3m-load.el.

(w3mhack-load-file): New variable.
(w3mhack-examine-modules): Ignore `w3mhack-load-file'.
(w3mhack-generate-load-file): New function.
(w3mhack-compile): Call the above.

* .cvsignore: Ignore w3m-load.el.

* Makefile.in (clean): Remove w3m-load.el.
  • Loading branch information...
1 parent 0c405aa commit b39cfafdc15e0af7b159561d6ff466712c8f970b tsuchiya committed Apr 27, 2004
Showing with 66 additions and 3 deletions.
  1. +2 −1 .cvsignore
  2. +12 −0 ChangeLog
  3. +1 −1 Makefile.in
  4. +51 −1 w3mhack.el
View
@@ -6,6 +6,7 @@ config.cache
config.log
config.status*
configure
+emacs-w3m-*.tar.gz
patch
w3m-kwds.el
-emacs-w3m-*.tar.gz
+w3m-load.el
View
@@ -1,3 +1,15 @@
+2004-04-27 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+
+ * w3mhack.el: Create w3m-load.el.
+ (w3mhack-load-file): New variable.
+ (w3mhack-examine-modules): Ignore `w3mhack-load-file'.
+ (w3mhack-generate-load-file): New function.
+ (w3mhack-compile): Call the above.
+
+ * .cvsignore: Ignore w3m-load.el.
+
+ * Makefile.in (clean): Remove w3m-load.el.
+
2004-04-26 Katsumi Yamaoka <yamaoka@jpl.org>
* shimbun/sb-nikkei.el (shimbun-nikkei-prepare-article-markets):
View
@@ -165,7 +165,7 @@ tarball: $(DOCS) $(DISTS) $(SUBDIRS)
clean:
-rm -rf $(PACKAGE)* ;\
- rm -f *~ *.elc shimbun/*.elc w3m-kwds.el ;\
+ rm -f *~ *.elc shimbun/*.elc w3m-load.el w3m-kwds.el ;\
rm -f doc/*~ doc/*.info doc/*.info-[0-9] doc/*.info-[0-9][0-9]
distclean: clean
View
@@ -243,6 +243,8 @@ Error: You have to install APEL before building emacs-w3m, see manuals.
(defconst w3mhack-colon-keywords-file "w3m-kwds.el")
+(defvar w3mhack-load-file "w3m-load.el")
+
;; Needed for interdependencies among w3m and shimbun modules.
(push default-directory load-path)
(push (expand-file-name shimbun-module-directory default-directory) load-path)
@@ -267,7 +269,8 @@ Error: You have to install APEL before building emacs-w3m, see manuals.
"w3m-fsf.el" "w3m-om.el" "w3m-xmas.el"))
(ignores;; modules not to be byte-compiled.
(append
- (list "w3mhack.el" "w3m-setup.el" w3mhack-colon-keywords-file)
+ (list "w3mhack.el" "w3m-setup.el"
+ w3mhack-load-file w3mhack-colon-keywords-file)
(w3mhack-mdelete (cond ((featurep 'xemacs)
"w3m-xmas.el")
((boundp 'MULE)
@@ -387,6 +390,7 @@ Error: You have to install APEL before building emacs-w3m, see manuals.
(defun w3mhack-compile ()
"Byte-compile the w3m modules."
(w3mhack-check-colon-keywords-file)
+ (w3mhack-generate-load-file)
(let (modules)
(let* ((buffer (generate-new-buffer " *modules*"))
(standard-output buffer)
@@ -1108,6 +1112,52 @@ NOTE: This function must be called from the top directory."
(setq error 1))))
(kill-emacs error)))
+(defun w3mhack-generate-load-file ()
+ "Generate a file including all autoload stubs."
+ (interactive)
+ (require 'autoload)
+ (let (files)
+ (let* ((buffer (generate-new-buffer " *modules*"))
+ (standard-output buffer))
+ (w3mhack-examine-modules)
+ (save-excursion
+ (set-buffer buffer)
+ (goto-char (point-min))
+ (while (re-search-forward "\\([^ ]+\\.el\\)c" nil t)
+ (setq files
+ (cons (expand-file-name
+ (buffer-substring (match-beginning 1) (match-end 1)))
+ files)))))
+ (when (or (not (file-exists-p w3mhack-load-file))
+ (catch 'modified
+ (dolist (file files)
+ (when (file-newer-than-file-p file w3mhack-load-file)
+ (throw 'modified t)))))
+ (let ((generated-autoload-file (expand-file-name w3mhack-load-file))
+ (make-backup-files nil)
+ (autoload-package-name "emacs-w3m"))
+ (save-excursion
+ (set-buffer (find-file-noselect generated-autoload-file))
+ (erase-buffer)
+ (goto-char (point-min))
+ (insert ";;; " w3mhack-load-file "\
+ --- automatically extracted autoload
+;;
+;; This file should be generated by make in emacs-w3m source directory.
+;;
+;;; Code:
+")
+ (dolist (file files)
+ (update-file-autoloads file))
+ (goto-char (point-max))
+ (insert "\
+
+\(provide '" (file-name-sans-extension w3mhack-load-file) "\)
+
+;;; " w3mhack-load-file " ends here
+")
+ (save-buffer))))))
+
(defun w3mhack-locate-library ()
"Print the precise file name of Emacs library remaining on the commane line."
(princ (or (locate-library (pop command-line-args-left)) "")))

0 comments on commit b39cfaf

Please sign in to comment.