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