1 ;;; dgnushack.el --- a hack to set the load path for byte-compiling
2 ;; Copyright (C) 1994,95,96,97,98,99 Free Software Foundation, Inc.
4 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6 ;; Keywords: news, path
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
34 (load "./lpath.el" nil t)
36 (defalias 'device-sound-enabled-p 'ignore)
37 (defalias 'play-sound-file 'ignore)
38 (defalias 'nndb-request-article 'ignore)
39 (defalias 'efs-re-read-dir 'ignore)
40 (defalias 'ange-ftp-re-read-dir 'ignore)
41 (defalias 'define-mail-user-agent 'ignore)
44 (unless (string-match "XEmacs" emacs-version)
45 (fset 'get-popup-menu-response 'ignore)
46 (fset 'event-object 'ignore)
47 (fset 'x-defined-colors 'ignore)
48 (fset 'read-color 'ignore)))
50 (defun dgnushack-compile (&optional warn)
51 ;;(setq byte-compile-dynamic t)
53 (setq byte-compile-warnings
54 '(free-vars unresolved callargs redefine)))
55 (unless (locate-library "cus-edit")
56 (error "You do not seem to have Custom installed.
57 Fetch it from <URL:http://www.dina.kvl.dk/~abraham/custom/>.
58 You also then need to add the following to the lisp/dgnushack.el file:
60 (push \"~/lisp/custom\" load-path)
62 Modify to suit your needs."))
63 (let ((files (delete "_pkg.el" (directory-files "." nil "^[^=].*\\.el$")))
64 (xemacs (string-match "XEmacs" emacs-version))
65 ;;(byte-compile-generate-call-tree t)
69 (error (setq files (delete "nnweb.el" (delete "nnlistserv.el" files)))))
72 (error (setq files (delete "gnus-bbdb.el" files))))
73 (while (setq file (pop files))
74 (when (or (and (not xemacs)
75 (not (member file '("gnus-xmas.el" "gnus-picon.el"
76 "messagexmas.el" "nnheaderxm.el"
77 "smiley.el" "x-overlay.el"))))
79 (not (member file '("md5.el")))))
80 (when (or (not (file-exists-p (setq elc (concat file "c"))))
81 (file-newer-than-file-p file elc))
83 (byte-compile-file file)))))))
85 (defun dgnushack-recompile ()
87 (byte-recompile-directory "." 0))
90 ;; Avoid byte-compile warnings.
91 (defvar gnus-revision-number)
92 (defvar gnus-version-number)
93 (defvar gnus-product-name)
94 (defvar configure-package-path)
97 (defconst dgnushack-info-file-regexp
98 "^\\(gnus\\|message\\|emacs-mime\\|gnus-ja\\|message-ja\\)\\(-[0-9]+\\)?$")
100 (defun dgnushack-make-package ()
106 '("auto-autoloads.el" "auto-autoloads.elc"))
111 (if (boundp 'gnus-revision-number)
112 (concat gnus-version-number "." gnus-revision-number)
115 (product-name (downcase gnus-product-name))
116 lisp-dir make-backup-files)
117 (setq version (apply 'concat (car version) "." (cdr version))
118 lisp-dir (concat "lisp/" product-name "/"))
121 (insert ";;;###autoload
122 \(package-provide '" product-name "
126 (write-file "_pkg.el"))
128 (message "Updating autoloads for directory %s..." default-directory)
129 (let ((generated-autoload-file "auto-autoloads.el")
131 (update-autoloads-from-directory default-directory))
132 (byte-compile-file "auto-autoloads.el")
135 (let ((standard-output (current-buffer)))
136 (Custom-make-dependencies "."))
137 (message (buffer-string)))
139 (byte-compile-file "custom-load.el")
141 (message "Generating MANIFEST.%s for the package..." product-name)
143 (insert "pkginfo/MANIFEST." product-name "\n"
147 (sort (directory-files "." nil "\\.elc?$")
149 (concat "\n" lisp-dir))
153 (sort (directory-files "../texi/"
154 nil dgnushack-info-file-regexp)
158 (write-file (concat "../MANIFEST." product-name)))))
160 (defun dgnushack-install-package ()
161 (let* ((package-dir (file-name-as-directory
162 (or (car command-line-args-left)
163 (if (boundp 'configure-package-path)
164 (car configure-package-path)
165 (car package-path)))))
166 (info-dir (expand-file-name "info/" package-dir))
167 (pkginfo-dir (expand-file-name "pkginfo/" package-dir))
168 product-name lisp-dir manifest)
170 (setq product-name (downcase gnus-product-name)
171 lisp-dir (expand-file-name (concat "lisp/" product-name "/")
173 manifest (concat "MANIFEST." product-name))
175 (unless (file-directory-p lisp-dir)
176 (make-directory lisp-dir t))
177 (unless (file-directory-p info-dir)
178 (make-directory info-dir))
179 (unless (file-directory-p pkginfo-dir)
180 (make-directory pkginfo-dir))
184 (message "Copying %s to %s..." file lisp-dir)
185 (copy-file file (expand-file-name file lisp-dir) t t))
186 (sort (directory-files "." nil "\\.elc?$") 'string-lessp))
190 (message "Copying ../texi/%s to %s..." file info-dir)
191 (copy-file (expand-file-name file "../texi/")
192 (expand-file-name file info-dir)
194 (sort (directory-files "../texi/" nil dgnushack-info-file-regexp)
197 (message "Copying ../%s to %s..." manifest pkginfo-dir)
198 (copy-file (expand-file-name manifest "../")
199 (expand-file-name manifest pkginfo-dir) t t)
203 ;;; dgnushack.el ends here