*** empty log message ***
[gnus] / lisp / dgnushack.el
1 ;;; dgnushack.el --- a hack to set the load path for byte-compiling
2 ;; Copyright (C) 1994,95,96,97,98 Free Software Foundation, Inc.
3
4 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
5 ;; Version: 4.19
6 ;; Keywords: news, path
7
8 ;; This file is part of GNU Emacs.
9
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)
13 ;; any later version.
14
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.
19
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.
24
25 ;;; Commentary:
26
27 ;;; Code:
28
29 (fset 'facep 'ignore)
30
31 (require 'cl)
32 (require 'bytecomp)
33 (push "~/lisp/custom" load-path)
34 (push "." load-path)
35 (load "./lpath.el")
36
37 (defalias 'device-sound-enabled-p 'ignore)
38 (defalias 'play-sound-file 'ignore)
39 (defalias 'nndb-request-article 'ignore)
40 (defalias 'efs-re-read-dir 'ignore)
41 (defalias 'ange-ftp-re-read-dir 'ignore)
42 (defalias 'define-mail-user-agent 'ignore)
43
44 (eval-and-compile
45   (unless (string-match "XEmacs" emacs-version)
46     (fset 'get-popup-menu-response 'ignore)
47     (fset 'event-object 'ignore)
48     (fset 'x-defined-colors 'ignore)
49     (fset 'read-color 'ignore)))
50
51 (setq byte-compile-warnings
52       '(free-vars unresolved callargs redefine))
53
54 (defun dgnushack-compile ()
55   ;;(setq byte-compile-dynamic t)
56   (unless (locate-library "cus-edit")
57     (error "You do not seem to have Custom installed.
58 Fetch it from <URL:http://www.dina.kvl.dk/~abraham/custom/>.
59 You also then need to add the following to the lisp/dgnushack.el file:
60
61      (push \"~/lisp/custom\" load-path)
62
63 Modify to suit your needs."))
64   (let ((files (directory-files "." nil "^[^=].*\\.el$"))
65         (xemacs (string-match "XEmacs" emacs-version))
66         ;;(byte-compile-generate-call-tree t)
67         file elc)
68     (condition-case ()
69         (require 'w3-forms)
70       (error (setq files (delete "nnweb.el" (delete "nnlistserv.el" files)))))
71     (while (setq file (pop files))
72       (when (or (and (not xemacs)
73                      (not (member file '("gnus-xmas.el" "gnus-picon.el"
74                                          "messagexmas.el" "nnheaderxm.el"
75                                          "smiley.el" "x-overlay.el"))))
76                 (and xemacs
77                      (not (member file '("md5.el")))))
78         (when (or (not (file-exists-p (setq elc (concat file "c"))))
79                   (file-newer-than-file-p file elc))
80           (ignore-errors
81             (byte-compile-file file)))))))
82
83 (defun dgnushack-recompile ()
84   (require 'gnus)
85   (byte-recompile-directory "." 0))
86
87 ;;; dgnushack.el ends here
88