X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;ds=sidebyside;f=lisp%2Fdgnushack.el;h=bc59422eb0fbf0e28ae4c8e33d8f59581ad349bd;hb=e56483f5bd16d51e8ef9339058a15a09f3901887;hp=f5e49d06c0a638b563fdd7d613b8827264ce4b59;hpb=6130a77c0eb21437ed58140f01456d867aa7d92d;p=gnus diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index f5e49d06c..bc59422eb 100644 --- a/lisp/dgnushack.el +++ b/lisp/dgnushack.el @@ -1,5 +1,5 @@ ;;; dgnushack.el --- a hack to set the load path for byte-compiling -;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 +;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen @@ -33,12 +33,21 @@ (defvar srcdir (or (getenv "srcdir") ".")) -(push (or (getenv "lispdir") - "/usr/share/emacs/site-lisp") +(defun my-getenv (str) + (let ((val (getenv str))) + (if (equal val "no") nil val))) + +(if (my-getenv "lispdir") + (push (my-getenv "lispdir") load-path)) + +(push (or (my-getenv "URLDIR") (expand-file-name "../../url/lisp/" srcdir)) load-path) -(push (or (getenv "W3DIR") (expand-file-name "../../w3/lisp/" srcdir)) + +(push (or (my-getenv "W3DIR") (expand-file-name "../../w3/lisp/" srcdir)) load-path) +(push "/usr/share/emacs/site-lisp" load-path) + (unless (featurep 'xemacs) (define-compiler-macro last (&whole form x &optional n) (if (and (fboundp 'last) @@ -84,7 +93,6 @@ (require 'bytecomp) (push srcdir load-path) -(push "/usr/share/emacs/site-lisp" load-path) (load (expand-file-name "lpath.el" srcdir) nil t) (defalias 'device-sound-enabled-p 'ignore) @@ -117,32 +125,40 @@ Modify to suit your needs.")) (let ((files (directory-files srcdir nil "^[^=].*\\.el$")) ;;(byte-compile-generate-call-tree t) file elc) + ;; Avoid barfing (from gnus-xmas) because the etc directory is not yet + ;; installed. + (when (featurep 'xemacs) + (setq gnus-xmas-glyph-directory "dummy")) (dolist (file '("dgnushack.el" "lpath.el")) (setq files (delete file files))) - (if (featurep 'base64) - (setq files (delete "base64.el" files))) - (condition-case () - (require 'w3-forms) + (when (featurep 'base64) + (setq files (delete "base64.el" files))) + (condition-case code + (require 'w3-forms) (error + (message "No w3: %s %s" code (locate-library "w3-forms")) (dolist (file '("nnweb.el" "nnlistserv.el" "nnultimate.el" - "nnslashdot.el" "nnwarchive.el" "webmail.el")) + "nnslashdot.el" "nnwarchive.el" "webmail.el" + "nnwfm.el")) (setq files (delete file files))))) - (dolist (file + (dolist (file (if (featurep 'xemacs) '("md5.el" "smiley-ems.el") - '("gnus-xmas.el" "gnus-picon.el" "messagexmas.el" + '("gnus-xmas.el" "gnus-picon.el" "messagexmas.el" "nnheaderxm.el" "smiley.el"))) (setq files (delete file files))) (dolist (file files) (setq file (expand-file-name file srcdir)) - (when (and (file-exists-p (setq elc (concat file "c"))) + (when (and (file-exists-p + (setq elc (concat (file-name-nondirectory file) "c"))) (file-newer-than-file-p file elc)) (delete-file elc))) - + (while (setq file (pop files)) (setq file (expand-file-name file srcdir)) - (when (or (not (file-exists-p (setq elc (concat file "c")))) + (when (or (not (file-exists-p + (setq elc (concat (file-name-nondirectory file) "c")))) (file-newer-than-file-p file elc)) (ignore-errors (byte-compile-file file)))))) @@ -151,5 +167,76 @@ Modify to suit your needs.")) (require 'gnus) (byte-recompile-directory "." 0)) -;;; dgnushack.el ends here +(defvar dgnushack-gnus-load-file (expand-file-name "gnus-load.el")) +(defvar dgnushack-cus-load-file (expand-file-name "cus-load.el")) + +(defun dgnushack-make-cus-load () + (load "cus-dep") + (let ((cusload-base-file dgnushack-cus-load-file)) + (if (fboundp 'custom-make-dependencies) + (custom-make-dependencies) + (Custom-make-dependencies)))) + +(defun dgnushack-make-auto-load () + (require 'autoload) + (let ((generated-autoload-file dgnushack-gnus-load-file) + (make-backup-files nil) + (autoload-package-name "gnus")) + (if (featurep 'xemacs) + (if (file-exists-p generated-autoload-file) + (delete-file generated-autoload-file)) + (with-temp-file generated-autoload-file + (insert ?\014))) + (batch-update-autoloads))) + +(defun dgnushack-make-load () + (message (format "Generating %s..." dgnushack-gnus-load-file)) + (with-temp-file dgnushack-gnus-load-file + (insert-file-contents dgnushack-cus-load-file) + (delete-file dgnushack-cus-load-file) + (goto-char (point-min)) + (search-forward ";;; Code:") + (forward-line) + (delete-region (point-min) (point)) + (insert "\ +;;; gnus-load.el --- automatically extracted custom dependencies and autoload +;; +;;; Code: +") + (goto-char (point-max)) + (if (search-backward "custom-versions-load-alist" nil t) + (forward-line -1) + (forward-line -1) + (while (eq (char-after) ?\;) + (forward-line -1)) + (forward-line)) + (delete-region (point) (point-max)) + (insert "\n") + ;; smiley-* are duplicated. Remove them all. + (let ((point (point))) + (insert-file-contents dgnushack-gnus-load-file) + (goto-char point) + (while (search-forward "smiley-" nil t) + (beginning-of-line) + (if (looking-at "(autoload ") + (delete-region (point) (progn (forward-sexp) (point))) + (forward-line)))) + ;; + (goto-char (point-max)) + (when (search-backward "\n(provide " nil t) + (forward-line -1) + (delete-region (point) (point-max))) + (insert "\ + +\(provide 'gnus-load) + +;;; Local Variables: +;;; version-control: never +;;; no-byte-compile: t +;;; no-update-autoloads: t +;;; End: +;;; gnus-load.el ends here\n")) + (message (format "Compiling %s..." dgnushack-gnus-load-file)) + (byte-compile-file dgnushack-gnus-load-file)) +;;; dgnushack.el ends here