Fix my last change.
[gnus] / lisp / gnus-setup.el
1 ;;; gnus-setup.el --- Initialization & Setup for Gnus 5
2 ;; Copyright (C) 1995, 96 Free Software Foundation, Inc.
3
4 ;; Author: Steven L. Baur <steve@miranova.com>
5 ;; Keywords: news
6
7 ;; This file is part of GNU Emacs.
8
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
12 ;; any later version.
13
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ;; GNU General Public License for more details.
18
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
23
24 ;;; Commentary:
25 ;; My head is starting to spin with all the different mail/news packages.
26 ;; Stop The Madness!
27
28 ;; Given that Emacs Lisp byte codes may be diverging, it is probably best
29 ;; not to byte compile this, and just arrange to have the .el loaded out
30 ;; of .emacs.
31
32 ;;; Code:
33
34 (eval-when-compile (require 'cl))
35
36 (defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))
37
38 (defvar gnus-use-installed-gnus t
39   "*If non-nil Use installed version of Gnus.")
40
41 (defvar gnus-use-installed-tm running-xemacs
42   "*If non-nil use installed version of tm.")
43
44 (defvar gnus-use-installed-mailcrypt running-xemacs
45   "*If non-nil use installed version of mailcrypt.")
46
47 (defvar gnus-emacs-lisp-directory (if running-xemacs
48                                       "/usr/local/lib/xemacs/"
49                                     "/usr/local/share/emacs/")
50   "Directory where Emacs site lisp is located.")
51
52 (defvar gnus-gnus-lisp-directory (concat gnus-emacs-lisp-directory
53                                          "gnus-5.0.15/lisp/")
54   "Directory where Gnus Emacs lisp is found.")
55
56 (defvar gnus-tm-lisp-directory (concat gnus-emacs-lisp-directory
57                                        "site-lisp/")
58   "Directory where TM Emacs lisp is found.")
59
60 (defvar gnus-mailcrypt-lisp-directory (concat gnus-emacs-lisp-directory
61                                               "site-lisp/mailcrypt-3.4/")
62   "Directory where Mailcrypt Emacs Lisp is found.")
63
64 (defvar gnus-bbdb-lisp-directory (concat gnus-emacs-lisp-directory
65                                          "site-lisp/bbdb-1.51/")
66   "Directory where Big Brother Database is found.")
67
68 (defvar gnus-use-mhe nil
69   "Set this if you want to use MH-E for mail reading.")
70 (defvar gnus-use-rmail nil
71   "Set this if you want to use RMAIL for mail reading.")
72 (defvar gnus-use-sendmail t
73   "Set this if you want to use SENDMAIL for mail reading.")
74 (defvar gnus-use-vm nil
75   "Set this if you want to use the VM package for mail reading.")
76 (defvar gnus-use-sc nil
77   "Set this if you want to use Supercite.")
78 (defvar gnus-use-mailcrypt t
79   "Set this if you want to use Mailcrypt for dealing with PGP messages.")
80 (defvar gnus-use-bbdb nil
81   "Set this if you want to use the Big Brother DataBase.")
82
83 (when (and (not gnus-use-installed-gnus)
84            (null (member gnus-gnus-lisp-directory load-path)))
85   (push gnus-gnus-lisp-directory load-path))
86
87 ;;; We can't do this until we know where Gnus is.
88 (require 'message)
89
90 ;;; Mailcrypt by
91 ;;; Jin Choi <jin@atype.com>
92 ;;; Patrick LoPresti <patl@lcs.mit.edu>
93
94 (when gnus-use-mailcrypt
95   (when (and (not gnus-use-installed-mailcrypt)
96              (null (member gnus-mailcrypt-lisp-directory load-path)))
97     (setq load-path (cons gnus-mailcrypt-lisp-directory load-path)))
98   (autoload 'mc-install-write-mode "mailcrypt" nil t)
99   (autoload 'mc-install-read-mode "mailcrypt" nil t)
100   (add-hook 'message-mode-hook 'mc-install-write-mode)
101   (add-hook 'gnus-summary-mode-hook 'mc-install-read-mode)
102   (when gnus-use-mhe
103     (add-hook 'mh-folder-mode-hook 'mc-install-read-mode)
104     (add-hook 'mh-letter-mode-hook 'mc-install-write-mode)))
105
106 ;;; BBDB by
107 ;;; Jamie Zawinski <jwz@lucid.com>
108
109 (when gnus-use-bbdb
110   ;; bbdb will never be installed with emacs.
111   (when (null (member gnus-bbdb-lisp-directory load-path))
112     (setq load-path (cons gnus-bbdb-lisp-directory load-path)))
113   (autoload 'bbdb "bbdb-com"
114     "Insidious Big Brother Database" t)
115   (autoload 'bbdb-name "bbdb-com"
116     "Insidious Big Brother Database" t)
117   (autoload 'bbdb-company "bbdb-com"
118     "Insidious Big Brother Database" t)
119   (autoload 'bbdb-net "bbdb-com"
120     "Insidious Big Brother Database" t)
121   (autoload 'bbdb-notes "bbdb-com"
122     "Insidious Big Brother Database" t)
123
124   (when gnus-use-vm
125     (autoload 'bbdb-insinuate-vm "bbdb-vm"
126       "Hook BBDB into VM" t))
127
128   (when gnus-use-rmail
129     (autoload 'bbdb-insinuate-rmail "bbdb-rmail"
130       "Hook BBDB into RMAIL" t)
131     (add-hook 'rmail-mode-hook 'bbdb-insinuate-rmail))
132
133   (when gnus-use-mhe
134     (autoload 'bbdb-insinuate-mh "bbdb-mh"
135       "Hook BBDB into MH-E" t)
136     (add-hook 'mh-folder-mode-hook 'bbdb-insinuate-mh))
137
138   (autoload 'bbdb-insinuate-gnus "bbdb-gnus"
139     "Hook BBDB into Gnus" t)
140   (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
141
142   (when gnus-use-sendmail
143     (autoload 'bbdb-insinuate-sendmail "bbdb"
144       "Insidious Big Brother Database" t)
145     (add-hook 'mail-setup-hook 'bbdb-insinuate-sendmail)
146     (add-hook 'message-setup-hook 'bbdb-insinuate-sendmail)))
147
148 (when gnus-use-sc
149   (add-hook 'mail-citation-hook 'sc-cite-original)
150   (setq message-cite-function 'sc-cite-original)
151   (autoload 'sc-cite-original "supercite"))
152 \f
153 ;;;### (autoloads (gnus gnus-slave gnus-no-server) "gnus" "lisp/gnus.el" (12473 2137))
154 ;;; Generated autoloads from lisp/gnus.el
155
156 ;; Don't redo this if autoloads already exist
157 (unless (fboundp 'gnus)
158   (autoload 'gnus-slave-no-server "gnus" "\
159 Read network news as a slave without connecting to local server." t nil)
160
161   (autoload 'gnus-no-server "gnus" "\
162 Read network news.
163 If ARG is a positive number, Gnus will use that as the
164 startup level.  If ARG is nil, Gnus will be started at level 2.
165 If ARG is non-nil and not a positive number, Gnus will
166 prompt the user for the name of an NNTP server to use.
167 As opposed to `gnus', this command will not connect to the local server." t nil)
168
169   (autoload 'gnus-slave "gnus" "\
170 Read news as a slave." t nil)
171
172   (autoload 'gnus "gnus" "\
173 Read network news.
174 If ARG is non-nil and a positive number, Gnus will use that as the
175 startup level.  If ARG is non-nil and not a positive number, Gnus will
176 prompt the user for the name of an NNTP server to use." t nil)
177
178 ;;;***
179
180 ;;; These have moved out of gnus.el into other files.
181 ;;; FIX FIX FIX: should other things be in gnus-setup? or these not in it?
182   (autoload 'gnus-update-format "gnus-spec" "\
183 Update the format specification near point." t nil)
184
185   (autoload 'gnus-fetch-group "gnus-group" "\
186 Start Gnus if necessary and enter GROUP.
187 Returns whether the fetching was successful or not." t nil)
188
189   (defalias 'gnus-batch-kill 'gnus-batch-score)
190
191   (autoload 'gnus-batch-score "gnus-kill" "\
192 Run batched scoring.
193 Usage: emacs -batch -l gnus -f gnus-batch-score <newsgroups> ...
194 Newsgroups is a list of strings in Bnews format.  If you want to score
195 the comp hierarchy, you'd say \"comp.all\".  If you would not like to
196 score the alt hierarchy, you'd say \"!alt.all\"." t nil))
197
198 (provide 'gnus-setup)
199
200 (run-hooks 'gnus-setup-load-hook)
201
202 ;;; gnus-setup.el ends here