*** 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 "." load-path)
34 (load "./lpath.el" nil t)
35
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)
42
43 (eval-and-compile
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)))
49
50 (defun dgnushack-compile (&optional warn)
51   ;;(setq byte-compile-dynamic t)
52   (unless warn
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:
59
60      (push \"~/lisp/custom\" load-path)
61
62 Modify to suit your needs."))
63   (let ((files (directory-files "." nil "^[^=].*\\.el$"))
64         (xemacs (string-match "XEmacs" emacs-version))
65         ;;(byte-compile-generate-call-tree t)
66         file elc)
67     (condition-case ()
68         (require 'w3-forms)
69       (error (setq files (delete "nnweb.el" (delete "nnlistserv.el" files)))))
70     (while (setq file (pop files))
71       (when (or (and (not xemacs)
72                      (not (member file '("gnus-xmas.el" "gnus-picon.el"
73                                          "messagexmas.el" "nnheaderxm.el"
74                                          "smiley.el" "x-overlay.el"))))
75                 (and xemacs
76                      (not (member file '("md5.el")))))
77         (when (or (not (file-exists-p (setq elc (concat file "c"))))
78                   (file-newer-than-file-p file elc))
79           (ignore-errors
80             (byte-compile-file file)))))))
81
82 (defun dgnushack-recompile ()
83   (require 'gnus)
84   (byte-recompile-directory "." 0))
85
86 ;;; dgnushack.el ends here
87