5f81c3852221b7373e06efbee65481e47d5f2217
[gnus] / texi / gnus.texi
1 \input texinfo
2
3 @setfilename gnus
4 @settitle Gnus Manual
5 @syncodeindex fn cp
6 @syncodeindex vr cp
7 @syncodeindex pg cp
8
9 @documentencoding ISO-8859-1
10
11 @copying
12 Copyright @copyright{} 1995-2011 Free Software Foundation, Inc.
13
14 @quotation
15 Permission is granted to copy, distribute and/or modify this document
16 under the terms of the GNU Free Documentation License, Version 1.3 or
17 any later version published by the Free Software Foundation; with no
18 Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
19 and with the Back-Cover Texts as in (a) below.  A copy of the license
20 is included in the section entitled ``GNU Free Documentation License''.
21
22 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
23 modify this GNU manual.  Buying copies from the FSF supports it in
24 developing GNU and promoting software freedom.''
25 @end quotation
26 @end copying
27
28 @iftex
29 @iflatex
30 \documentclass[twoside,a4paper,openright,11pt]{book}
31 \usepackage[latin1]{inputenc}
32 \usepackage{pagestyle}
33 \usepackage{epsfig}
34 \usepackage{pixidx}
35 \input{gnusconfig.tex}
36
37 \ifx\pdfoutput\undefined
38 \else
39 \usepackage[pdftex,bookmarks,colorlinks=true]{hyperref}
40 \usepackage{thumbpdf}
41 \pdfcompresslevel=9
42 \fi
43
44 \makeindex
45 \begin{document}
46
47 % Adjust ../Makefile.in if you change the following line:
48 \newcommand{\gnusversionname}{No Gnus v0.11}
49 \newcommand{\gnuschaptername}{}
50 \newcommand{\gnussectionname}{}
51
52 \newcommand{\gnusbackslash}{/}
53
54 \newcommand{\gnusref}[1]{``#1'' on page \pageref{#1}}
55 \ifx\pdfoutput\undefined
56 \newcommand{\gnusuref}[1]{\gnustt{#1}}
57 \else
58 \newcommand{\gnusuref}[1]{\href{#1}{\gnustt{#1}}}
59 \fi
60 \newcommand{\gnusxref}[1]{See ``#1'' on page \pageref{#1}}
61 \newcommand{\gnuspxref}[1]{see ``#1'' on page \pageref{#1}}
62
63 \newcommand{\gnuskindex}[1]{\index{#1}}
64 \newcommand{\gnusindex}[1]{\index{#1}}
65
66 \newcommand{\gnustt}[1]{{\gnusselectttfont{}#1}}
67 \newcommand{\gnuscode}[1]{\gnustt{#1}}
68 \newcommand{\gnusasis}[1]{\gnustt{#1}}
69 \newcommand{\gnusurl}[1]{\gnustt{#1}}
70 \newcommand{\gnuscommand}[1]{\gnustt{#1}}
71 \newcommand{\gnusenv}[1]{\gnustt{#1}}
72 \newcommand{\gnussamp}[1]{``{\fontencoding{OT1}\gnusselectttfont{}#1}''}
73 \newcommand{\gnuslisp}[1]{\gnustt{#1}}
74 \newcommand{\gnuskbd}[1]{`\gnustt{#1}'}
75 \newcommand{\gnuskey}[1]{`\gnustt{#1}'}
76 \newcommand{\gnusfile}[1]{`\gnustt{#1}'}
77 \newcommand{\gnusdfn}[1]{\textit{#1}}
78 \newcommand{\gnusi}[1]{\textit{#1}}
79 \newcommand{\gnusr}[1]{\textrm{#1}}
80 \newcommand{\gnusstrong}[1]{\textbf{#1}}
81 \newcommand{\gnusemph}[1]{\textit{#1}}
82 \newcommand{\gnusvar}[1]{{\fontsize{10pt}{10}\selectfont\textsl{\textsf{#1}}}}
83 \newcommand{\gnussc}[1]{\textsc{#1}}
84 \newcommand{\gnustitle}[1]{{\huge\textbf{#1}}}
85 \newcommand{\gnusversion}[1]{{\small\textit{#1}}}
86 \newcommand{\gnusauthor}[1]{{\large\textbf{#1}}}
87 \newcommand{\gnusresult}[1]{\gnustt{=> #1}}
88 \newcommand{\gnusacronym}[1]{\textsc{#1}}
89 \newcommand{\gnusemail}[1]{\textit{#1}}
90
91 \newcommand{\gnusbullet}{{${\bullet}$}}
92 \newcommand{\gnusdollar}{\$}
93 \newcommand{\gnusampersand}{\&}
94 \newcommand{\gnuspercent}{\%}
95 \newcommand{\gnushash}{\#}
96 \newcommand{\gnushat}{\symbol{"5E}}
97 \newcommand{\gnusunderline}{\symbol{"5F}}
98 \newcommand{\gnusnot}{$\neg$}
99 \newcommand{\gnustilde}{\symbol{"7E}}
100 \newcommand{\gnusless}{{$<$}}
101 \newcommand{\gnusgreater}{{$>$}}
102 \newcommand{\gnusbraceleft}{{$>$}}
103 \newcommand{\gnusbraceright}{{$>$}}
104
105 \newcommand{\gnushead}{\raisebox{-1cm}{\epsfig{figure=ps/gnus-head,height=1cm}}}
106 \newcommand{\gnusinteresting}{
107 \marginpar[\mbox{}\hfill\gnushead]{\gnushead}
108 }
109
110 \newcommand{\gnuscleardoublepage}{\ifodd\count0\mbox{}\clearpage\thispagestyle{empty}\mbox{}\clearpage\else\clearpage\fi}
111
112 \newcommand{\gnuspagechapter}[1]{
113 {\mbox{}}
114 }
115
116 \newdimen{\gnusdimen}
117 \gnusdimen 0pt
118
119 \newcommand{\gnuschapter}[2]{
120 \gnuscleardoublepage
121 \ifdim \gnusdimen = 0pt\setcounter{page}{1}\pagestyle{gnus}\pagenumbering{arabic} \gnusdimen 1pt\fi
122 \chapter{#2}
123 \renewcommand{\gnussectionname}{}
124 \renewcommand{\gnuschaptername}{#2}
125 \thispagestyle{empty}
126 \hspace*{-2cm}
127 \begin{picture}(500,500)(0,0)
128 \put(480,350){\makebox(0,0)[tr]{#1}}
129 \put(40,300){\makebox(500,50)[bl]{{\Huge\bf{#2}}}}
130 \end{picture}
131 \clearpage
132 }
133
134 \newcommand{\gnusfigure}[3]{
135 \begin{figure}
136 \mbox{}\ifodd\count0\hspace*{-0.8cm}\else\hspace*{-3cm}\fi\begin{picture}(440,#2)
137 #3
138 \end{picture}
139 \caption{#1}
140 \end{figure}
141 }
142
143 \newcommand{\gnusicon}[1]{
144 \marginpar[\mbox{}\hfill\raisebox{-1.5cm}{\epsfig{figure=ps/#1-up,height=1.5cm}}]{\raisebox{-1cm}{\epsfig{figure=ps/#1-up,height=1cm}}}
145 }
146
147 \newcommand{\gnuspicon}[1]{
148 \margindex{\epsfig{figure=#1,width=2cm}}
149 }
150
151 \newcommand{\gnusxface}[2]{
152 \margindex{\epsfig{figure=#1,width=1cm}\epsfig{figure=#2,width=1cm}}
153 }
154
155 \newcommand{\gnussmiley}[2]{
156 \margindex{\makebox[2cm]{\hfill\epsfig{figure=#1,width=0.5cm}\hfill\epsfig{figure=#2,width=0.5cm}\hfill}}
157 }
158
159 \newcommand{\gnusitemx}[1]{\mbox{}\vspace*{-\itemsep}\vspace*{-\parsep}\item#1}
160
161 \newcommand{\gnussection}[1]{
162 \renewcommand{\gnussectionname}{#1}
163 \section{#1}
164 }
165
166 \newenvironment{codelist}%
167 {\begin{list}{}{
168 }
169 }{\end{list}}
170
171 \newenvironment{asislist}%
172 {\begin{list}{}{
173 }
174 }{\end{list}}
175
176 \newenvironment{kbdlist}%
177 {\begin{list}{}{
178 \labelwidth=0cm
179 }
180 }{\end{list}}
181
182 \newenvironment{dfnlist}%
183 {\begin{list}{}{
184 }
185 }{\end{list}}
186
187 \newenvironment{stronglist}%
188 {\begin{list}{}{
189 }
190 }{\end{list}}
191
192 \newenvironment{samplist}%
193 {\begin{list}{}{
194 }
195 }{\end{list}}
196
197 \newenvironment{varlist}%
198 {\begin{list}{}{
199 }
200 }{\end{list}}
201
202 \newenvironment{emphlist}%
203 {\begin{list}{}{
204 }
205 }{\end{list}}
206
207 \newlength\gnusheadtextwidth
208 \setlength{\gnusheadtextwidth}{\headtextwidth}
209 \addtolength{\gnusheadtextwidth}{1cm}
210
211 \newpagestyle{gnuspreamble}%
212 {
213 {
214 \ifodd\count0
215 {
216 \hspace*{-0.23cm}\underline{\makebox[\gnusheadtextwidth]{\mbox{}}\textbf{\hfill\roman{page}}}
217 }
218 \else
219 {
220 \hspace*{-3.25cm}\underline{\makebox[\gnusheadtextwidth]{\textbf{\roman{page}\hfill\mbox{}}}
221 }
222 }
223 \fi
224 }
225 }
226 {
227 \ifodd\count0
228 \mbox{} \hfill
229 \raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}}
230 \else
231 \raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}}
232 \hfill \mbox{}
233 \fi
234 }
235
236 \newpagestyle{gnusindex}%
237 {
238 {
239 \ifodd\count0
240 {
241 \hspace*{-0.23cm}\underline{\makebox[\gnusheadtextwidth]{\textbf{\gnuschaptername\hfill\arabic{page}}}}
242 }
243 \else
244 {
245 \hspace*{-3.25cm}\underline{\makebox[\gnusheadtextwidth]{\textbf{\arabic{page}\hfill\gnuschaptername}}}
246 }
247 \fi
248 }
249 }
250 {
251 \ifodd\count0
252 \mbox{} \hfill
253 \raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}}
254 \else
255 \raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}}
256 \hfill \mbox{}
257 \fi
258 }
259
260 \newpagestyle{gnus}%
261 {
262 {
263 \ifodd\count0
264 {
265 \makebox[12cm]{\hspace*{3.1cm}\underline{\makebox[\gnusheadtextwidth]{\textbf{\arabic{chapter}.\arabic{section}} \textbf{\gnussectionname\hfill\arabic{page}}}}}
266 }
267 \else
268 {
269 \makebox[12cm]{\hspace*{-2.95cm}\underline{\makebox[\gnusheadtextwidth]{\textbf{\arabic{page}\hfill\gnuschaptername}}}}
270 }
271 \fi
272 }
273 }
274 {
275 \ifodd\count0
276 \mbox{} \hfill
277 \raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}}
278 \else
279 \raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}}
280 \hfill \mbox{}
281 \fi
282 }
283
284 \pagenumbering{roman}
285 \pagestyle{gnuspreamble}
286
287 @end iflatex
288 @end iftex
289
290 @iftex
291 @iflatex
292
293 \begin{titlepage}
294 {
295
296 %\addtolength{\oddsidemargin}{-5cm}
297 %\addtolength{\evensidemargin}{-5cm}
298 \parindent=0cm
299 \addtolength{\textheight}{2cm}
300
301 \gnustitle{\gnustitlename}\hfill\gnusversion{\gnusversionname}\\
302 \rule{15cm}{1mm}\\
303 \vfill
304 \hspace*{0cm}\epsfig{figure=ps/gnus-big-logo,height=15cm}
305 \vfill
306 \rule{15cm}{1mm}\\
307 \gnusauthor{by Lars Magne Ingebrigtsen}
308 \newpage
309 }
310
311 \mbox{}
312 \vfill
313
314 \thispagestyle{empty}
315
316 @c @insertcopying
317 \newpage
318 \end{titlepage}
319 @end iflatex
320 @end iftex
321
322 @dircategory Emacs
323 @direntry
324 * Gnus: (gnus).                 The newsreader Gnus.
325 @end direntry
326 @iftex
327 @finalout
328 @end iftex
329
330
331 @titlepage
332 @title Gnus Manual
333
334 @author by Lars Magne Ingebrigtsen
335 @page
336 @vskip 0pt plus 1filll
337 @insertcopying
338 @end titlepage
339
340 @summarycontents
341 @contents
342
343 @node Top
344 @top The Gnus Newsreader
345
346 @ifinfo
347
348 You can read news (and mail) from within Emacs by using Gnus.  The news
349 can be gotten by any nefarious means you can think of---@acronym{NNTP}, local
350 spool or your mbox file.  All at the same time, if you want to push your
351 luck.
352
353 @c Adjust ../Makefile.in if you change the following line:
354 This manual corresponds to No Gnus v0.11.
355
356 @ifnottex
357 @insertcopying
358 @end ifnottex
359
360 @end ifinfo
361
362 @iftex
363
364 @iflatex
365 \tableofcontents
366 \gnuscleardoublepage
367 @end iflatex
368
369 Gnus is the advanced, self-documenting, customizable, extensible
370 unreal-time newsreader for GNU Emacs.
371
372 Oops.  That sounds oddly familiar, so let's start over again to avoid
373 being accused of plagiarism:
374
375 Gnus is a message-reading laboratory.  It will let you look at just
376 about anything as if it were a newsgroup.  You can read mail with it,
377 you can browse directories with it, you can @code{ftp} with it---you
378 can even read news with it!
379
380 Gnus tries to empower people who read news the same way Emacs empowers
381 people who edit text.  Gnus sets no limits to what the user should be
382 allowed to do.  Users are encouraged to extend Gnus to make it behave
383 like they want it to behave.  A program should not control people;
384 people should be empowered to do what they want by using (or abusing)
385 the program.
386
387 @c Adjust ../Makefile.in if you change the following line:
388 This manual corresponds to No Gnus v0.11.
389
390 @heading Other related manuals
391 @itemize
392 @item Message manual: Composing messages
393 @item Emacs-MIME:     Composing messages; @acronym{MIME}-specific parts.
394 @item Sieve:          Managing Sieve scripts in Emacs.
395 @item PGG:            @acronym{PGP/MIME} with Gnus.
396 @item SASL:           @acronym{SASL} authentication in Emacs.
397 @end itemize
398
399 @end iftex
400
401 @menu
402 * Starting Up::              Finding news can be a pain.
403 * Group Buffer::             Selecting, subscribing and killing groups.
404 * Summary Buffer::           Reading, saving and posting articles.
405 * Article Buffer::           Displaying and handling articles.
406 * Composing Messages::       Information on sending mail and news.
407 * Select Methods::           Gnus reads all messages from various select methods.
408 * Scoring::                  Assigning values to articles.
409 * Searching::                Mail and News search engines.
410 * Various::                  General purpose settings.
411 * The End::                  Farewell and goodbye.
412 * Appendices::               Terminology, Emacs intro, @acronym{FAQ}, History, Internals.
413 * GNU Free Documentation License:: The license for this documentation.
414 * Index::                    Variable, function and concept index.
415 * Key Index::                Key Index.
416
417 Other related manuals
418
419 * Message:(message).         Composing messages.
420 * Emacs-MIME:(emacs-mime).   Composing messages; @acronym{MIME}-specific parts.
421 * Sieve:(sieve).             Managing Sieve scripts in Emacs.
422 * PGG:(pgg).                 @acronym{PGP/MIME} with Gnus.
423 * SASL:(sasl).               @acronym{SASL} authentication in Emacs.
424
425 @detailmenu
426  --- The Detailed Node Listing ---
427
428 Starting Gnus
429
430 * Finding the News::            Choosing a method for getting news.
431 * The Server is Down::          How can I read my mail then?
432 * Slave Gnusae::                You can have more than one Gnus active at a time.
433 * Fetching a Group::            Starting Gnus just to read a group.
434 * New Groups::                  What is Gnus supposed to do with new groups?
435 * Changing Servers::            You may want to move from one server to another.
436 * Startup Files::               Those pesky startup files---@file{.newsrc}.
437 * Auto Save::                   Recovering from a crash.
438 * The Active File::             Reading the active file over a slow line Takes Time.
439 * Startup Variables::           Other variables you might change.
440
441 New Groups
442
443 * Checking New Groups::         Determining what groups are new.
444 * Subscription Methods::        What Gnus should do with new groups.
445 * Filtering New Groups::        Making Gnus ignore certain new groups.
446
447 Group Buffer
448
449 * Group Buffer Format::         Information listed and how you can change it.
450 * Group Maneuvering::           Commands for moving in the group buffer.
451 * Selecting a Group::           Actually reading news.
452 * Subscription Commands::       Unsubscribing, killing, subscribing.
453 * Group Data::                  Changing the info for a group.
454 * Group Levels::                Levels? What are those, then?
455 * Group Score::                 A mechanism for finding out what groups you like.
456 * Marking Groups::              You can mark groups for later processing.
457 * Foreign Groups::              Creating and editing groups.
458 * Group Parameters::            Each group may have different parameters set.
459 * Listing Groups::              Gnus can list various subsets of the groups.
460 * Sorting Groups::              Re-arrange the group order.
461 * Group Maintenance::           Maintaining a tidy @file{.newsrc} file.
462 * Browse Foreign Server::       You can browse a server.  See what it has to offer.
463 * Exiting Gnus::                Stop reading news and get some work done.
464 * Group Topics::                A folding group mode divided into topics.
465 * Non-ASCII Group Names::       Accessing groups of non-English names.
466 * Misc Group Stuff::            Other stuff that you can to do.
467
468 Group Buffer Format
469
470 * Group Line Specification::    Deciding how the group buffer is to look.
471 * Group Mode Line Specification::  The group buffer mode line.
472 * Group Highlighting::          Having nice colors in the group buffer.
473
474 Group Topics
475
476 * Topic Commands::              Interactive E-Z commands.
477 * Topic Variables::             How to customize the topics the Lisp Way.
478 * Topic Sorting::               Sorting each topic individually.
479 * Topic Topology::              A map of the world.
480 * Topic Parameters::            Parameters that apply to all groups in a topic.
481
482 Misc Group Stuff
483
484 * Scanning New Messages::       Asking Gnus to see whether new messages have arrived.
485 * Group Information::           Information and help on groups and Gnus.
486 * Group Timestamp::             Making Gnus keep track of when you last read a group.
487 * File Commands::               Reading and writing the Gnus files.
488 * Sieve Commands::              Managing Sieve scripts.
489
490 Summary Buffer
491
492 * Summary Buffer Format::       Deciding how the summary buffer is to look.
493 * Summary Maneuvering::         Moving around the summary buffer.
494 * Choosing Articles::           Reading articles.
495 * Paging the Article::          Scrolling the current article.
496 * Reply Followup and Post::     Posting articles.
497 * Delayed Articles::            Send articles at a later time.
498 * Marking Articles::            Marking articles as read, expirable, etc.
499 * Limiting::                    You can limit the summary buffer.
500 * Threading::                   How threads are made.
501 * Sorting the Summary Buffer::  How articles and threads are sorted.
502 * Asynchronous Fetching::       Gnus might be able to pre-fetch articles.
503 * Article Caching::             You may store articles in a cache.
504 * Persistent Articles::         Making articles expiry-resistant.
505 * Sticky Articles::             Article buffers that are not reused.
506 * Article Backlog::             Having already read articles hang around.
507 * Saving Articles::             Ways of customizing article saving.
508 * Decoding Articles::           Gnus can treat series of (uu)encoded articles.
509 * Article Treatment::           The article buffer can be mangled at will.
510 * MIME Commands::               Doing MIMEy things with the articles.
511 * Charsets::                    Character set issues.
512 * Article Commands::            Doing various things with the article buffer.
513 * Summary Sorting::             Sorting the summary buffer in various ways.
514 * Finding the Parent::          No child support? Get the parent.
515 * Alternative Approaches::      Reading using non-default summaries.
516 * Tree Display::                A more visual display of threads.
517 * Mail Group Commands::         Some commands can only be used in mail groups.
518 * Various Summary Stuff::       What didn't fit anywhere else.
519 * Exiting the Summary Buffer::  Returning to the Group buffer,
520                                 or reselecting the current group.
521 * Crosspost Handling::          How crossposted articles are dealt with.
522 * Duplicate Suppression::       An alternative when crosspost handling fails.
523 * Security::                    Decrypt and Verify.
524 * Mailing List::                Mailing list minor mode.
525
526 Summary Buffer Format
527
528 * Summary Buffer Lines::        You can specify how summary lines should look.
529 * To From Newsgroups::          How to not display your own name.
530 * Summary Buffer Mode Line::    You can say how the mode line should look.
531 * Summary Highlighting::        Making the summary buffer all pretty and nice.
532
533 Choosing Articles
534
535 * Choosing Commands::           Commands for choosing articles.
536 * Choosing Variables::          Variables that influence these commands.
537
538 Reply, Followup and Post
539
540 * Summary Mail Commands::       Sending mail.
541 * Summary Post Commands::       Sending news.
542 * Summary Message Commands::    Other Message-related commands.
543 * Canceling and Superseding::
544
545 Marking Articles
546
547 * Unread Articles::             Marks for unread articles.
548 * Read Articles::               Marks for read articles.
549 * Other Marks::                 Marks that do not affect readedness.
550 * Setting Marks::               How to set and remove marks.
551 * Generic Marking Commands::    How to customize the marking.
552 * Setting Process Marks::       How to mark articles for later processing.
553
554 Threading
555
556 * Customizing Threading::       Variables you can change to affect the threading.
557 * Thread Commands::             Thread based commands in the summary buffer.
558
559 Customizing Threading
560
561 * Loose Threads::               How Gnus gathers loose threads into bigger threads.
562 * Filling In Threads::          Making the threads displayed look fuller.
563 * More Threading::              Even more variables for fiddling with threads.
564 * Low-Level Threading::         You thought it was over@dots{} but you were wrong!
565
566 Decoding Articles
567
568 * Uuencoded Articles::          Uudecode articles.
569 * Shell Archives::              Unshar articles.
570 * PostScript Files::            Split PostScript.
571 * Other Files::                 Plain save and binhex.
572 * Decoding Variables::          Variables for a happy decoding.
573 * Viewing Files::               You want to look at the result of the decoding?
574
575 Decoding Variables
576
577 * Rule Variables::              Variables that say how a file is to be viewed.
578 * Other Decode Variables::      Other decode variables.
579 * Uuencoding and Posting::      Variables for customizing uuencoding.
580
581 Article Treatment
582
583 * Article Highlighting::        You want to make the article look like fruit salad.
584 * Article Fontisizing::         Making emphasized text look nice.
585 * Article Hiding::              You also want to make certain info go away.
586 * Article Washing::             Lots of way-neat functions to make life better.
587 * Article Header::              Doing various header transformations.
588 * Article Buttons::             Click on URLs, Message-IDs, addresses and the like.
589 * Article Button Levels::       Controlling appearance of buttons.
590 * Article Date::                Grumble, UT!
591 * Article Display::             Display various stuff---X-Face, Picons, Smileys, Gravatars
592 * Article Signature::           What is a signature?
593 * Article Miscellanea::         Various other stuff.
594
595 Alternative Approaches
596
597 * Pick and Read::               First mark articles and then read them.
598 * Binary Groups::               Auto-decode all articles.
599
600 Various Summary Stuff
601
602 * Summary Group Information::   Information oriented commands.
603 * Searching for Articles::      Multiple article commands.
604 * Summary Generation Commands::
605 * Really Various Summary Commands::  Those pesky non-conformant commands.
606
607 Article Buffer
608
609 * Hiding Headers::              Deciding what headers should be displayed.
610 * Using MIME::                  Pushing articles through @acronym{MIME} before reading them.
611 * Customizing Articles::        Tailoring the look of the articles.
612 * Article Keymap::              Keystrokes available in the article buffer.
613 * Misc Article::                Other stuff.
614
615 Composing Messages
616
617 * Mail::                        Mailing and replying.
618 * Posting Server::              What server should you post and mail via?
619 * POP before SMTP::             You cannot send a mail unless you read a mail.
620 * Mail and Post::               Mailing and posting at the same time.
621 * Archived Messages::           Where Gnus stores the messages you've sent.
622 * Posting Styles::              An easier way to specify who you are.
623 * Drafts::                      Postponing messages and rejected messages.
624 * Rejected Articles::           What happens if the server doesn't like your article?
625 * Signing and encrypting::      How to compose secure messages.
626
627 Select Methods
628
629 * Server Buffer::               Making and editing virtual servers.
630 * Getting News::                Reading USENET news with Gnus.
631 * Using IMAP::                  Reading mail from @acronym{IMAP}.
632 * Getting Mail::                Reading your personal mail with Gnus.
633 * Browsing the Web::            Getting messages from a plethora of Web sources.
634 * Other Sources::               Reading directories, files.
635 * Combined Groups::             Combining groups into one group.
636 * Email Based Diary::           Using mails to manage diary events in Gnus.
637 * Gnus Unplugged::              Reading news and mail offline.
638
639 Server Buffer
640
641 * Server Buffer Format::        You can customize the look of this buffer.
642 * Server Commands::             Commands to manipulate servers.
643 * Example Methods::             Examples server specifications.
644 * Creating a Virtual Server::   An example session.
645 * Server Variables::            Which variables to set.
646 * Servers and Methods::         You can use server names as select methods.
647 * Unavailable Servers::         Some servers you try to contact may be down.
648
649 Getting News
650
651 * NNTP::                        Reading news from an @acronym{NNTP} server.
652 * News Spool::                  Reading news from the local spool.
653
654 @acronym{NNTP}
655
656 * Direct Functions::            Connecting directly to the server.
657 * Indirect Functions::          Connecting indirectly to the server.
658 * Common Variables::            Understood by several connection functions.
659 * NNTP marks::                  Storing marks for @acronym{NNTP} servers.
660
661 Getting Mail
662
663 * Mail in a Newsreader::        Important introductory notes.
664 * Getting Started Reading Mail::  A simple cookbook example.
665 * Splitting Mail::              How to create mail groups.
666 * Mail Sources::                How to tell Gnus where to get mail from.
667 * Mail Back End Variables::     Variables for customizing mail handling.
668 * Fancy Mail Splitting::        Gnus can do hairy splitting of incoming mail.
669 * Group Mail Splitting::        Use group customize to drive mail splitting.
670 * Incorporating Old Mail::      What about the old mail you have?
671 * Expiring Mail::               Getting rid of unwanted mail.
672 * Washing Mail::                Removing cruft from the mail you get.
673 * Duplicates::                  Dealing with duplicated mail.
674 * Not Reading Mail::            Using mail back ends for reading other files.
675 * Choosing a Mail Back End::    Gnus can read a variety of mail formats.
676
677 Mail Sources
678
679 * Mail Source Specifiers::      How to specify what a mail source is.
680 * Mail Source Customization::   Some variables that influence things.
681 * Fetching Mail::               Using the mail source specifiers.
682
683 Choosing a Mail Back End
684
685 * Unix Mail Box::               Using the (quite) standard Un*x mbox.
686 * Babyl::                       Babyl was used by older versions of Rmail.
687 * Mail Spool::                  Store your mail in a private spool?
688 * MH Spool::                    An mhspool-like back end.
689 * Maildir::                     Another one-file-per-message format.
690 * Mail Folders::                Having one file for each group.
691 * Comparing Mail Back Ends::    An in-depth looks at pros and cons.
692
693 Browsing the Web
694
695 * Archiving Mail::
696 * Web Searches::                Creating groups from articles that match a string.
697 * RSS::                         Reading RDF site summary.
698 * Customizing W3::              Doing stuff to Emacs/W3 from Gnus.
699
700 Other Sources
701
702 * Directory Groups::            You can read a directory as if it was a newsgroup.
703 * Anything Groups::             Dired?  Who needs dired?
704 * Document Groups::             Single files can be the basis of a group.
705 * Mail-To-News Gateways::       Posting articles via mail-to-news gateways.
706 * The Empty Backend::           The backend that never has any news.
707
708 Document Groups
709
710 * Document Server Internals::   How to add your own document types.
711
712 Combined Groups
713
714 * Virtual Groups::              Combining articles from many groups.
715
716 Email Based Diary
717
718 * The NNDiary Back End::        Basic setup and usage.
719 * The Gnus Diary Library::      Utility toolkit on top of nndiary.
720 * Sending or Not Sending::      A final note on sending diary messages.
721
722 The NNDiary Back End
723
724 * Diary Messages::              What makes a message valid for nndiary.
725 * Running NNDiary::             NNDiary has two modes of operation.
726 * Customizing NNDiary::         Bells and whistles.
727
728 The Gnus Diary Library
729
730 * Diary Summary Line Format::           A nicer summary buffer line format.
731 * Diary Articles Sorting::              A nicer way to sort messages.
732 * Diary Headers Generation::            Not doing it manually.
733 * Diary Group Parameters::              Not handling them manually.
734
735 Gnus Unplugged
736
737 * Agent Basics::                How it all is supposed to work.
738 * Agent Categories::            How to tell the Gnus Agent what to download.
739 * Agent Commands::              New commands for all the buffers.
740 * Agent Visuals::               Ways that the agent may effect your summary buffer.
741 * Agent as Cache::              The Agent is a big cache too.
742 * Agent Expiry::                How to make old articles go away.
743 * Agent Regeneration::          How to recover from lost connections and other accidents.
744 * Agent and flags::             How the Agent maintains flags.
745 * Agent and IMAP::              How to use the Agent with @acronym{IMAP}.
746 * Outgoing Messages::           What happens when you post/mail something?
747 * Agent Variables::             Customizing is fun.
748 * Example Setup::               An example @file{~/.gnus.el} file for offline people.
749 * Batching Agents::             How to fetch news from a @code{cron} job.
750 * Agent Caveats::               What you think it'll do and what it does.
751
752 Agent Categories
753
754 * Category Syntax::             What a category looks like.
755 * Category Buffer::             A buffer for maintaining categories.
756 * Category Variables::          Customize'r'Us.
757
758 Agent Commands
759
760 * Group Agent Commands::        Configure groups and fetch their contents.
761 * Summary Agent Commands::      Manually select then fetch specific articles.
762 * Server Agent Commands::       Select the servers that are supported by the agent.
763
764 Scoring
765
766 * Summary Score Commands::      Adding score entries for the current group.
767 * Group Score Commands::        General score commands.
768 * Score Variables::             Customize your scoring.  (My, what terminology).
769 * Score File Format::           What a score file may contain.
770 * Score File Editing::          You can edit score files by hand as well.
771 * Adaptive Scoring::            Big Sister Gnus knows what you read.
772 * Home Score File::             How to say where new score entries are to go.
773 * Followups To Yourself::       Having Gnus notice when people answer you.
774 * Scoring On Other Headers::    Scoring on non-standard headers.
775 * Scoring Tips::                How to score effectively.
776 * Reverse Scoring::             That problem child of old is not problem.
777 * Global Score Files::          Earth-spanning, ear-splitting score files.
778 * Kill Files::                  They are still here, but they can be ignored.
779 * Converting Kill Files::       Translating kill files to score files.
780 * Advanced Scoring::            Using logical expressions to build score rules.
781 * Score Decays::                It can be useful to let scores wither away.
782
783 Advanced Scoring
784
785 * Advanced Scoring Syntax::     A definition.
786 * Advanced Scoring Examples::   What they look like.
787 * Advanced Scoring Tips::       Getting the most out of it.
788
789 Searching
790
791 * nnir::                        Searching with various engines.
792 * nnmairix::                    Searching with Mairix.
793
794 nnir
795
796 * What is nnir?::               What does nnir do.
797 * Basic Usage::                 How to perform simple searches.
798 * Setting up nnir::             How to set up nnir.
799
800 Setting up nnir
801
802 * Associating Engines::         How to associate engines.
803
804 Various
805
806 * Process/Prefix::              A convention used by many treatment commands.
807 * Interactive::                 Making Gnus ask you many questions.
808 * Symbolic Prefixes::           How to supply some Gnus functions with options.
809 * Formatting Variables::        You can specify what buffers should look like.
810 * Window Layout::               Configuring the Gnus buffer windows.
811 * Faces and Fonts::             How to change how faces look.
812 * Compilation::                 How to speed Gnus up.
813 * Mode Lines::                  Displaying information in the mode lines.
814 * Highlighting and Menus::      Making buffers look all nice and cozy.
815 * Daemons::                     Gnus can do things behind your back.
816 * Undo::                        Some actions can be undone.
817 * Predicate Specifiers::        Specifying predicates.
818 * Moderation::                  What to do if you're a moderator.
819 * Image Enhancements::          Modern versions of Emacs/XEmacs can display images.
820 * Fuzzy Matching::              What's the big fuzz?
821 * Thwarting Email Spam::        Simple ways to avoid unsolicited commercial email.
822 * Spam Package::                A package for filtering and processing spam.
823 * The Gnus Registry::           A package for tracking messages by Message-ID.
824 * Other modes::                 Interaction with other modes.
825 * Various Various::             Things that are really various.
826
827 Formatting Variables
828
829 * Formatting Basics::           A formatting variable is basically a format string.
830 * Mode Line Formatting::        Some rules about mode line formatting variables.
831 * Advanced Formatting::         Modifying output in various ways.
832 * User-Defined Specs::          Having Gnus call your own functions.
833 * Formatting Fonts::            Making the formatting look colorful and nice.
834 * Positioning Point::           Moving point to a position after an operation.
835 * Tabulation::                  Tabulating your output.
836 * Wide Characters::             Dealing with wide characters.
837
838 Image Enhancements
839
840 * X-Face::                      Display a funky, teensy black-and-white image.
841 * Face::                        Display a funkier, teensier colored image.
842 * Smileys::                     Show all those happy faces the way they were
843                                   meant to be shown.
844 * Picons::                      How to display pictures of what you're reading.
845 * Gravatars::                   Display the avatar of people you read.
846 * XVarious::                    Other XEmacsy Gnusey variables.
847
848 Thwarting Email Spam
849
850 * The problem of spam::         Some background, and some solutions
851 * Anti-Spam Basics::            Simple steps to reduce the amount of spam.
852 * SpamAssassin::                How to use external anti-spam tools.
853 * Hashcash::                    Reduce spam by burning CPU time.
854
855 Spam Package
856
857 * Spam Package Introduction::
858 * Filtering Incoming Mail::
859 * Detecting Spam in Groups::
860 * Spam and Ham Processors::
861 * Spam Package Configuration Examples::
862 * Spam Back Ends::
863 * Extending the Spam package::
864 * Spam Statistics Package::
865
866 Spam Statistics Package
867
868 * Creating a spam-stat dictionary::
869 * Splitting mail using spam-stat::
870 * Low-level interface to the spam-stat dictionary::
871
872 Appendices
873
874 * XEmacs::                      Requirements for installing under XEmacs.
875 * History::                     How Gnus got where it is today.
876 * On Writing Manuals::          Why this is not a beginner's guide.
877 * Terminology::                 We use really difficult, like, words here.
878 * Customization::               Tailoring Gnus to your needs.
879 * Troubleshooting::             What you might try if things do not work.
880 * Gnus Reference Guide::        Rilly, rilly technical stuff.
881 * Emacs for Heathens::          A short introduction to Emacsian terms.
882 * Frequently Asked Questions::  The Gnus FAQ
883
884 History
885
886 * Gnus Versions::               What Gnus versions have been released.
887 * Other Gnus Versions::         Other Gnus versions that also have been released.
888 * Why?::                        What's the point of Gnus?
889 * Compatibility::               Just how compatible is Gnus with @sc{gnus}?
890 * Conformity::                  Gnus tries to conform to all standards.
891 * Emacsen::                     Gnus can be run on a few modern Emacsen.
892 * Gnus Development::            How Gnus is developed.
893 * Contributors::                Oodles of people.
894 * New Features::                Pointers to some of the new stuff in Gnus.
895
896 New Features
897
898 * ding Gnus::                   New things in Gnus 5.0/5.1, the first new Gnus.
899 * September Gnus::              The Thing Formally Known As Gnus 5.2/5.3.
900 * Red Gnus::                    Third time best---Gnus 5.4/5.5.
901 * Quassia Gnus::                Two times two is four, or Gnus 5.6/5.7.
902 * Pterodactyl Gnus::            Pentad also starts with P, AKA Gnus 5.8/5.9.
903 * Oort Gnus::                   It's big.  It's far out.  Gnus 5.10/5.11.
904 * No Gnus::                     Very punny.
905
906 Customization
907
908 * Slow/Expensive Connection::   You run a local Emacs and get the news elsewhere.
909 * Slow Terminal Connection::    You run a remote Emacs.
910 * Little Disk Space::           You feel that having large setup files is icky.
911 * Slow Machine::                You feel like buying a faster machine.
912
913 Gnus Reference Guide
914
915 * Gnus Utility Functions::      Common functions and variable to use.
916 * Back End Interface::          How Gnus communicates with the servers.
917 * Score File Syntax::           A BNF definition of the score file standard.
918 * Headers::                     How Gnus stores headers internally.
919 * Ranges::                      A handy format for storing mucho numbers.
920 * Group Info::                  The group info format.
921 * Extended Interactive::        Symbolic prefixes and stuff.
922 * Emacs/XEmacs Code::           Gnus can be run under all modern Emacsen.
923 * Various File Formats::        Formats of files that Gnus use.
924
925 Back End Interface
926
927 * Required Back End Functions::  Functions that must be implemented.
928 * Optional Back End Functions::  Functions that need not be implemented.
929 * Error Messaging::             How to get messages and report errors.
930 * Writing New Back Ends::       Extending old back ends.
931 * Hooking New Back Ends Into Gnus::  What has to be done on the Gnus end.
932 * Mail-like Back Ends::         Some tips on mail back ends.
933
934 Various File Formats
935
936 * Active File Format::          Information on articles and groups available.
937 * Newsgroups File Format::      Group descriptions.
938
939 Emacs for Heathens
940
941 * Keystrokes::                  Entering text and executing commands.
942 * Emacs Lisp::                  The built-in Emacs programming language.
943
944 @end detailmenu
945 @end menu
946
947 @node Starting Up
948 @chapter Starting Gnus
949 @cindex starting up
950
951 If you haven't used Emacs much before using Gnus, read @ref{Emacs for
952 Heathens} first.
953
954 @kindex M-x gnus
955 @findex gnus
956 If your system administrator has set things up properly, starting Gnus
957 and reading news is extremely easy---you just type @kbd{M-x gnus} in
958 your Emacs.  If not, you should customize the variable
959 @code{gnus-select-method} as described in @ref{Finding the News}.  For a
960 minimal setup for posting should also customize the variables
961 @code{user-full-name} and @code{user-mail-address}.
962
963 @findex gnus-other-frame
964 @kindex M-x gnus-other-frame
965 If you want to start Gnus in a different frame, you can use the command
966 @kbd{M-x gnus-other-frame} instead.
967
968 If things do not go smoothly at startup, you have to twiddle some
969 variables in your @file{~/.gnus.el} file.  This file is similar to
970 @file{~/.emacs}, but is read when Gnus starts.
971
972 If you puzzle at any terms used in this manual, please refer to the
973 terminology section (@pxref{Terminology}).
974
975 @menu
976 * Finding the News::      Choosing a method for getting news.
977 * The Server is Down::    How can I read my mail then?
978 * Slave Gnusae::          You can have more than one Gnus active at a time.
979 * New Groups::            What is Gnus supposed to do with new groups?
980 * Changing Servers::      You may want to move from one server to another.
981 * Startup Files::         Those pesky startup files---@file{.newsrc}.
982 * Auto Save::             Recovering from a crash.
983 * The Active File::       Reading the active file over a slow line Takes Time.
984 * Startup Variables::     Other variables you might change.
985 @end menu
986
987
988 @node Finding the News
989 @section Finding the News
990 @cindex finding news
991
992 First of all, you should know that there is a special buffer called
993 @code{*Server*} that lists all the servers Gnus knows about.  You can
994 press @kbd{^} from the Group buffer to see it.  In the Server buffer,
995 you can press @kbd{RET} on a defined server to see all the groups it
996 serves (subscribed or not!).  You can also add or delete servers, edit
997 a foreign server's definition, agentize or de-agentize a server, and
998 do many other neat things.  @xref{Server Buffer}.  
999 @xref{Foreign Groups}.  @xref{Agent Basics}.
1000
1001 @vindex gnus-select-method
1002 @c @head
1003 The @code{gnus-select-method} variable says where Gnus should look for
1004 news.  This variable should be a list where the first element says
1005 @dfn{how} and the second element says @dfn{where}.  This method is your
1006 native method.  All groups not fetched with this method are
1007 foreign groups.
1008
1009 For instance, if the @samp{news.somewhere.edu} @acronym{NNTP} server is where
1010 you want to get your daily dosage of news from, you'd say:
1011
1012 @lisp
1013 (setq gnus-select-method '(nntp "news.somewhere.edu"))
1014 @end lisp
1015
1016 If you want to read directly from the local spool, say:
1017
1018 @lisp
1019 (setq gnus-select-method '(nnspool ""))
1020 @end lisp
1021
1022 If you can use a local spool, you probably should, as it will almost
1023 certainly be much faster.  But do not use the local spool if your
1024 server is running Leafnode (which is a simple, standalone private news
1025 server); in this case, use @code{(nntp "localhost")}.
1026
1027 @vindex gnus-nntpserver-file
1028 @cindex NNTPSERVER
1029 @cindex @acronym{NNTP} server
1030 If this variable is not set, Gnus will take a look at the
1031 @env{NNTPSERVER} environment variable.  If that variable isn't set,
1032 Gnus will see whether @code{gnus-nntpserver-file}
1033 (@file{/etc/nntpserver} by default) has any opinions on the matter.
1034 If that fails as well, Gnus will try to use the machine running Emacs
1035 as an @acronym{NNTP} server.  That's a long shot, though.
1036
1037 @findex gnus-group-browse-foreign-server
1038 @kindex B (Group)
1039 However, if you use one @acronym{NNTP} server regularly and are just
1040 interested in a couple of groups from a different server, you would be
1041 better served by using the @kbd{B} command in the group buffer.  It will
1042 let you have a look at what groups are available, and you can subscribe
1043 to any of the groups you want to.  This also makes @file{.newsrc}
1044 maintenance much tidier.  @xref{Foreign Groups}.
1045
1046 @vindex gnus-secondary-select-methods
1047 @c @head
1048 A slightly different approach to foreign groups is to set the
1049 @code{gnus-secondary-select-methods} variable.  The select methods
1050 listed in this variable are in many ways just as native as the
1051 @code{gnus-select-method} server.  They will also be queried for active
1052 files during startup (if that's required), and new newsgroups that
1053 appear on these servers will be subscribed (or not) just as native
1054 groups are.
1055
1056 For instance, if you use the @code{nnmbox} back end to read your mail,
1057 you would typically set this variable to
1058
1059 @lisp
1060 (setq gnus-secondary-select-methods '((nnmbox "")))
1061 @end lisp
1062
1063 Note: the @acronym{NNTP} back end stores marks in marks files
1064 (@pxref{NNTP marks}).  This feature makes it easy to share marks between
1065 several Gnus installations, but may slow down things a bit when fetching
1066 new articles.  @xref{NNTP marks}, for more information.
1067
1068
1069 @node The Server is Down
1070 @section The Server is Down
1071 @cindex server errors
1072
1073 If the default server is down, Gnus will understandably have some
1074 problems starting.  However, if you have some mail groups in addition to
1075 the news groups, you may want to start Gnus anyway.
1076
1077 Gnus, being the trusting sort of program, will ask whether to proceed
1078 without a native select method if that server can't be contacted.  This
1079 will happen whether the server doesn't actually exist (i.e., you have
1080 given the wrong address) or the server has just momentarily taken ill
1081 for some reason or other.  If you decide to continue and have no foreign
1082 groups, you'll find it difficult to actually do anything in the group
1083 buffer.  But, hey, that's your problem.  Blllrph!
1084
1085 @findex gnus-no-server
1086 @kindex M-x gnus-no-server
1087 @c @head
1088 If you know that the server is definitely down, or you just want to read
1089 your mail without bothering with the server at all, you can use the
1090 @code{gnus-no-server} command to start Gnus.  That might come in handy
1091 if you're in a hurry as well.  This command will not attempt to contact
1092 your primary server---instead, it will just activate all groups on level
1093 1 and 2.  (You should preferably keep no native groups on those two
1094 levels.) Also @pxref{Group Levels}.
1095
1096
1097 @node Slave Gnusae
1098 @section Slave Gnusae
1099 @cindex slave
1100
1101 You might want to run more than one Emacs with more than one Gnus at the
1102 same time.  If you are using different @file{.newsrc} files (e.g., if you
1103 are using the two different Gnusae to read from two different servers),
1104 that is no problem whatsoever.  You just do it.
1105
1106 The problem appears when you want to run two Gnusae that use the same
1107 @file{.newsrc} file.
1108
1109 To work around that problem some, we here at the Think-Tank at the Gnus
1110 Towers have come up with a new concept: @dfn{Masters} and
1111 @dfn{slaves}.  (We have applied for a patent on this concept, and have
1112 taken out a copyright on those words.  If you wish to use those words in
1113 conjunction with each other, you have to send $1 per usage instance to
1114 me.  Usage of the patent (@dfn{Master/Slave Relationships In Computer
1115 Applications}) will be much more expensive, of course.)
1116
1117 @findex gnus-slave
1118 Anyway, you start one Gnus up the normal way with @kbd{M-x gnus} (or
1119 however you do it).  Each subsequent slave Gnusae should be started with
1120 @kbd{M-x gnus-slave}.  These slaves won't save normal @file{.newsrc}
1121 files, but instead save @dfn{slave files} that contain information only
1122 on what groups have been read in the slave session.  When a master Gnus
1123 starts, it will read (and delete) these slave files, incorporating all
1124 information from them.  (The slave files will be read in the sequence
1125 they were created, so the latest changes will have precedence.)
1126
1127 Information from the slave files has, of course, precedence over the
1128 information in the normal (i.e., master) @file{.newsrc} file.
1129
1130 If the @file{.newsrc*} files have not been saved in the master when the
1131 slave starts, you may be prompted as to whether to read an auto-save
1132 file.  If you answer ``yes'', the unsaved changes to the master will be
1133 incorporated into the slave.  If you answer ``no'', the slave may see some
1134 messages as unread that have been read in the master.
1135
1136
1137
1138 @node New Groups
1139 @section New Groups
1140 @cindex new groups
1141 @cindex subscription
1142
1143 @vindex gnus-check-new-newsgroups
1144 If you are satisfied that you really never want to see any new groups,
1145 you can set @code{gnus-check-new-newsgroups} to @code{nil}.  This will
1146 also save you some time at startup.  Even if this variable is
1147 @code{nil}, you can always subscribe to the new groups just by pressing
1148 @kbd{U} in the group buffer (@pxref{Group Maintenance}).  This variable
1149 is @code{ask-server} by default.  If you set this variable to
1150 @code{always}, then Gnus will query the back ends for new groups even
1151 when you do the @kbd{g} command (@pxref{Scanning New Messages}).
1152
1153 @menu
1154 * Checking New Groups::         Determining what groups are new.
1155 * Subscription Methods::        What Gnus should do with new groups.
1156 * Filtering New Groups::        Making Gnus ignore certain new groups.
1157 @end menu
1158
1159
1160 @node Checking New Groups
1161 @subsection Checking New Groups
1162
1163 Gnus normally determines whether a group is new or not by comparing the
1164 list of groups from the active file(s) with the lists of subscribed and
1165 dead groups.  This isn't a particularly fast method.  If
1166 @code{gnus-check-new-newsgroups} is @code{ask-server}, Gnus will ask the
1167 server for new groups since the last time.  This is both faster and
1168 cheaper.  This also means that you can get rid of the list of killed
1169 groups altogether, so you may set @code{gnus-save-killed-list} to
1170 @code{nil}, which will save time both at startup, at exit, and all over.
1171 Saves disk space, too.  Why isn't this the default, then?
1172 Unfortunately, not all servers support this command.
1173
1174 I bet I know what you're thinking now: How do I find out whether my
1175 server supports @code{ask-server}?  No?  Good, because I don't have a
1176 fail-safe answer.  I would suggest just setting this variable to
1177 @code{ask-server} and see whether any new groups appear within the next
1178 few days.  If any do, then it works.  If none do, then it doesn't
1179 work.  I could write a function to make Gnus guess whether the server
1180 supports @code{ask-server}, but it would just be a guess.  So I won't.
1181 You could @code{telnet} to the server and say @code{HELP} and see
1182 whether it lists @samp{NEWGROUPS} among the commands it understands.  If
1183 it does, then it might work.  (But there are servers that lists
1184 @samp{NEWGROUPS} without supporting the function properly.)
1185
1186 This variable can also be a list of select methods.  If so, Gnus will
1187 issue an @code{ask-server} command to each of the select methods, and
1188 subscribe them (or not) using the normal methods.  This might be handy
1189 if you are monitoring a few servers for new groups.  A side effect is
1190 that startup will take much longer, so you can meditate while waiting.
1191 Use the mantra ``dingnusdingnusdingnus'' to achieve permanent bliss.
1192
1193
1194 @node Subscription Methods
1195 @subsection Subscription Methods
1196
1197 @vindex gnus-subscribe-newsgroup-method
1198 What Gnus does when it encounters a new group is determined by the
1199 @code{gnus-subscribe-newsgroup-method} variable.
1200
1201 This variable should contain a function.  This function will be called
1202 with the name of the new group as the only parameter.
1203
1204 Some handy pre-fab functions are:
1205
1206 @table @code
1207
1208 @item gnus-subscribe-zombies
1209 @vindex gnus-subscribe-zombies
1210 Make all new groups zombies.  This is the default.  You can browse the
1211 zombies later (with @kbd{A z}) and either kill them all off properly
1212 (with @kbd{S z}), or subscribe to them (with @kbd{u}).
1213
1214 @item gnus-subscribe-randomly
1215 @vindex gnus-subscribe-randomly
1216 Subscribe all new groups in arbitrary order.  This really means that all
1217 new groups will be added at ``the top'' of the group buffer.
1218
1219 @item gnus-subscribe-alphabetically
1220 @vindex gnus-subscribe-alphabetically
1221 Subscribe all new groups in alphabetical order.
1222
1223 @item gnus-subscribe-hierarchically
1224 @vindex gnus-subscribe-hierarchically
1225 Subscribe all new groups hierarchically.  The difference between this
1226 function and @code{gnus-subscribe-alphabetically} is slight.
1227 @code{gnus-subscribe-alphabetically} will subscribe new groups in a strictly
1228 alphabetical fashion, while this function will enter groups into its
1229 hierarchy.  So if you want to have the @samp{rec} hierarchy before the
1230 @samp{comp} hierarchy, this function will not mess that configuration
1231 up.  Or something like that.
1232
1233 @item gnus-subscribe-interactively
1234 @vindex gnus-subscribe-interactively
1235 Subscribe new groups interactively.  This means that Gnus will ask
1236 you about @strong{all} new groups.  The groups you choose to subscribe
1237 to will be subscribed hierarchically.
1238
1239 @item gnus-subscribe-killed
1240 @vindex gnus-subscribe-killed
1241 Kill all new groups.
1242
1243 @item gnus-subscribe-topics
1244 @vindex gnus-subscribe-topics
1245 Put the groups into the topic that has a matching @code{subscribe} topic
1246 parameter (@pxref{Topic Parameters}).  For instance, a @code{subscribe}
1247 topic parameter that looks like
1248
1249 @example
1250 "nnml"
1251 @end example
1252
1253 will mean that all groups that match that regex will be subscribed under
1254 that topic.
1255
1256 If no topics match the groups, the groups will be subscribed in the
1257 top-level topic.
1258
1259 @end table
1260
1261 @vindex gnus-subscribe-hierarchical-interactive
1262 A closely related variable is
1263 @code{gnus-subscribe-hierarchical-interactive}.  (That's quite a
1264 mouthful.)  If this variable is non-@code{nil}, Gnus will ask you in a
1265 hierarchical fashion whether to subscribe to new groups or not.  Gnus
1266 will ask you for each sub-hierarchy whether you want to descend the
1267 hierarchy or not.
1268
1269 One common mistake is to set the variable a few paragraphs above
1270 (@code{gnus-subscribe-newsgroup-method}) to
1271 @code{gnus-subscribe-hierarchical-interactive}.  This is an error.  This
1272 will not work.  This is ga-ga.  So don't do it.
1273
1274
1275 @node Filtering New Groups
1276 @subsection Filtering New Groups
1277
1278 A nice and portable way to control which new newsgroups should be
1279 subscribed (or ignored) is to put an @dfn{options} line at the start of
1280 the @file{.newsrc} file.  Here's an example:
1281
1282 @example
1283 options -n !alt.all !rec.all sci.all
1284 @end example
1285
1286 @vindex gnus-subscribe-options-newsgroup-method
1287 This line obviously belongs to a serious-minded intellectual scientific
1288 person (or she may just be plain old boring), because it says that all
1289 groups that have names beginning with @samp{alt} and @samp{rec} should
1290 be ignored, and all groups with names beginning with @samp{sci} should
1291 be subscribed.  Gnus will not use the normal subscription method for
1292 subscribing these groups.
1293 @code{gnus-subscribe-options-newsgroup-method} is used instead.  This
1294 variable defaults to @code{gnus-subscribe-alphabetically}.
1295
1296 @vindex gnus-options-not-subscribe
1297 @vindex gnus-options-subscribe
1298 If you don't want to mess with your @file{.newsrc} file, you can just
1299 set the two variables @code{gnus-options-subscribe} and
1300 @code{gnus-options-not-subscribe}.  These two variables do exactly the
1301 same as the @file{.newsrc} @samp{options -n} trick.  Both are regexps,
1302 and if the new group matches the former, it will be unconditionally
1303 subscribed, and if it matches the latter, it will be ignored.
1304
1305 @vindex gnus-auto-subscribed-groups
1306 Yet another variable that meddles here is
1307 @code{gnus-auto-subscribed-groups}.  It works exactly like
1308 @code{gnus-options-subscribe}, and is therefore really superfluous,
1309 but I thought it would be nice to have two of these.  This variable is
1310 more meant for setting some ground rules, while the other variable is
1311 used more for user fiddling.  By default this variable makes all new
1312 groups that come from mail back ends (@code{nnml}, @code{nnbabyl},
1313 @code{nnfolder}, @code{nnmbox}, @code{nnmh}, @code{nnimap}, and
1314 @code{nnmaildir}) subscribed.  If you don't like that, just set this
1315 variable to @code{nil}.
1316
1317 @vindex gnus-auto-subscribed-categories
1318 As if that wasn't enough, @code{gnus-auto-subscribed-categories} also
1319 allows you to specify that new groups should be subcribed based on the
1320 category their select methods belong to.  The default is @samp{(mail
1321 post-mail)}, meaning that all new groups from mail-like backends
1322 should be subscribed automatically.
1323
1324 New groups that match these variables are subscribed using
1325 @code{gnus-subscribe-options-newsgroup-method}.
1326
1327
1328 @node Changing Servers
1329 @section Changing Servers
1330 @cindex changing servers
1331
1332 Sometimes it is necessary to move from one @acronym{NNTP} server to another.
1333 This happens very rarely, but perhaps you change jobs, or one server is
1334 very flaky and you want to use another.
1335
1336 Changing the server is pretty easy, right?  You just change
1337 @code{gnus-select-method} to point to the new server?
1338
1339 @emph{Wrong!}
1340
1341 Article numbers are not (in any way) kept synchronized between different
1342 @acronym{NNTP} servers, and the only way Gnus keeps track of what articles
1343 you have read is by keeping track of article numbers.  So when you
1344 change @code{gnus-select-method}, your @file{.newsrc} file becomes
1345 worthless.
1346
1347 @kindex M-x gnus-group-clear-data-on-native-groups
1348 @findex gnus-group-clear-data-on-native-groups
1349 You can use the @kbd{M-x gnus-group-clear-data-on-native-groups}
1350 command to clear out all data that you have on your native groups.
1351 Use with caution.
1352
1353 @kindex M-x gnus-group-clear-data
1354 @findex gnus-group-clear-data
1355 Clear the data from the current group only---nix out marks and the
1356 list of read articles (@code{gnus-group-clear-data}).
1357
1358 After changing servers, you @strong{must} move the cache hierarchy away,
1359 since the cached articles will have wrong article numbers, which will
1360 affect which articles Gnus thinks are read.
1361 @code{gnus-group-clear-data-on-native-groups} will ask you if you want
1362 to have it done automatically; for @code{gnus-group-clear-data}, you
1363 can use @kbd{M-x gnus-cache-move-cache} (but beware, it will move the
1364 cache for all groups).
1365
1366
1367 @node Startup Files
1368 @section Startup Files
1369 @cindex startup files
1370 @cindex .newsrc
1371 @cindex .newsrc.el
1372 @cindex .newsrc.eld
1373
1374 Most common Unix news readers use a shared startup file called
1375 @file{.newsrc}.  This file contains all the information about what
1376 groups are subscribed, and which articles in these groups have been
1377 read.
1378
1379 Things got a bit more complicated with @sc{gnus}.  In addition to
1380 keeping the @file{.newsrc} file updated, it also used a file called
1381 @file{.newsrc.el} for storing all the information that didn't fit into
1382 the @file{.newsrc} file.  (Actually, it also duplicated everything in
1383 the @file{.newsrc} file.)  @sc{gnus} would read whichever one of these
1384 files was the most recently saved, which enabled people to swap between
1385 @sc{gnus} and other newsreaders.
1386
1387 That was kinda silly, so Gnus went one better: In addition to the
1388 @file{.newsrc} and @file{.newsrc.el} files, Gnus also has a file called
1389 @file{.newsrc.eld}.  It will read whichever of these files that are most
1390 recent, but it will never write a @file{.newsrc.el} file.  You should
1391 never delete the @file{.newsrc.eld} file---it contains much information
1392 not stored in the @file{.newsrc} file.
1393
1394 @vindex gnus-save-newsrc-file
1395 @vindex gnus-read-newsrc-file
1396 You can turn off writing the @file{.newsrc} file by setting
1397 @code{gnus-save-newsrc-file} to @code{nil}, which means you can delete
1398 the file and save some space, as well as exiting from Gnus faster.
1399 However, this will make it impossible to use other newsreaders than
1400 Gnus.  But hey, who would want to, right?  Similarly, setting
1401 @code{gnus-read-newsrc-file} to @code{nil} makes Gnus ignore the
1402 @file{.newsrc} file and any @file{.newsrc-SERVER} files, which can be
1403 convenient if you use a different news reader occasionally, and you
1404 want to read a different subset of the available groups with that
1405 news reader.
1406
1407 @vindex gnus-save-killed-list
1408 If @code{gnus-save-killed-list} (default @code{t}) is @code{nil}, Gnus
1409 will not save the list of killed groups to the startup file.  This will
1410 save both time (when starting and quitting) and space (on disk).  It
1411 will also mean that Gnus has no record of what groups are new or old,
1412 so the automatic new groups subscription methods become meaningless.
1413 You should always set @code{gnus-check-new-newsgroups} to @code{nil} or
1414 @code{ask-server} if you set this variable to @code{nil} (@pxref{New
1415 Groups}).  This variable can also be a regular expression.  If that's
1416 the case, remove all groups that do not match this regexp before
1417 saving.  This can be useful in certain obscure situations that involve
1418 several servers where not all servers support @code{ask-server}.
1419
1420 @vindex gnus-startup-file
1421 @vindex gnus-backup-startup-file
1422 @vindex version-control
1423 The @code{gnus-startup-file} variable says where the startup files are.
1424 The default value is @file{~/.newsrc}, with the Gnus (El Dingo) startup
1425 file being whatever that one is, with a @samp{.eld} appended.
1426 If you want version control for this file, set
1427 @code{gnus-backup-startup-file}.  It respects the same values as the
1428 @code{version-control} variable.
1429
1430 @vindex gnus-save-newsrc-hook
1431 @vindex gnus-save-quick-newsrc-hook
1432 @vindex gnus-save-standard-newsrc-hook
1433 @code{gnus-save-newsrc-hook} is called before saving any of the newsrc
1434 files, while @code{gnus-save-quick-newsrc-hook} is called just before
1435 saving the @file{.newsrc.eld} file, and
1436 @code{gnus-save-standard-newsrc-hook} is called just before saving the
1437 @file{.newsrc} file.  The latter two are commonly used to turn version
1438 control on or off.  Version control is on by default when saving the
1439 startup files.  If you want to turn backup creation off, say something like:
1440
1441 @lisp
1442 (defun turn-off-backup ()
1443   (set (make-local-variable 'backup-inhibited) t))
1444
1445 (add-hook 'gnus-save-quick-newsrc-hook 'turn-off-backup)
1446 (add-hook 'gnus-save-standard-newsrc-hook 'turn-off-backup)
1447 @end lisp
1448
1449 @vindex gnus-init-file
1450 @vindex gnus-site-init-file
1451 When Gnus starts, it will read the @code{gnus-site-init-file}
1452 (@file{.../site-lisp/gnus-init} by default) and @code{gnus-init-file}
1453 (@file{~/.gnus} by default) files.  These are normal Emacs Lisp files
1454 and can be used to avoid cluttering your @file{~/.emacs} and
1455 @file{site-init} files with Gnus stuff.  Gnus will also check for files
1456 with the same names as these, but with @file{.elc} and @file{.el}
1457 suffixes.  In other words, if you have set @code{gnus-init-file} to
1458 @file{~/.gnus}, it will look for @file{~/.gnus.elc}, @file{~/.gnus.el},
1459 and finally @file{~/.gnus} (in this order).  If Emacs was invoked with
1460 the @option{-q} or @option{--no-init-file} options (@pxref{Initial
1461 Options, ,Initial Options, emacs, The Emacs Manual}), Gnus doesn't read
1462 @code{gnus-init-file}.
1463
1464
1465 @node Auto Save
1466 @section Auto Save
1467 @cindex dribble file
1468 @cindex auto-save
1469
1470 Whenever you do something that changes the Gnus data (reading articles,
1471 catching up, killing/subscribing groups), the change is added to a
1472 special @dfn{dribble buffer}.  This buffer is auto-saved the normal
1473 Emacs way.  If your Emacs should crash before you have saved the
1474 @file{.newsrc} files, all changes you have made can be recovered from
1475 this file.
1476
1477 If Gnus detects this file at startup, it will ask the user whether to
1478 read it.  The auto save file is deleted whenever the real startup file is
1479 saved.
1480
1481 @vindex gnus-use-dribble-file
1482 If @code{gnus-use-dribble-file} is @code{nil}, Gnus won't create and
1483 maintain a dribble buffer.  The default is @code{t}.
1484
1485 @vindex gnus-dribble-directory
1486 Gnus will put the dribble file(s) in @code{gnus-dribble-directory}.  If
1487 this variable is @code{nil}, which it is by default, Gnus will dribble
1488 into the directory where the @file{.newsrc} file is located.  (This is
1489 normally the user's home directory.)  The dribble file will get the same
1490 file permissions as the @file{.newsrc} file.
1491
1492 @vindex gnus-always-read-dribble-file
1493 If @code{gnus-always-read-dribble-file} is non-@code{nil}, Gnus will
1494 read the dribble file on startup without querying the user.
1495
1496
1497 @node The Active File
1498 @section The Active File
1499 @cindex active file
1500 @cindex ignored groups
1501
1502 When Gnus starts, or indeed whenever it tries to determine whether new
1503 articles have arrived, it reads the active file.  This is a very large
1504 file that lists all the active groups and articles on the server.
1505
1506 @vindex gnus-ignored-newsgroups
1507 Before examining the active file, Gnus deletes all lines that match the
1508 regexp @code{gnus-ignored-newsgroups}.  This is done primarily to reject
1509 any groups with bogus names, but you can use this variable to make Gnus
1510 ignore hierarchies you aren't ever interested in.  However, this is not
1511 recommended.  In fact, it's highly discouraged.  Instead, @pxref{New
1512 Groups} for an overview of other variables that can be used instead.
1513
1514 @c This variable is
1515 @c @code{nil} by default, and will slow down active file handling somewhat
1516 @c if you set it to anything else.
1517
1518 @vindex gnus-read-active-file
1519 @c @head
1520 The active file can be rather Huge, so if you have a slow network, you
1521 can set @code{gnus-read-active-file} to @code{nil} to prevent Gnus from
1522 reading the active file.  This variable is @code{some} by default.
1523
1524 Gnus will try to make do by getting information just on the groups that
1525 you actually subscribe to.
1526
1527 Note that if you subscribe to lots and lots of groups, setting this
1528 variable to @code{nil} will probably make Gnus slower, not faster.  At
1529 present, having this variable @code{nil} will slow Gnus down
1530 considerably, unless you read news over a 2400 baud modem.
1531
1532 This variable can also have the value @code{some}.  Gnus will then
1533 attempt to read active info only on the subscribed groups.  On some
1534 servers this is quite fast (on sparkling, brand new INN servers that
1535 support the @code{LIST ACTIVE group} command), on others this isn't fast
1536 at all.  In any case, @code{some} should be faster than @code{nil}, and
1537 is certainly faster than @code{t} over slow lines.
1538
1539 Some news servers (old versions of Leafnode and old versions of INN, for
1540 instance) do not support the @code{LIST ACTIVE group}.  For these
1541 servers, @code{nil} is probably the most efficient value for this
1542 variable.
1543
1544 If this variable is @code{nil}, Gnus will ask for group info in total
1545 lock-step, which isn't very fast.  If it is @code{some} and you use an
1546 @acronym{NNTP} server, Gnus will pump out commands as fast as it can, and
1547 read all the replies in one swoop.  This will normally result in better
1548 performance, but if the server does not support the aforementioned
1549 @code{LIST ACTIVE group} command, this isn't very nice to the server.
1550
1551 If you think that starting up Gnus takes too long, try all the three
1552 different values for this variable and see what works best for you.
1553
1554 In any case, if you use @code{some} or @code{nil}, you should definitely
1555 kill all groups that you aren't interested in to speed things up.
1556
1557 Note that this variable also affects active file retrieval from
1558 secondary select methods.
1559
1560
1561 @node Startup Variables
1562 @section Startup Variables
1563
1564 @table @code
1565
1566 @item gnus-load-hook
1567 @vindex gnus-load-hook
1568 A hook run while Gnus is being loaded.  Note that this hook will
1569 normally be run just once in each Emacs session, no matter how many
1570 times you start Gnus.
1571
1572 @item gnus-before-startup-hook
1573 @vindex gnus-before-startup-hook
1574 A hook called as the first thing when Gnus is started.
1575
1576 @item gnus-startup-hook
1577 @vindex gnus-startup-hook
1578 A hook run as the very last thing after starting up Gnus
1579
1580 @item gnus-started-hook
1581 @vindex gnus-started-hook
1582 A hook that is run as the very last thing after starting up Gnus
1583 successfully.
1584
1585 @item gnus-setup-news-hook
1586 @vindex gnus-setup-news-hook
1587 A hook that is run after reading the @file{.newsrc} file(s), but before
1588 generating the group buffer.
1589
1590 @item gnus-check-bogus-newsgroups
1591 @vindex gnus-check-bogus-newsgroups
1592 If non-@code{nil}, Gnus will check for and delete all bogus groups at
1593 startup.  A @dfn{bogus group} is a group that you have in your
1594 @file{.newsrc} file, but doesn't exist on the news server.  Checking for
1595 bogus groups can take quite a while, so to save time and resources it's
1596 best to leave this option off, and do the checking for bogus groups once
1597 in a while from the group buffer instead (@pxref{Group Maintenance}).
1598
1599 @item gnus-inhibit-startup-message
1600 @vindex gnus-inhibit-startup-message
1601 If non-@code{nil}, the startup message won't be displayed.  That way,
1602 your boss might not notice as easily that you are reading news instead
1603 of doing your job.  Note that this variable is used before
1604 @file{~/.gnus.el} is loaded, so it should be set in @file{.emacs} instead.
1605
1606 @item gnus-no-groups-message
1607 @vindex gnus-no-groups-message
1608 Message displayed by Gnus when no groups are available.
1609
1610 @item gnus-use-backend-marks
1611 @vindex gnus-use-backend-marks
1612 If non-@code{nil}, Gnus will store article marks both in the
1613 @file{.newsrc.eld} file and in the backends.  This will slow down
1614 group operation some.
1615
1616 @end table
1617
1618
1619 @node Group Buffer
1620 @chapter Group Buffer
1621 @cindex group buffer
1622
1623 @c Alex Schroeder suggests to rearrange this as follows:
1624 @c
1625 @c <kensanata> ok, just save it for reference.  I'll go to bed in a minute.
1626 @c   1. Selecting a Group, 2. (new) Finding a Group, 3. Group Levels,
1627 @c   4. Subscription Commands, 5. Group Maneuvering, 6. Group Data,
1628 @c   7. Group Score, 8. Group Buffer Format
1629 @c <kensanata> Group Levels should have more information on levels 5 to 9.  I
1630 @c   suggest to split the 4th paragraph ("Gnus considers groups...") as follows:
1631 @c <kensanata> First, "Gnus considers groups... (default 9)."
1632 @c <kensanata> New, a table summarizing what levels 1 to 9 mean.
1633 @c <kensanata> Third, "Gnus treats subscribed ... reasons of efficiency"
1634 @c <kensanata> Then expand the next paragraph or add some more to it.
1635 @c    This short one sentence explains levels 1 and 2, therefore I understand
1636 @c    that I should keep important news at 3 and boring news at 4.
1637 @c    Say so!  Then go on to explain why I should bother with levels 6 to 9.
1638 @c    Maybe keep those that you don't want to read temporarily at 6,
1639 @c    those that you never want to read at 8, those that offend your
1640 @c    human rights at 9...
1641
1642
1643 The @dfn{group buffer} lists all (or parts) of the available groups.  It
1644 is the first buffer shown when Gnus starts, and will never be killed as
1645 long as Gnus is active.
1646
1647 @iftex
1648 @iflatex
1649 \gnusfigure{The Group Buffer}{320}{
1650 \put(75,50){\epsfig{figure=ps/group,height=9cm}}
1651 \put(120,37){\makebox(0,0)[t]{Buffer name}}
1652 \put(120,38){\vector(1,2){10}}
1653 \put(40,60){\makebox(0,0)[r]{Mode line}}
1654 \put(40,58){\vector(1,0){30}}
1655 \put(200,28){\makebox(0,0)[t]{Native select method}}
1656 \put(200,26){\vector(-1,2){15}}
1657 }
1658 @end iflatex
1659 @end iftex
1660
1661 @menu
1662 * Group Buffer Format::         Information listed and how you can change it.
1663 * Group Maneuvering::           Commands for moving in the group buffer.
1664 * Selecting a Group::           Actually reading news.
1665 * Subscription Commands::       Unsubscribing, killing, subscribing.
1666 * Group Data::                  Changing the info for a group.
1667 * Group Levels::                Levels? What are those, then?
1668 * Group Score::                 A mechanism for finding out what groups you like.
1669 * Marking Groups::              You can mark groups for later processing.
1670 * Foreign Groups::              Creating and editing groups.
1671 * Group Parameters::            Each group may have different parameters set.
1672 * Listing Groups::              Gnus can list various subsets of the groups.
1673 * Sorting Groups::              Re-arrange the group order.
1674 * Group Maintenance::           Maintaining a tidy @file{.newsrc} file.
1675 * Browse Foreign Server::       You can browse a server.  See what it has to offer.
1676 * Exiting Gnus::                Stop reading news and get some work done.
1677 * Group Topics::                A folding group mode divided into topics.
1678 * Non-ASCII Group Names::       Accessing groups of non-English names.
1679 * Misc Group Stuff::            Other stuff that you can to do.
1680 @end menu
1681
1682
1683 @node Group Buffer Format
1684 @section Group Buffer Format
1685
1686 @menu
1687 * Group Line Specification::    Deciding how the group buffer is to look.
1688 * Group Mode Line Specification::  The group buffer mode line.
1689 * Group Highlighting::          Having nice colors in the group buffer.
1690 @end menu
1691
1692 You can customize the Group Mode tool bar, see @kbd{M-x
1693 customize-apropos RET gnus-group-tool-bar}.  This feature is only
1694 available in Emacs.
1695
1696 The tool bar icons are now (de)activated correctly depending on the
1697 cursor position.  Therefore, moving around in the Group Buffer is
1698 slower.  You can disable this via the variable
1699 @code{gnus-group-update-tool-bar}.  Its default value depends on your
1700 Emacs version.
1701
1702 @node Group Line Specification
1703 @subsection Group Line Specification
1704 @cindex group buffer format
1705
1706 The default format of the group buffer is nice and dull, but you can
1707 make it as exciting and ugly as you feel like.
1708
1709 Here's a couple of example group lines:
1710
1711 @example
1712      25: news.announce.newusers
1713  *    0: alt.fan.andrea-dworkin
1714 @end example
1715
1716 Quite simple, huh?
1717
1718 You can see that there are 25 unread articles in
1719 @samp{news.announce.newusers}.  There are no unread articles, but some
1720 ticked articles, in @samp{alt.fan.andrea-dworkin} (see that little
1721 asterisk at the beginning of the line?).
1722
1723 @vindex gnus-group-line-format
1724 You can change that format to whatever you want by fiddling with the
1725 @code{gnus-group-line-format} variable.  This variable works along the
1726 lines of a @code{format} specification, which is pretty much the same as
1727 a @code{printf} specifications, for those of you who use (feh!) C.
1728 @xref{Formatting Variables}.
1729
1730 @samp{%M%S%5y:%B%(%g%)\n} is the value that produced those lines above.
1731
1732 There should always be a colon on the line; the cursor always moves to
1733 the colon after performing an operation.  @xref{Positioning
1734 Point}.  Nothing else is required---not even the group name.  All
1735 displayed text is just window dressing, and is never examined by Gnus.
1736 Gnus stores all real information it needs using text properties.
1737
1738 (Note that if you make a really strange, wonderful, spreadsheet-like
1739 layout, everybody will believe you are hard at work with the accounting
1740 instead of wasting time reading news.)
1741
1742 Here's a list of all available format characters:
1743
1744 @table @samp
1745
1746 @item M
1747 An asterisk if the group only has marked articles.
1748
1749 @item S
1750 Whether the group is subscribed.
1751
1752 @item L
1753 Level of subscribedness.
1754
1755 @item N
1756 Number of unread articles.
1757
1758 @item I
1759 Number of dormant articles.
1760
1761 @item T
1762 Number of ticked articles.
1763
1764 @item R
1765 Number of read articles.
1766
1767 @item U
1768 Number of unseen articles.
1769
1770 @item t
1771 Estimated total number of articles.  (This is really @var{max-number}
1772 minus @var{min-number} plus 1.)
1773
1774 Gnus uses this estimation because the @acronym{NNTP} protocol provides
1775 efficient access to @var{max-number} and @var{min-number} but getting
1776 the true unread message count is not possible efficiently.  For
1777 hysterical raisins, even the mail back ends, where the true number of
1778 unread messages might be available efficiently, use the same limited
1779 interface.  To remove this restriction from Gnus means that the back
1780 end interface has to be changed, which is not an easy job.
1781
1782 The nnml backend (@pxref{Mail Spool}) has a feature called ``group
1783 compaction'' which circumvents this deficiency: the idea is to
1784 renumber all articles from 1, removing all gaps between numbers, hence
1785 getting a correct total count.  Other backends may support this in the
1786 future.  In order to keep your total article count relatively up to
1787 date, you might want to compact your groups (or even directly your
1788 server) from time to time. @xref{Misc Group Stuff}, @xref{Server Commands}.
1789
1790 @item y
1791 Number of unread, unticked, non-dormant articles.
1792
1793 @item i
1794 Number of ticked and dormant articles.
1795
1796 @item g
1797 Full group name.
1798
1799 @item G
1800 Group name.
1801
1802 @item C
1803 Group comment (@pxref{Group Parameters}) or group name if there is no
1804 comment element in the group parameters.
1805
1806 @item D
1807 Newsgroup description.  You need to read the group descriptions
1808 before these will appear, and to do that, you either have to set
1809 @code{gnus-read-active-file} or use the group buffer @kbd{M-d}
1810 command.
1811
1812 @item o
1813 @samp{m} if moderated.
1814
1815 @item O
1816 @samp{(m)} if moderated.
1817
1818 @item s
1819 Select method.
1820
1821 @item B
1822 If the summary buffer for the group is open or not.
1823
1824 @item n
1825 Select from where.
1826
1827 @item z
1828 A string that looks like @samp{<%s:%n>} if a foreign select method is
1829 used.
1830
1831 @item P
1832 Indentation based on the level of the topic (@pxref{Group Topics}).
1833
1834 @item c
1835 @vindex gnus-group-uncollapsed-levels
1836 Short (collapsed) group name.  The @code{gnus-group-uncollapsed-levels}
1837 variable says how many levels to leave at the end of the group name.
1838 The default is 1---this will mean that group names like
1839 @samp{gnu.emacs.gnus} will be shortened to @samp{g.e.gnus}.
1840
1841 @item m
1842 @vindex gnus-new-mail-mark
1843 @cindex %
1844 @samp{%} (@code{gnus-new-mail-mark}) if there has arrived new mail to
1845 the group lately.
1846
1847 @item p
1848 @samp{#} (@code{gnus-process-mark}) if the group is process marked.
1849
1850 @item d
1851 A string that says when you last read the group (@pxref{Group
1852 Timestamp}).
1853
1854 @item F
1855 The disk space used by the articles fetched by both the cache and
1856 agent.  The value is automatically scaled to bytes(B), kilobytes(K),
1857 megabytes(M), or gigabytes(G) to minimize the column width.  A format
1858 of %7F is sufficient for a fixed-width column.
1859
1860 @item u
1861 User defined specifier.  The next character in the format string should
1862 be a letter.  Gnus will call the function
1863 @code{gnus-user-format-function-}@samp{X}, where @samp{X} is the letter
1864 following @samp{%u}.  The function will be passed a single dummy
1865 parameter as argument.  The function should return a string, which will
1866 be inserted into the buffer just like information from any other
1867 specifier.
1868 @end table
1869
1870 @cindex *
1871 All the ``number-of'' specs will be filled with an asterisk (@samp{*})
1872 if no info is available---for instance, if it is a non-activated foreign
1873 group, or a bogus native group.
1874
1875
1876 @node Group Mode Line Specification
1877 @subsection Group Mode Line Specification
1878 @cindex group mode line
1879
1880 @vindex gnus-group-mode-line-format
1881 The mode line can be changed by setting
1882 @code{gnus-group-mode-line-format} (@pxref{Mode Line Formatting}).  It
1883 doesn't understand that many format specifiers:
1884
1885 @table @samp
1886 @item S
1887 The native news server.
1888 @item M
1889 The native select method.
1890 @end table
1891
1892
1893 @node Group Highlighting
1894 @subsection Group Highlighting
1895 @cindex highlighting
1896 @cindex group highlighting
1897
1898 @vindex gnus-group-highlight
1899 Highlighting in the group buffer is controlled by the
1900 @code{gnus-group-highlight} variable.  This is an alist with elements
1901 that look like @code{(@var{form} . @var{face})}.  If @var{form} evaluates to
1902 something non-@code{nil}, the @var{face} will be used on the line.
1903
1904 Here's an example value for this variable that might look nice if the
1905 background is dark:
1906
1907 @lisp
1908 (cond (window-system
1909        (setq custom-background-mode 'light)
1910        (defface my-group-face-1
1911          '((t (:foreground "Red" :bold t))) "First group face")
1912        (defface my-group-face-2
1913          '((t (:foreground "DarkSeaGreen4" :bold t)))
1914          "Second group face")
1915        (defface my-group-face-3
1916          '((t (:foreground "Green4" :bold t))) "Third group face")
1917        (defface my-group-face-4
1918          '((t (:foreground "SteelBlue" :bold t))) "Fourth group face")
1919        (defface my-group-face-5
1920          '((t (:foreground "Blue" :bold t))) "Fifth group face")))
1921
1922 (setq gnus-group-highlight
1923       '(((> unread 200) . my-group-face-1)
1924         ((and (< level 3) (zerop unread)) . my-group-face-2)
1925         ((< level 3) . my-group-face-3)
1926         ((zerop unread) . my-group-face-4)
1927         (t . my-group-face-5)))
1928 @end lisp
1929
1930 Also @pxref{Faces and Fonts}.
1931
1932 Variables that are dynamically bound when the forms are evaluated
1933 include:
1934
1935 @table @code
1936 @item group
1937 The group name.
1938 @item unread
1939 The number of unread articles in the group.
1940 @item method
1941 The select method.
1942 @item mailp
1943 Whether the group is a mail group.
1944 @item level
1945 The level of the group.
1946 @item score
1947 The score of the group.
1948 @item ticked
1949 The number of ticked articles in the group.
1950 @item total
1951 The total number of articles in the group.  Or rather,
1952 @var{max-number} minus @var{min-number} plus one.
1953 @item topic
1954 When using the topic minor mode, this variable is bound to the current
1955 topic being inserted.
1956 @end table
1957
1958 When the forms are @code{eval}ed, point is at the beginning of the line
1959 of the group in question, so you can use many of the normal Gnus
1960 functions for snarfing info on the group.
1961
1962 @vindex gnus-group-update-hook
1963 @findex gnus-group-highlight-line
1964 @code{gnus-group-update-hook} is called when a group line is changed.
1965 It will not be called when @code{gnus-visual} is @code{nil}.
1966
1967
1968 @node Group Maneuvering
1969 @section Group Maneuvering
1970 @cindex group movement
1971
1972 All movement commands understand the numeric prefix and will behave as
1973 expected, hopefully.
1974
1975 @table @kbd
1976
1977 @item n
1978 @kindex n (Group)
1979 @findex gnus-group-next-unread-group
1980 Go to the next group that has unread articles
1981 (@code{gnus-group-next-unread-group}).
1982
1983 @item p
1984 @itemx DEL
1985 @kindex DEL (Group)
1986 @kindex p (Group)
1987 @findex gnus-group-prev-unread-group
1988 Go to the previous group that has unread articles
1989 (@code{gnus-group-prev-unread-group}).
1990
1991 @item N
1992 @kindex N (Group)
1993 @findex gnus-group-next-group
1994 Go to the next group (@code{gnus-group-next-group}).
1995
1996 @item P
1997 @kindex P (Group)
1998 @findex gnus-group-prev-group
1999 Go to the previous group (@code{gnus-group-prev-group}).
2000
2001 @item M-n
2002 @kindex M-n (Group)
2003 @findex gnus-group-next-unread-group-same-level
2004 Go to the next unread group on the same (or lower) level
2005 (@code{gnus-group-next-unread-group-same-level}).
2006
2007 @item M-p
2008 @kindex M-p (Group)
2009 @findex gnus-group-prev-unread-group-same-level
2010 Go to the previous unread group on the same (or lower) level
2011 (@code{gnus-group-prev-unread-group-same-level}).
2012 @end table
2013
2014 Three commands for jumping to groups:
2015
2016 @table @kbd
2017
2018 @item j
2019 @kindex j (Group)
2020 @findex gnus-group-jump-to-group
2021 Jump to a group (and make it visible if it isn't already)
2022 (@code{gnus-group-jump-to-group}).  Killed groups can be jumped to, just
2023 like living groups.
2024
2025 @item ,
2026 @kindex , (Group)
2027 @findex gnus-group-best-unread-group
2028 Jump to the unread group with the lowest level
2029 (@code{gnus-group-best-unread-group}).
2030
2031 @item .
2032 @kindex . (Group)
2033 @findex gnus-group-first-unread-group
2034 Jump to the first group with unread articles
2035 (@code{gnus-group-first-unread-group}).
2036 @end table
2037
2038 @vindex gnus-group-goto-unread
2039 If @code{gnus-group-goto-unread} is @code{nil}, all the movement
2040 commands will move to the next group, not the next unread group.  Even
2041 the commands that say they move to the next unread group.  The default
2042 is @code{t}.
2043
2044 @vindex gnus-summary-next-group-on-exit
2045 If @code{gnus-summary-next-group-on-exit} is @code{t}, when a summary is
2046 exited, the point in the group buffer is moved to the next unread group.
2047 Otherwise, the point is set to the group just exited.  The default is
2048 @code{t}.
2049
2050 @node Selecting a Group
2051 @section Selecting a Group
2052 @cindex group selection
2053
2054 @table @kbd
2055
2056 @item SPACE
2057 @kindex SPACE (Group)
2058 @findex gnus-group-read-group
2059 Select the current group, switch to the summary buffer and display the
2060 first unread article (@code{gnus-group-read-group}).  If there are no
2061 unread articles in the group, or if you give a non-numerical prefix to
2062 this command, Gnus will offer to fetch all the old articles in this
2063 group from the server.  If you give a numerical prefix @var{n}, @var{n}
2064 determines the number of articles Gnus will fetch.  If @var{n} is
2065 positive, Gnus fetches the @var{n} newest articles, if @var{n} is
2066 negative, Gnus fetches the @code{abs(@var{n})} oldest articles.
2067
2068 Thus, @kbd{SPC} enters the group normally, @kbd{C-u SPC} offers old
2069 articles, @kbd{C-u 4 2 SPC} fetches the 42 newest articles, and @kbd{C-u
2070 - 4 2 SPC} fetches the 42 oldest ones.
2071
2072 When you are in the group (in the Summary buffer), you can type
2073 @kbd{M-g} to fetch new articles, or @kbd{C-u M-g} to also show the old
2074 ones.
2075
2076 @item RET
2077 @kindex RET (Group)
2078 @findex gnus-group-select-group
2079 Select the current group and switch to the summary buffer
2080 (@code{gnus-group-select-group}).  Takes the same arguments as
2081 @code{gnus-group-read-group}---the only difference is that this command
2082 does not display the first unread article automatically upon group
2083 entry.
2084
2085 @item M-RET
2086 @kindex M-RET (Group)
2087 @findex gnus-group-quick-select-group
2088 This does the same as the command above, but tries to do it with the
2089 minimum amount of fuzz (@code{gnus-group-quick-select-group}).  No
2090 scoring/killing will be performed, there will be no highlights and no
2091 expunging.  This might be useful if you're in a real hurry and have to
2092 enter some humongous group.  If you give a 0 prefix to this command
2093 (i.e., @kbd{0 M-RET}), Gnus won't even generate the summary buffer,
2094 which is useful if you want to toggle threading before generating the
2095 summary buffer (@pxref{Summary Generation Commands}).
2096
2097 @item M-SPACE
2098 @kindex M-SPACE (Group)
2099 @findex gnus-group-visible-select-group
2100 This is yet one more command that does the same as the @kbd{RET}
2101 command, but this one does it without expunging and hiding dormants
2102 (@code{gnus-group-visible-select-group}).
2103
2104 @item C-M-RET
2105 @kindex C-M-RET (Group)
2106 @findex gnus-group-select-group-ephemerally
2107 Finally, this command selects the current group ephemerally without
2108 doing any processing of its contents
2109 (@code{gnus-group-select-group-ephemerally}).  Even threading has been
2110 turned off.  Everything you do in the group after selecting it in this
2111 manner will have no permanent effects.
2112
2113 @end table
2114
2115 @vindex gnus-large-newsgroup
2116 The @code{gnus-large-newsgroup} variable says what Gnus should
2117 consider to be a big group.  If it is @code{nil}, no groups are
2118 considered big.  The default value is 200.  If the group has more
2119 (unread and/or ticked) articles than this, Gnus will query the user
2120 before entering the group.  The user can then specify how many
2121 articles should be fetched from the server.  If the user specifies a
2122 negative number (@var{-n}), the @var{n} oldest articles will be
2123 fetched.  If it is positive, the @var{n} articles that have arrived
2124 most recently will be fetched.
2125
2126 @vindex gnus-large-ephemeral-newsgroup
2127 @code{gnus-large-ephemeral-newsgroup} is the same as
2128 @code{gnus-large-newsgroup}, but is only used for ephemeral
2129 newsgroups.
2130
2131 @vindex gnus-newsgroup-maximum-articles
2132 In groups in some news servers, there might be a big gap between a few
2133 very old articles that will never be expired and the recent ones.  In
2134 such a case, the server will return the data like @code{(1 . 30000000)}
2135 for the @code{LIST ACTIVE group} command, for example.  Even if there
2136 are actually only the articles 1-10 and 29999900-30000000, Gnus doesn't
2137 know it at first and prepares for getting 30000000 articles.  However,
2138 it will consume hundreds megabytes of memories and might make Emacs get
2139 stuck as the case may be.  If you use such news servers, set the
2140 variable @code{gnus-newsgroup-maximum-articles} to a positive number.
2141 The value means that Gnus ignores articles other than this number of the
2142 latest ones in every group.  For instance, the value 10000 makes Gnus
2143 get only the articles 29990001-30000000 (if the latest article number is
2144 30000000 in a group).  Note that setting this variable to a number might
2145 prevent you from reading very old articles.  The default value of the
2146 variable @code{gnus-newsgroup-maximum-articles} is @code{nil}, which
2147 means Gnus never ignores old articles.
2148
2149 @vindex gnus-select-group-hook
2150 @vindex gnus-auto-select-first
2151 @vindex gnus-auto-select-subject
2152 If @code{gnus-auto-select-first} is non-@code{nil}, select an article
2153 automatically when entering a group with the @kbd{SPACE} command.
2154 Which article this is controlled by the
2155 @code{gnus-auto-select-subject} variable.  Valid values for this
2156 variable are:
2157
2158 @table @code
2159
2160 @item unread
2161 Place point on the subject line of the first unread article.
2162
2163 @item first
2164 Place point on the subject line of the first article.
2165
2166 @item unseen
2167 Place point on the subject line of the first unseen article.
2168
2169 @item unseen-or-unread
2170 Place point on the subject line of the first unseen article, and if
2171 there is no such article, place point on the subject line of the first
2172 unread article.
2173
2174 @item best
2175 Place point on the subject line of the highest-scored unread article.
2176
2177 @end table
2178
2179 This variable can also be a function.  In that case, that function
2180 will be called to place point on a subject line.
2181
2182 If you want to prevent automatic selection in some group (say, in a
2183 binary group with Huge articles) you can set the
2184 @code{gnus-auto-select-first} variable to @code{nil} in
2185 @code{gnus-select-group-hook}, which is called when a group is
2186 selected.
2187
2188
2189 @node Subscription Commands
2190 @section Subscription Commands
2191 @cindex subscription
2192
2193 The following commands allow for managing your subscriptions in the
2194 Group buffer.  If you want to subscribe to many groups, it's probably
2195 more convenient to go to the @ref{Server Buffer}, and choose the
2196 server there using @kbd{RET} or @kbd{SPC}.  Then you'll have the
2197 commands listed in @ref{Browse Foreign Server} at hand.
2198
2199 @table @kbd
2200
2201 @item S t
2202 @itemx u
2203 @kindex S t (Group)
2204 @kindex u (Group)
2205 @findex gnus-group-unsubscribe-current-group
2206 @c @icon{gnus-group-unsubscribe}
2207 Toggle subscription to the current group
2208 (@code{gnus-group-unsubscribe-current-group}).
2209
2210 @item S s
2211 @itemx U
2212 @kindex S s (Group)
2213 @kindex U (Group)
2214 @findex gnus-group-unsubscribe-group
2215 Prompt for a group to subscribe, and then subscribe it.  If it was
2216 subscribed already, unsubscribe it instead
2217 (@code{gnus-group-unsubscribe-group}).
2218
2219 @item S k
2220 @itemx C-k
2221 @kindex S k (Group)
2222 @kindex C-k (Group)
2223 @findex gnus-group-kill-group
2224 @c @icon{gnus-group-kill-group}
2225 Kill the current group (@code{gnus-group-kill-group}).
2226
2227 @item S y
2228 @itemx C-y
2229 @kindex S y (Group)
2230 @kindex C-y (Group)
2231 @findex gnus-group-yank-group
2232 Yank the last killed group (@code{gnus-group-yank-group}).
2233
2234 @item C-x C-t
2235 @kindex C-x C-t (Group)
2236 @findex gnus-group-transpose-groups
2237 Transpose two groups (@code{gnus-group-transpose-groups}).  This isn't
2238 really a subscription command, but you can use it instead of a
2239 kill-and-yank sequence sometimes.
2240
2241 @item S w
2242 @itemx C-w
2243 @kindex S w (Group)
2244 @kindex C-w (Group)
2245 @findex gnus-group-kill-region
2246 Kill all groups in the region (@code{gnus-group-kill-region}).
2247
2248 @item S z
2249 @kindex S z (Group)
2250 @findex gnus-group-kill-all-zombies
2251 Kill all zombie groups (@code{gnus-group-kill-all-zombies}).
2252
2253 @item S C-k
2254 @kindex S C-k (Group)
2255 @findex gnus-group-kill-level
2256 Kill all groups on a certain level (@code{gnus-group-kill-level}).
2257 These groups can't be yanked back after killing, so this command should
2258 be used with some caution.  The only time where this command comes in
2259 really handy is when you have a @file{.newsrc} with lots of unsubscribed
2260 groups that you want to get rid off.  @kbd{S C-k} on level 7 will
2261 kill off all unsubscribed groups that do not have message numbers in the
2262 @file{.newsrc} file.
2263
2264 @end table
2265
2266 Also @pxref{Group Levels}.
2267
2268
2269 @node Group Data
2270 @section Group Data
2271
2272 @table @kbd
2273
2274 @item c
2275 @kindex c (Group)
2276 @findex gnus-group-catchup-current
2277 @vindex gnus-group-catchup-group-hook
2278 @c @icon{gnus-group-catchup-current}
2279 Mark all unticked articles in this group as read
2280 (@code{gnus-group-catchup-current}).
2281 @code{gnus-group-catchup-group-hook} is called when catching up a group from
2282 the group buffer.
2283
2284 @item C
2285 @kindex C (Group)
2286 @findex gnus-group-catchup-current-all
2287 Mark all articles in this group, even the ticked ones, as read
2288 (@code{gnus-group-catchup-current-all}).
2289
2290 @item M-c
2291 @kindex M-c (Group)
2292 @findex gnus-group-clear-data
2293 Clear the data from the current group---nix out marks and the list of
2294 read articles (@code{gnus-group-clear-data}).
2295
2296 @item M-x gnus-group-clear-data-on-native-groups
2297 @kindex M-x gnus-group-clear-data-on-native-groups
2298 @findex gnus-group-clear-data-on-native-groups
2299 If you have switched from one @acronym{NNTP} server to another, all your marks
2300 and read ranges have become worthless.  You can use this command to
2301 clear out all data that you have on your native groups.  Use with
2302 caution.
2303
2304 @end table
2305
2306
2307 @node Group Levels
2308 @section Group Levels
2309 @cindex group level
2310 @cindex level
2311
2312 All groups have a level of @dfn{subscribedness}.  For instance, if a
2313 group is on level 2, it is more subscribed than a group on level 5.  You
2314 can ask Gnus to just list groups on a given level or lower
2315 (@pxref{Listing Groups}), or to just check for new articles in groups on
2316 a given level or lower (@pxref{Scanning New Messages}).
2317
2318 Remember:  The higher the level of the group, the less important it is.
2319
2320 @table @kbd
2321
2322 @item S l
2323 @kindex S l (Group)
2324 @findex gnus-group-set-current-level
2325 Set the level of the current group.  If a numeric prefix is given, the
2326 next @var{n} groups will have their levels set.  The user will be
2327 prompted for a level.
2328 @end table
2329
2330 @vindex gnus-level-killed
2331 @vindex gnus-level-zombie
2332 @vindex gnus-level-unsubscribed
2333 @vindex gnus-level-subscribed
2334 Gnus considers groups from levels 1 to
2335 @code{gnus-level-subscribed} (inclusive) (default 5) to be subscribed,
2336 @code{gnus-level-subscribed} (exclusive) and
2337 @code{gnus-level-unsubscribed} (inclusive) (default 7) to be
2338 unsubscribed, @code{gnus-level-zombie} to be zombies (walking dead)
2339 (default 8) and @code{gnus-level-killed} to be killed (completely dead)
2340 (default 9).  Gnus treats subscribed and unsubscribed groups exactly the
2341 same, but zombie and killed groups have no information on what articles
2342 you have read, etc, stored.  This distinction between dead and living
2343 groups isn't done because it is nice or clever, it is done purely for
2344 reasons of efficiency.
2345
2346 It is recommended that you keep all your mail groups (if any) on quite
2347 low levels (e.g. 1 or 2).
2348
2349 Maybe the following description of the default behavior of Gnus helps to
2350 understand what these levels are all about.  By default, Gnus shows you
2351 subscribed nonempty groups, but by hitting @kbd{L} you can have it show
2352 empty subscribed groups and unsubscribed groups, too.  Type @kbd{l} to
2353 go back to showing nonempty subscribed groups again.  Thus, unsubscribed
2354 groups are hidden, in a way.
2355
2356 Zombie and killed groups are similar to unsubscribed groups in that they
2357 are hidden by default.  But they are different from subscribed and
2358 unsubscribed groups in that Gnus doesn't ask the news server for
2359 information (number of messages, number of unread messages) on zombie
2360 and killed groups.  Normally, you use @kbd{C-k} to kill the groups you
2361 aren't interested in.  If most groups are killed, Gnus is faster.
2362
2363 Why does Gnus distinguish between zombie and killed groups?  Well, when
2364 a new group arrives on the server, Gnus by default makes it a zombie
2365 group.  This means that you are normally not bothered with new groups,
2366 but you can type @kbd{A z} to get a list of all new groups.  Subscribe
2367 the ones you like and kill the ones you don't want.  (@kbd{A k} shows a
2368 list of killed groups.)
2369
2370 If you want to play with the level variables, you should show some care.
2371 Set them once, and don't touch them ever again.  Better yet, don't touch
2372 them at all unless you know exactly what you're doing.
2373
2374 @vindex gnus-level-default-unsubscribed
2375 @vindex gnus-level-default-subscribed
2376 Two closely related variables are @code{gnus-level-default-subscribed}
2377 (default 3) and @code{gnus-level-default-unsubscribed} (default 6),
2378 which are the levels that new groups will be put on if they are
2379 (un)subscribed.  These two variables should, of course, be inside the
2380 relevant valid ranges.
2381
2382 @vindex gnus-keep-same-level
2383 If @code{gnus-keep-same-level} is non-@code{nil}, some movement commands
2384 will only move to groups of the same level (or lower).  In
2385 particular, going from the last article in one group to the next group
2386 will go to the next group of the same level (or lower).  This might be
2387 handy if you want to read the most important groups before you read the
2388 rest.
2389
2390 If this variable is @code{best}, Gnus will make the next newsgroup the
2391 one with the best level.
2392
2393 @vindex gnus-group-default-list-level
2394 All groups with a level less than or equal to
2395 @code{gnus-group-default-list-level} will be listed in the group buffer
2396 by default.
2397 This variable can also be a function.  In that case, that function will
2398 be called and the result will be used as value.
2399
2400
2401 @vindex gnus-group-list-inactive-groups
2402 If @code{gnus-group-list-inactive-groups} is non-@code{nil}, non-active
2403 groups will be listed along with the unread groups.  This variable is
2404 @code{t} by default.  If it is @code{nil}, inactive groups won't be
2405 listed.
2406
2407 @vindex gnus-group-use-permanent-levels
2408 If @code{gnus-group-use-permanent-levels} is non-@code{nil}, once you
2409 give a level prefix to @kbd{g} or @kbd{l}, all subsequent commands will
2410 use this level as the ``work'' level.
2411
2412 @vindex gnus-activate-level
2413 Gnus will normally just activate (i. e., query the server about) groups
2414 on level @code{gnus-activate-level} or less.  If you don't want to
2415 activate unsubscribed groups, for instance, you might set this variable
2416 to 5.  The default is 6.
2417
2418
2419 @node Group Score
2420 @section Group Score
2421 @cindex group score
2422 @cindex group rank
2423 @cindex rank
2424
2425 You would normally keep important groups on high levels, but that scheme
2426 is somewhat restrictive.  Don't you wish you could have Gnus sort the
2427 group buffer according to how often you read groups, perhaps?  Within
2428 reason?
2429
2430 This is what @dfn{group score} is for.  You can have Gnus assign a score
2431 to each group through the mechanism described below.  You can then sort
2432 the group buffer based on this score.  Alternatively, you can sort on
2433 score and then level.  (Taken together, the level and the score is
2434 called the @dfn{rank} of the group.  A group that is on level 4 and has
2435 a score of 1 has a higher rank than a group on level 5 that has a score
2436 of 300.  (The level is the most significant part and the score is the
2437 least significant part.))
2438
2439 @findex gnus-summary-bubble-group
2440 If you want groups you read often to get higher scores than groups you
2441 read seldom you can add the @code{gnus-summary-bubble-group} function to
2442 the @code{gnus-summary-exit-hook} hook.  This will result (after
2443 sorting) in a bubbling sort of action.  If you want to see that in
2444 action after each summary exit, you can add
2445 @code{gnus-group-sort-groups-by-rank} or
2446 @code{gnus-group-sort-groups-by-score} to the same hook, but that will
2447 slow things down somewhat.
2448
2449
2450 @node Marking Groups
2451 @section Marking Groups
2452 @cindex marking groups
2453
2454 If you want to perform some command on several groups, and they appear
2455 subsequently in the group buffer, you would normally just give a
2456 numerical prefix to the command.  Most group commands will then do your
2457 bidding on those groups.
2458
2459 However, if the groups are not in sequential order, you can still
2460 perform a command on several groups.  You simply mark the groups first
2461 with the process mark and then execute the command.
2462
2463 @table @kbd
2464
2465 @item #
2466 @kindex # (Group)
2467 @itemx M m
2468 @kindex M m (Group)
2469 @findex gnus-group-mark-group
2470 Set the mark on the current group (@code{gnus-group-mark-group}).
2471
2472 @item M-#
2473 @kindex M-# (Group)
2474 @itemx M u
2475 @kindex M u (Group)
2476 @findex gnus-group-unmark-group
2477 Remove the mark from the current group
2478 (@code{gnus-group-unmark-group}).
2479
2480 @item M U
2481 @kindex M U (Group)
2482 @findex gnus-group-unmark-all-groups
2483 Remove the mark from all groups (@code{gnus-group-unmark-all-groups}).
2484
2485 @item M w
2486 @kindex M w (Group)
2487 @findex gnus-group-mark-region
2488 Mark all groups between point and mark (@code{gnus-group-mark-region}).
2489
2490 @item M b
2491 @kindex M b (Group)
2492 @findex gnus-group-mark-buffer
2493 Mark all groups in the buffer (@code{gnus-group-mark-buffer}).
2494
2495 @item M r
2496 @kindex M r (Group)
2497 @findex gnus-group-mark-regexp
2498 Mark all groups that match some regular expression
2499 (@code{gnus-group-mark-regexp}).
2500 @end table
2501
2502 Also @pxref{Process/Prefix}.
2503
2504 @findex gnus-group-universal-argument
2505 If you want to execute some command on all groups that have been marked
2506 with the process mark, you can use the @kbd{M-&}
2507 (@code{gnus-group-universal-argument}) command.  It will prompt you for
2508 the command to be executed.
2509
2510
2511 @node Foreign Groups
2512 @section Foreign Groups
2513 @cindex foreign groups
2514
2515 If you recall how to subscribe to servers (@pxref{Finding the News})
2516 you will remember that @code{gnus-secondary-select-methods} and
2517 @code{gnus-select-method} let you write a definition in Emacs Lisp of
2518 what servers you want to see when you start up.  The alternate
2519 approach is to use foreign servers and groups.  ``Foreign'' here means
2520 they are not coming from the select methods.  All foreign server
2521 configuration and subscriptions are stored only in the
2522 @file{~/.newsrc.eld} file.
2523
2524 Below are some group mode commands for making and editing general foreign
2525 groups, as well as commands to ease the creation of a few
2526 special-purpose groups.  All these commands insert the newly created
2527 groups under point---@code{gnus-subscribe-newsgroup-method} is not
2528 consulted.
2529
2530 Changes from the group editing commands are stored in
2531 @file{~/.newsrc.eld} (@code{gnus-startup-file}).  An alternative is the
2532 variable @code{gnus-parameters}, @xref{Group Parameters}.
2533
2534 @table @kbd
2535
2536 @item G m
2537 @kindex G m (Group)
2538 @findex gnus-group-make-group
2539 @cindex making groups
2540 Make a new group (@code{gnus-group-make-group}).  Gnus will prompt you
2541 for a name, a method and possibly an @dfn{address}.  For an easier way
2542 to subscribe to @acronym{NNTP} groups (@pxref{Browse Foreign Server}).
2543
2544 @item G M
2545 @kindex G M (Group)
2546 @findex gnus-group-read-ephemeral-group
2547 Make an ephemeral group (@code{gnus-group-read-ephemeral-group}).  Gnus
2548 will prompt you for a name, a method and an @dfn{address}.
2549
2550 @item G r
2551 @kindex G r (Group)
2552 @findex gnus-group-rename-group
2553 @cindex renaming groups
2554 Rename the current group to something else
2555 (@code{gnus-group-rename-group}).  This is valid only on some
2556 groups---mail groups mostly.  This command might very well be quite slow
2557 on some back ends.
2558
2559 @item G c
2560 @kindex G c (Group)
2561 @cindex customizing
2562 @findex gnus-group-customize
2563 Customize the group parameters (@code{gnus-group-customize}).
2564
2565 @item G e
2566 @kindex G e (Group)
2567 @findex gnus-group-edit-group-method
2568 @cindex renaming groups
2569 Enter a buffer where you can edit the select method of the current
2570 group (@code{gnus-group-edit-group-method}).
2571
2572 @item G p
2573 @kindex G p (Group)
2574 @findex gnus-group-edit-group-parameters
2575 Enter a buffer where you can edit the group parameters
2576 (@code{gnus-group-edit-group-parameters}).
2577
2578 @item G E
2579 @kindex G E (Group)
2580 @findex gnus-group-edit-group
2581 Enter a buffer where you can edit the group info
2582 (@code{gnus-group-edit-group}).
2583
2584 @item G d
2585 @kindex G d (Group)
2586 @findex gnus-group-make-directory-group
2587 @cindex nndir
2588 Make a directory group (@pxref{Directory Groups}).  You will be prompted
2589 for a directory name (@code{gnus-group-make-directory-group}).
2590
2591 @item G h
2592 @kindex G h (Group)
2593 @cindex help group
2594 @findex gnus-group-make-help-group
2595 Make the Gnus help group (@code{gnus-group-make-help-group}).
2596
2597 @item G D
2598 @kindex G D (Group)
2599 @findex gnus-group-enter-directory
2600 @cindex nneething
2601 Read an arbitrary directory as if it were a newsgroup with the
2602 @code{nneething} back end (@code{gnus-group-enter-directory}).
2603 @xref{Anything Groups}.
2604
2605 @item G f
2606 @kindex G f (Group)
2607 @findex gnus-group-make-doc-group
2608 @cindex ClariNet Briefs
2609 @cindex nndoc
2610 Make a group based on some file or other
2611 (@code{gnus-group-make-doc-group}).  If you give a prefix to this
2612 command, you will be prompted for a file name and a file type.
2613 Currently supported types are @code{mbox}, @code{babyl},
2614 @code{digest}, @code{news}, @code{rnews}, @code{mmdf}, @code{forward},
2615 @code{rfc934}, @code{rfc822-forward}, @code{mime-parts},
2616 @code{standard-digest}, @code{slack-digest}, @code{clari-briefs},
2617 @code{nsmail}, @code{outlook}, @code{oe-dbx}, and @code{mailman}.  If
2618 you run this command without a prefix, Gnus will guess at the file
2619 type.  @xref{Document Groups}.
2620
2621 @item G u
2622 @kindex G u (Group)
2623 @vindex gnus-useful-groups
2624 @findex gnus-group-make-useful-group
2625 Create one of the groups mentioned in @code{gnus-useful-groups}
2626 (@code{gnus-group-make-useful-group}).
2627
2628 @item G w
2629 @kindex G w (Group)
2630 @findex gnus-group-make-web-group
2631 @cindex Google
2632 @cindex nnweb
2633 @cindex gmane
2634 Make an ephemeral group based on a web search
2635 (@code{gnus-group-make-web-group}).  If you give a prefix to this
2636 command, make a solid group instead.  You will be prompted for the
2637 search engine type and the search string.  Valid search engine types
2638 include @code{google}, @code{dejanews}, and @code{gmane}.
2639 @xref{Web Searches}.
2640
2641 If you use the @code{google} search engine, you can limit the search
2642 to a particular group by using a match string like
2643 @samp{shaving group:alt.sysadmin.recovery}.
2644
2645 @item G R
2646 @kindex G R (Group)
2647 @findex gnus-group-make-rss-group
2648 Make a group based on an @acronym{RSS} feed
2649 (@code{gnus-group-make-rss-group}).  You will be prompted for an URL.
2650 @xref{RSS}.
2651
2652 @item G DEL
2653 @kindex G DEL (Group)
2654 @findex gnus-group-delete-group
2655 This function will delete the current group
2656 (@code{gnus-group-delete-group}).  If given a prefix, this function will
2657 actually delete all the articles in the group, and forcibly remove the
2658 group itself from the face of the Earth.  Use a prefix only if you are
2659 absolutely sure of what you are doing.  This command can't be used on
2660 read-only groups (like @code{nntp} groups), though.
2661
2662 @item G V
2663 @kindex G V (Group)
2664 @findex gnus-group-make-empty-virtual
2665 Make a new, fresh, empty @code{nnvirtual} group
2666 (@code{gnus-group-make-empty-virtual}).  @xref{Virtual Groups}.
2667
2668 @item G v
2669 @kindex G v (Group)
2670 @findex gnus-group-add-to-virtual
2671 Add the current group to an @code{nnvirtual} group
2672 (@code{gnus-group-add-to-virtual}).  Uses the process/prefix convention.
2673 @end table
2674
2675 @xref{Select Methods}, for more information on the various select
2676 methods.
2677
2678 @vindex gnus-activate-foreign-newsgroups
2679 If @code{gnus-activate-foreign-newsgroups} is a positive number,
2680 Gnus will check all foreign groups with this level or lower at startup.
2681 This might take quite a while, especially if you subscribe to lots of
2682 groups from different @acronym{NNTP} servers.  Also @pxref{Group Levels};
2683 @code{gnus-activate-level} also affects activation of foreign
2684 newsgroups.
2685
2686
2687 The following commands create ephemeral groups.  They can be called not
2688 only from the Group buffer, but in any Gnus buffer.
2689
2690 @table @code
2691 @item gnus-read-ephemeral-gmane-group
2692 @findex gnus-read-ephemeral-gmane-group
2693 @vindex gnus-gmane-group-download-format
2694 Read an ephemeral group on Gmane.org.  The articles are downloaded via
2695 HTTP using the URL specified by @code{gnus-gmane-group-download-format}.
2696 Gnus will prompt you for a group name, the start article number and an
2697 the article range.
2698
2699 @item gnus-read-ephemeral-gmane-group-url
2700 @findex gnus-read-ephemeral-gmane-group-url
2701 This command is similar to @code{gnus-read-ephemeral-gmane-group}, but
2702 the group name and the article number and range are constructed from a
2703 given @acronym{URL}.  Supported @acronym{URL} formats include e.g.
2704 @url{http://thread.gmane.org/gmane.foo.bar/12300/focus=12399},
2705 @url{http://thread.gmane.org/gmane.foo.bar/12345/},
2706 @url{http://article.gmane.org/gmane.foo.bar/12345/},
2707 @url{http://permalink.gmane.org/gmane.foo.bar/12345/}, and
2708 @url{http://news.gmane.org/group/gmane.foo.bar/thread=12345}.
2709
2710 @item gnus-read-ephemeral-emacs-bug-group
2711 @findex gnus-read-ephemeral-emacs-bug-group
2712 Read an Emacs bug report in an ephemeral group.  Gnus will prompt for a
2713 bug number.  The default is the number at point.  The @acronym{URL} is
2714 specified in @code{gnus-bug-group-download-format-alist}.
2715
2716 @item gnus-read-ephemeral-debian-bug-group
2717 @findex gnus-read-ephemeral-debian-bug-group
2718 Read a Debian bug report in an ephemeral group.  Analog to
2719 @code{gnus-read-ephemeral-emacs-bug-group}.
2720 @end table
2721
2722 Some of these command are also useful for article buttons, @xref{Article
2723 Buttons}.
2724
2725 Here is an example:
2726 @lisp
2727 (require 'gnus-art)
2728 (add-to-list
2729  'gnus-button-alist
2730  '("#\\([0-9]+\\)\\>" 1
2731    (string-match "\\<emacs\\>" (or gnus-newsgroup-name ""))
2732    gnus-read-ephemeral-emacs-bug-group 1))
2733 @end lisp
2734
2735
2736 @node Group Parameters
2737 @section Group Parameters
2738 @cindex group parameters
2739
2740 The group parameters store information local to a particular group.
2741
2742 Use the @kbd{G p} or the @kbd{G c} command to edit group parameters of a
2743 group.  (@kbd{G p} presents you with a Lisp-based interface, @kbd{G c}
2744 presents you with a Customize-like interface.  The latter helps avoid
2745 silly Lisp errors.)  You might also be interested in reading about topic
2746 parameters (@pxref{Topic Parameters}).
2747 Additionally, you can set group parameters via the
2748 @code{gnus-parameters} variable, see below.
2749
2750 Here's an example group parameter list:
2751
2752 @example
2753 ((to-address . "ding@@gnus.org")
2754  (auto-expire . t))
2755 @end example
2756
2757 We see that each element consists of a ``dotted pair''---the thing before
2758 the dot is the key, while the thing after the dot is the value.  All the
2759 parameters have this form @emph{except} local variable specs, which are
2760 not dotted pairs, but proper lists.
2761
2762 Some parameters have correspondent customizable variables, each of which
2763 is an alist of regexps and values.
2764
2765 The following group parameters can be used:
2766
2767 @table @code
2768 @item to-address
2769 @cindex to-address
2770 Address used by when doing followups and new posts.
2771
2772 @example
2773 (to-address . "some@@where.com")
2774 @end example
2775
2776 This is primarily useful in mail groups that represent closed mailing
2777 lists---mailing lists where it's expected that everybody that writes to
2778 the mailing list is subscribed to it.  Since using this parameter
2779 ensures that the mail only goes to the mailing list itself, it means
2780 that members won't receive two copies of your followups.
2781
2782 Using @code{to-address} will actually work whether the group is foreign
2783 or not.  Let's say there's a group on the server that is called
2784 @samp{fa.4ad-l}.  This is a real newsgroup, but the server has gotten
2785 the articles from a mail-to-news gateway.  Posting directly to this
2786 group is therefore impossible---you have to send mail to the mailing
2787 list address instead.
2788
2789 See also @code{gnus-parameter-to-address-alist}.
2790
2791 @item to-list
2792 @cindex to-list
2793 Address used when doing @kbd{a} in that group.
2794
2795 @example
2796 (to-list . "some@@where.com")
2797 @end example
2798
2799 It is totally ignored
2800 when doing a followup---except that if it is present in a news group,
2801 you'll get mail group semantics when doing @kbd{f}.
2802
2803 If you do an @kbd{a} command in a mail group and you have neither a
2804 @code{to-list} group parameter nor a @code{to-address} group parameter,
2805 then a @code{to-list} group parameter will be added automatically upon
2806 sending the message if @code{gnus-add-to-list} is set to @code{t}.
2807 @vindex gnus-add-to-list
2808
2809 @findex gnus-mailing-list-mode
2810 @cindex mail list groups
2811 If this variable is set, @code{gnus-mailing-list-mode} is turned on when
2812 entering summary buffer.
2813
2814 See also @code{gnus-parameter-to-list-alist}.
2815
2816 @anchor{subscribed}
2817 @item subscribed
2818 @cindex subscribed
2819 @cindex Mail-Followup-To
2820 @findex gnus-find-subscribed-addresses
2821 If this parameter is set to @code{t}, Gnus will consider the
2822 to-address and to-list parameters for this group as addresses of
2823 mailing lists you are subscribed to.  Giving Gnus this information is
2824 (only) a first step in getting it to generate correct Mail-Followup-To
2825 headers for your posts to these lists.  The second step is to put the
2826 following in your @file{.gnus.el}
2827
2828 @lisp
2829 (setq message-subscribed-address-functions
2830       '(gnus-find-subscribed-addresses))
2831 @end lisp
2832
2833 @xref{Mailing Lists, ,Mailing Lists, message, The Message Manual}, for
2834 a complete treatment of available MFT support.
2835
2836 @item visible
2837 @cindex visible
2838 If the group parameter list has the element @code{(visible . t)},
2839 that group will always be visible in the Group buffer, regardless
2840 of whether it has any unread articles.
2841
2842 This parameter cannot be set via @code{gnus-parameters}. See
2843 @code{gnus-permanently-visible-groups} as an alternative.
2844
2845 @item broken-reply-to
2846 @cindex broken-reply-to
2847 Elements like @code{(broken-reply-to . t)} signals that @code{Reply-To}
2848 headers in this group are to be ignored, and for the header to be hidden
2849 if @code{reply-to} is part of @code{gnus-boring-article-headers}.  This
2850 can be useful if you're reading a mailing list group where the listserv
2851 has inserted @code{Reply-To} headers that point back to the listserv
2852 itself.  That is broken behavior.  So there!
2853
2854 @item to-group
2855 @cindex to-group
2856 Elements like @code{(to-group . "some.group.name")} means that all
2857 posts in that group will be sent to @code{some.group.name}.
2858
2859 @item newsgroup
2860 @cindex newsgroup
2861 If you have @code{(newsgroup . t)} in the group parameter list, Gnus
2862 will treat all responses as if they were responses to news articles.
2863 This can be useful if you have a mail group that's really a mirror of a
2864 news group.
2865
2866 @item gcc-self
2867 @cindex gcc-self
2868 If @code{(gcc-self . t)} is present in the group parameter list, newly
2869 composed messages will be @code{Gcc}'d to the current group.  If
2870 @code{(gcc-self . none)} is present, no @code{Gcc:} header will be
2871 generated, if @code{(gcc-self . "string")} is present, this string will
2872 be inserted literally as a @code{gcc} header.  This parameter takes
2873 precedence over any default @code{Gcc} rules as described later
2874 (@pxref{Archived Messages}).
2875
2876 @strong{Caveat}: Adding @code{(gcc-self . t)} to the parameter list of
2877 @code{nntp} groups (or the like) isn't valid.  An @code{nntp} server
2878 doesn't accept articles.
2879
2880 @item auto-expire
2881 @cindex auto-expire
2882 @cindex expiring mail
2883 If the group parameter has an element that looks like @code{(auto-expire
2884 . t)}, all articles read will be marked as expirable.  For an
2885 alternative approach, @pxref{Expiring Mail}.
2886
2887 See also @code{gnus-auto-expirable-newsgroups}.
2888
2889 @item total-expire
2890 @cindex total-expire
2891 @cindex expiring mail
2892 If the group parameter has an element that looks like
2893 @code{(total-expire . t)}, all read articles will be put through the
2894 expiry process, even if they are not marked as expirable.  Use with
2895 caution.  Unread, ticked and dormant articles are not eligible for
2896 expiry.
2897
2898 See also @code{gnus-total-expirable-newsgroups}.
2899
2900 @item expiry-wait
2901 @cindex expiry-wait
2902 @vindex nnmail-expiry-wait-function
2903 If the group parameter has an element that looks like
2904 @code{(expiry-wait . 10)}, this value will override any
2905 @code{nnmail-expiry-wait} and @code{nnmail-expiry-wait-function}
2906 (@pxref{Expiring Mail}) when expiring expirable messages.  The value
2907 can either be a number of days (not necessarily an integer) or the
2908 symbols @code{never} or @code{immediate}.
2909
2910 @item expiry-target
2911 @cindex expiry-target
2912 Where expired messages end up.  This parameter overrides
2913 @code{nnmail-expiry-target}.
2914
2915 @item score-file
2916 @cindex score file group parameter
2917 Elements that look like @code{(score-file . "file")} will make
2918 @file{file} into the current score file for the group in question.  All
2919 interactive score entries will be put into this file.
2920
2921 @item adapt-file
2922 @cindex adapt file group parameter
2923 Elements that look like @code{(adapt-file . "file")} will make
2924 @file{file} into the current adaptive file for the group in question.
2925 All adaptive score entries will be put into this file.
2926
2927 @item admin-address
2928 @cindex admin-address
2929 When unsubscribing from a mailing list you should never send the
2930 unsubscription notice to the mailing list itself.  Instead, you'd send
2931 messages to the administrative address.  This parameter allows you to
2932 put the admin address somewhere convenient.
2933
2934 @item display
2935 @cindex display
2936 Elements that look like @code{(display . MODE)} say which articles to
2937 display on entering the group.  Valid values are:
2938
2939 @table @code
2940 @item all
2941 Display all articles, both read and unread.
2942
2943 @item an integer
2944 Display the last @var{integer} articles in the group.  This is the same as
2945 entering the group with @kbd{C-u @var{integer}}.
2946
2947 @item default
2948 Display the default visible articles, which normally includes unread and
2949 ticked articles.
2950
2951 @item an array
2952 Display articles that satisfy a predicate.
2953
2954 Here are some examples:
2955
2956 @table @code
2957 @item [unread]
2958 Display only unread articles.
2959
2960 @item [not expire]
2961 Display everything except expirable articles.
2962
2963 @item [and (not reply) (not expire)]
2964 Display everything except expirable and articles you've already
2965 responded to.
2966 @end table
2967
2968 The available operators are @code{not}, @code{and} and @code{or}.
2969 Predicates include @code{tick}, @code{unsend}, @code{undownload},
2970 @code{unread}, @code{dormant}, @code{expire}, @code{reply},
2971 @code{killed}, @code{bookmark}, @code{score}, @code{save},
2972 @code{cache}, @code{forward}, @code{unseen} and @code{recent}.
2973
2974 @end table
2975
2976 The @code{display} parameter works by limiting the summary buffer to
2977 the subset specified.  You can pop the limit by using the @kbd{/ w}
2978 command (@pxref{Limiting}).
2979
2980 @item comment
2981 @cindex comment
2982 Elements that look like @code{(comment . "This is a comment")} are
2983 arbitrary comments on the group.  You can display comments in the
2984 group line (@pxref{Group Line Specification}).
2985
2986 @item charset
2987 @cindex charset
2988 Elements that look like @code{(charset . iso-8859-1)} will make
2989 @code{iso-8859-1} the default charset; that is, the charset that will be
2990 used for all articles that do not specify a charset.
2991
2992 See also @code{gnus-group-charset-alist}.
2993
2994 @item ignored-charsets
2995 @cindex ignored-charset
2996 Elements that look like @code{(ignored-charsets x-unknown iso-8859-1)}
2997 will make @code{iso-8859-1} and @code{x-unknown} ignored; that is, the
2998 default charset will be used for decoding articles.
2999
3000 See also @code{gnus-group-ignored-charsets-alist}.
3001
3002 @item posting-style
3003 @cindex posting-style
3004 You can store additional posting style information for this group
3005 here (@pxref{Posting Styles}).  The format is that of an entry in the
3006 @code{gnus-posting-styles} alist, except that there's no regexp matching
3007 the group name (of course).  Style elements in this group parameter will
3008 take precedence over the ones found in @code{gnus-posting-styles}.
3009
3010 For instance, if you want a funky name and signature in this group only,
3011 instead of hacking @code{gnus-posting-styles}, you could put something
3012 like this in the group parameters:
3013
3014 @example
3015 (posting-style
3016   (name "Funky Name")
3017   ("X-My-Header" "Funky Value")
3018   (signature "Funky Signature"))
3019 @end example
3020
3021 If you're using topics to organize your group buffer
3022 (@pxref{Group Topics}), note that posting styles can also be set in
3023 the topics parameters. Posting styles in topic parameters apply to all
3024 groups in this topic. More precisely, the posting-style settings for a
3025 group result from the hierarchical merging of all posting-style
3026 entries in the parameters of this group and all the topics it belongs
3027 to.
3028
3029
3030 @item post-method
3031 @cindex post-method
3032 If it is set, the value is used as the method for posting message
3033 instead of @code{gnus-post-method}.
3034
3035 @item mail-source
3036 @cindex mail-source
3037 If it is set, and the setting of @code{mail-sources} includes a
3038 @code{group} mail source (@pxref{Mail Sources}), the value is a
3039 mail source for this group.
3040
3041 @item banner
3042 @cindex banner
3043 An item like @code{(banner . @var{regexp})} causes any part of an article
3044 that matches the regular expression @var{regexp} to be stripped.  Instead of
3045 @var{regexp}, you can also use the symbol @code{signature} which strips the
3046 last signature or any of the elements of the alist
3047 @code{gnus-article-banner-alist}.
3048
3049 @item sieve
3050 @cindex sieve
3051 This parameter contains a Sieve test that should match incoming mail
3052 that should be placed in this group.  From this group parameter, a
3053 Sieve @samp{IF} control structure is generated, having the test as the
3054 condition and @samp{fileinto "group.name";} as the body.
3055
3056 For example, if the @samp{INBOX.list.sieve} group has the @code{(sieve
3057 address "sender" "sieve-admin@@extundo.com")} group parameter, when
3058 translating the group parameter into a Sieve script (@pxref{Sieve
3059 Commands}) the following Sieve code is generated:
3060
3061 @example
3062 if address "sender" "sieve-admin@@extundo.com" @{
3063         fileinto "INBOX.list.sieve";
3064 @}
3065 @end example
3066
3067 To generate tests for multiple email-addresses use a group parameter
3068 like @code{(sieve address "sender" ("name@@one.org" else@@two.org"))}.
3069 When generating a sieve script (@pxref{Sieve Commands}) Sieve code
3070 like the following is generated:
3071
3072 @example
3073 if address "sender" ["name@@one.org", "else@@two.org"] @{
3074         fileinto "INBOX.list.sieve";
3075 @}
3076 @end example
3077
3078 See @pxref{Sieve Commands} for commands and variables that might be of
3079 interest in relation to the sieve parameter.
3080
3081 The Sieve language is described in RFC 3028.  @xref{Top, Emacs Sieve,
3082 Top, sieve, Emacs Sieve}.
3083
3084 @item (agent parameters)
3085 If the agent has been enabled, you can set any of its parameters to
3086 control the behavior of the agent in individual groups.  See Agent
3087 Parameters in @ref{Category Syntax}.  Most users will choose to set
3088 agent parameters in either an agent category or group topic to
3089 minimize the configuration effort.
3090
3091 @item (@var{variable} @var{form})
3092 You can use the group parameters to set variables local to the group you
3093 are entering.  If you want to turn threading off in @samp{news.answers},
3094 you could put @code{(gnus-show-threads nil)} in the group parameters of
3095 that group.  @code{gnus-show-threads} will be made into a local variable
3096 in the summary buffer you enter, and the form @code{nil} will be
3097 @code{eval}ed there.
3098
3099 Note that this feature sets the variable locally to the summary buffer
3100 if and only if @var{variable} has been bound as a variable.  Otherwise,
3101 only evaluating the form will take place.  So, you may want to bind the
3102 variable in advance using @code{defvar} or other if the result of the
3103 form needs to be set to it.
3104
3105 But some variables are evaluated in the article buffer, or in the
3106 message buffer (of a reply or followup or otherwise newly created
3107 message).  As a workaround, it might help to add the variable in
3108 question to @code{gnus-newsgroup-variables}.  @xref{Various Summary
3109 Stuff}.  So if you want to set @code{message-from-style} via the group
3110 parameters, then you may need the following statement elsewhere in your
3111 @file{~/.gnus.el} file:
3112
3113 @lisp
3114 (add-to-list 'gnus-newsgroup-variables 'message-from-style)
3115 @end lisp
3116
3117 @vindex gnus-list-identifiers
3118 A use for this feature is to remove a mailing list identifier tag in
3119 the subject fields of articles.  E.g. if the news group
3120
3121 @example
3122 nntp+news.gnus.org:gmane.text.docbook.apps
3123 @end example
3124
3125 has the tag @samp{DOC-BOOK-APPS:} in the subject of all articles, this
3126 tag can be removed from the article subjects in the summary buffer for
3127 the group by putting @code{(gnus-list-identifiers "DOCBOOK-APPS:")}
3128 into the group parameters for the group.
3129
3130 This can also be used as a group-specific hook function.  If you want to
3131 hear a beep when you enter a group, you could put something like
3132 @code{(dummy-variable (ding))} in the parameters of that group.  If
3133 @code{dummy-variable} has been bound (see above), it will be set to the
3134 (meaningless) result of the @code{(ding)} form.
3135
3136 Alternatively, since the VARIABLE becomes local to the group, this
3137 pattern can be used to temporarily change a hook.  For example, if the
3138 following is added to a group parameter
3139
3140 @lisp
3141 (gnus-summary-prepared-hook
3142   '(lambda nil (local-set-key "d" (local-key-binding "n"))))
3143 @end lisp
3144
3145 when the group is entered, the 'd' key will not mark the article as
3146 expired.
3147
3148 @end table
3149
3150 @vindex gnus-parameters
3151 Group parameters can be set via the @code{gnus-parameters} variable too.
3152 But some variables, such as @code{visible}, have no effect (For this
3153 case see @code{gnus-permanently-visible-groups} as an alternative.).
3154 For example:
3155
3156 @lisp
3157 (setq gnus-parameters
3158       '(("mail\\..*"
3159          (gnus-show-threads nil)
3160          (gnus-use-scoring nil)
3161          (gnus-summary-line-format
3162           "%U%R%z%I%(%[%d:%ub%-23,23f%]%) %s\n")
3163          (gcc-self . t)
3164          (display . all))
3165
3166         ("^nnimap:\\(foo.bar\\)$"
3167          (to-group . "\\1"))
3168
3169         ("mail\\.me"
3170          (gnus-use-scoring  t))
3171
3172         ("list\\..*"
3173          (total-expire . t)
3174          (broken-reply-to . t))))
3175 @end lisp
3176
3177 String value of parameters will be subjected to regexp substitution, as
3178 the @code{to-group} example shows.
3179
3180 @vindex gnus-parameters-case-fold-search
3181 By default, whether comparing the group name and one of those regexps
3182 specified in @code{gnus-parameters} is done in a case-sensitive manner
3183 or a case-insensitive manner depends on the value of
3184 @code{case-fold-search} at the time when the comparison is done.  The
3185 value of @code{case-fold-search} is typically @code{t}; it means, for
3186 example, the element @code{("INBOX\\.FOO" (total-expire . t))} might be
3187 applied to both the @samp{INBOX.FOO} group and the @samp{INBOX.foo}
3188 group.  If you want to make those regexps always case-sensitive, set the
3189 value of the @code{gnus-parameters-case-fold-search} variable to
3190 @code{nil}.  Otherwise, set it to @code{t} if you want to compare them
3191 always in a case-insensitive manner.
3192
3193 You can define different sorting to different groups via
3194 @code{gnus-parameters}.  Here is an example to sort an @acronym{NNTP}
3195 group by reverse date to see the latest news at the top and an
3196 @acronym{RSS} group by subject.  In this example, the first group is the
3197 Debian daily news group @code{gmane.linux.debian.user.news} from
3198 news.gmane.org.  The @acronym{RSS} group corresponds to the Debian
3199 weekly news RSS feed
3200 @url{http://packages.debian.org/unstable/newpkg_main.en.rdf},
3201 @xref{RSS}.
3202
3203 @lisp
3204 (setq
3205  gnus-parameters
3206  '(("nntp.*gmane\\.debian\\.user\\.news"
3207     (gnus-show-threads nil)
3208     (gnus-article-sort-functions '((not gnus-article-sort-by-date)))
3209     (gnus-use-adaptive-scoring nil)
3210     (gnus-use-scoring nil))
3211    ("nnrss.*debian"
3212     (gnus-show-threads nil)
3213     (gnus-article-sort-functions 'gnus-article-sort-by-subject)
3214     (gnus-use-adaptive-scoring nil)
3215     (gnus-use-scoring t)
3216     (gnus-score-find-score-files-function 'gnus-score-find-single)
3217     (gnus-summary-line-format "%U%R%z%d %I%(%[ %s %]%)\n"))))
3218 @end lisp
3219
3220
3221 @node Listing Groups
3222 @section Listing Groups
3223 @cindex group listing
3224
3225 These commands all list various slices of the groups available.
3226
3227 @table @kbd
3228
3229 @item l
3230 @itemx A s
3231 @kindex A s (Group)
3232 @kindex l (Group)
3233 @findex gnus-group-list-groups
3234 List all groups that have unread articles
3235 (@code{gnus-group-list-groups}).  If the numeric prefix is used, this
3236 command will list only groups of level ARG and lower.  By default, it
3237 only lists groups of level five (i.e.,
3238 @code{gnus-group-default-list-level}) or lower (i.e., just subscribed
3239 groups).
3240
3241 @item L
3242 @itemx A u
3243 @kindex A u (Group)
3244 @kindex L (Group)
3245 @findex gnus-group-list-all-groups
3246 List all groups, whether they have unread articles or not
3247 (@code{gnus-group-list-all-groups}).  If the numeric prefix is used,
3248 this command will list only groups of level ARG and lower.  By default,
3249 it lists groups of level seven or lower (i.e., just subscribed and
3250 unsubscribed groups).
3251
3252 @item A l
3253 @kindex A l (Group)
3254 @findex gnus-group-list-level
3255 List all unread groups on a specific level
3256 (@code{gnus-group-list-level}).  If given a prefix, also list the groups
3257 with no unread articles.
3258
3259 @item A k
3260 @kindex A k (Group)
3261 @findex gnus-group-list-killed
3262 List all killed groups (@code{gnus-group-list-killed}).  If given a
3263 prefix argument, really list all groups that are available, but aren't
3264 currently (un)subscribed.  This could entail reading the active file
3265 from the server.
3266
3267 @item A z
3268 @kindex A z (Group)
3269 @findex gnus-group-list-zombies
3270 List all zombie groups (@code{gnus-group-list-zombies}).
3271
3272 @item A m
3273 @kindex A m (Group)
3274 @findex gnus-group-list-matching
3275 List all unread, subscribed groups with names that match a regexp
3276 (@code{gnus-group-list-matching}).
3277
3278 @item A M
3279 @kindex A M (Group)
3280 @findex gnus-group-list-all-matching
3281 List groups that match a regexp (@code{gnus-group-list-all-matching}).
3282
3283 @item A A
3284 @kindex A A (Group)
3285 @findex gnus-group-list-active
3286 List absolutely all groups in the active file(s) of the
3287 server(s) you are connected to (@code{gnus-group-list-active}).  This
3288 might very well take quite a while.  It might actually be a better idea
3289 to do a @kbd{A M} to list all matching, and just give @samp{.} as the
3290 thing to match on.  Also note that this command may list groups that
3291 don't exist (yet)---these will be listed as if they were killed groups.
3292 Take the output with some grains of salt.
3293
3294 @item A a
3295 @kindex A a (Group)
3296 @findex gnus-group-apropos
3297 List all groups that have names that match a regexp
3298 (@code{gnus-group-apropos}).
3299
3300 @item A d
3301 @kindex A d (Group)
3302 @findex gnus-group-description-apropos
3303 List all groups that have names or descriptions that match a regexp
3304 (@code{gnus-group-description-apropos}).
3305
3306 @item A c
3307 @kindex A c (Group)
3308 @findex gnus-group-list-cached
3309 List all groups with cached articles (@code{gnus-group-list-cached}).
3310
3311 @item A ?
3312 @kindex A ? (Group)
3313 @findex gnus-group-list-dormant
3314 List all groups with dormant articles (@code{gnus-group-list-dormant}).
3315
3316 @item A /
3317 @kindex A / (Group)
3318 @findex gnus-group-list-limit
3319 List groups limited within the current selection
3320 (@code{gnus-group-list-limit}).
3321
3322 @item A f
3323 @kindex A f (Group)
3324 @findex gnus-group-list-flush
3325 Flush groups from the current selection (@code{gnus-group-list-flush}).
3326
3327 @item A p
3328 @kindex A p (Group)
3329 @findex gnus-group-list-plus
3330 List groups plus the current selection (@code{gnus-group-list-plus}).
3331
3332 @end table
3333
3334 @vindex gnus-permanently-visible-groups
3335 @cindex visible group parameter
3336 Groups that match the @code{gnus-permanently-visible-groups} regexp will
3337 always be shown, whether they have unread articles or not.  You can also
3338 add the @code{visible} element to the group parameters in question to
3339 get the same effect.
3340
3341 @vindex gnus-list-groups-with-ticked-articles
3342 Groups that have just ticked articles in it are normally listed in the
3343 group buffer.  If @code{gnus-list-groups-with-ticked-articles} is
3344 @code{nil}, these groups will be treated just like totally empty
3345 groups.  It is @code{t} by default.
3346
3347
3348 @node Sorting Groups
3349 @section Sorting Groups
3350 @cindex sorting groups
3351
3352 @kindex C-c C-s (Group)
3353 @findex gnus-group-sort-groups
3354 @vindex gnus-group-sort-function
3355 The @kbd{C-c C-s} (@code{gnus-group-sort-groups}) command sorts the
3356 group buffer according to the function(s) given by the
3357 @code{gnus-group-sort-function} variable.  Available sorting functions
3358 include:
3359
3360 @table @code
3361
3362 @item gnus-group-sort-by-alphabet
3363 @findex gnus-group-sort-by-alphabet
3364 Sort the group names alphabetically.  This is the default.
3365
3366 @item gnus-group-sort-by-real-name
3367 @findex gnus-group-sort-by-real-name
3368 Sort the group alphabetically on the real (unprefixed) group names.
3369
3370 @item gnus-group-sort-by-level
3371 @findex gnus-group-sort-by-level
3372 Sort by group level.
3373
3374 @item gnus-group-sort-by-score
3375 @findex gnus-group-sort-by-score
3376 Sort by group score.  @xref{Group Score}.
3377
3378 @item gnus-group-sort-by-rank
3379 @findex gnus-group-sort-by-rank
3380 Sort by group score and then the group level.  The level and the score
3381 are, when taken together, the group's @dfn{rank}.  @xref{Group Score}.
3382
3383 @item gnus-group-sort-by-unread
3384 @findex gnus-group-sort-by-unread
3385 Sort by number of unread articles.
3386
3387 @item gnus-group-sort-by-method
3388 @findex gnus-group-sort-by-method
3389 Sort alphabetically on the select method.
3390
3391 @item gnus-group-sort-by-server
3392 @findex gnus-group-sort-by-server
3393 Sort alphabetically on the Gnus server name.
3394
3395
3396 @end table
3397
3398 @code{gnus-group-sort-function} can also be a list of sorting
3399 functions.  In that case, the most significant sort key function must be
3400 the last one.
3401
3402
3403 There are also a number of commands for sorting directly according to
3404 some sorting criteria:
3405
3406 @table @kbd
3407 @item G S a
3408 @kindex G S a (Group)
3409 @findex gnus-group-sort-groups-by-alphabet
3410 Sort the group buffer alphabetically by group name
3411 (@code{gnus-group-sort-groups-by-alphabet}).
3412
3413 @item G S u
3414 @kindex G S u (Group)
3415 @findex gnus-group-sort-groups-by-unread
3416 Sort the group buffer by the number of unread articles
3417 (@code{gnus-group-sort-groups-by-unread}).
3418
3419 @item G S l
3420 @kindex G S l (Group)
3421 @findex gnus-group-sort-groups-by-level
3422 Sort the group buffer by group level
3423 (@code{gnus-group-sort-groups-by-level}).
3424
3425 @item G S v
3426 @kindex G S v (Group)
3427 @findex gnus-group-sort-groups-by-score
3428 Sort the group buffer by group score
3429 (@code{gnus-group-sort-groups-by-score}).  @xref{Group Score}.
3430
3431 @item G S r
3432 @kindex G S r (Group)
3433 @findex gnus-group-sort-groups-by-rank
3434 Sort the group buffer by group rank
3435 (@code{gnus-group-sort-groups-by-rank}).  @xref{Group Score}.
3436
3437 @item G S m
3438 @kindex G S m (Group)
3439 @findex gnus-group-sort-groups-by-method
3440 Sort the group buffer alphabetically by back end name@*
3441 (@code{gnus-group-sort-groups-by-method}).
3442
3443 @item G S n
3444 @kindex G S n (Group)
3445 @findex gnus-group-sort-groups-by-real-name
3446 Sort the group buffer alphabetically by real (unprefixed) group name
3447 (@code{gnus-group-sort-groups-by-real-name}).
3448
3449 @end table
3450
3451 All the commands below obey the process/prefix convention
3452 (@pxref{Process/Prefix}).
3453
3454 When given a symbolic prefix (@pxref{Symbolic Prefixes}), all these
3455 commands will sort in reverse order.
3456
3457 You can also sort a subset of the groups:
3458
3459 @table @kbd
3460 @item G P a
3461 @kindex G P a (Group)
3462 @findex gnus-group-sort-selected-groups-by-alphabet
3463 Sort the groups alphabetically by group name
3464 (@code{gnus-group-sort-selected-groups-by-alphabet}).
3465
3466 @item G P u
3467 @kindex G P u (Group)
3468 @findex gnus-group-sort-selected-groups-by-unread
3469 Sort the groups by the number of unread articles
3470 (@code{gnus-group-sort-selected-groups-by-unread}).
3471
3472 @item G P l
3473 @kindex G P l (Group)
3474 @findex gnus-group-sort-selected-groups-by-level
3475 Sort the groups by group level
3476 (@code{gnus-group-sort-selected-groups-by-level}).
3477
3478 @item G P v
3479 @kindex G P v (Group)
3480 @findex gnus-group-sort-selected-groups-by-score
3481 Sort the groups by group score
3482 (@code{gnus-group-sort-selected-groups-by-score}).  @xref{Group Score}.
3483
3484 @item G P r
3485 @kindex G P r (Group)
3486 @findex gnus-group-sort-selected-groups-by-rank
3487 Sort the groups by group rank
3488 (@code{gnus-group-sort-selected-groups-by-rank}).  @xref{Group Score}.
3489
3490 @item G P m
3491 @kindex G P m (Group)
3492 @findex gnus-group-sort-selected-groups-by-method
3493 Sort the groups alphabetically by back end name@*
3494 (@code{gnus-group-sort-selected-groups-by-method}).
3495
3496 @item G P n
3497 @kindex G P n (Group)
3498 @findex gnus-group-sort-selected-groups-by-real-name
3499 Sort the groups alphabetically by real (unprefixed) group name
3500 (@code{gnus-group-sort-selected-groups-by-real-name}).
3501
3502 @item G P s
3503 @kindex G P s (Group)
3504 @findex gnus-group-sort-selected-groups
3505 Sort the groups according to @code{gnus-group-sort-function}.
3506
3507 @end table
3508
3509 And finally, note that you can use @kbd{C-k} and @kbd{C-y} to manually
3510 move groups around.
3511
3512
3513 @node Group Maintenance
3514 @section Group Maintenance
3515 @cindex bogus groups
3516
3517 @table @kbd
3518 @item b
3519 @kindex b (Group)
3520 @findex gnus-group-check-bogus-groups
3521 Find bogus groups and delete them
3522 (@code{gnus-group-check-bogus-groups}).
3523
3524 @item F
3525 @kindex F (Group)
3526 @findex gnus-group-find-new-groups
3527 Find new groups and process them (@code{gnus-group-find-new-groups}).
3528 With 1 @kbd{C-u}, use the @code{ask-server} method to query the server
3529 for new groups.  With 2 @kbd{C-u}'s, use most complete method possible
3530 to query the server for new groups, and subscribe the new groups as
3531 zombies.
3532
3533 @item C-c C-x
3534 @kindex C-c C-x (Group)
3535 @findex gnus-group-expire-articles
3536 @cindex expiring mail
3537 Run all expirable articles in the current group through the expiry
3538 process (if any) (@code{gnus-group-expire-articles}).  That is, delete
3539 all expirable articles in the group that have been around for a while.
3540 (@pxref{Expiring Mail}).
3541
3542 @item C-c C-M-x
3543 @kindex C-c C-M-x (Group)
3544 @findex gnus-group-expire-all-groups
3545 @cindex expiring mail
3546 Run all expirable articles in all groups through the expiry process
3547 (@code{gnus-group-expire-all-groups}).
3548
3549 @end table
3550
3551
3552 @node Browse Foreign Server
3553 @section Browse Foreign Server
3554 @cindex foreign servers
3555 @cindex browsing servers
3556
3557 @table @kbd
3558 @item B
3559 @kindex B (Group)
3560 @findex gnus-group-browse-foreign-server
3561 You will be queried for a select method and a server name.  Gnus will
3562 then attempt to contact this server and let you browse the groups there
3563 (@code{gnus-group-browse-foreign-server}).
3564 @end table
3565
3566 @findex gnus-browse-mode
3567 A new buffer with a list of available groups will appear.  This buffer
3568 will use the @code{gnus-browse-mode}.  This buffer looks a bit (well,
3569 a lot) like a normal group buffer.
3570
3571 Here's a list of keystrokes available in the browse mode:
3572
3573 @table @kbd
3574 @item n
3575 @kindex n (Browse)
3576 @findex gnus-group-next-group
3577 Go to the next group (@code{gnus-group-next-group}).
3578
3579 @item p
3580 @kindex p (Browse)
3581 @findex gnus-group-prev-group
3582 Go to the previous group (@code{gnus-group-prev-group}).
3583
3584 @item SPACE
3585 @kindex SPACE (Browse)
3586 @findex gnus-browse-read-group
3587 Enter the current group and display the first article
3588 (@code{gnus-browse-read-group}).
3589
3590 @item RET
3591 @kindex RET (Browse)
3592 @findex gnus-browse-select-group
3593 Enter the current group (@code{gnus-browse-select-group}).
3594
3595 @item u
3596 @kindex u (Browse)
3597 @findex gnus-browse-unsubscribe-current-group
3598 @vindex gnus-browse-subscribe-newsgroup-method
3599 Unsubscribe to the current group, or, as will be the case here,
3600 subscribe to it (@code{gnus-browse-unsubscribe-current-group}).  You
3601 can affect the way the new group is entered into the Group buffer
3602 using the variable @code{gnus-browse-subscribe-newsgroup-method}.  See
3603 @pxref{Subscription Methods} for available options.
3604
3605 @item l
3606 @itemx q
3607 @kindex q (Browse)
3608 @kindex l (Browse)
3609 @findex gnus-browse-exit
3610 Exit browse mode (@code{gnus-browse-exit}).
3611
3612 @item d
3613 @kindex d (Browse)
3614 @findex gnus-browse-describe-group
3615 Describe the current group (@code{gnus-browse-describe-group}).
3616
3617 @item ?
3618 @kindex ? (Browse)
3619 @findex gnus-browse-describe-briefly
3620 Describe browse mode briefly (well, there's not much to describe, is
3621 there) (@code{gnus-browse-describe-briefly}).
3622 @end table
3623
3624
3625 @node Exiting Gnus
3626 @section Exiting Gnus
3627 @cindex exiting Gnus
3628
3629 Yes, Gnus is ex(c)iting.
3630
3631 @table @kbd
3632 @item z
3633 @kindex z (Group)
3634 @findex gnus-group-suspend
3635 Suspend Gnus (@code{gnus-group-suspend}).  This doesn't really exit Gnus,
3636 but it kills all buffers except the Group buffer.  I'm not sure why this
3637 is a gain, but then who am I to judge?
3638
3639 @item q
3640 @kindex q (Group)
3641 @findex gnus-group-exit
3642 @c @icon{gnus-group-exit}
3643 Quit Gnus (@code{gnus-group-exit}).
3644
3645 @item Q
3646 @kindex Q (Group)
3647 @findex gnus-group-quit
3648 Quit Gnus without saving the @file{.newsrc} files (@code{gnus-group-quit}).
3649 The dribble file will be saved, though (@pxref{Auto Save}).
3650 @end table
3651
3652 @vindex gnus-exit-gnus-hook
3653 @vindex gnus-suspend-gnus-hook
3654 @vindex gnus-after-exiting-gnus-hook
3655 @code{gnus-suspend-gnus-hook} is called when you suspend Gnus and
3656 @code{gnus-exit-gnus-hook} is called when you quit Gnus, while
3657 @code{gnus-after-exiting-gnus-hook} is called as the final item when
3658 exiting Gnus.
3659
3660 Note:
3661
3662 @quotation
3663 Miss Lisa Cannifax, while sitting in English class, felt her feet go
3664 numbly heavy and herself fall into a hazy trance as the boy sitting
3665 behind her drew repeated lines with his pencil across the back of her
3666 plastic chair.
3667 @end quotation
3668
3669
3670 @node Group Topics
3671 @section Group Topics
3672 @cindex topics
3673
3674 If you read lots and lots of groups, it might be convenient to group
3675 them hierarchically according to topics.  You put your Emacs groups over
3676 here, your sex groups over there, and the rest (what, two groups or so?)
3677 you put in some misc section that you never bother with anyway.  You can
3678 even group the Emacs sex groups as a sub-topic to either the Emacs
3679 groups or the sex groups---or both!  Go wild!
3680
3681 @iftex
3682 @iflatex
3683 \gnusfigure{Group Topics}{400}{
3684 \put(75,50){\epsfig{figure=ps/group-topic,height=9cm}}
3685 }
3686 @end iflatex
3687 @end iftex
3688
3689 Here's an example:
3690
3691 @example
3692 Gnus
3693   Emacs -- I wuw it!
3694      3: comp.emacs
3695      2: alt.religion.emacs
3696     Naughty Emacs
3697      452: alt.sex.emacs
3698        0: comp.talk.emacs.recovery
3699   Misc
3700      8: comp.binaries.fractals
3701     13: comp.sources.unix
3702 @end example
3703
3704 @findex gnus-topic-mode
3705 @kindex t (Group)
3706 To get this @emph{fab} functionality you simply turn on (ooh!) the
3707 @code{gnus-topic} minor mode---type @kbd{t} in the group buffer.  (This
3708 is a toggling command.)
3709
3710 Go ahead, just try it.  I'll still be here when you get back.  La de
3711 dum@dots{} Nice tune, that@dots{} la la la@dots{} What, you're back?
3712 Yes, and now press @kbd{l}.  There.  All your groups are now listed
3713 under @samp{misc}.  Doesn't that make you feel all warm and fuzzy?
3714 Hot and bothered?
3715
3716 If you want this permanently enabled, you should add that minor mode to
3717 the hook for the group mode.  Put the following line in your
3718 @file{~/.gnus.el} file:
3719
3720 @lisp
3721 (add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
3722 @end lisp
3723
3724 @menu
3725 * Topic Commands::              Interactive E-Z commands.
3726 * Topic Variables::             How to customize the topics the Lisp Way.
3727 * Topic Sorting::               Sorting each topic individually.
3728 * Topic Topology::              A map of the world.
3729 * Topic Parameters::            Parameters that apply to all groups in a topic.
3730 @end menu
3731
3732
3733 @node Topic Commands
3734 @subsection Topic Commands
3735 @cindex topic commands
3736
3737 When the topic minor mode is turned on, a new @kbd{T} submap will be
3738 available.  In addition, a few of the standard keys change their
3739 definitions slightly.
3740
3741 In general, the following kinds of operations are possible on topics.
3742 First of all, you want to create topics.  Secondly, you want to put
3743 groups in topics and to move them around until you have an order you
3744 like.  The third kind of operation is to show/hide parts of the whole
3745 shebang.  You might want to hide a topic including its subtopics and
3746 groups, to get a better overview of the other groups.
3747
3748 Here is a list of the basic keys that you might need to set up topics
3749 the way you like.
3750
3751 @table @kbd
3752
3753 @item T n
3754 @kindex T n (Topic)
3755 @findex gnus-topic-create-topic
3756 Prompt for a new topic name and create it
3757 (@code{gnus-topic-create-topic}).
3758
3759 @item T TAB
3760 @itemx TAB
3761 @kindex T TAB (Topic)
3762 @kindex TAB (Topic)
3763 @findex gnus-topic-indent
3764 ``Indent'' the current topic so that it becomes a sub-topic of the
3765 previous topic (@code{gnus-topic-indent}).  If given a prefix,
3766 ``un-indent'' the topic instead.
3767
3768 @item M-TAB
3769 @kindex M-TAB (Topic)
3770 @findex gnus-topic-unindent
3771 ``Un-indent'' the current topic so that it becomes a sub-topic of the
3772 parent of its current parent (@code{gnus-topic-unindent}).
3773
3774 @end table
3775
3776 The following two keys can be used to move groups and topics around.
3777 They work like the well-known cut and paste.  @kbd{C-k} is like cut and
3778 @kbd{C-y} is like paste.  Of course, this being Emacs, we use the terms
3779 kill and yank rather than cut and paste.
3780
3781 @table @kbd
3782
3783 @item C-k
3784 @kindex C-k (Topic)
3785 @findex gnus-topic-kill-group
3786 Kill a group or topic (@code{gnus-topic-kill-group}).  All groups in the
3787 topic will be removed along with the topic.
3788
3789 @item C-y
3790 @kindex C-y (Topic)
3791 @findex gnus-topic-yank-group
3792 Yank the previously killed group or topic
3793 (@code{gnus-topic-yank-group}).  Note that all topics will be yanked
3794 before all groups.
3795
3796 So, to move a topic to the beginning of the list of topics, just hit
3797 @kbd{C-k} on it.  This is like the ``cut'' part of cut and paste.  Then,
3798 move the cursor to the beginning of the buffer (just below the ``Gnus''
3799 topic) and hit @kbd{C-y}.  This is like the ``paste'' part of cut and
3800 paste.  Like I said -- E-Z.
3801
3802 You can use @kbd{C-k} and @kbd{C-y} on groups as well as on topics.  So
3803 you can move topics around as well as groups.
3804
3805 @end table
3806
3807 After setting up the topics the way you like them, you might wish to
3808 hide a topic, or to show it again.  That's why we have the following
3809 key.
3810
3811 @table @kbd
3812
3813 @item RET
3814 @kindex RET (Topic)
3815 @findex gnus-topic-select-group
3816 @itemx SPACE
3817 Either select a group or fold a topic (@code{gnus-topic-select-group}).
3818 When you perform this command on a group, you'll enter the group, as
3819 usual.  When done on a topic line, the topic will be folded (if it was
3820 visible) or unfolded (if it was folded already).  So it's basically a
3821 toggling command on topics.  In addition, if you give a numerical
3822 prefix, group on that level (and lower) will be displayed.
3823
3824 @end table
3825
3826 Now for a list of other commands, in no particular order.
3827
3828 @table @kbd
3829
3830 @item T m
3831 @kindex T m (Topic)
3832 @findex gnus-topic-move-group
3833 Move the current group to some other topic
3834 (@code{gnus-topic-move-group}).  This command uses the process/prefix
3835 convention (@pxref{Process/Prefix}).
3836
3837 @item T j
3838 @kindex T j (Topic)
3839 @findex gnus-topic-jump-to-topic
3840 Go to a topic (@code{gnus-topic-jump-to-topic}).
3841
3842 @item T c
3843 @kindex T c (Topic)
3844 @findex gnus-topic-copy-group
3845 Copy the current group to some other topic
3846 (@code{gnus-topic-copy-group}).  This command uses the process/prefix
3847 convention (@pxref{Process/Prefix}).
3848
3849 @item T h
3850 @kindex T h (Topic)
3851 @findex gnus-topic-hide-topic
3852 Hide the current topic (@code{gnus-topic-hide-topic}).  If given
3853 a prefix, hide the topic permanently.
3854
3855 @item T s
3856 @kindex T s (Topic)
3857 @findex gnus-topic-show-topic
3858 Show the current topic (@code{gnus-topic-show-topic}).  If given
3859 a prefix, show the topic permanently.
3860
3861 @item T D
3862 @kindex T D (Topic)
3863 @findex gnus-topic-remove-group
3864 Remove a group from the current topic (@code{gnus-topic-remove-group}).
3865 This command is mainly useful if you have the same group in several
3866 topics and wish to remove it from one of the topics.  You may also
3867 remove a group from all topics, but in that case, Gnus will add it to
3868 the root topic the next time you start Gnus.  In fact, all new groups
3869 (which, naturally, don't belong to any topic) will show up in the root
3870 topic.
3871
3872 This command uses the process/prefix convention
3873 (@pxref{Process/Prefix}).
3874
3875 @item T M
3876 @kindex T M (Topic)
3877 @findex gnus-topic-move-matching
3878 Move all groups that match some regular expression to a topic
3879 (@code{gnus-topic-move-matching}).
3880
3881 @item T C
3882 @kindex T C (Topic)
3883 @findex gnus-topic-copy-matching
3884 Copy all groups that match some regular expression to a topic
3885 (@code{gnus-topic-copy-matching}).
3886
3887 @item T H
3888 @kindex T H (Topic)
3889 @findex gnus-topic-toggle-display-empty-topics
3890 Toggle hiding empty topics
3891 (@code{gnus-topic-toggle-display-empty-topics}).
3892
3893 @item T #
3894 @kindex T # (Topic)
3895 @findex gnus-topic-mark-topic
3896 Mark all groups in the current topic with the process mark
3897 (@code{gnus-topic-mark-topic}).  This command works recursively on
3898 sub-topics unless given a prefix.
3899
3900 @item T M-#
3901 @kindex T M-# (Topic)
3902 @findex gnus-topic-unmark-topic
3903 Remove the process mark from all groups in the current topic
3904 (@code{gnus-topic-unmark-topic}).  This command works recursively on
3905 sub-topics unless given a prefix.
3906
3907 @item C-c C-x
3908 @kindex C-c C-x (Topic)
3909 @findex gnus-topic-expire-articles
3910 @cindex expiring mail
3911 Run all expirable articles in the current group or topic through the
3912 expiry process (if any)
3913 (@code{gnus-topic-expire-articles}).  (@pxref{Expiring Mail}).
3914
3915 @item T r
3916 @kindex T r (Topic)
3917 @findex gnus-topic-rename
3918 Rename a topic (@code{gnus-topic-rename}).
3919
3920 @item T DEL
3921 @kindex T DEL (Topic)
3922 @findex gnus-topic-delete
3923 Delete an empty topic (@code{gnus-topic-delete}).
3924
3925 @item A T
3926 @kindex A T (Topic)
3927 @findex gnus-topic-list-active
3928 List all groups that Gnus knows about in a topics-ified way
3929 (@code{gnus-topic-list-active}).
3930
3931 @item T M-n
3932 @kindex T M-n (Topic)
3933 @findex gnus-topic-goto-next-topic
3934 Go to the next topic (@code{gnus-topic-goto-next-topic}).
3935
3936 @item T M-p
3937 @kindex T M-p (Topic)
3938 @findex gnus-topic-goto-previous-topic
3939 Go to the previous topic (@code{gnus-topic-goto-previous-topic}).
3940
3941 @item G p
3942 @kindex G p (Topic)
3943 @findex gnus-topic-edit-parameters
3944 @cindex group parameters
3945 @cindex topic parameters
3946 @cindex parameters
3947 Edit the topic parameters (@code{gnus-topic-edit-parameters}).
3948 @xref{Topic Parameters}.
3949
3950 @end table
3951
3952
3953 @node Topic Variables
3954 @subsection Topic Variables
3955 @cindex topic variables
3956
3957 The previous section told you how to tell Gnus which topics to display.
3958 This section explains how to tell Gnus what to display about each topic.
3959
3960 @vindex gnus-topic-line-format
3961 The topic lines themselves are created according to the
3962 @code{gnus-topic-line-format} variable (@pxref{Formatting Variables}).
3963 Valid elements are:
3964
3965 @table @samp
3966 @item i
3967 Indentation.
3968 @item n
3969 Topic name.
3970 @item v
3971 Visibility.
3972 @item l
3973 Level.
3974 @item g
3975 Number of groups in the topic.
3976 @item a
3977 Number of unread articles in the topic.
3978 @item A
3979 Number of unread articles in the topic and all its subtopics.
3980 @end table
3981
3982 @vindex gnus-topic-indent-level
3983 Each sub-topic (and the groups in the sub-topics) will be indented with
3984 @code{gnus-topic-indent-level} times the topic level number of spaces.
3985 The default is 2.
3986
3987 @vindex gnus-topic-mode-hook
3988 @code{gnus-topic-mode-hook} is called in topic minor mode buffers.
3989
3990 @vindex gnus-topic-display-empty-topics
3991 The @code{gnus-topic-display-empty-topics} says whether to display even
3992 topics that have no unread articles in them.  The default is @code{t}.
3993
3994
3995 @node Topic Sorting
3996 @subsection Topic Sorting
3997 @cindex topic sorting
3998
3999 You can sort the groups in each topic individually with the following
4000 commands:
4001
4002
4003 @table @kbd
4004 @item T S a
4005 @kindex T S a (Topic)
4006 @findex gnus-topic-sort-groups-by-alphabet
4007 Sort the current topic alphabetically by group name
4008 (@code{gnus-topic-sort-groups-by-alphabet}).
4009
4010 @item T S u
4011 @kindex T S u (Topic)
4012 @findex gnus-topic-sort-groups-by-unread
4013 Sort the current topic by the number of unread articles
4014 (@code{gnus-topic-sort-groups-by-unread}).
4015
4016 @item T S l
4017 @kindex T S l (Topic)
4018 @findex gnus-topic-sort-groups-by-level
4019 Sort the current topic by group level
4020 (@code{gnus-topic-sort-groups-by-level}).
4021
4022 @item T S v
4023 @kindex T S v (Topic)
4024 @findex gnus-topic-sort-groups-by-score
4025 Sort the current topic by group score
4026 (@code{gnus-topic-sort-groups-by-score}).  @xref{Group Score}.
4027
4028 @item T S r
4029 @kindex T S r (Topic)
4030 @findex gnus-topic-sort-groups-by-rank
4031 Sort the current topic by group rank
4032 (@code{gnus-topic-sort-groups-by-rank}).  @xref{Group Score}.
4033
4034 @item T S m
4035 @kindex T S m (Topic)
4036 @findex gnus-topic-sort-groups-by-method
4037 Sort the current topic alphabetically by back end name
4038 (@code{gnus-topic-sort-groups-by-method}).
4039
4040 @item T S e
4041 @kindex T S e (Topic)
4042 @findex gnus-topic-sort-groups-by-server
4043 Sort the current topic alphabetically by server name
4044 (@code{gnus-topic-sort-groups-by-server}).
4045
4046 @item T S s
4047 @kindex T S s (Topic)
4048 @findex gnus-topic-sort-groups
4049 Sort the current topic according to the function(s) given by the
4050 @code{gnus-group-sort-function} variable
4051 (@code{gnus-topic-sort-groups}).
4052
4053 @end table
4054
4055 When given a prefix argument, all these commands will sort in reverse
4056 order.  @xref{Sorting Groups}, for more information about group
4057 sorting.
4058
4059
4060 @node Topic Topology
4061 @subsection Topic Topology
4062 @cindex topic topology
4063 @cindex topology
4064
4065 So, let's have a look at an example group buffer:
4066
4067 @example
4068 @group
4069 Gnus
4070   Emacs -- I wuw it!
4071      3: comp.emacs
4072      2: alt.religion.emacs
4073     Naughty Emacs
4074      452: alt.sex.emacs
4075        0: comp.talk.emacs.recovery
4076   Misc
4077      8: comp.binaries.fractals
4078     13: comp.sources.unix
4079 @end group
4080 @end example
4081
4082 So, here we have one top-level topic (@samp{Gnus}), two topics under
4083 that, and one sub-topic under one of the sub-topics.  (There is always
4084 just one (1) top-level topic).  This topology can be expressed as
4085 follows:
4086
4087 @lisp
4088 (("Gnus" visible)
4089  (("Emacs -- I wuw it!" visible)
4090   (("Naughty Emacs" visible)))
4091  (("Misc" visible)))
4092 @end lisp
4093
4094 @vindex gnus-topic-topology
4095 This is in fact how the variable @code{gnus-topic-topology} would look
4096 for the display above.  That variable is saved in the @file{.newsrc.eld}
4097 file, and shouldn't be messed with manually---unless you really want
4098 to.  Since this variable is read from the @file{.newsrc.eld} file,
4099 setting it in any other startup files will have no effect.
4100
4101 This topology shows what topics are sub-topics of what topics (right),
4102 and which topics are visible.  Two settings are currently
4103 allowed---@code{visible} and @code{invisible}.
4104
4105
4106 @node Topic Parameters
4107 @subsection Topic Parameters
4108 @cindex topic parameters
4109
4110 All groups in a topic will inherit group parameters from the parent
4111 (and ancestor) topic parameters.  All valid group parameters are valid
4112 topic parameters (@pxref{Group Parameters}).  When the agent is
4113 enabled, all agent parameters (See Agent Parameters in @ref{Category
4114 Syntax}) are also valid topic parameters.
4115
4116 In addition, the following parameters are only valid as topic
4117 parameters:
4118
4119 @table @code
4120 @item subscribe
4121 When subscribing new groups by topic (@pxref{Subscription Methods}), the
4122 @code{subscribe} topic parameter says what groups go in what topic.  Its
4123 value should be a regexp to match the groups that should go in that
4124 topic.
4125
4126 @item subscribe-level
4127 When subscribing new groups by topic (see the @code{subscribe} parameter),
4128 the group will be subscribed with the level specified in the
4129 @code{subscribe-level} instead of @code{gnus-level-default-subscribed}.
4130
4131 @end table
4132
4133 Group parameters (of course) override topic parameters, and topic
4134 parameters in sub-topics override topic parameters in super-topics.  You
4135 know.  Normal inheritance rules.  (@dfn{Rules} is here a noun, not a
4136 verb, although you may feel free to disagree with me here.)
4137
4138 @example
4139 @group
4140 Gnus
4141   Emacs
4142      3: comp.emacs
4143      2: alt.religion.emacs
4144    452: alt.sex.emacs
4145     Relief
4146      452: alt.sex.emacs
4147        0: comp.talk.emacs.recovery
4148   Misc
4149      8: comp.binaries.fractals
4150     13: comp.sources.unix
4151    452: alt.sex.emacs
4152 @end group
4153 @end example
4154
4155 The @samp{Emacs} topic has the topic parameter @code{(score-file
4156 . "emacs.SCORE")}; the @samp{Relief} topic has the topic parameter
4157 @code{(score-file . "relief.SCORE")}; and the @samp{Misc} topic has the
4158 topic parameter @code{(score-file . "emacs.SCORE")}.  In addition,
4159 @* @samp{alt.religion.emacs} has the group parameter @code{(score-file
4160 . "religion.SCORE")}.
4161
4162 Now, when you enter @samp{alt.sex.emacs} in the @samp{Relief} topic, you
4163 will get the @file{relief.SCORE} home score file.  If you enter the same
4164 group in the @samp{Emacs} topic, you'll get the @file{emacs.SCORE} home
4165 score file.  If you enter the group @samp{alt.religion.emacs}, you'll
4166 get the @file{religion.SCORE} home score file.
4167
4168 This seems rather simple and self-evident, doesn't it?  Well, yes.  But
4169 there are some problems, especially with the @code{total-expiry}
4170 parameter.  Say you have a mail group in two topics; one with
4171 @code{total-expiry} and one without.  What happens when you do @kbd{M-x
4172 gnus-expire-all-expirable-groups}?  Gnus has no way of telling which one
4173 of these topics you mean to expire articles from, so anything may
4174 happen.  In fact, I hereby declare that it is @dfn{undefined} what
4175 happens.  You just have to be careful if you do stuff like that.
4176
4177
4178 @node Non-ASCII Group Names
4179 @section Accessing groups of non-English names
4180 @cindex non-ascii group names
4181
4182 There are some news servers that provide groups of which the names are
4183 expressed with their native languages in the world.  For instance, in a
4184 certain news server there are some newsgroups of which the names are
4185 spelled in Chinese, where people are talking in Chinese.  You can, of
4186 course, subscribe to such news groups using Gnus.  Currently Gnus
4187 supports non-@acronym{ASCII} group names not only with the @code{nntp}
4188 back end but also with the @code{nnml} back end and the @code{nnrss}
4189 back end.
4190
4191 Every such group name is encoded by a certain charset in the server
4192 side (in an @acronym{NNTP} server its administrator determines the
4193 charset, but for groups in the other back ends it is determined by you).
4194 Gnus has to display the decoded ones for you in the group buffer and the
4195 article buffer, and needs to use the encoded ones when communicating
4196 with servers.  However, Gnus doesn't know what charset is used for each
4197 non-@acronym{ASCII} group name.  The following two variables are just
4198 the ones for telling Gnus what charset should be used for each group:
4199
4200 @table @code
4201 @item gnus-group-name-charset-method-alist
4202 @vindex gnus-group-name-charset-method-alist
4203 An alist of select methods and charsets.  The default value is
4204 @code{nil}.  The names of groups in the server specified by that select
4205 method are all supposed to use the corresponding charset.  For example:
4206
4207 @lisp
4208 (setq gnus-group-name-charset-method-alist
4209       '(((nntp "news.com.cn") . cn-gb-2312)))
4210 @end lisp
4211
4212 Charsets specified for groups with this variable are preferred to the
4213 ones specified for the same groups with the
4214 @code{gnus-group-name-charset-group-alist} variable (see below).
4215
4216 A select method can be very long, like:
4217
4218 @lisp
4219 (nntp "gmane"
4220       (nntp-address "news.gmane.org")
4221       (nntp-end-of-line "\n")
4222       (nntp-open-connection-function
4223        nntp-open-via-rlogin-and-telnet)
4224       (nntp-via-rlogin-command "ssh")
4225       (nntp-via-rlogin-command-switches
4226        ("-C" "-t" "-e" "none"))
4227       (nntp-via-address @dots{}))
4228 @end lisp
4229
4230 In that case, you can truncate it into @code{(nntp "gmane")} in this
4231 variable.  That is, it is enough to contain only the back end name and
4232 the server name.
4233
4234 @item gnus-group-name-charset-group-alist
4235 @cindex UTF-8 group names
4236 @vindex gnus-group-name-charset-group-alist
4237 An alist of regexp of group name and the charset for group names.
4238 @code{((".*" . utf-8))} is the default value if UTF-8 is supported,
4239 otherwise the default is @code{nil}.  For example:
4240
4241 @lisp
4242 (setq gnus-group-name-charset-group-alist
4243       '(("\\.com\\.cn:" . cn-gb-2312)
4244         (".*" . utf-8)))
4245 @end lisp
4246
4247 Note that this variable is ignored if the match is made with
4248 @code{gnus-group-name-charset-method-alist}.
4249 @end table
4250
4251 Those two variables are used also to determine the charset for encoding
4252 and decoding non-@acronym{ASCII} group names that are in the back ends
4253 other than @code{nntp}.  It means that it is you who determine it.  If
4254 you do nothing, the charset used for group names in those back ends will
4255 all be @code{utf-8} because of the last element of
4256 @code{gnus-group-name-charset-group-alist}.
4257
4258 There is one more important variable for non-@acronym{ASCII} group
4259 names:
4260
4261 @table @code
4262 @item nnmail-pathname-coding-system
4263 @vindex nnmail-pathname-coding-system
4264 The value of this variable should be a coding system or @code{nil}.  The
4265 default is @code{nil} in Emacs, or is the aliasee of the coding system
4266 named @code{file-name} (a certain coding system of which an alias is
4267 @code{file-name}) in XEmacs.
4268
4269 The @code{nnml} back end, the @code{nnrss} back end, the @acronym{NNTP}
4270 marks feature (@pxref{NNTP marks}), the agent, and the cache use
4271 non-@acronym{ASCII} group names in those files and directories.  This
4272 variable overrides the value of @code{file-name-coding-system} which
4273 specifies the coding system used when encoding and decoding those file
4274 names and directory names.
4275
4276 In XEmacs (with the @code{mule} feature), @code{file-name-coding-system}
4277 is the only means to specify the coding system used to encode and decode
4278 file names.  On the other hand, Emacs uses the value of
4279 @code{default-file-name-coding-system} if @code{file-name-coding-system}
4280 is @code{nil} or it is bound to the value of
4281 @code{nnmail-pathname-coding-system} which is @code{nil}.
4282
4283 Normally the value of @code{default-file-name-coding-system} in Emacs or
4284 @code{nnmail-pathname-coding-system} in XEmacs is initialized according
4285 to the locale, so you will need to do nothing if the value is suitable
4286 to encode and decode non-@acronym{ASCII} group names.
4287
4288 The value of this variable (or @code{default-file-name-coding-system})
4289 does not necessarily need to be the same value that is determined by
4290 @code{gnus-group-name-charset-method-alist} and
4291 @code{gnus-group-name-charset-group-alist}.
4292
4293 If @code{default-file-name-coding-system} or this variable is
4294 initialized by default to @code{iso-latin-1} for example, although you
4295 want to subscribe to the groups spelled in Chinese, that is the most
4296 typical case where you have to customize
4297 @code{nnmail-pathname-coding-system}.  The @code{utf-8} coding system is
4298 a good candidate for it.  Otherwise, you may change the locale in your
4299 system so that @code{default-file-name-coding-system} or this variable
4300 may be initialized to an appropriate value.
4301 @end table
4302
4303 Note that when you copy or move articles from a non-@acronym{ASCII}
4304 group to another group, the charset used to encode and decode group
4305 names should be the same in both groups.  Otherwise the Newsgroups
4306 header will be displayed incorrectly in the article buffer.
4307
4308
4309 @node Misc Group Stuff
4310 @section Misc Group Stuff
4311
4312 @menu
4313 * Scanning New Messages::       Asking Gnus to see whether new messages have arrived.
4314 * Group Information::           Information and help on groups and Gnus.
4315 * Group Timestamp::             Making Gnus keep track of when you last read a group.
4316 * File Commands::               Reading and writing the Gnus files.
4317 * Sieve Commands::              Managing Sieve scripts.
4318 @end menu
4319
4320 @table @kbd
4321
4322 @item v
4323 @kindex v (Group)
4324 @cindex keys, reserved for users (Group)
4325 The key @kbd{v} is reserved for users.  You can bind it to some
4326 command or better use it as a prefix key.  For example:
4327
4328 @lisp
4329 (define-key gnus-group-mode-map (kbd "v j d")
4330   (lambda ()
4331     (interactive)
4332     (gnus-group-jump-to-group "nndraft:drafts")))
4333 @end lisp
4334
4335 On keys reserved for users in Emacs and on keybindings in general
4336 @xref{Keymaps, Keymaps, , emacs, The Emacs Editor}.
4337
4338 @item ^
4339 @kindex ^ (Group)
4340 @findex gnus-group-enter-server-mode
4341 Enter the server buffer (@code{gnus-group-enter-server-mode}).
4342 @xref{Server Buffer}.
4343
4344 @item a
4345 @kindex a (Group)
4346 @findex gnus-group-post-news
4347 Start composing a message (a news by default)
4348 (@code{gnus-group-post-news}).  If given a prefix, post to the group
4349 under the point.  If the prefix is 1, prompt for a group to post to.
4350 Contrary to what the name of this function suggests, the prepared
4351 article might be a mail instead of a news, if a mail group is specified
4352 with the prefix argument.  @xref{Composing Messages}.
4353
4354 @item m
4355 @kindex m (Group)
4356 @findex gnus-group-mail
4357 Mail a message somewhere (@code{gnus-group-mail}).  If given a prefix,
4358 use the posting style of the group under the point.  If the prefix is 1,
4359 prompt for a group name to find the posting style.
4360 @xref{Composing Messages}.
4361
4362 @item i
4363 @kindex i (Group)
4364 @findex gnus-group-news
4365 Start composing a news (@code{gnus-group-news}).  If given a prefix,
4366 post to the group under the point.  If the prefix is 1, prompt
4367 for group to post to.  @xref{Composing Messages}.
4368
4369 This function actually prepares a news even when using mail groups.
4370 This is useful for ``posting'' messages to mail groups without actually
4371 sending them over the network: they're just saved directly to the group
4372 in question.  The corresponding back end must have a request-post method
4373 for this to work though.
4374
4375 @item G z
4376 @kindex G z (Group)
4377 @findex gnus-group-compact-group
4378
4379 Compact the group under point (@code{gnus-group-compact-group}).
4380 Currently implemented only in nnml (@pxref{Mail Spool}).  This removes
4381 gaps between article numbers, hence getting a correct total article
4382 count.
4383
4384 @end table
4385
4386 Variables for the group buffer:
4387
4388 @table @code
4389
4390 @item gnus-group-mode-hook
4391 @vindex gnus-group-mode-hook
4392 is called after the group buffer has been
4393 created.
4394
4395 @item gnus-group-prepare-hook
4396 @vindex gnus-group-prepare-hook
4397 is called after the group buffer is
4398 generated.  It may be used to modify the buffer in some strange,
4399 unnatural way.
4400
4401 @item gnus-group-prepared-hook
4402 @vindex gnus-group-prepare-hook
4403 is called as the very last thing after the group buffer has been
4404 generated.  It may be used to move point around, for instance.
4405
4406 @item gnus-permanently-visible-groups
4407 @vindex gnus-permanently-visible-groups
4408 Groups matching this regexp will always be listed in the group buffer,
4409 whether they are empty or not.
4410
4411 @end table
4412
4413 @node Scanning New Messages
4414 @subsection Scanning New Messages
4415 @cindex new messages
4416 @cindex scanning new news
4417
4418 @table @kbd
4419
4420 @item g
4421 @kindex g (Group)
4422 @findex gnus-group-get-new-news
4423 @c @icon{gnus-group-get-new-news}
4424 Check the server(s) for new articles.  If the numerical prefix is used,
4425 this command will check only groups of level @var{arg} and lower
4426 (@code{gnus-group-get-new-news}).  If given a non-numerical prefix, this
4427 command will force a total re-reading of the active file(s) from the
4428 back end(s).
4429
4430 @item M-g
4431 @kindex M-g (Group)
4432 @findex gnus-group-get-new-news-this-group
4433 @vindex gnus-goto-next-group-when-activating
4434 @c @icon{gnus-group-get-new-news-this-group}
4435 Check whether new articles have arrived in the current group
4436 (@code{gnus-group-get-new-news-this-group}).
4437 @code{gnus-goto-next-group-when-activating} says whether this command is
4438 to move point to the next group or not.  It is @code{t} by default.
4439
4440 @findex gnus-activate-all-groups
4441 @cindex activating groups
4442 @item C-c M-g
4443 @kindex C-c M-g (Group)
4444 Activate absolutely all groups (@code{gnus-activate-all-groups}).
4445
4446 @item R
4447 @kindex R (Group)
4448 @cindex restarting
4449 @findex gnus-group-restart
4450 Restart Gnus (@code{gnus-group-restart}).  This saves the @file{.newsrc}
4451 file(s), closes the connection to all servers, clears up all run-time
4452 Gnus variables, and then starts Gnus all over again.
4453
4454 @end table
4455
4456 @vindex gnus-get-new-news-hook
4457 @code{gnus-get-new-news-hook} is run just before checking for new news.
4458
4459 @vindex gnus-after-getting-new-news-hook
4460 @code{gnus-after-getting-new-news-hook} is run after checking for new
4461 news.
4462
4463
4464 @node Group Information
4465 @subsection Group Information
4466 @cindex group information
4467 @cindex information on groups
4468
4469 @table @kbd
4470
4471
4472 @item H f
4473 @kindex H f (Group)
4474 @findex gnus-group-fetch-faq
4475 @vindex gnus-group-faq-directory
4476 @cindex FAQ
4477 @cindex ange-ftp
4478 Try to fetch the @acronym{FAQ} for the current group
4479 (@code{gnus-group-fetch-faq}).  Gnus will try to get the @acronym{FAQ}
4480 from @code{gnus-group-faq-directory}, which is usually a directory on
4481 a remote machine.  This variable can also be a list of directories.
4482 In that case, giving a prefix to this command will allow you to choose
4483 between the various sites.  @code{ange-ftp} (or @code{efs}) will be
4484 used for fetching the file.
4485
4486 If fetching from the first site is unsuccessful, Gnus will attempt to go
4487 through @code{gnus-group-faq-directory} and try to open them one by one.
4488
4489 @item H d
4490 @itemx C-c C-d
4491 @c @icon{gnus-group-describe-group}
4492 @kindex H d (Group)
4493 @kindex C-c C-d (Group)
4494 @cindex describing groups
4495 @cindex group description
4496 @findex gnus-group-describe-group
4497 Describe the current group (@code{gnus-group-describe-group}).  If given
4498 a prefix, force Gnus to re-read the description from the server.
4499
4500 @item M-d
4501 @kindex M-d (Group)
4502 @findex gnus-group-describe-all-groups
4503 Describe all groups (@code{gnus-group-describe-all-groups}).  If given a
4504 prefix, force Gnus to re-read the description file from the server.
4505
4506 @item H v
4507 @itemx V
4508 @kindex V (Group)
4509 @kindex H v (Group)
4510 @cindex version
4511 @findex gnus-version
4512 Display current Gnus version numbers (@code{gnus-version}).
4513
4514 @item ?
4515 @kindex ? (Group)
4516 @findex gnus-group-describe-briefly
4517 Give a very short help message (@code{gnus-group-describe-briefly}).
4518
4519 @item C-c C-i
4520 @kindex C-c C-i (Group)
4521 @cindex info
4522 @cindex manual
4523 @findex gnus-info-find-node
4524 Go to the Gnus info node (@code{gnus-info-find-node}).
4525 @end table
4526
4527
4528 @node Group Timestamp
4529 @subsection Group Timestamp
4530 @cindex timestamps
4531 @cindex group timestamps
4532
4533 It can be convenient to let Gnus keep track of when you last read a
4534 group.  To set the ball rolling, you should add
4535 @code{gnus-group-set-timestamp} to @code{gnus-select-group-hook}:
4536
4537 @lisp
4538 (add-hook 'gnus-select-group-hook 'gnus-group-set-timestamp)
4539 @end lisp
4540
4541 After doing this, each time you enter a group, it'll be recorded.
4542
4543 This information can be displayed in various ways---the easiest is to
4544 use the @samp{%d} spec in the group line format:
4545
4546 @lisp
4547 (setq gnus-group-line-format
4548       "%M\%S\%p\%P\%5y: %(%-40,40g%) %d\n")
4549 @end lisp
4550
4551 This will result in lines looking like:
4552
4553 @example
4554 *        0: mail.ding                                19961002T012943
4555          0: custom                                   19961002T012713
4556 @end example
4557
4558 As you can see, the date is displayed in compact ISO 8601 format.  This
4559 may be a bit too much, so to just display the date, you could say
4560 something like:
4561
4562 @lisp
4563 (setq gnus-group-line-format
4564       "%M\%S\%p\%P\%5y: %(%-40,40g%) %6,6~(cut 2)d\n")
4565 @end lisp
4566
4567 If you would like greater control of the time format, you can use a
4568 user-defined format spec.  Something like the following should do the
4569 trick:
4570
4571 @lisp
4572 (setq gnus-group-line-format
4573       "%M\%S\%p\%P\%5y: %(%-40,40g%) %ud\n")
4574 (defun gnus-user-format-function-d (headers)
4575   (let ((time (gnus-group-timestamp gnus-tmp-group)))
4576     (if time
4577         (format-time-string "%b %d  %H:%M" time)
4578       "")))
4579 @end lisp
4580
4581
4582 @node File Commands
4583 @subsection File Commands
4584 @cindex file commands
4585
4586 @table @kbd
4587
4588 @item r
4589 @kindex r (Group)
4590 @findex gnus-group-read-init-file
4591 @vindex gnus-init-file
4592 @cindex reading init file
4593 Re-read the init file (@code{gnus-init-file}, which defaults to
4594 @file{~/.gnus.el}) (@code{gnus-group-read-init-file}).
4595
4596 @item s
4597 @kindex s (Group)
4598 @findex gnus-group-save-newsrc
4599 @cindex saving .newsrc
4600 Save the @file{.newsrc.eld} file (and @file{.newsrc} if wanted)
4601 (@code{gnus-group-save-newsrc}).  If given a prefix, force saving the
4602 file(s) whether Gnus thinks it is necessary or not.
4603
4604 @c @item Z
4605 @c @kindex Z (Group)
4606 @c @findex gnus-group-clear-dribble
4607 @c Clear the dribble buffer (@code{gnus-group-clear-dribble}).
4608
4609 @end table
4610
4611
4612 @node Sieve Commands
4613 @subsection Sieve Commands
4614 @cindex group sieve commands
4615
4616 Sieve is a server-side mail filtering language.  In Gnus you can use
4617 the @code{sieve} group parameter (@pxref{Group Parameters}) to specify
4618 sieve rules that should apply to each group.  Gnus provides two
4619 commands to translate all these group parameters into a proper Sieve
4620 script that can be transfered to the server somehow.
4621
4622 @vindex gnus-sieve-file
4623 @vindex gnus-sieve-region-start
4624 @vindex gnus-sieve-region-end
4625 The generated Sieve script is placed in @code{gnus-sieve-file} (by
4626 default @file{~/.sieve}).  The Sieve code that Gnus generate is placed
4627 between two delimiters, @code{gnus-sieve-region-start} and
4628 @code{gnus-sieve-region-end}, so you may write additional Sieve code
4629 outside these delimiters that will not be removed the next time you
4630 regenerate the Sieve script.
4631
4632 @vindex gnus-sieve-crosspost
4633 The variable @code{gnus-sieve-crosspost} controls how the Sieve script
4634 is generated.  If it is non-@code{nil} (the default) articles is
4635 placed in all groups that have matching rules, otherwise the article
4636 is only placed in the group with the first matching rule.  For
4637 example, the group parameter @samp{(sieve address "sender"
4638 "owner-ding@@hpc.uh.edu")} will generate the following piece of Sieve
4639 code if @code{gnus-sieve-crosspost} is @code{nil}.  (When
4640 @code{gnus-sieve-crosspost} is non-@code{nil}, it looks the same
4641 except that the line containing the call to @code{stop} is removed.)
4642
4643 @example
4644 if address "sender" "owner-ding@@hpc.uh.edu" @{
4645         fileinto "INBOX.ding";
4646         stop;
4647 @}
4648 @end example
4649
4650 @xref{Top, Emacs Sieve, Top, sieve, Emacs Sieve}.
4651
4652 @table @kbd
4653
4654 @item D g
4655 @kindex D g (Group)
4656 @findex gnus-sieve-generate
4657 @vindex gnus-sieve-file
4658 @cindex generating sieve script
4659 Regenerate a Sieve script from the @code{sieve} group parameters and
4660 put you into the @code{gnus-sieve-file} without saving it.
4661
4662 @item D u
4663 @kindex D u (Group)
4664 @findex gnus-sieve-update
4665 @vindex gnus-sieve-file
4666 @cindex updating sieve script
4667 Regenerates the Gnus managed part of @code{gnus-sieve-file} using the
4668 @code{sieve} group parameters, save the file and upload it to the
4669 server using the @code{sieveshell} program.
4670
4671 @end table
4672
4673
4674 @node Summary Buffer
4675 @chapter Summary Buffer
4676 @cindex summary buffer
4677
4678 A line for each article is displayed in the summary buffer.  You can
4679 move around, read articles, post articles and reply to articles.
4680
4681 The most common way to a summary buffer is to select a group from the
4682 group buffer (@pxref{Selecting a Group}).
4683
4684 You can have as many summary buffers open as you wish.
4685
4686 You can customize the Summary Mode tool bar, see @kbd{M-x
4687 customize-apropos RET gnus-summary-tool-bar}.  This feature is only
4688 available in Emacs.
4689
4690 @kindex v (Summary)
4691 @cindex keys, reserved for users (Summary)
4692 The key @kbd{v} is reserved for users.  You can bind it to some
4693 command or better use it as a prefix key.  For example:
4694 @lisp
4695 (define-key gnus-summary-mode-map (kbd "v -") "LrS") ;; lower subthread
4696 @end lisp
4697
4698 @menu
4699 * Summary Buffer Format::       Deciding how the summary buffer is to look.
4700 * Summary Maneuvering::         Moving around the summary buffer.
4701 * Choosing Articles::           Reading articles.
4702 * Paging the Article::          Scrolling the current article.
4703 * Reply Followup and Post::     Posting articles.
4704 * Delayed Articles::            Send articles at a later time.
4705 * Marking Articles::            Marking articles as read, expirable, etc.
4706 * Limiting::                    You can limit the summary buffer.
4707 * Threading::                   How threads are made.
4708 * Sorting the Summary Buffer::  How articles and threads are sorted.
4709 * Asynchronous Fetching::       Gnus might be able to pre-fetch articles.
4710 * Article Caching::             You may store articles in a cache.
4711 * Persistent Articles::         Making articles expiry-resistant.
4712 * Sticky Articles::             Article buffers that are not reused.
4713 * Article Backlog::             Having already read articles hang around.
4714 * Saving Articles::             Ways of customizing article saving.
4715 * Decoding Articles::           Gnus can treat series of (uu)encoded articles.
4716 * Article Treatment::           The article buffer can be mangled at will.
4717 * MIME Commands::               Doing MIMEy things with the articles.
4718 * Charsets::                    Character set issues.
4719 * Article Commands::            Doing various things with the article buffer.
4720 * Summary Sorting::             Sorting the summary buffer in various ways.
4721 * Finding the Parent::          No child support? Get the parent.
4722 * Alternative Approaches::      Reading using non-default summaries.
4723 * Tree Display::                A more visual display of threads.
4724 * Mail Group Commands::         Some commands can only be used in mail groups.
4725 * Various Summary Stuff::       What didn't fit anywhere else.
4726 * Exiting the Summary Buffer::  Returning to the Group buffer,
4727                                 or reselecting the current group.
4728 * Crosspost Handling::          How crossposted articles are dealt with.
4729 * Duplicate Suppression::       An alternative when crosspost handling fails.
4730 * Security::                    Decrypt and Verify.
4731 * Mailing List::                Mailing list minor mode.
4732 @end menu
4733
4734
4735 @node Summary Buffer Format
4736 @section Summary Buffer Format
4737 @cindex summary buffer format
4738
4739 @iftex
4740 @iflatex
4741 \gnusfigure{The Summary Buffer}{180}{
4742 \put(0,0){\epsfig{figure=ps/summary,width=7.5cm}}
4743 \put(445,0){\makebox(0,0)[br]{\epsfig{figure=ps/summary-article,width=7.5cm}}}
4744 }
4745 @end iflatex
4746 @end iftex
4747
4748 @menu
4749 * Summary Buffer Lines::        You can specify how summary lines should look.
4750 * To From Newsgroups::          How to not display your own name.
4751 * Summary Buffer Mode Line::    You can say how the mode line should look.
4752 * Summary Highlighting::        Making the summary buffer all pretty and nice.
4753 @end menu
4754
4755 @findex mail-extract-address-components
4756 @findex gnus-extract-address-components
4757 @vindex gnus-extract-address-components
4758 Gnus will use the value of the @code{gnus-extract-address-components}
4759 variable as a function for getting the name and address parts of a
4760 @code{From} header.  Two pre-defined functions exist:
4761 @code{gnus-extract-address-components}, which is the default, quite
4762 fast, and too simplistic solution; and
4763 @code{mail-extract-address-components}, which works very nicely, but is
4764 slower.  The default function will return the wrong answer in 5% of the
4765 cases.  If this is unacceptable to you, use the other function instead:
4766
4767 @lisp
4768 (setq gnus-extract-address-components
4769       'mail-extract-address-components)
4770 @end lisp
4771
4772 @vindex gnus-summary-same-subject
4773 @code{gnus-summary-same-subject} is a string indicating that the current
4774 article has the same subject as the previous.  This string will be used
4775 with those specs that require it.  The default is @code{""}.
4776
4777
4778 @node Summary Buffer Lines
4779 @subsection Summary Buffer Lines
4780
4781 @vindex gnus-summary-line-format
4782 You can change the format of the lines in the summary buffer by changing
4783 the @code{gnus-summary-line-format} variable.  It works along the same
4784 lines as a normal @code{format} string, with some extensions
4785 (@pxref{Formatting Variables}).
4786
4787 There should always be a colon or a point position marker on the line;
4788 the cursor always moves to the point position marker or the colon after
4789 performing an operation.  (Of course, Gnus wouldn't be Gnus if it wasn't
4790 possible to change this.  Just write a new function
4791 @code{gnus-goto-colon} which does whatever you like with the cursor.)
4792 @xref{Positioning Point}.
4793
4794 The default string is @samp{%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n}.
4795
4796 The following format specification characters and extended format
4797 specification(s) are understood:
4798
4799 @table @samp
4800 @item N
4801 Article number.
4802 @item S
4803 Subject string.  List identifiers stripped,
4804 @code{gnus-list-identifiers}.  @xref{Article Hiding}.
4805 @item s
4806 Subject if the article is the root of the thread or the previous article
4807 had a different subject, @code{gnus-summary-same-subject} otherwise.
4808 (@code{gnus-summary-same-subject} defaults to @code{""}.)
4809 @item F
4810 Full @code{From} header.
4811 @item n
4812 The name (from the @code{From} header).
4813 @item f
4814 The name, @code{To} header or the @code{Newsgroups} header (@pxref{To
4815 From Newsgroups}).
4816 @item a
4817 The name (from the @code{From} header).  This differs from the @code{n}
4818 spec in that it uses the function designated by the
4819 @code{gnus-extract-address-components} variable, which is slower, but
4820 may be more thorough.
4821 @item A
4822 The address (from the @code{From} header).  This works the same way as
4823 the @code{a} spec.
4824 @item L
4825 Number of lines in the article.
4826 @item c
4827 Number of characters in the article.  This specifier is not supported
4828 in some methods (like nnfolder).
4829 @item k
4830 Pretty-printed version of the number of characters in the article;
4831 for example, @samp{1.2k} or @samp{0.4M}.
4832 @item I
4833 Indentation based on thread level (@pxref{Customizing Threading}).
4834 @item B
4835 A complex trn-style thread tree, showing response-connecting trace
4836 lines.  A thread could be drawn like this:
4837
4838 @example
4839 >
4840 +->
4841 | +->
4842 | | \->
4843 | |   \->
4844 | \->
4845 +->
4846 \->
4847 @end example
4848
4849 You can customize the appearance with the following options.  Note
4850 that it is possible to make the thread display look really neat by
4851 replacing the default @acronym{ASCII} characters with graphic
4852 line-drawing glyphs.
4853 @table @code
4854 @item gnus-sum-thread-tree-root
4855 @vindex gnus-sum-thread-tree-root
4856 Used for the root of a thread.  If @code{nil}, use subject
4857 instead.  The default is @samp{> }.
4858
4859 @item gnus-sum-thread-tree-false-root
4860 @vindex gnus-sum-thread-tree-false-root
4861 Used for the false root of a thread (@pxref{Loose Threads}).  If
4862 @code{nil}, use subject instead.  The default is @samp{> }.
4863
4864 @item gnus-sum-thread-tree-single-indent
4865 @vindex gnus-sum-thread-tree-single-indent
4866 Used for a thread with just one message.  If @code{nil}, use subject
4867 instead.  The default is @samp{}.
4868
4869 @item gnus-sum-thread-tree-vertical
4870 @vindex gnus-sum-thread-tree-vertical
4871 Used for drawing a vertical line.  The default is @samp{| }.
4872
4873 @item gnus-sum-thread-tree-indent
4874 @vindex gnus-sum-thread-tree-indent
4875 Used for indenting.  The default is @samp{  }.
4876
4877 @item gnus-sum-thread-tree-leaf-with-other
4878 @vindex gnus-sum-thread-tree-leaf-with-other
4879 Used for a leaf with brothers.  The default is @samp{+-> }.
4880
4881 @item gnus-sum-thread-tree-single-leaf
4882 @vindex gnus-sum-thread-tree-single-leaf
4883 Used for a leaf without brothers.  The default is @samp{\-> }
4884
4885 @end table
4886
4887 @item T
4888 Nothing if the article is a root and lots of spaces if it isn't (it
4889 pushes everything after it off the screen).
4890 @item [
4891 Opening bracket, which is normally @samp{[}, but can also be @samp{<}
4892 for adopted articles (@pxref{Customizing Threading}).
4893 @item ]
4894 Closing bracket, which is normally @samp{]}, but can also be @samp{>}
4895 for adopted articles.
4896 @item >
4897 One space for each thread level.
4898 @item <
4899 Twenty minus thread level spaces.
4900 @item U
4901 Unread.  @xref{Read Articles}.
4902
4903 @item R
4904 This misleadingly named specifier is the @dfn{secondary mark}.  This
4905 mark will say whether the article has been replied to, has been cached,
4906 or has been saved.  @xref{Other Marks}.
4907
4908 @item i
4909 Score as a number (@pxref{Scoring}).
4910 @item z
4911 @vindex gnus-summary-zcore-fuzz
4912 Zcore, @samp{+} if above the default level and @samp{-} if below the
4913 default level.  If the difference between
4914 @code{gnus-summary-default-score} and the score is less than
4915 @code{gnus-summary-zcore-fuzz}, this spec will not be used.
4916 @item V
4917 Total thread score.
4918 @item x
4919 @code{Xref}.
4920 @item D
4921 @code{Date}.
4922 @item d
4923 The @code{Date} in @code{DD-MMM} format.
4924 @item o
4925 The @code{Date} in @var{YYYYMMDD}@code{T}@var{HHMMSS} format.
4926 @item M
4927 @code{Message-ID}.
4928 @item r
4929 @code{References}.
4930 @item t
4931 Number of articles in the current sub-thread.  Using this spec will slow
4932 down summary buffer generation somewhat.
4933 @item e
4934 An @samp{=} (@code{gnus-not-empty-thread-mark}) will be displayed if the
4935 article has any children.
4936 @item P
4937 The line number.
4938 @item O
4939 Download mark.
4940 @item *
4941 Desired cursor position (instead of after first colon).
4942 @item &user-date;
4943 Age sensitive date format.  Various date format is defined in
4944 @code{gnus-user-date-format-alist}.
4945 @item u
4946 User defined specifier.  The next character in the format string should
4947 be a letter.  Gnus will call the function
4948 @code{gnus-user-format-function-@var{x}}, where @var{x} is the letter
4949 following @samp{%u}.  The function will be passed the current header as
4950 argument.  The function should return a string, which will be inserted
4951 into the summary just like information from any other summary specifier.
4952 @end table
4953
4954 Text between @samp{%(} and @samp{%)} will be highlighted with
4955 @code{gnus-mouse-face} when the mouse point is placed inside the area.
4956 There can only be one such area.
4957
4958 The @samp{%U} (status), @samp{%R} (replied) and @samp{%z} (zcore) specs
4959 have to be handled with care.  For reasons of efficiency, Gnus will
4960 compute what column these characters will end up in, and ``hard-code''
4961 that.  This means that it is invalid to have these specs after a
4962 variable-length spec.  Well, you might not be arrested, but your summary
4963 buffer will look strange, which is bad enough.
4964
4965 The smart choice is to have these specs as far to the left as possible.
4966 (Isn't that the case with everything, though?  But I digress.)
4967
4968 This restriction may disappear in later versions of Gnus.
4969
4970
4971 @node To From Newsgroups
4972 @subsection To From Newsgroups
4973 @cindex To
4974 @cindex Newsgroups
4975
4976 In some groups (particularly in archive groups), the @code{From} header
4977 isn't very interesting, since all the articles there are written by
4978 you.  To display the information in the @code{To} or @code{Newsgroups}
4979 headers instead, you need to decide three things: What information to
4980 gather; where to display it; and when to display it.
4981
4982 @enumerate
4983 @item
4984 @vindex gnus-extra-headers
4985 The reading of extra header information is controlled by the
4986 @code{gnus-extra-headers}.  This is a list of header symbols.  For
4987 instance:
4988
4989 @lisp
4990 (setq gnus-extra-headers
4991       '(To Newsgroups X-Newsreader))
4992 @end lisp
4993
4994 This will result in Gnus trying to obtain these three headers, and
4995 storing it in header structures for later easy retrieval.
4996
4997 @item
4998 @findex gnus-extra-header
4999 The value of these extra headers can be accessed via the
5000 @code{gnus-extra-header} function.  Here's a format line spec that will
5001 access the @code{X-Newsreader} header:
5002
5003 @example
5004 "%~(form (gnus-extra-header 'X-Newsreader))@@"
5005 @end example
5006
5007 @item
5008 @vindex gnus-ignored-from-addresses
5009 The @code{gnus-ignored-from-addresses} variable says when the @samp{%f}
5010 summary line spec returns the @code{To}, @code{Newsreader} or
5011 @code{From} header.  If this regexp matches the contents of the
5012 @code{From} header, the value of the @code{To} or @code{Newsreader}
5013 headers are used instead.
5014
5015 To distinguish regular articles from those where the @code{From} field
5016 has been swapped, a string is prefixed to the @code{To} or
5017 @code{Newsgroups} header in the summary line.  By default the string is
5018 @samp{-> } for @code{To} and @samp{=> } for @code{Newsgroups}, you can
5019 customize these strings with @code{gnus-summary-to-prefix} and
5020 @code{gnus-summary-newsgroup-prefix}.
5021
5022 @end enumerate
5023
5024 @vindex nnmail-extra-headers
5025 A related variable is @code{nnmail-extra-headers}, which controls when
5026 to include extra headers when generating overview (@acronym{NOV}) files.
5027 If you have old overview files, you should regenerate them after
5028 changing this variable, by entering the server buffer using @kbd{^},
5029 and then @kbd{g} on the appropriate mail server (e.g. nnml) to cause
5030 regeneration.
5031
5032 @vindex gnus-summary-line-format
5033 You also have to instruct Gnus to display the data by changing the
5034 @code{%n} spec to the @code{%f} spec in the
5035 @code{gnus-summary-line-format} variable.
5036
5037 In summary, you'd typically put something like the following in
5038 @file{~/.gnus.el}:
5039
5040 @lisp
5041 (setq gnus-extra-headers
5042       '(To Newsgroups))
5043 (setq nnmail-extra-headers gnus-extra-headers)
5044 (setq gnus-summary-line-format
5045       "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n")
5046 (setq gnus-ignored-from-addresses
5047       "Your Name Here")
5048 @end lisp
5049
5050 (The values listed above are the default values in Gnus.  Alter them
5051 to fit your needs.)
5052
5053 A note for news server administrators, or for users who wish to try to
5054 convince their news server administrator to provide some additional
5055 support:
5056
5057 The above is mostly useful for mail groups, where you have control over
5058 the @acronym{NOV} files that are created.  However, if you can persuade your
5059 nntp admin to add (in the usual implementation, notably INN):
5060
5061 @example
5062 Newsgroups:full
5063 @end example
5064
5065 to the end of her @file{overview.fmt} file, then you can use that just
5066 as you would the extra headers from the mail groups.
5067
5068
5069 @node Summary Buffer Mode Line
5070 @subsection Summary Buffer Mode Line
5071
5072 @vindex gnus-summary-mode-line-format
5073 You can also change the format of the summary mode bar (@pxref{Mode Line
5074 Formatting}).  Set @code{gnus-summary-mode-line-format} to whatever you
5075 like.  The default is @samp{Gnus: %%b [%A] %Z}.
5076
5077 Here are the elements you can play with:
5078
5079 @table @samp
5080 @item G
5081 Group name.
5082 @item p
5083 Unprefixed group name.
5084 @item A
5085 Current article number.
5086 @item z
5087 Current article score.
5088 @item V
5089 Gnus version.
5090 @item U
5091 Number of unread articles in this group.
5092 @item e
5093 Number of unread articles in this group that aren't displayed in the
5094 summary buffer.
5095 @item Z
5096 A string with the number of unread and unselected articles represented
5097 either as @samp{<%U(+%e) more>} if there are both unread and unselected
5098 articles, and just as @samp{<%U more>} if there are just unread articles
5099 and no unselected ones.
5100 @item g
5101 Shortish group name.  For instance, @samp{rec.arts.anime} will be
5102 shortened to @samp{r.a.anime}.
5103 @item S
5104 Subject of the current article.
5105 @item u
5106 User-defined spec (@pxref{User-Defined Specs}).
5107 @item s
5108 Name of the current score file (@pxref{Scoring}).
5109 @item d
5110 Number of dormant articles (@pxref{Unread Articles}).
5111 @item t
5112 Number of ticked articles (@pxref{Unread Articles}).
5113 @item r
5114 Number of articles that have been marked as read in this session.
5115 @item E
5116 Number of articles expunged by the score files.
5117 @end table
5118
5119
5120 @node Summary Highlighting
5121 @subsection Summary Highlighting
5122
5123 @table @code
5124
5125 @item gnus-visual-mark-article-hook
5126 @vindex gnus-visual-mark-article-hook
5127 This hook is run after selecting an article.  It is meant to be used for
5128 highlighting the article in some way.  It is not run if
5129 @code{gnus-visual} is @code{nil}.
5130
5131 @item gnus-summary-update-hook
5132 @vindex gnus-summary-update-hook
5133 This hook is called when a summary line is changed.  It is not run if
5134 @code{gnus-visual} is @code{nil}.
5135
5136 @item gnus-summary-selected-face
5137 @vindex gnus-summary-selected-face
5138 This is the face (or @dfn{font} as some people call it) used to
5139 highlight the current article in the summary buffer.
5140
5141 @item gnus-summary-highlight
5142 @vindex gnus-summary-highlight
5143 Summary lines are highlighted according to this variable, which is a
5144 list where the elements are of the format @code{(@var{form}
5145 . @var{face})}.  If you would, for instance, like ticked articles to be
5146 italic and high-scored articles to be bold, you could set this variable
5147 to something like
5148 @lisp
5149 (((eq mark gnus-ticked-mark) . italic)
5150  ((> score default) . bold))
5151 @end lisp
5152 As you may have guessed, if @var{form} returns a non-@code{nil} value,
5153 @var{face} will be applied to the line.
5154 @end table
5155
5156
5157 @node Summary Maneuvering
5158 @section Summary Maneuvering
5159 @cindex summary movement
5160
5161 All the straight movement commands understand the numeric prefix and
5162 behave pretty much as you'd expect.
5163
5164 None of these commands select articles.
5165
5166 @table @kbd
5167 @item G M-n
5168 @itemx M-n
5169 @kindex M-n (Summary)
5170 @kindex G M-n (Summary)
5171 @findex gnus-summary-next-unread-subject
5172 Go to the next summary line of an unread article
5173 (@code{gnus-summary-next-unread-subject}).
5174
5175 @item G M-p
5176 @itemx M-p
5177 @kindex M-p (Summary)
5178 @kindex G M-p (Summary)
5179 @findex gnus-summary-prev-unread-subject
5180 Go to the previous summary line of an unread article
5181 (@code{gnus-summary-prev-unread-subject}).
5182
5183 @item G g
5184 @kindex G g (Summary)
5185 @findex gnus-summary-goto-subject
5186 Ask for an article number and then go to the summary line of that article
5187 without displaying the article (@code{gnus-summary-goto-subject}).
5188 @end table
5189
5190 If Gnus asks you to press a key to confirm going to the next group, you
5191 can use the @kbd{C-n} and @kbd{C-p} keys to move around the group
5192 buffer, searching for the next group to read without actually returning
5193 to the group buffer.
5194
5195 Variables related to summary movement:
5196
5197 @table @code
5198
5199 @vindex gnus-auto-select-next
5200 @item gnus-auto-select-next
5201 If you issue one of the movement commands (like @kbd{n}) and there are
5202 no more unread articles after the current one, Gnus will offer to go to
5203 the next group.  If this variable is @code{t} and the next group is
5204 empty, Gnus will exit summary mode and return to the group buffer.  If
5205 this variable is neither @code{t} nor @code{nil}, Gnus will select the
5206 next group with unread articles.  As a special case, if this variable
5207 is @code{quietly}, Gnus will select the next group without asking for
5208 confirmation.  If this variable is @code{almost-quietly}, the same
5209 will happen only if you are located on the last article in the group.
5210 Finally, if this variable is @code{slightly-quietly}, the @kbd{Z n}
5211 command will go to the next group without confirmation.  Also
5212 @pxref{Group Levels}.
5213
5214 @item gnus-auto-select-same
5215 @vindex gnus-auto-select-same
5216 If non-@code{nil}, all the movement commands will try to go to the next
5217 article with the same subject as the current.  (@dfn{Same} here might
5218 mean @dfn{roughly equal}.  See @code{gnus-summary-gather-subject-limit}
5219 for details (@pxref{Customizing Threading}).)  If there are no more
5220 articles with the same subject, go to the first unread article.
5221
5222 This variable is not particularly useful if you use a threaded display.
5223
5224 @item gnus-summary-check-current
5225 @vindex gnus-summary-check-current
5226 If non-@code{nil}, all the ``unread'' movement commands will not proceed
5227 to the next (or previous) article if the current article is unread.
5228 Instead, they will choose the current article.
5229
5230 @item gnus-auto-center-summary
5231 @vindex gnus-auto-center-summary
5232 If non-@code{nil}, Gnus will keep the point in the summary buffer
5233 centered at all times.  This makes things quite tidy, but if you have a
5234 slow network connection, or simply do not like this un-Emacsism, you can
5235 set this variable to @code{nil} to get the normal Emacs scrolling
5236 action.  This will also inhibit horizontal re-centering of the summary
5237 buffer, which might make it more inconvenient to read extremely long
5238 threads.
5239
5240 This variable can also be a number.  In that case, center the window at
5241 the given number of lines from the top.
5242
5243 @item gnus-summary-stop-at-end-of-message
5244 @vindex gnus-summary-stop-at-end-of-message
5245 If non-@code{nil}, don't go to the next article when hitting
5246 @kbd{SPC}, and you're at the end of the article.
5247
5248 @end table
5249
5250
5251 @node Choosing Articles
5252 @section Choosing Articles
5253 @cindex selecting articles
5254
5255 @menu
5256 * Choosing Commands::           Commands for choosing articles.
5257 * Choosing Variables::          Variables that influence these commands.
5258 @end menu
5259
5260
5261 @node Choosing Commands
5262 @subsection Choosing Commands
5263
5264 None of the following movement commands understand the numeric prefix,
5265 and they all select and display an article.
5266
5267 If you want to fetch new articles or redisplay the group, see
5268 @ref{Exiting the Summary Buffer}.
5269
5270 @table @kbd
5271 @item SPACE
5272 @kindex SPACE (Summary)
5273 @findex gnus-summary-next-page
5274 Select the current article, or, if that one's read already, the next
5275 unread article (@code{gnus-summary-next-page}).
5276
5277 If you have an article window open already and you press @kbd{SPACE}
5278 again, the article will be scrolled.  This lets you conveniently
5279 @kbd{SPACE} through an entire newsgroup.  @xref{Paging the Article}.
5280
5281 @item G n
5282 @itemx n
5283 @kindex n (Summary)
5284 @kindex G n (Summary)
5285 @findex gnus-summary-next-unread-article
5286 @c @icon{gnus-summary-next-unread}
5287 Go to next unread article (@code{gnus-summary-next-unread-article}).
5288
5289 @item G p
5290 @itemx p
5291 @kindex p (Summary)
5292 @findex gnus-summary-prev-unread-article
5293 @c @icon{gnus-summary-prev-unread}
5294 Go to previous unread article (@code{gnus-summary-prev-unread-article}).
5295
5296 @item G N
5297 @itemx N
5298 @kindex N (Summary)
5299 @kindex G N (Summary)
5300 @findex gnus-summary-next-article
5301 Go to the next article (@code{gnus-summary-next-article}).
5302
5303 @item G P
5304 @itemx P
5305 @kindex P (Summary)
5306 @kindex G P (Summary)
5307 @findex gnus-summary-prev-article
5308 Go to the previous article (@code{gnus-summary-prev-article}).
5309
5310 @item G C-n
5311 @kindex G C-n (Summary)
5312 @findex gnus-summary-next-same-subject
5313 Go to the next article with the same subject
5314 (@code{gnus-summary-next-same-subject}).
5315
5316 @item G C-p
5317 @kindex G C-p (Summary)
5318 @findex gnus-summary-prev-same-subject
5319 Go to the previous article with the same subject
5320 (@code{gnus-summary-prev-same-subject}).
5321
5322 @item G f
5323 @itemx .
5324 @kindex G f  (Summary)
5325 @kindex .  (Summary)
5326 @findex gnus-summary-first-unread-article
5327 Go to the first unread article
5328 (@code{gnus-summary-first-unread-article}).
5329
5330 @item G b
5331 @itemx ,
5332 @kindex G b (Summary)
5333 @kindex , (Summary)
5334 @findex gnus-summary-best-unread-article
5335 Go to the unread article with the highest score
5336 (@code{gnus-summary-best-unread-article}).  If given a prefix argument,
5337 go to the first unread article that has a score over the default score.
5338
5339 @item G l
5340 @itemx l
5341 @kindex l (Summary)
5342 @kindex G l (Summary)
5343 @findex gnus-summary-goto-last-article
5344 Go to the previous article read (@code{gnus-summary-goto-last-article}).
5345
5346 @item G o
5347 @kindex G o (Summary)
5348 @findex gnus-summary-pop-article
5349 @cindex history
5350 @cindex article history
5351 Pop an article off the summary history and go to this article
5352 (@code{gnus-summary-pop-article}).  This command differs from the
5353 command above in that you can pop as many previous articles off the
5354 history as you like, while @kbd{l} toggles the two last read articles.
5355 For a somewhat related issue (if you use these commands a lot),
5356 @pxref{Article Backlog}.
5357
5358 @item G j
5359 @itemx j
5360 @kindex j (Summary)
5361 @kindex G j (Summary)
5362 @findex gnus-summary-goto-article
5363 Ask for an article number or @code{Message-ID}, and then go to that
5364 article (@code{gnus-summary-goto-article}).
5365
5366 @end table
5367
5368
5369 @node Choosing Variables
5370 @subsection Choosing Variables
5371
5372 Some variables relevant for moving and selecting articles:
5373
5374 @table @code
5375 @item gnus-auto-extend-newsgroup
5376 @vindex gnus-auto-extend-newsgroup
5377 All the movement commands will try to go to the previous (or next)
5378 article, even if that article isn't displayed in the Summary buffer if
5379 this variable is non-@code{nil}.  Gnus will then fetch the article from
5380 the server and display it in the article buffer.
5381
5382 @item gnus-select-article-hook
5383 @vindex gnus-select-article-hook
5384 This hook is called whenever an article is selected.  The default is
5385 @code{nil}.  If you would like each article to be saved in the Agent as
5386 you read it, putting @code{gnus-agent-fetch-selected-article} on this
5387 hook will do so.
5388
5389 @item gnus-mark-article-hook
5390 @vindex gnus-mark-article-hook
5391 @findex gnus-summary-mark-unread-as-read
5392 @findex gnus-summary-mark-read-and-unread-as-read
5393 @findex gnus-unread-mark
5394 This hook is called whenever an article is selected.  It is intended to
5395 be used for marking articles as read.  The default value is
5396 @code{gnus-summary-mark-read-and-unread-as-read}, and will change the
5397 mark of almost any article you read to @code{gnus-read-mark}.  The only
5398 articles not affected by this function are ticked, dormant, and
5399 expirable articles.  If you'd instead like to just have unread articles
5400 marked as read, you can use @code{gnus-summary-mark-unread-as-read}
5401 instead.  It will leave marks like @code{gnus-low-score-mark},
5402 @code{gnus-del-mark} (and so on) alone.
5403
5404 @end table
5405
5406
5407 @node Paging the Article
5408 @section Scrolling the Article
5409 @cindex article scrolling
5410
5411 @table @kbd
5412
5413 @item SPACE
5414 @kindex SPACE (Summary)
5415 @findex gnus-summary-next-page
5416 Pressing @kbd{SPACE} will scroll the current article forward one page,
5417 or, if you have come to the end of the current article, will choose the
5418 next article (@code{gnus-summary-next-page}).
5419
5420 @vindex gnus-article-boring-faces
5421 @vindex gnus-article-skip-boring
5422 If @code{gnus-article-skip-boring} is non-@code{nil} and the rest of
5423 the article consists only of citations and signature, then it will be
5424 skipped; the next article will be shown instead.  You can customize
5425 what is considered uninteresting with
5426 @code{gnus-article-boring-faces}.  You can manually view the article's
5427 pages, no matter how boring, using @kbd{C-M-v}.
5428
5429 @item DEL
5430 @kindex DEL (Summary)
5431 @findex gnus-summary-prev-page
5432 Scroll the current article back one page (@code{gnus-summary-prev-page}).
5433
5434 @item RET
5435 @kindex RET (Summary)
5436 @findex gnus-summary-scroll-up
5437 Scroll the current article one line forward
5438 (@code{gnus-summary-scroll-up}).
5439
5440 @item M-RET
5441 @kindex M-RET (Summary)
5442 @findex gnus-summary-scroll-down
5443 Scroll the current article one line backward
5444 (@code{gnus-summary-scroll-down}).
5445
5446 @item A g
5447 @itemx g
5448 @kindex A g (Summary)
5449 @kindex g (Summary)
5450 @findex gnus-summary-show-article
5451 @vindex gnus-summary-show-article-charset-alist
5452 (Re)fetch the current article (@code{gnus-summary-show-article}).  If
5453 given a prefix, show a completely ``raw'' article, just the way it
5454 came from the server.  If given a prefix twice (i.e., @kbd{C-u C-u
5455 g'}), fetch the current article, but don't run any of the article
5456 treatment functions.
5457
5458 @cindex charset, view article with different charset
5459 If given a numerical prefix, you can do semi-manual charset stuff.
5460 @kbd{C-u 0 g cn-gb-2312 RET} will decode the message as if it were
5461 encoded in the @code{cn-gb-2312} charset.  If you have
5462
5463 @lisp
5464 (setq gnus-summary-show-article-charset-alist
5465       '((1 . cn-gb-2312)
5466         (2 . big5)))
5467 @end lisp
5468
5469 then you can say @kbd{C-u 1 g} to get the same effect.
5470
5471 @item A <
5472 @itemx <
5473 @kindex < (Summary)
5474 @kindex A < (Summary)
5475 @findex gnus-summary-beginning-of-article
5476 Scroll to the beginning of the article
5477 (@code{gnus-summary-beginning-of-article}).
5478
5479 @item A >
5480 @itemx >
5481 @kindex > (Summary)
5482 @kindex A > (Summary)
5483 @findex gnus-summary-end-of-article
5484 Scroll to the end of the article (@code{gnus-summary-end-of-article}).
5485
5486 @item A s
5487 @itemx s
5488 @kindex A s (Summary)
5489 @kindex s (Summary)
5490 @findex gnus-summary-isearch-article
5491 Perform an isearch in the article buffer
5492 (@code{gnus-summary-isearch-article}).
5493
5494 @item h
5495 @kindex h (Summary)
5496 @findex gnus-summary-select-article-buffer
5497 Select the article buffer (@code{gnus-summary-select-article-buffer}).
5498
5499 @end table
5500
5501
5502 @node Reply Followup and Post
5503 @section Reply, Followup and Post
5504
5505 @menu
5506 * Summary Mail Commands::       Sending mail.
5507 * Summary Post Commands::       Sending news.
5508 * Summary Message Commands::    Other Message-related commands.
5509 * Canceling and Superseding::
5510 @end menu
5511
5512
5513 @node Summary Mail Commands
5514 @subsection Summary Mail Commands
5515 @cindex mail
5516 @cindex composing mail
5517
5518 Commands for composing a mail message:
5519
5520 @table @kbd
5521
5522 @item S r
5523 @itemx r
5524 @kindex S r (Summary)
5525 @kindex r (Summary)
5526 @findex gnus-summary-reply
5527 @c @icon{gnus-summary-mail-reply}
5528 @c @icon{gnus-summary-reply}
5529 Mail a reply to the author of the current article
5530 (@code{gnus-summary-reply}).
5531
5532 @item S R
5533 @itemx R
5534 @kindex R (Summary)
5535 @kindex S R (Summary)
5536 @findex gnus-summary-reply-with-original
5537 @c @icon{gnus-summary-reply-with-original}
5538 Mail a reply to the author of the current article and include the
5539 original message (@code{gnus-summary-reply-with-original}).  This
5540 command uses the process/prefix convention.
5541
5542 @item S w
5543 @kindex S w (Summary)
5544 @findex gnus-summary-wide-reply
5545 Mail a wide reply to the author of the current article
5546 (@code{gnus-summary-wide-reply}).  A @dfn{wide reply} is a reply that
5547 goes out to all people listed in the @code{To}, @code{From} (or
5548 @code{Reply-to}) and @code{Cc} headers.  If @code{Mail-Followup-To} is
5549 present, that's used instead.
5550
5551 @item S W
5552 @kindex S W (Summary)
5553 @findex gnus-summary-wide-reply-with-original
5554 Mail a wide reply to the current article and include the original
5555 message (@code{gnus-summary-wide-reply-with-original}).  This command uses
5556 the process/prefix convention, but only uses the headers from the
5557 first article to determine the recipients.
5558
5559 @item S v
5560 @kindex S v (Summary)
5561 @findex gnus-summary-very-wide-reply
5562 Mail a very wide reply to the author of the current article
5563 (@code{gnus-summary-wide-reply}).  A @dfn{very wide reply} is a reply
5564 that goes out to all people listed in the @code{To}, @code{From} (or
5565 @code{Reply-to}) and @code{Cc} headers in all the process/prefixed
5566 articles.  This command uses the process/prefix convention.
5567
5568 @item S V
5569 @kindex S V (Summary)
5570 @findex gnus-summary-very-wide-reply-with-original
5571 Mail a very wide reply to the author of the current article and include the
5572 original message (@code{gnus-summary-very-wide-reply-with-original}).  This
5573 command uses the process/prefix convention.
5574
5575 @item S B r
5576 @kindex S B r (Summary)
5577 @findex gnus-summary-reply-broken-reply-to
5578 Mail a reply to the author of the current article but ignore the
5579 @code{Reply-To} field (@code{gnus-summary-reply-broken-reply-to}).
5580 If you need this because a mailing list incorrectly sets a
5581 @code{Reply-To} header pointing to the list, you probably want to set
5582 the @code{broken-reply-to} group parameter instead, so things will work
5583 correctly.  @xref{Group Parameters}.
5584
5585 @item S B R
5586 @kindex S B R (Summary)
5587 @findex gnus-summary-reply-broken-reply-to-with-original
5588 Mail a reply to the author of the current article and include the
5589 original message but ignore the @code{Reply-To} field
5590 (@code{gnus-summary-reply-broken-reply-to-with-original}).
5591
5592 @item S o m
5593 @itemx C-c C-f
5594 @kindex S o m (Summary)
5595 @kindex C-c C-f (Summary)
5596 @findex gnus-summary-mail-forward
5597 @c @icon{gnus-summary-mail-forward}
5598 Forward the current article to some other person
5599 (@code{gnus-summary-mail-forward}).  If no prefix is given, the message
5600 is forwarded according to the value of (@code{message-forward-as-mime})
5601 and (@code{message-forward-show-mml}); if the prefix is 1, decode the
5602 message and forward directly inline; if the prefix is 2, forward message
5603 as an rfc822 @acronym{MIME} section; if the prefix is 3, decode message and
5604 forward as an rfc822 @acronym{MIME} section; if the prefix is 4, forward message
5605 directly inline; otherwise, the message is forwarded as no prefix given
5606 but use the flipped value of (@code{message-forward-as-mime}).  By
5607 default, the message is decoded and forwarded as an rfc822 @acronym{MIME}
5608 section.
5609
5610 @item S m
5611 @itemx m
5612 @kindex m (Summary)
5613 @kindex S m (Summary)
5614 @findex gnus-summary-mail-other-window
5615 @c @icon{gnus-summary-mail-originate}
5616 Prepare a mail (@code{gnus-summary-mail-other-window}).  By default, use
5617 the posting style of the current group.  If given a prefix, disable that.
5618 If the prefix is 1, prompt for a group name to find the posting style.
5619
5620 @item S i
5621 @kindex S i (Summary)
5622 @findex gnus-summary-news-other-window
5623 Prepare a news (@code{gnus-summary-news-other-window}).  By default,
5624 post to the current group.  If given a prefix, disable that.  If the
5625 prefix is 1, prompt for a group to post to.
5626
5627 This function actually prepares a news even when using mail groups.
5628 This is useful for ``posting'' messages to mail groups without actually
5629 sending them over the network: they're just saved directly to the group
5630 in question.  The corresponding back end must have a request-post method
5631 for this to work though.
5632
5633 @item S D b
5634 @kindex S D b (Summary)
5635 @findex gnus-summary-resend-bounced-mail
5636 @cindex bouncing mail
5637 If you have sent a mail, but the mail was bounced back to you for some
5638 reason (wrong address, transient failure), you can use this command to
5639 resend that bounced mail (@code{gnus-summary-resend-bounced-mail}).  You
5640 will be popped into a mail buffer where you can edit the headers before
5641 sending the mail off again.  If you give a prefix to this command, and
5642 the bounced mail is a reply to some other mail, Gnus will try to fetch
5643 that mail and display it for easy perusal of its headers.  This might
5644 very well fail, though.
5645
5646 @item S D r
5647 @kindex S D r (Summary)
5648 @findex gnus-summary-resend-message
5649 Not to be confused with the previous command,
5650 @code{gnus-summary-resend-message} will prompt you for an address to
5651 send the current message off to, and then send it to that place.  The
5652 headers of the message won't be altered---but lots of headers that say
5653 @code{Resent-To}, @code{Resent-From} and so on will be added.  This
5654 means that you actually send a mail to someone that has a @code{To}
5655 header that (probably) points to yourself.  This will confuse people.
5656 So, natcherly you'll only do that if you're really eVIl.
5657
5658 This command is mainly used if you have several accounts and want to
5659 ship a mail to a different account of yours.  (If you're both
5660 @code{root} and @code{postmaster} and get a mail for @code{postmaster}
5661 to the @code{root} account, you may want to resend it to
5662 @code{postmaster}.  Ordnung muss sein!
5663
5664 This command understands the process/prefix convention
5665 (@pxref{Process/Prefix}).
5666
5667 @item S D e
5668 @kindex S D e (Summary)
5669 @findex gnus-summary-resend-message-edit
5670
5671 Like the previous command, but will allow you to edit the message as
5672 if it were a new message before resending.
5673
5674 @item S O m
5675 @kindex S O m (Summary)
5676 @findex gnus-uu-digest-mail-forward
5677 Digest the current series (@pxref{Decoding Articles}) and forward the
5678 result using mail (@code{gnus-uu-digest-mail-forward}).  This command
5679 uses the process/prefix convention (@pxref{Process/Prefix}).
5680
5681 @item S M-c
5682 @kindex S M-c (Summary)
5683 @findex gnus-summary-mail-crosspost-complaint
5684 @cindex crossposting
5685 @cindex excessive crossposting
5686 Send a complaint about excessive crossposting to the author of the
5687 current article (@code{gnus-summary-mail-crosspost-complaint}).
5688
5689 @findex gnus-crosspost-complaint
5690 This command is provided as a way to fight back against the current
5691 crossposting pandemic that's sweeping Usenet.  It will compose a reply
5692 using the @code{gnus-crosspost-complaint} variable as a preamble.  This
5693 command understands the process/prefix convention
5694 (@pxref{Process/Prefix}) and will prompt you before sending each mail.
5695
5696 @end table
5697
5698 Also @xref{Header Commands, ,Header Commands, message, The Message
5699 Manual}, for more information.
5700
5701
5702 @node Summary Post Commands
5703 @subsection Summary Post Commands
5704 @cindex post
5705 @cindex composing news
5706
5707 Commands for posting a news article:
5708
5709 @table @kbd
5710 @item S p
5711 @itemx a
5712 @kindex a (Summary)
5713 @kindex S p (Summary)
5714 @findex gnus-summary-post-news
5715 @c @icon{gnus-summary-post-news}
5716 Prepare for posting an article (@code{gnus-summary-post-news}).  By
5717 default, post to the current group.  If given a prefix, disable that.
5718 If the prefix is 1, prompt for another group instead.
5719
5720 @item S f
5721 @itemx f
5722 @kindex f (Summary)
5723 @kindex S f (Summary)
5724 @findex gnus-summary-followup
5725 @c @icon{gnus-summary-followup}
5726 Post a followup to the current article (@code{gnus-summary-followup}).
5727
5728 @item S F
5729 @itemx F
5730 @kindex S F (Summary)
5731 @kindex F (Summary)
5732 @c @icon{gnus-summary-followup-with-original}
5733 @findex gnus-summary-followup-with-original
5734 Post a followup to the current article and include the original message
5735 (@code{gnus-summary-followup-with-original}).  This command uses the
5736 process/prefix convention.
5737
5738 @item S n
5739 @kindex S n (Summary)
5740 @findex gnus-summary-followup-to-mail
5741 Post a followup to the current article via news, even if you got the
5742 message through mail (@code{gnus-summary-followup-to-mail}).
5743
5744 @item S N
5745 @kindex S N (Summary)
5746 @findex gnus-summary-followup-to-mail-with-original
5747 Post a followup to the current article via news, even if you got the
5748 message through mail and include the original message
5749 (@code{gnus-summary-followup-to-mail-with-original}).  This command uses
5750 the process/prefix convention.
5751
5752 @item S o p
5753 @kindex S o p (Summary)
5754 @findex gnus-summary-post-forward
5755 Forward the current article to a newsgroup
5756 (@code{gnus-summary-post-forward}).
5757  If no prefix is given, the message is forwarded according to the value
5758 of (@code{message-forward-as-mime}) and
5759 (@code{message-forward-show-mml}); if the prefix is 1, decode the
5760 message and forward directly inline; if the prefix is 2, forward message
5761 as an rfc822 @acronym{MIME} section; if the prefix is 3, decode message and
5762 forward as an rfc822 @acronym{MIME} section; if the prefix is 4, forward message
5763 directly inline; otherwise, the message is forwarded as no prefix given
5764 but use the flipped value of (@code{message-forward-as-mime}).  By
5765 default, the message is decoded and forwarded as an rfc822 @acronym{MIME} section.
5766
5767 @item S O p
5768 @kindex S O p (Summary)
5769 @findex gnus-uu-digest-post-forward
5770 @cindex digests
5771 @cindex making digests
5772 Digest the current series and forward the result to a newsgroup
5773 (@code{gnus-uu-digest-post-forward}).  This command uses the
5774 process/prefix convention.
5775
5776 @item S u
5777 @kindex S u (Summary)
5778 @findex gnus-uu-post-news
5779 @c @icon{gnus-uu-post-news}
5780 Uuencode a file, split it into parts, and post it as a series
5781 (@code{gnus-uu-post-news}).  (@pxref{Uuencoding and Posting}).
5782 @end table
5783
5784 Also @xref{Header Commands, ,Header Commands, message, The Message
5785 Manual}, for more information.
5786
5787
5788 @node Summary Message Commands
5789 @subsection Summary Message Commands
5790
5791 @table @kbd
5792 @item S y
5793 @kindex S y (Summary)
5794 @findex gnus-summary-yank-message
5795 Yank the current article into an already existing Message composition
5796 buffer (@code{gnus-summary-yank-message}).  This command prompts for
5797 what message buffer you want to yank into, and understands the
5798 process/prefix convention (@pxref{Process/Prefix}).
5799
5800 @end table
5801
5802
5803 @node Canceling and Superseding
5804 @subsection Canceling Articles
5805 @cindex canceling articles
5806 @cindex superseding articles
5807
5808 Have you ever written something, and then decided that you really,
5809 really, really wish you hadn't posted that?
5810
5811 Well, you can't cancel mail, but you can cancel posts.
5812
5813 @findex gnus-summary-cancel-article
5814 @kindex C (Summary)
5815 @c @icon{gnus-summary-cancel-article}
5816 Find the article you wish to cancel (you can only cancel your own
5817 articles, so don't try any funny stuff).  Then press @kbd{C} or @kbd{S
5818 c} (@code{gnus-summary-cancel-article}).  Your article will be
5819 canceled---machines all over the world will be deleting your article.
5820 This command uses the process/prefix convention (@pxref{Process/Prefix}).
5821
5822 Be aware, however, that not all sites honor cancels, so your article may
5823 live on here and there, while most sites will delete the article in
5824 question.
5825
5826 Gnus will use the ``current'' select method when canceling.  If you
5827 want to use the standard posting method, use the @samp{a} symbolic
5828 prefix (@pxref{Symbolic Prefixes}).
5829
5830 Gnus ensures that only you can cancel your own messages using a
5831 @code{Cancel-Lock} header (@pxref{Canceling News, Canceling News, ,
5832 message, Message Manual}).
5833
5834 If you discover that you have made some mistakes and want to do some
5835 corrections, you can post a @dfn{superseding} article that will replace
5836 your original article.
5837
5838 @findex gnus-summary-supersede-article
5839 @kindex S (Summary)
5840 Go to the original article and press @kbd{S s}
5841 (@code{gnus-summary-supersede-article}).  You will be put in a buffer
5842 where you can edit the article all you want before sending it off the
5843 usual way.
5844
5845 The same goes for superseding as for canceling, only more so: Some
5846 sites do not honor superseding.  On those sites, it will appear that you
5847 have posted almost the same article twice.
5848
5849 If you have just posted the article, and change your mind right away,
5850 there is a trick you can use to cancel/supersede the article without
5851 waiting for the article to appear on your site first.  You simply return
5852 to the post buffer (which is called @code{*sent ...*}).  There you will
5853 find the article you just posted, with all the headers intact.  Change
5854 the @code{Message-ID} header to a @code{Cancel} or @code{Supersedes}
5855 header by substituting one of those words for the word
5856 @code{Message-ID}.  Then just press @kbd{C-c C-c} to send the article as
5857 you would do normally.  The previous article will be
5858 canceled/superseded.
5859
5860 Just remember, kids: There is no 'c' in 'supersede'.
5861
5862 @node Delayed Articles
5863 @section Delayed Articles
5864 @cindex delayed sending
5865 @cindex send delayed
5866
5867 Sometimes, you might wish to delay the sending of a message.  For
5868 example, you might wish to arrange for a message to turn up just in time
5869 to remind your about the birthday of your Significant Other.  For this,
5870 there is the @code{gnus-delay} package.  Setup is simple:
5871
5872 @lisp
5873 (gnus-delay-initialize)
5874 @end lisp
5875
5876 @findex gnus-delay-article
5877 Normally, to send a message you use the @kbd{C-c C-c} command from
5878 Message mode.  To delay a message, use @kbd{C-c C-j}
5879 (@code{gnus-delay-article}) instead.  This will ask you for how long the
5880 message should be delayed.  Possible answers are:
5881
5882 @itemize @bullet
5883 @item
5884 A time span.  Consists of an integer and a letter.  For example,
5885 @code{42d} means to delay for 42 days.  Available letters are @code{m}
5886 (minutes), @code{h} (hours), @code{d} (days), @code{w} (weeks), @code{M}
5887 (months) and @code{Y} (years).
5888
5889 @item
5890 A specific date.  Looks like @code{YYYY-MM-DD}.  The message will be
5891 delayed until that day, at a specific time (eight o'clock by default).
5892 See also @code{gnus-delay-default-hour}.
5893
5894 @item
5895 A specific time of day.  Given in @code{hh:mm} format, 24h, no am/pm
5896 stuff.  The deadline will be at that time today, except if that time has
5897 already passed, then it's at the given time tomorrow.  So if it's ten
5898 o'clock in the morning and you specify @code{11:15}, then the deadline
5899 is one hour and fifteen minutes hence.  But if you specify @code{9:20},
5900 that means a time tomorrow.
5901 @end itemize
5902
5903 The action of the @code{gnus-delay-article} command is influenced by a
5904 couple of variables:
5905
5906 @table @code
5907 @item gnus-delay-default-hour
5908 @vindex gnus-delay-default-hour
5909 When you specify a specific date, the message will be due on that hour
5910 on the given date.  Possible values are integers 0 through 23.
5911
5912 @item gnus-delay-default-delay
5913 @vindex gnus-delay-default-delay
5914 This is a string and gives the default delay.  It can be of any of the
5915 formats described above.
5916
5917 @item gnus-delay-group
5918 @vindex gnus-delay-group
5919 Delayed articles will be kept in this group on the drafts server until
5920 they are due.  You probably don't need to change this.  The default
5921 value is @code{"delayed"}.
5922
5923 @item gnus-delay-header
5924 @vindex gnus-delay-header
5925 The deadline for each article will be stored in a header.  This variable
5926 is a string and gives the header name.  You probably don't need to
5927 change this.  The default value is @code{"X-Gnus-Delayed"}.
5928 @end table
5929
5930 The way delaying works is like this: when you use the
5931 @code{gnus-delay-article} command, you give a certain delay.  Gnus
5932 calculates the deadline of the message and stores it in the
5933 @code{X-Gnus-Delayed} header and puts the message in the
5934 @code{nndraft:delayed} group.
5935
5936 @findex gnus-delay-send-queue
5937 And whenever you get new news, Gnus looks through the group for articles
5938 which are due and sends them.  It uses the @code{gnus-delay-send-queue}
5939 function for this.  By default, this function is added to the hook
5940 @code{gnus-get-new-news-hook}.  But of course, you can change this.
5941 Maybe you want to use the demon to send drafts?  Just tell the demon to
5942 execute the @code{gnus-delay-send-queue} function.
5943
5944 @table @code
5945 @item gnus-delay-initialize
5946 @findex gnus-delay-initialize
5947 By default, this function installs @code{gnus-delay-send-queue} in
5948 @code{gnus-get-new-news-hook}.  But it accepts the optional second
5949 argument @code{no-check}.  If it is non-@code{nil},
5950 @code{gnus-get-new-news-hook} is not changed.  The optional first
5951 argument is ignored.
5952
5953 For example, @code{(gnus-delay-initialize nil t)} means to do nothing.
5954 Presumably, you want to use the demon for sending due delayed articles.
5955 Just don't forget to set that up :-)
5956 @end table
5957
5958 When delaying an article with @kbd{C-c C-j}, Message mode will
5959 automatically add a @code{"Date"} header with the current time.  In
5960 many cases you probably want the @code{"Date"} header to reflect the
5961 time the message is sent instead.  To do this, you have to delete
5962 @code{Date} from @code{message-draft-headers}.
5963
5964
5965 @node Marking Articles
5966 @section Marking Articles
5967 @cindex article marking
5968 @cindex article ticking
5969 @cindex marks
5970
5971 There are several marks you can set on an article.
5972
5973 You have marks that decide the @dfn{readedness} (whoo, neato-keano
5974 neologism ohoy!) of the article.  Alphabetic marks generally mean
5975 @dfn{read}, while non-alphabetic characters generally mean @dfn{unread}.
5976
5977 In addition, you also have marks that do not affect readedness.
5978
5979 @ifinfo
5980 There's a plethora of commands for manipulating these marks.
5981 @end ifinfo
5982
5983 @menu
5984 * Unread Articles::             Marks for unread articles.
5985 * Read Articles::               Marks for read articles.
5986 * Other Marks::                 Marks that do not affect readedness.
5987 * Setting Marks::               How to set and remove marks.
5988 * Generic Marking Commands::    How to customize the marking.
5989 * Setting Process Marks::       How to mark articles for later processing.
5990 @end menu
5991
5992
5993 @node Unread Articles
5994 @subsection Unread Articles
5995
5996 The following marks mark articles as (kinda) unread, in one form or
5997 other.
5998
5999 @table @samp
6000 @item !
6001 @vindex gnus-ticked-mark
6002 Marked as ticked (@code{gnus-ticked-mark}).
6003
6004 @dfn{Ticked articles} are articles that will remain visible always.  If
6005 you see an article that you find interesting, or you want to put off
6006 reading it, or replying to it, until sometime later, you'd typically
6007 tick it.  However, articles can be expired (from news servers by the
6008 news server software, Gnus itself never expires ticked messages), so if
6009 you want to keep an article forever, you'll have to make it persistent
6010 (@pxref{Persistent Articles}).
6011
6012 @item ?
6013 @vindex gnus-dormant-mark
6014 Marked as dormant (@code{gnus-dormant-mark}).
6015
6016 @dfn{Dormant articles} will only appear in the summary buffer if there
6017 are followups to it.  If you want to see them even if they don't have
6018 followups, you can use the @kbd{/ D} command (@pxref{Limiting}).
6019 Otherwise (except for the visibility issue), they are just like ticked
6020 messages.
6021
6022 @item SPACE
6023 @vindex gnus-unread-mark
6024 Marked as unread (@code{gnus-unread-mark}).
6025
6026 @dfn{Unread articles} are articles that haven't been read at all yet.
6027 @end table
6028
6029
6030 @node Read Articles
6031 @subsection Read Articles
6032 @cindex expirable mark
6033
6034 All the following marks mark articles as read.
6035
6036 @table @samp
6037
6038 @item r
6039 @vindex gnus-del-mark
6040 These are articles that the user has marked as read with the @kbd{d}
6041 command manually, more or less (@code{gnus-del-mark}).
6042
6043 @item R
6044 @vindex gnus-read-mark
6045 Articles that have actually been read (@code{gnus-read-mark}).
6046
6047 @item O
6048 @vindex gnus-ancient-mark
6049 Articles that were marked as read in previous sessions and are now
6050 @dfn{old} (@code{gnus-ancient-mark}).
6051
6052 @item K
6053 @vindex gnus-killed-mark
6054 Marked as killed (@code{gnus-killed-mark}).
6055
6056 @item X
6057 @vindex gnus-kill-file-mark
6058 Marked as killed by kill files (@code{gnus-kill-file-mark}).
6059
6060 @item Y
6061 @vindex gnus-low-score-mark
6062 Marked as read by having too low a score (@code{gnus-low-score-mark}).
6063
6064 @item C
6065 @vindex gnus-catchup-mark
6066 Marked as read by a catchup (@code{gnus-catchup-mark}).
6067
6068 @item G
6069 @vindex gnus-canceled-mark
6070 Canceled article (@code{gnus-canceled-mark})
6071
6072 @item Q
6073 @vindex gnus-sparse-mark
6074 Sparsely reffed article (@code{gnus-sparse-mark}).  @xref{Customizing
6075 Threading}.
6076
6077 @item M
6078 @vindex gnus-duplicate-mark
6079 Article marked as read by duplicate suppression
6080 (@code{gnus-duplicate-mark}).  @xref{Duplicate Suppression}.
6081
6082 @end table
6083
6084 All these marks just mean that the article is marked as read, really.
6085 They are interpreted differently when doing adaptive scoring, though.
6086
6087 One more special mark, though:
6088
6089 @table @samp
6090 @item E
6091 @vindex gnus-expirable-mark
6092 Marked as expirable (@code{gnus-expirable-mark}).
6093
6094 Marking articles as @dfn{expirable} (or have them marked as such
6095 automatically) doesn't make much sense in normal groups---a user doesn't
6096 control expiring of news articles, but in mail groups, for instance,
6097 articles marked as @dfn{expirable} can be deleted by Gnus at
6098 any time.
6099 @end table
6100
6101
6102 @node Other Marks
6103 @subsection Other Marks
6104 @cindex process mark
6105 @cindex bookmarks
6106
6107 There are some marks that have nothing to do with whether the article is
6108 read or not.
6109
6110 @itemize @bullet
6111
6112 @item
6113 You can set a bookmark in the current article.  Say you are reading a
6114 long thesis on cats' urinary tracts, and have to go home for dinner
6115 before you've finished reading the thesis.  You can then set a bookmark
6116 in the article, and Gnus will jump to this bookmark the next time it
6117 encounters the article.  @xref{Setting Marks}.
6118
6119 @item
6120 @vindex gnus-replied-mark
6121 All articles that you have replied to or made a followup to (i.e., have
6122 answered) will be marked with an @samp{A} in the second column
6123 (@code{gnus-replied-mark}).
6124
6125 @item
6126 @vindex gnus-forwarded-mark
6127 All articles that you have forwarded will be marked with an @samp{F} in
6128 the second column (@code{gnus-forwarded-mark}).
6129
6130 @item
6131 @vindex gnus-cached-mark
6132 Articles stored in the article cache will be marked with an @samp{*} in
6133 the second column (@code{gnus-cached-mark}).  @xref{Article Caching}.
6134
6135 @item
6136 @vindex gnus-saved-mark
6137 Articles ``saved'' (in some manner or other; not necessarily
6138 religiously) are marked with an @samp{S} in the second column
6139 (@code{gnus-saved-mark}).
6140
6141 @item
6142 @vindex gnus-recent-mark
6143 Articles that according to the server haven't been shown to the user
6144 before are marked with a @samp{N} in the second column
6145 (@code{gnus-recent-mark}).  Note that not all servers support this
6146 mark, in which case it simply never appears.  Compare with
6147 @code{gnus-unseen-mark}.
6148
6149 @item
6150 @vindex gnus-unseen-mark
6151 Articles that haven't been seen before in Gnus by the user are marked
6152 with a @samp{.} in the second column (@code{gnus-unseen-mark}).
6153 Compare with @code{gnus-recent-mark}.
6154
6155 @item
6156 @vindex gnus-downloaded-mark
6157 When using the Gnus agent (@pxref{Agent Basics}), articles may be
6158 downloaded for unplugged (offline) viewing.  If you are using the
6159 @samp{%O} spec, these articles get the @samp{+} mark in that spec.
6160 (The variable @code{gnus-downloaded-mark} controls which character to
6161 use.)
6162
6163 @item
6164 @vindex gnus-undownloaded-mark
6165 When using the Gnus agent (@pxref{Agent Basics}), some articles might
6166 not have been downloaded.  Such articles cannot be viewed while you
6167 are unplugged (offline).  If you are using the @samp{%O} spec, these
6168 articles get the @samp{-} mark in that spec.  (The variable
6169 @code{gnus-undownloaded-mark} controls which character to use.)
6170
6171 @item
6172 @vindex gnus-downloadable-mark
6173 The Gnus agent (@pxref{Agent Basics}) downloads some articles
6174 automatically, but it is also possible to explicitly mark articles for
6175 download, even if they would not be downloaded automatically.  Such
6176 explicitly-marked articles get the @samp{%} mark in the first column.
6177 (The variable @code{gnus-downloadable-mark} controls which character to
6178 use.)
6179
6180 @item
6181 @vindex gnus-not-empty-thread-mark
6182 @vindex gnus-empty-thread-mark
6183 If the @samp{%e} spec is used, the presence of threads or not will be
6184 marked with @code{gnus-not-empty-thread-mark} and
6185 @code{gnus-empty-thread-mark} in the third column, respectively.
6186
6187 @item
6188 @vindex gnus-process-mark
6189 Finally we have the @dfn{process mark} (@code{gnus-process-mark}).  A
6190 variety of commands react to the presence of the process mark.  For
6191 instance, @kbd{X u} (@code{gnus-uu-decode-uu}) will uudecode and view
6192 all articles that have been marked with the process mark.  Articles
6193 marked with the process mark have a @samp{#} in the second column.
6194
6195 @end itemize
6196
6197 You might have noticed that most of these ``non-readedness'' marks
6198 appear in the second column by default.  So if you have a cached, saved,
6199 replied article that you have process-marked, what will that look like?
6200
6201 Nothing much.  The precedence rules go as follows: process -> cache ->
6202 replied -> saved.  So if the article is in the cache and is replied,
6203 you'll only see the cache mark and not the replied mark.
6204
6205
6206 @node Setting Marks
6207 @subsection Setting Marks
6208 @cindex setting marks
6209
6210 All the marking commands understand the numeric prefix.
6211
6212 @table @kbd
6213 @item M c
6214 @itemx M-u
6215 @kindex M c (Summary)
6216 @kindex M-u (Summary)
6217 @findex gnus-summary-clear-mark-forward
6218 @cindex mark as unread
6219 Clear all readedness-marks from the current article
6220 (@code{gnus-summary-clear-mark-forward}).  In other words, mark the
6221 article as unread.
6222
6223 @item M t
6224 @itemx !
6225 @kindex ! (Summary)
6226 @kindex M t (Summary)
6227 @findex gnus-summary-tick-article-forward
6228 Tick the current article (@code{gnus-summary-tick-article-forward}).
6229 @xref{Article Caching}.
6230
6231 @item M ?
6232 @itemx ?
6233 @kindex ? (Summary)
6234 @kindex M ? (Summary)
6235 @findex gnus-summary-mark-as-dormant
6236 Mark the current article as dormant
6237 (@code{gnus-summary-mark-as-dormant}).  @xref{Article Caching}.
6238
6239 @item M d
6240 @itemx d
6241 @kindex M d (Summary)
6242 @kindex d (Summary)
6243 @findex gnus-summary-mark-as-read-forward
6244 Mark the current article as read
6245 (@code{gnus-summary-mark-as-read-forward}).
6246
6247 @item D
6248 @kindex D (Summary)
6249 @findex gnus-summary-mark-as-read-backward
6250 Mark the current article as read and move point to the previous line
6251 (@code{gnus-summary-mark-as-read-backward}).
6252
6253 @item M k
6254 @itemx k
6255 @kindex k (Summary)
6256 @kindex M k (Summary)
6257 @findex gnus-summary-kill-same-subject-and-select
6258 Mark all articles that have the same subject as the current one as read,
6259 and then select the next unread article
6260 (@code{gnus-summary-kill-same-subject-and-select}).
6261
6262 @item M K
6263 @itemx C-k
6264 @kindex M K (Summary)
6265 @kindex C-k (Summary)
6266 @findex gnus-summary-kill-same-subject
6267 Mark all articles that have the same subject as the current one as read
6268 (@code{gnus-summary-kill-same-subject}).
6269
6270 @item M C
6271 @kindex M C (Summary)
6272 @findex gnus-summary-catchup
6273 @c @icon{gnus-summary-catchup}
6274 Mark all unread articles as read (@code{gnus-summary-catchup}).
6275
6276 @item M C-c
6277 @kindex M C-c (Summary)
6278 @findex gnus-summary-catchup-all
6279 Mark all articles in the group as read---even the ticked and dormant
6280 articles (@code{gnus-summary-catchup-all}).
6281
6282 @item M H
6283 @kindex M H (Summary)
6284 @findex gnus-summary-catchup-to-here
6285 Catchup the current group to point (before the point)
6286 (@code{gnus-summary-catchup-to-here}).
6287
6288 @item M h
6289 @kindex M h (Summary)
6290 @findex gnus-summary-catchup-from-here
6291 Catchup the current group from point (after the point)
6292 (@code{gnus-summary-catchup-from-here}).
6293
6294 @item C-w
6295 @kindex C-w (Summary)
6296 @findex gnus-summary-mark-region-as-read
6297 Mark all articles between point and mark as read
6298 (@code{gnus-summary-mark-region-as-read}).
6299
6300 @item M V k
6301 @kindex M V k (Summary)
6302 @findex gnus-summary-kill-below
6303 Kill all articles with scores below the default score (or below the
6304 numeric prefix) (@code{gnus-summary-kill-below}).
6305
6306 @item M e
6307 @itemx E
6308 @kindex M e (Summary)
6309 @kindex E (Summary)
6310 @findex gnus-summary-mark-as-expirable
6311 Mark the current article as expirable
6312 (@code{gnus-summary-mark-as-expirable}).
6313
6314 @item M b
6315 @kindex M b (Summary)
6316 @findex gnus-summary-set-bookmark
6317 Set a bookmark in the current article
6318 (@code{gnus-summary-set-bookmark}).
6319
6320 @item M B
6321 @kindex M B (Summary)
6322 @findex gnus-summary-remove-bookmark
6323 Remove the bookmark from the current article
6324 (@code{gnus-summary-remove-bookmark}).
6325
6326 @item M V c
6327 @kindex M V c (Summary)
6328 @findex gnus-summary-clear-above
6329 Clear all marks from articles with scores over the default score (or
6330 over the numeric prefix) (@code{gnus-summary-clear-above}).
6331
6332 @item M V u
6333 @kindex M V u (Summary)
6334 @findex gnus-summary-tick-above
6335 Tick all articles with scores over the default score (or over the
6336 numeric prefix) (@code{gnus-summary-tick-above}).
6337
6338 @item M V m
6339 @kindex M V m (Summary)
6340 @findex gnus-summary-mark-above
6341 Prompt for a mark, and mark all articles with scores over the default
6342 score (or over the numeric prefix) with this mark
6343 (@code{gnus-summary-clear-above}).
6344 @end table
6345
6346 @vindex gnus-summary-goto-unread
6347 The @code{gnus-summary-goto-unread} variable controls what action should
6348 be taken after setting a mark.  If non-@code{nil}, point will move to
6349 the next/previous unread article.  If @code{nil}, point will just move
6350 one line up or down.  As a special case, if this variable is
6351 @code{never}, all the marking commands as well as other commands (like
6352 @kbd{SPACE}) will move to the next article, whether it is unread or not.
6353 The default is @code{t}.
6354
6355
6356 @node Generic Marking Commands
6357 @subsection Generic Marking Commands
6358
6359 Some people would like the command that ticks an article (@kbd{!}) go to
6360 the next article.  Others would like it to go to the next unread
6361 article.  Yet others would like it to stay on the current article.  And
6362 even though I haven't heard of anybody wanting it to go to the
6363 previous (unread) article, I'm sure there are people that want that as
6364 well.
6365
6366 Multiply these five behaviors with five different marking commands, and
6367 you get a potentially complex set of variable to control what each
6368 command should do.
6369
6370 To sidestep that mess, Gnus provides commands that do all these
6371 different things.  They can be found on the @kbd{M M} map in the summary
6372 buffer.  Type @kbd{M M C-h} to see them all---there are too many of them
6373 to list in this manual.
6374
6375 While you can use these commands directly, most users would prefer
6376 altering the summary mode keymap.  For instance, if you would like the
6377 @kbd{!} command to go to the next article instead of the next unread
6378 article, you could say something like:
6379
6380 @lisp
6381 @group
6382 (add-hook 'gnus-summary-mode-hook 'my-alter-summary-map)
6383 (defun my-alter-summary-map ()
6384   (local-set-key "!" 'gnus-summary-put-mark-as-ticked-next))
6385 @end group
6386 @end lisp
6387
6388 @noindent
6389 or
6390
6391 @lisp
6392 (defun my-alter-summary-map ()
6393   (local-set-key "!" "MM!n"))
6394 @end lisp
6395
6396
6397 @node Setting Process Marks
6398 @subsection Setting Process Marks
6399 @cindex setting process marks
6400
6401 Process marks are displayed as @code{#} in the summary buffer, and are
6402 used for marking articles in such a way that other commands will
6403 process these articles.  For instance, if you process mark four
6404 articles and then use the @kbd{*} command, Gnus will enter these four
6405 articles into the cache.  For more information,
6406 @pxref{Process/Prefix}.
6407
6408 @table @kbd
6409
6410 @item M P p
6411 @itemx #
6412 @kindex # (Summary)
6413 @kindex M P p (Summary)
6414 @findex gnus-summary-mark-as-processable
6415 Mark the current article with the process mark
6416 (@code{gnus-summary-mark-as-processable}).
6417 @findex gnus-summary-unmark-as-processable
6418
6419 @item M P u
6420 @itemx M-#
6421 @kindex M P u (Summary)
6422 @kindex M-# (Summary)
6423 Remove the process mark, if any, from the current article
6424 (@code{gnus-summary-unmark-as-processable}).
6425
6426 @item M P U
6427 @kindex M P U (Summary)
6428 @findex gnus-summary-unmark-all-processable
6429 Remove the process mark from all articles
6430 (@code{gnus-summary-unmark-all-processable}).
6431
6432 @item M P i
6433 @kindex M P i (Summary)
6434 @findex gnus-uu-invert-processable
6435 Invert the list of process marked articles
6436 (@code{gnus-uu-invert-processable}).
6437
6438 @item M P R
6439 @kindex M P R (Summary)
6440 @findex gnus-uu-mark-by-regexp
6441 Mark articles that have a @code{Subject} header that matches a regular
6442 expression (@code{gnus-uu-mark-by-regexp}).
6443
6444 @item M P G
6445 @kindex M P G (Summary)
6446 @findex gnus-uu-unmark-by-regexp
6447 Unmark articles that have a @code{Subject} header that matches a regular
6448 expression (@code{gnus-uu-unmark-by-regexp}).
6449
6450 @item M P r
6451 @kindex M P r (Summary)
6452 @findex gnus-uu-mark-region
6453 Mark articles in region (@code{gnus-uu-mark-region}).
6454
6455 @item M P g
6456 @kindex M P g (Summary)
6457 @findex gnus-uu-unmark-region
6458 Unmark articles in region (@code{gnus-uu-unmark-region}).
6459
6460 @item M P t
6461 @kindex M P t (Summary)
6462 @findex gnus-uu-mark-thread
6463 Mark all articles in the current (sub)thread
6464 (@code{gnus-uu-mark-thread}).
6465
6466 @item M P T
6467 @kindex M P T (Summary)
6468 @findex gnus-uu-unmark-thread
6469 Unmark all articles in the current (sub)thread
6470 (@code{gnus-uu-unmark-thread}).
6471
6472 @item M P v
6473 @kindex M P v (Summary)
6474 @findex gnus-uu-mark-over
6475 Mark all articles that have a score above the prefix argument
6476 (@code{gnus-uu-mark-over}).
6477
6478 @item M P s
6479 @kindex M P s (Summary)
6480 @findex gnus-uu-mark-series
6481 Mark all articles in the current series (@code{gnus-uu-mark-series}).
6482
6483 @item M P S
6484 @kindex M P S (Summary)
6485 @findex gnus-uu-mark-sparse
6486 Mark all series that have already had some articles marked
6487 (@code{gnus-uu-mark-sparse}).
6488
6489 @item M P a
6490 @kindex M P a (Summary)
6491 @findex gnus-uu-mark-all
6492 Mark all articles in series order (@code{gnus-uu-mark-all}).
6493
6494 @item M P b
6495 @kindex M P b (Summary)
6496 @findex gnus-uu-mark-buffer
6497 Mark all articles in the buffer in the order they appear
6498 (@code{gnus-uu-mark-buffer}).
6499
6500 @item M P k
6501 @kindex M P k (Summary)
6502 @findex gnus-summary-kill-process-mark
6503 Push the current process mark set onto the stack and unmark all articles
6504 (@code{gnus-summary-kill-process-mark}).
6505
6506 @item M P y
6507 @kindex M P y (Summary)
6508 @findex gnus-summary-yank-process-mark
6509 Pop the previous process mark set from the stack and restore it
6510 (@code{gnus-summary-yank-process-mark}).
6511
6512 @item M P w
6513 @kindex M P w (Summary)
6514 @findex gnus-summary-save-process-mark
6515 Push the current process mark set onto the stack
6516 (@code{gnus-summary-save-process-mark}).
6517
6518 @end table
6519
6520 Also see the @kbd{&} command in @ref{Searching for Articles}, for how to
6521 set process marks based on article body contents.
6522
6523
6524 @node Limiting
6525 @section Limiting
6526 @cindex limiting
6527
6528 It can be convenient to limit the summary buffer to just show some
6529 subset of the articles currently in the group.  The effect most limit
6530 commands have is to remove a few (or many) articles from the summary
6531 buffer.
6532
6533 Limiting commands work on subsets of the articles already fetched from
6534 the servers.  These commands don't query the server for additional
6535 articles.
6536
6537 @table @kbd
6538
6539 @item / /
6540 @itemx / s
6541 @kindex / / (Summary)
6542 @findex gnus-summary-limit-to-subject
6543 Limit the summary buffer to articles that match some subject
6544 (@code{gnus-summary-limit-to-subject}).  If given a prefix, exclude
6545 matching articles.
6546
6547 @item / a
6548 @kindex / a (Summary)
6549 @findex gnus-summary-limit-to-author
6550 Limit the summary buffer to articles that match some author
6551 (@code{gnus-summary-limit-to-author}).  If given a prefix, exclude
6552 matching articles.
6553
6554 @item / R
6555 @kindex / R (Summary)
6556 @findex gnus-summary-limit-to-recipient
6557 Limit the summary buffer to articles that match some recipient
6558 (@code{gnus-summary-limit-to-recipient}).  If given a prefix, exclude
6559 matching articles.
6560
6561 @item / A
6562 @kindex / A (Summary)
6563 @findex gnus-summary-limit-to-address
6564 Limit the summary buffer to articles in which contents of From, To or Cc
6565 header match a given address (@code{gnus-summary-limit-to-address}).  If
6566 given a prefix, exclude matching articles.
6567
6568 @item / S
6569 @kindex / S (Summary)
6570 @findex gnus-summary-limit-to-singletons
6571 Limit the summary buffer to articles that aren't part of any displayed
6572 threads (@code{gnus-summary-limit-to-singletons}).  If given a prefix,
6573 limit to articles that are part of displayed threads.
6574
6575 @item / x
6576 @kindex / x (Summary)
6577 @findex gnus-summary-limit-to-extra
6578 Limit the summary buffer to articles that match one of the ``extra''
6579 headers (@pxref{To From Newsgroups})
6580 (@code{gnus-summary-limit-to-extra}).  If given a prefix, exclude
6581 matching articles.
6582
6583 @item / u
6584 @itemx x
6585 @kindex / u (Summary)
6586 @kindex x (Summary)
6587 @findex gnus-summary-limit-to-unread
6588 Limit the summary buffer to articles not marked as read
6589 (@code{gnus-summary-limit-to-unread}).  If given a prefix, limit the
6590 buffer to articles strictly unread.  This means that ticked and
6591 dormant articles will also be excluded.
6592
6593 @item / m
6594 @kindex / m (Summary)
6595 @findex gnus-summary-limit-to-marks
6596 Ask for a mark and then limit to all articles that have been marked
6597 with that mark (@code{gnus-summary-limit-to-marks}).
6598
6599 @item / t
6600 @kindex / t (Summary)
6601 @findex gnus-summary-limit-to-age
6602 Ask for a number and then limit the summary buffer to articles older than (or equal to) that number of days
6603 (@code{gnus-summary-limit-to-age}).  If given a prefix, limit to
6604 articles younger than that number of days.
6605
6606 @item / n
6607 @kindex / n (Summary)
6608 @findex gnus-summary-limit-to-articles
6609 With prefix @samp{n}, limit the summary buffer to the next @samp{n}
6610 articles.  If not given a prefix, use the process marked articles
6611 instead.  (@code{gnus-summary-limit-to-articles}).
6612
6613 @item / w
6614 @kindex / w (Summary)
6615 @findex gnus-summary-pop-limit
6616 Pop the previous limit off the stack and restore it
6617 (@code{gnus-summary-pop-limit}).  If given a prefix, pop all limits off
6618 the stack.
6619
6620 @item / .
6621 @kindex / . (Summary)
6622 @findex gnus-summary-limit-to-unseen
6623 Limit the summary buffer to the unseen articles
6624 (@code{gnus-summary-limit-to-unseen}).
6625
6626 @item / v
6627 @kindex / v (Summary)
6628 @findex gnus-summary-limit-to-score
6629 Limit the summary buffer to articles that have a score at or above some
6630 score (@code{gnus-summary-limit-to-score}).
6631
6632 @item / p
6633 @kindex / p (Summary)
6634 @findex gnus-summary-limit-to-display-predicate
6635 Limit the summary buffer to articles that satisfy the @code{display}
6636 group parameter predicate
6637 (@code{gnus-summary-limit-to-display-predicate}).  @xref{Group
6638 Parameters}, for more on this predicate.
6639
6640 @item / r
6641 @kindex / r (Summary)
6642 @findex gnus-summary-limit-to-replied
6643 Limit the summary buffer to replied articles
6644 (@code{gnus-summary-limit-to-replied}).  If given a prefix, exclude
6645 replied articles.
6646
6647 @item / E
6648 @itemx M S
6649 @kindex M S (Summary)
6650 @kindex / E (Summary)
6651 @findex gnus-summary-limit-include-expunged
6652 Include all expunged articles in the limit
6653 (@code{gnus-summary-limit-include-expunged}).
6654
6655 @item / D
6656 @kindex / D (Summary)
6657 @findex gnus-summary-limit-include-dormant
6658 Include all dormant articles in the limit
6659 (@code{gnus-summary-limit-include-dormant}).
6660
6661 @item / *
6662 @kindex / * (Summary)
6663 @findex gnus-summary-limit-include-cached
6664 Include all cached articles in the limit
6665 (@code{gnus-summary-limit-include-cached}).
6666
6667 @item / d
6668 @kindex / d (Summary)
6669 @findex gnus-summary-limit-exclude-dormant
6670 Exclude all dormant articles from the limit
6671 (@code{gnus-summary-limit-exclude-dormant}).
6672
6673 @item / M
6674 @kindex / M (Summary)
6675 @findex gnus-summary-limit-exclude-marks
6676 Exclude all marked articles (@code{gnus-summary-limit-exclude-marks}).
6677
6678 @item / T
6679 @kindex / T (Summary)
6680 @findex gnus-summary-limit-include-thread
6681 Include all the articles in the current thread in the limit.
6682
6683 @item / c
6684 @kindex / c (Summary)
6685 @findex gnus-summary-limit-exclude-childless-dormant
6686 Exclude all dormant articles that have no children from the limit@*
6687 (@code{gnus-summary-limit-exclude-childless-dormant}).
6688
6689 @item / C
6690 @kindex / C (Summary)
6691 @findex gnus-summary-limit-mark-excluded-as-read
6692 Mark all excluded unread articles as read
6693 (@code{gnus-summary-limit-mark-excluded-as-read}).  If given a prefix,
6694 also mark excluded ticked and dormant articles as read.
6695
6696 @item / b
6697 @kindex / b (Summary)
6698 @findex gnus-summary-limit-to-bodies
6699 Limit the summary buffer to articles that have bodies that match a
6700 certain regexp (@code{gnus-summary-limit-to-bodies}).  If given a
6701 prefix, reverse the limit.  This command is quite slow since it
6702 requires selecting each article to find the matches.
6703
6704 @item / h
6705 @kindex / h (Summary)
6706 @findex gnus-summary-limit-to-headers
6707 Like the previous command, only limit to headers instead
6708 (@code{gnus-summary-limit-to-headers}).
6709
6710 @end table
6711
6712
6713 The following commands aren't limiting commands, but use the @kbd{/}
6714 prefix as well.
6715
6716 @table @kbd
6717 @item / N
6718 @kindex / N (Summary)
6719 @findex gnus-summary-insert-new-articles
6720 Insert all new articles in the summary buffer.  It scans for new emails
6721 if @var{back-end}@code{-get-new-mail} is non-@code{nil}.
6722
6723 @item / o
6724 @kindex / o (Summary)
6725 @findex gnus-summary-insert-old-articles
6726 Insert all old articles in the summary buffer.  If given a numbered
6727 prefix, fetch this number of articles.
6728
6729 @end table
6730
6731
6732 @node Threading
6733 @section Threading
6734 @cindex threading
6735 @cindex article threading
6736
6737 Gnus threads articles by default.  @dfn{To thread} is to put responses
6738 to articles directly after the articles they respond to---in a
6739 hierarchical fashion.
6740
6741 Threading is done by looking at the @code{References} headers of the
6742 articles.  In a perfect world, this would be enough to build pretty
6743 trees, but unfortunately, the @code{References} header is often broken
6744 or simply missing.  Weird news propagation exacerbates the problem,
6745 so one has to employ other heuristics to get pleasing results.  A
6746 plethora of approaches exists, as detailed in horrible detail in
6747 @ref{Customizing Threading}.
6748
6749 First, a quick overview of the concepts:
6750
6751 @table @dfn
6752 @item root
6753 The top-most article in a thread; the first article in the thread.
6754
6755 @item thread
6756 A tree-like article structure.
6757
6758 @item sub-thread
6759 A small(er) section of this tree-like structure.
6760
6761 @item loose threads
6762 Threads often lose their roots due to article expiry, or due to the root
6763 already having been read in a previous session, and not displayed in the
6764 summary buffer.  We then typically have many sub-threads that really
6765 belong to one thread, but are without connecting roots.  These are
6766 called loose threads.
6767
6768 @item thread gathering
6769 An attempt to gather loose threads into bigger threads.
6770
6771 @item sparse threads
6772 A thread where the missing articles have been ``guessed'' at, and are
6773 displayed as empty lines in the summary buffer.
6774
6775 @end table
6776
6777
6778 @menu
6779 * Customizing Threading::       Variables you can change to affect the threading.
6780 * Thread Commands::             Thread based commands in the summary buffer.
6781 @end menu
6782
6783
6784 @node Customizing Threading
6785 @subsection Customizing Threading
6786 @cindex customizing threading
6787
6788 @menu
6789 * Loose Threads::               How Gnus gathers loose threads into bigger threads.
6790 * Filling In Threads::          Making the threads displayed look fuller.
6791 * More Threading::              Even more variables for fiddling with threads.
6792 * Low-Level Threading::         You thought it was over@dots{} but you were wrong!
6793 @end menu
6794
6795
6796 @node Loose Threads
6797 @subsubsection Loose Threads
6798 @cindex <
6799 @cindex >
6800 @cindex loose threads
6801
6802 @table @code
6803 @item gnus-summary-make-false-root
6804 @vindex gnus-summary-make-false-root
6805 If non-@code{nil}, Gnus will gather all loose subtrees into one big tree
6806 and create a dummy root at the top.  (Wait a minute.  Root at the top?
6807 Yup.)  Loose subtrees occur when the real root has expired, or you've
6808 read or killed the root in a previous session.
6809
6810 When there is no real root of a thread, Gnus will have to fudge
6811 something.  This variable says what fudging method Gnus should use.
6812 There are four possible values:
6813
6814 @iftex
6815 @iflatex
6816 \gnusfigure{The Summary Buffer}{390}{
6817 \put(0,0){\epsfig{figure=ps/summary-adopt,width=7.5cm}}
6818 \put(445,0){\makebox(0,0)[br]{\epsfig{figure=ps/summary-empty,width=7.5cm}}}
6819 \put(0,400){\makebox(0,0)[tl]{\epsfig{figure=ps/summary-none,width=7.5cm}}}
6820 \put(445,400){\makebox(0,0)[tr]{\epsfig{figure=ps/summary-dummy,width=7.5cm}}}
6821 }
6822 @end iflatex
6823 @end iftex
6824
6825 @cindex adopting articles
6826
6827 @table @code
6828
6829 @item adopt
6830 Gnus will make the first of the orphaned articles the parent.  This
6831 parent will adopt all the other articles.  The adopted articles will be
6832 marked as such by pointy brackets (@samp{<>}) instead of the standard
6833 square brackets (@samp{[]}).  This is the default method.
6834
6835 @item dummy
6836 @vindex gnus-summary-dummy-line-format
6837 @vindex gnus-summary-make-false-root-always
6838 Gnus will create a dummy summary line that will pretend to be the
6839 parent.  This dummy line does not correspond to any real article, so
6840 selecting it will just select the first real article after the dummy
6841 article.  @code{gnus-summary-dummy-line-format} is used to specify the
6842 format of the dummy roots.  It accepts only one format spec:  @samp{S},
6843 which is the subject of the article.  @xref{Formatting Variables}.
6844 If you want all threads to have a dummy root, even the non-gathered
6845 ones, set @code{gnus-summary-make-false-root-always} to @code{t}.
6846
6847 @item empty
6848 Gnus won't actually make any article the parent, but simply leave the
6849 subject field of all orphans except the first empty.  (Actually, it will
6850 use @code{gnus-summary-same-subject} as the subject (@pxref{Summary
6851 Buffer Format}).)
6852
6853 @item none
6854 Don't make any article parent at all.  Just gather the threads and
6855 display them after one another.
6856
6857 @item nil
6858 Don't gather loose threads.
6859 @end table
6860
6861 @item gnus-summary-gather-subject-limit
6862 @vindex gnus-summary-gather-subject-limit
6863 Loose threads are gathered by comparing subjects of articles.  If this
6864 variable is @code{nil}, Gnus requires an exact match between the
6865 subjects of the loose threads before gathering them into one big
6866 super-thread.  This might be too strict a requirement, what with the
6867 presence of stupid newsreaders that chop off long subject lines.  If
6868 you think so, set this variable to, say, 20 to require that only the
6869 first 20 characters of the subjects have to match.  If you set this
6870 variable to a really low number, you'll find that Gnus will gather
6871 everything in sight into one thread, which isn't very helpful.
6872
6873 @cindex fuzzy article gathering
6874 If you set this variable to the special value @code{fuzzy}, Gnus will
6875 use a fuzzy string comparison algorithm on the subjects (@pxref{Fuzzy
6876 Matching}).
6877
6878 @item gnus-simplify-subject-fuzzy-regexp
6879 @vindex gnus-simplify-subject-fuzzy-regexp
6880 This can either be a regular expression or list of regular expressions
6881 that match strings that will be removed from subjects if fuzzy subject
6882 simplification is used.
6883
6884 @item gnus-simplify-ignored-prefixes
6885 @vindex gnus-simplify-ignored-prefixes
6886 If you set @code{gnus-summary-gather-subject-limit} to something as low
6887 as 10, you might consider setting this variable to something sensible:
6888
6889 @c Written by Michael Ernst <mernst@cs.rice.edu>
6890 @lisp
6891 (setq gnus-simplify-ignored-prefixes
6892       (concat
6893        "\\`\\[?\\("
6894        (mapconcat
6895         'identity
6896         '("looking"
6897           "wanted" "followup" "summary\\( of\\)?"
6898           "help" "query" "problem" "question"
6899           "answer" "reference" "announce"
6900           "How can I" "How to" "Comparison of"
6901           ;; ...
6902           )
6903         "\\|")
6904        "\\)\\s *\\("
6905        (mapconcat 'identity
6906                   '("for" "for reference" "with" "about")
6907                   "\\|")
6908        "\\)?\\]?:?[ \t]*"))
6909 @end lisp
6910
6911 All words that match this regexp will be removed before comparing two
6912 subjects.
6913
6914 @item gnus-simplify-subject-functions
6915 @vindex gnus-simplify-subject-functions
6916 If non-@code{nil}, this variable overrides
6917 @code{gnus-summary-gather-subject-limit}.  This variable should be a
6918 list of functions to apply to the @code{Subject} string iteratively to
6919 arrive at the simplified version of the string.
6920
6921 Useful functions to put in this list include:
6922
6923 @table @code
6924 @item gnus-simplify-subject-re
6925 @findex gnus-simplify-subject-re
6926 Strip the leading @samp{Re:}.
6927
6928 @item gnus-simplify-subject-fuzzy
6929 @findex gnus-simplify-subject-fuzzy
6930 Simplify fuzzily.
6931
6932 @item gnus-simplify-whitespace
6933 @findex gnus-simplify-whitespace
6934 Remove excessive whitespace.
6935
6936 @item gnus-simplify-all-whitespace
6937 @findex gnus-simplify-all-whitespace
6938 Remove all whitespace.
6939 @end table
6940
6941 You may also write your own functions, of course.
6942
6943
6944 @item gnus-summary-gather-exclude-subject
6945 @vindex gnus-summary-gather-exclude-subject
6946 Since loose thread gathering is done on subjects only, that might lead
6947 to many false hits, especially with certain common subjects like
6948 @samp{} and @samp{(none)}.  To make the situation slightly better,
6949 you can use the regexp @code{gnus-summary-gather-exclude-subject} to say
6950 what subjects should be excluded from the gathering process.@*
6951 The default is @samp{^ *$\\|^(none)$}.
6952
6953 @item gnus-summary-thread-gathering-function
6954 @vindex gnus-summary-thread-gathering-function
6955 Gnus gathers threads by looking at @code{Subject} headers.  This means
6956 that totally unrelated articles may end up in the same ``thread'', which
6957 is confusing.  An alternate approach is to look at all the
6958 @code{Message-ID}s in all the @code{References} headers to find matches.
6959 This will ensure that no gathered threads ever include unrelated
6960 articles, but it also means that people who have posted with broken
6961 newsreaders won't be gathered properly.  The choice is yours---plague or
6962 cholera:
6963
6964 @table @code
6965 @item gnus-gather-threads-by-subject
6966 @findex gnus-gather-threads-by-subject
6967 This function is the default gathering function and looks at
6968 @code{Subject}s exclusively.
6969
6970 @item gnus-gather-threads-by-references
6971 @findex gnus-gather-threads-by-references
6972 This function looks at @code{References} headers exclusively.
6973 @end table
6974
6975 If you want to test gathering by @code{References}, you could say
6976 something like:
6977
6978 @lisp
6979 (setq gnus-summary-thread-gathering-function
6980       'gnus-gather-threads-by-references)
6981 @end lisp
6982
6983 @end table
6984
6985
6986 @node Filling In Threads
6987 @subsubsection Filling In Threads
6988
6989 @table @code
6990 @item gnus-fetch-old-headers
6991 @vindex gnus-fetch-old-headers
6992 If non-@code{nil}, Gnus will attempt to build old threads by fetching
6993 more old headers---headers to articles marked as read.  If you would
6994 like to display as few summary lines as possible, but still connect as
6995 many loose threads as possible, you should set this variable to
6996 @code{some} or a number.  If you set it to a number, no more than that
6997 number of extra old headers will be fetched.  In either case, fetching
6998 old headers only works if the back end you are using carries overview
6999 files---this would normally be @code{nntp}, @code{nnspool},
7000 @code{nnml}, and @code{nnmaildir}.  Also remember that if the root of
7001 the thread has been expired by the server, there's not much Gnus can
7002 do about that.
7003
7004 This variable can also be set to @code{invisible}.  This won't have any
7005 visible effects, but is useful if you use the @kbd{A T} command a lot
7006 (@pxref{Finding the Parent}).
7007
7008 The server has to support @acronym{NOV} for any of this to work.
7009
7010 @cindex Gmane, gnus-fetch-old-headers
7011 This feature can seriously impact performance it ignores all locally
7012 cached header entries.  Setting it to @code{t} for groups for a server
7013 that doesn't expire articles (such as news.gmane.org), leads to very
7014 slow summary generation.
7015
7016 @item gnus-fetch-old-ephemeral-headers
7017 @vindex gnus-fetch-old-ephemeral-headers
7018 Same as @code{gnus-fetch-old-headers}, but only used for ephemeral
7019 newsgroups.
7020
7021 @item gnus-build-sparse-threads
7022 @vindex gnus-build-sparse-threads
7023 Fetching old headers can be slow.  A low-rent similar effect can be
7024 gotten by setting this variable to @code{some}.  Gnus will then look at
7025 the complete @code{References} headers of all articles and try to string
7026 together articles that belong in the same thread.  This will leave
7027 @dfn{gaps} in the threading display where Gnus guesses that an article
7028 is missing from the thread.  (These gaps appear like normal summary
7029 lines.  If you select a gap, Gnus will try to fetch the article in
7030 question.)  If this variable is @code{t}, Gnus will display all these
7031 ``gaps'' without regard for whether they are useful for completing the
7032 thread or not.  Finally, if this variable is @code{more}, Gnus won't cut
7033 off sparse leaf nodes that don't lead anywhere.  This variable is
7034 @code{nil} by default.
7035
7036 @item gnus-read-all-available-headers
7037 @vindex gnus-read-all-available-headers
7038 This is a rather obscure variable that few will find useful.  It's
7039 intended for those non-news newsgroups where the back end has to fetch
7040 quite a lot to present the summary buffer, and where it's impossible to
7041 go back to parents of articles.  This is mostly the case in the
7042 web-based groups.
7043
7044 If you don't use those, then it's safe to leave this as the default
7045 @code{nil}.  If you want to use this variable, it should be a regexp
7046 that matches the group name, or @code{t} for all groups.
7047
7048 @end table
7049
7050
7051 @node More Threading
7052 @subsubsection More Threading
7053
7054 @table @code
7055 @item gnus-show-threads
7056 @vindex gnus-show-threads
7057 If this variable is @code{nil}, no threading will be done, and all of
7058 the rest of the variables here will have no effect.  Turning threading
7059 off will speed group selection up a bit, but it is sure to make reading
7060 slower and more awkward.
7061
7062 @item gnus-thread-hide-subtree
7063 @vindex gnus-thread-hide-subtree
7064 If non-@code{nil}, all threads will be hidden when the summary buffer is
7065 generated.
7066
7067 This can also be a predicate specifier (@pxref{Predicate Specifiers}).
7068 Available predicates are @code{gnus-article-unread-p} and
7069 @code{gnus-article-unseen-p}.
7070
7071 Here's an example:
7072
7073 @lisp
7074 (setq gnus-thread-hide-subtree
7075       '(or gnus-article-unread-p
7076            gnus-article-unseen-p))
7077 @end lisp
7078
7079 (It's a pretty nonsensical example, since all unseen articles are also
7080 unread, but you get my drift.)
7081
7082
7083 @item gnus-thread-expunge-below
7084 @vindex gnus-thread-expunge-below
7085 All threads that have a total score (as defined by
7086 @code{gnus-thread-score-function}) less than this number will be
7087 expunged.  This variable is @code{nil} by default, which means that no
7088 threads are expunged.
7089
7090 @item gnus-thread-hide-killed
7091 @vindex gnus-thread-hide-killed
7092 if you kill a thread and this variable is non-@code{nil}, the subtree
7093 will be hidden.
7094
7095 @item gnus-thread-ignore-subject
7096 @vindex gnus-thread-ignore-subject
7097 Sometimes somebody changes the subject in the middle of a thread.  If
7098 this variable is non-@code{nil}, which is the default, the subject
7099 change is ignored.  If it is @code{nil}, a change in the subject will
7100 result in a new thread.
7101
7102 @item gnus-thread-indent-level
7103 @vindex gnus-thread-indent-level
7104 This is a number that says how much each sub-thread should be indented.
7105 The default is 4.
7106
7107 @item gnus-sort-gathered-threads-function
7108 @vindex gnus-sort-gathered-threads-function
7109 Sometimes, particularly with mailing lists, the order in which mails
7110 arrive locally is not necessarily the same as the order in which they
7111 arrived on the mailing list.  Consequently, when sorting sub-threads
7112 using the default @code{gnus-thread-sort-by-number}, responses can end
7113 up appearing before the article to which they are responding to.
7114 Setting this variable to an alternate value
7115 (e.g. @code{gnus-thread-sort-by-date}), in a group's parameters or in an
7116 appropriate hook (e.g. @code{gnus-summary-generate-hook}) can produce a
7117 more logical sub-thread ordering in such instances.
7118
7119 @end table
7120
7121
7122 @node Low-Level Threading
7123 @subsubsection Low-Level Threading
7124
7125 @table @code
7126
7127 @item gnus-parse-headers-hook
7128 @vindex gnus-parse-headers-hook
7129 Hook run before parsing any headers.
7130
7131 @item gnus-alter-header-function
7132 @vindex gnus-alter-header-function
7133 If non-@code{nil}, this function will be called to allow alteration of
7134 article header structures.  The function is called with one parameter,
7135 the article header vector, which it may alter in any way.  For instance,
7136 if you have a mail-to-news gateway which alters the @code{Message-ID}s
7137 in systematic ways (by adding prefixes and such), you can use this
7138 variable to un-scramble the @code{Message-ID}s so that they are more
7139 meaningful.  Here's one example:
7140
7141 @lisp
7142 (setq gnus-alter-header-function 'my-alter-message-id)
7143
7144 (defun my-alter-message-id (header)
7145   (let ((id (mail-header-id header)))
7146     (when (string-match
7147            "\\(<[^<>@@]*\\)\\.?cygnus\\..*@@\\([^<>@@]*>\\)" id)
7148       (mail-header-set-id
7149        (concat (match-string 1 id) "@@" (match-string 2 id))
7150        header))))
7151 @end lisp
7152
7153 @end table
7154
7155
7156 @node Thread Commands
7157 @subsection Thread Commands
7158 @cindex thread commands
7159
7160 @table @kbd
7161
7162 @item T k
7163 @itemx C-M-k
7164 @kindex T k (Summary)
7165 @kindex C-M-k (Summary)
7166 @findex gnus-summary-kill-thread
7167 Mark all articles in the current (sub-)thread as read
7168 (@code{gnus-summary-kill-thread}).  If the prefix argument is positive,
7169 remove all marks instead.  If the prefix argument is negative, tick
7170 articles instead.
7171
7172 @item T l
7173 @itemx C-M-l
7174 @kindex T l (Summary)
7175 @kindex C-M-l (Summary)
7176 @findex gnus-summary-lower-thread
7177 Lower the score of the current (sub-)thread
7178 (@code{gnus-summary-lower-thread}).
7179
7180 @item T i
7181 @kindex T i (Summary)
7182 @findex gnus-summary-raise-thread
7183 Increase the score of the current (sub-)thread
7184 (@code{gnus-summary-raise-thread}).
7185
7186 @item T #
7187 @kindex T # (Summary)
7188 @findex gnus-uu-mark-thread
7189 Set the process mark on the current (sub-)thread
7190 (@code{gnus-uu-mark-thread}).
7191
7192 @item T M-#
7193 @kindex T M-# (Summary)
7194 @findex gnus-uu-unmark-thread
7195 Remove the process mark from the current (sub-)thread
7196 (@code{gnus-uu-unmark-thread}).
7197
7198 @item T T
7199 @kindex T T (Summary)
7200 @findex gnus-summary-toggle-threads
7201 Toggle threading (@code{gnus-summary-toggle-threads}).
7202
7203 @item T s
7204 @kindex T s (Summary)
7205 @findex gnus-summary-show-thread
7206 Expose the (sub-)thread hidden under the current article, if any@*
7207 (@code{gnus-summary-show-thread}).
7208
7209 @item T h
7210 @kindex T h (Summary)
7211 @findex gnus-summary-hide-thread
7212 Hide the current (sub-)thread (@code{gnus-summary-hide-thread}).
7213
7214 @item T S
7215 @kindex T S (Summary)
7216 @findex gnus-summary-show-all-threads
7217 Expose all hidden threads (@code{gnus-summary-show-all-threads}).
7218
7219 @item T H
7220 @kindex T H (Summary)
7221 @findex gnus-summary-hide-all-threads
7222 Hide all threads (@code{gnus-summary-hide-all-threads}).
7223
7224 @item T t
7225 @kindex T t (Summary)
7226 @findex gnus-summary-rethread-current
7227 Re-thread the current article's thread
7228 (@code{gnus-summary-rethread-current}).  This works even when the
7229 summary buffer is otherwise unthreaded.
7230
7231 @item T ^
7232 @kindex T ^ (Summary)
7233 @findex gnus-summary-reparent-thread
7234 Make the current article the child of the marked (or previous) article
7235 (@code{gnus-summary-reparent-thread}).
7236
7237 @item T M-^
7238 @kindex T M-^ (Summary)
7239 @findex gnus-summary-reparent-children
7240 Make the current article the parent of the marked articles
7241 (@code{gnus-summary-reparent-children}).
7242
7243 @end table
7244
7245 The following commands are thread movement commands.  They all
7246 understand the numeric prefix.
7247
7248 @table @kbd
7249
7250 @item T n
7251 @kindex T n (Summary)
7252 @itemx C-M-f
7253 @kindex C-M-n (Summary)
7254 @itemx M-down
7255 @kindex M-down (Summary)
7256 @findex gnus-summary-next-thread
7257 Go to the next thread (@code{gnus-summary-next-thread}).
7258
7259 @item T p
7260 @kindex T p (Summary)
7261 @itemx C-M-b
7262 @kindex C-M-p (Summary)
7263 @itemx M-up
7264 @kindex M-up (Summary)
7265 @findex gnus-summary-prev-thread
7266 Go to the previous thread (@code{gnus-summary-prev-thread}).
7267
7268 @item T d
7269 @kindex T d (Summary)
7270 @findex gnus-summary-down-thread
7271 Descend the thread (@code{gnus-summary-down-thread}).
7272
7273 @item T u
7274 @kindex T u (Summary)
7275 @findex gnus-summary-up-thread
7276 Ascend the thread (@code{gnus-summary-up-thread}).
7277
7278 @item T o
7279 @kindex T o (Summary)
7280 @findex gnus-summary-top-thread
7281 Go to the top of the thread (@code{gnus-summary-top-thread}).
7282 @end table
7283
7284 @vindex gnus-thread-operation-ignore-subject
7285 If you ignore subject while threading, you'll naturally end up with
7286 threads that have several different subjects in them.  If you then issue
7287 a command like @kbd{T k} (@code{gnus-summary-kill-thread}) you might not
7288 wish to kill the entire thread, but just those parts of the thread that
7289 have the same subject as the current article.  If you like this idea,
7290 you can fiddle with @code{gnus-thread-operation-ignore-subject}.  If it
7291 is non-@code{nil} (which it is by default), subjects will be ignored
7292 when doing thread commands.  If this variable is @code{nil}, articles in
7293 the same thread with different subjects will not be included in the
7294 operation in question.  If this variable is @code{fuzzy}, only articles
7295 that have subjects fuzzily equal will be included (@pxref{Fuzzy
7296 Matching}).
7297
7298
7299 @node Sorting the Summary Buffer
7300 @section Sorting the Summary Buffer
7301
7302 @findex gnus-thread-sort-by-total-score
7303 @findex gnus-thread-sort-by-date
7304 @findex gnus-thread-sort-by-score
7305 @findex gnus-thread-sort-by-subject
7306 @findex gnus-thread-sort-by-author
7307 @findex gnus-thread-sort-by-recipient
7308 @findex gnus-thread-sort-by-number
7309 @findex gnus-thread-sort-by-random
7310 @vindex gnus-thread-sort-functions
7311 @findex gnus-thread-sort-by-most-recent-number
7312 @findex gnus-thread-sort-by-most-recent-date
7313 If you are using a threaded summary display, you can sort the threads by
7314 setting @code{gnus-thread-sort-functions}, which can be either a single
7315 function, a list of functions, or a list containing functions and
7316 @code{(not some-function)} elements.
7317
7318 By default, sorting is done on article numbers.  Ready-made sorting
7319 predicate functions include @code{gnus-thread-sort-by-number},
7320 @code{gnus-thread-sort-by-author}, @code{gnus-thread-sort-by-recipient},
7321 @code{gnus-thread-sort-by-subject},
7322 @code{gnus-thread-sort-by-date},
7323 @code{gnus-thread-sort-by-score},
7324 @code{gnus-thread-sort-by-most-recent-number},
7325 @code{gnus-thread-sort-by-most-recent-date},
7326 @code{gnus-thread-sort-by-random} and
7327 @code{gnus-thread-sort-by-total-score}.
7328
7329 Each function takes two threads and returns non-@code{nil} if the first
7330 thread should be sorted before the other.  Note that sorting really is
7331 normally done by looking only at the roots of each thread.
7332
7333 If you use more than one function, the primary sort key should be the
7334 last function in the list.  You should probably always include
7335 @code{gnus-thread-sort-by-number} in the list of sorting
7336 functions---preferably first.  This will ensure that threads that are
7337 equal with respect to the other sort criteria will be displayed in
7338 ascending article order.
7339
7340 If you would like to sort by reverse score, then by subject, and finally
7341 by number, you could do something like:
7342
7343 @lisp
7344 (setq gnus-thread-sort-functions
7345       '(gnus-thread-sort-by-number
7346         gnus-thread-sort-by-subject
7347         (not gnus-thread-sort-by-total-score)))
7348 @end lisp
7349
7350 The threads that have highest score will be displayed first in the
7351 summary buffer.  When threads have the same score, they will be sorted
7352 alphabetically.  The threads that have the same score and the same
7353 subject will be sorted by number, which is (normally) the sequence in
7354 which the articles arrived.
7355
7356 If you want to sort by score and then reverse arrival order, you could
7357 say something like:
7358
7359 @lisp
7360 (setq gnus-thread-sort-functions
7361       '((not gnus-thread-sort-by-number)
7362         gnus-thread-sort-by-score))
7363 @end lisp
7364
7365 @vindex gnus-thread-score-function
7366 The function in the @code{gnus-thread-score-function} variable (default
7367 @code{+}) is used for calculating the total score of a thread.  Useful
7368 functions might be @code{max}, @code{min}, or squared means, or whatever
7369 tickles your fancy.
7370
7371 @findex gnus-article-sort-functions
7372 @findex gnus-article-sort-by-date
7373 @findex gnus-article-sort-by-most-recent-date
7374 @findex gnus-article-sort-by-score
7375 @findex gnus-article-sort-by-subject
7376 @findex gnus-article-sort-by-author
7377 @findex gnus-article-sort-by-random
7378 @findex gnus-article-sort-by-number
7379 @findex gnus-article-sort-by-most-recent-number
7380 If you are using an unthreaded display for some strange reason or
7381 other, you have to fiddle with the @code{gnus-article-sort-functions}
7382 variable.  It is very similar to the
7383 @code{gnus-thread-sort-functions}, except that it uses slightly
7384 different functions for article comparison.  Available sorting
7385 predicate functions are @code{gnus-article-sort-by-number},
7386 @code{gnus-article-sort-by-author},
7387 @code{gnus-article-sort-by-subject}, @code{gnus-article-sort-by-date},
7388 @code{gnus-article-sort-by-random}, and
7389 @code{gnus-article-sort-by-score}.
7390
7391 If you want to sort an unthreaded summary display by subject, you could
7392 say something like:
7393
7394 @lisp
7395 (setq gnus-article-sort-functions
7396       '(gnus-article-sort-by-number
7397         gnus-article-sort-by-subject))
7398 @end lisp
7399
7400 You can define group specific sorting via @code{gnus-parameters},
7401 @xref{Group Parameters}.
7402
7403
7404 @node Asynchronous Fetching
7405 @section Asynchronous Article Fetching
7406 @cindex asynchronous article fetching
7407 @cindex article pre-fetch
7408 @cindex pre-fetch
7409
7410 If you read your news from an @acronym{NNTP} server that's far away, the
7411 network latencies may make reading articles a chore.  You have to wait
7412 for a while after pressing @kbd{n} to go to the next article before the
7413 article appears.  Why can't Gnus just go ahead and fetch the article
7414 while you are reading the previous one?  Why not, indeed.
7415
7416 First, some caveats.  There are some pitfalls to using asynchronous
7417 article fetching, especially the way Gnus does it.
7418
7419 Let's say you are reading article 1, which is short, and article 2 is
7420 quite long, and you are not interested in reading that.  Gnus does not
7421 know this, so it goes ahead and fetches article 2.  You decide to read
7422 article 3, but since Gnus is in the process of fetching article 2, the
7423 connection is blocked.
7424
7425 To avoid these situations, Gnus will open two (count 'em two)
7426 connections to the server.  Some people may think this isn't a very nice
7427 thing to do, but I don't see any real alternatives.  Setting up that
7428 extra connection takes some time, so Gnus startup will be slower.
7429
7430 Gnus will fetch more articles than you will read.  This will mean that
7431 the link between your machine and the @acronym{NNTP} server will become more
7432 loaded than if you didn't use article pre-fetch.  The server itself will
7433 also become more loaded---both with the extra article requests, and the
7434 extra connection.
7435
7436 Ok, so now you know that you shouldn't really use this thing@dots{} unless
7437 you really want to.
7438
7439 @vindex gnus-asynchronous
7440 Here's how:  Set @code{gnus-asynchronous} to @code{t}.  The rest should
7441 happen automatically.
7442
7443 @vindex gnus-use-article-prefetch
7444 You can control how many articles are to be pre-fetched by setting
7445 @code{gnus-use-article-prefetch}.  This is 30 by default, which means
7446 that when you read an article in the group, the back end will pre-fetch
7447 the next 30 articles.  If this variable is @code{t}, the back end will
7448 pre-fetch all the articles it can without bound.  If it is
7449 @code{nil}, no pre-fetching will be done.
7450
7451 @vindex gnus-async-prefetch-article-p
7452 @findex gnus-async-unread-p
7453 There are probably some articles that you don't want to pre-fetch---read
7454 articles, for instance.  The @code{gnus-async-prefetch-article-p}
7455 variable controls whether an article is to be pre-fetched.  This
7456 function should return non-@code{nil} when the article in question is
7457 to be pre-fetched.  The default is @code{gnus-async-unread-p}, which
7458 returns @code{nil} on read articles.  The function is called with an
7459 article data structure as the only parameter.
7460
7461 If, for instance, you wish to pre-fetch only unread articles shorter
7462 than 100 lines, you could say something like:
7463
7464 @lisp
7465 (defun my-async-short-unread-p (data)
7466   "Return non-nil for short, unread articles."
7467   (and (gnus-data-unread-p data)
7468        (< (mail-header-lines (gnus-data-header data))
7469           100)))
7470
7471 (setq gnus-async-prefetch-article-p 'my-async-short-unread-p)
7472 @end lisp
7473
7474 These functions will be called many, many times, so they should
7475 preferably be short and sweet to avoid slowing down Gnus too much.
7476 It's probably a good idea to byte-compile things like this.
7477
7478 @vindex gnus-async-post-fetch-function
7479 @findex gnus-html-prefetch-images
7480 After an article has been prefetched, this
7481 @code{gnus-async-post-fetch-function} will be called.  The buffer will
7482 be narrowed to the region of the article that was fetched.  A useful
7483 value would be @code{gnus-html-prefetch-images}, which will prefetch
7484 and store images referenced in the article, so that you don't have to
7485 wait for them to be fetched when you read the article.  This is useful
7486 for @acronym{HTML} messages that have external images.
7487
7488 @vindex gnus-prefetched-article-deletion-strategy
7489 Articles have to be removed from the asynch buffer sooner or later.  The
7490 @code{gnus-prefetched-article-deletion-strategy} says when to remove
7491 articles.  This is a list that may contain the following elements:
7492
7493 @table @code
7494 @item read
7495 Remove articles when they are read.
7496
7497 @item exit
7498 Remove articles when exiting the group.
7499 @end table
7500
7501 The default value is @code{(read exit)}.
7502
7503 @c @vindex gnus-use-header-prefetch
7504 @c If @code{gnus-use-header-prefetch} is non-@code{nil}, prefetch articles
7505 @c from the next group.
7506
7507
7508 @node Article Caching
7509 @section Article Caching
7510 @cindex article caching
7511 @cindex caching
7512
7513 If you have an @emph{extremely} slow @acronym{NNTP} connection, you may
7514 consider turning article caching on.  Each article will then be stored
7515 locally under your home directory.  As you may surmise, this could
7516 potentially use @emph{huge} amounts of disk space, as well as eat up all
7517 your inodes so fast it will make your head swim.  In vodka.
7518
7519 Used carefully, though, it could be just an easier way to save articles.
7520
7521 @vindex gnus-use-long-file-name
7522 @vindex gnus-cache-directory
7523 @vindex gnus-use-cache
7524 To turn caching on, set @code{gnus-use-cache} to @code{t}.  By default,
7525 all articles ticked or marked as dormant will then be copied
7526 over to your local cache (@code{gnus-cache-directory}).  Whether this
7527 cache is flat or hierarchical is controlled by the
7528 @code{gnus-use-long-file-name} variable, as usual.
7529
7530 When re-selecting a ticked or dormant article, it will be fetched from the
7531 cache instead of from the server.  As articles in your cache will never
7532 expire, this might serve as a method of saving articles while still
7533 keeping them where they belong.  Just mark all articles you want to save
7534 as dormant, and don't worry.
7535
7536 When an article is marked as read, is it removed from the cache.
7537
7538 @vindex gnus-cache-remove-articles
7539 @vindex gnus-cache-enter-articles
7540 The entering/removal of articles from the cache is controlled by the
7541 @code{gnus-cache-enter-articles} and @code{gnus-cache-remove-articles}
7542 variables.  Both are lists of symbols.  The first is @code{(ticked
7543 dormant)} by default, meaning that ticked and dormant articles will be
7544 put in the cache.  The latter is @code{(read)} by default, meaning that
7545 articles marked as read are removed from the cache.  Possibly
7546 symbols in these two lists are @code{ticked}, @code{dormant},
7547 @code{unread} and @code{read}.
7548
7549 @findex gnus-jog-cache
7550 So where does the massive article-fetching and storing come into the
7551 picture?  The @code{gnus-jog-cache} command will go through all
7552 subscribed newsgroups, request all unread articles, score them, and
7553 store them in the cache.  You should only ever, ever ever ever, use this
7554 command if 1) your connection to the @acronym{NNTP} server is really, really,
7555 really slow and 2) you have a really, really, really huge disk.
7556 Seriously.  One way to cut down on the number of articles downloaded is
7557 to score unwanted articles down and have them marked as read.  They will
7558 not then be downloaded by this command.
7559
7560 @vindex gnus-uncacheable-groups
7561 @vindex gnus-cacheable-groups
7562 It is likely that you do not want caching on all groups.  For instance,
7563 if your @code{nnml} mail is located under your home directory, it makes no
7564 sense to cache it somewhere else under your home directory.  Unless you
7565 feel that it's neat to use twice as much space.
7566
7567 To limit the caching, you could set @code{gnus-cacheable-groups} to a
7568 regexp of groups to cache, @samp{^nntp} for instance, or set the
7569 @code{gnus-uncacheable-groups} regexp to @samp{^nnml}, for instance.
7570 Both variables are @code{nil} by default.  If a group matches both
7571 variables, the group is not cached.
7572
7573 @findex gnus-cache-generate-nov-databases
7574 @findex gnus-cache-generate-active
7575 @vindex gnus-cache-active-file
7576 The cache stores information on what articles it contains in its active
7577 file (@code{gnus-cache-active-file}).  If this file (or any other parts
7578 of the cache) becomes all messed up for some reason or other, Gnus
7579 offers two functions that will try to set things right.  @kbd{M-x
7580 gnus-cache-generate-nov-databases} will (re)build all the @acronym{NOV}
7581 files, and @kbd{gnus-cache-generate-active} will (re)generate the active
7582 file.
7583
7584 @findex gnus-cache-move-cache
7585 @code{gnus-cache-move-cache} will move your whole
7586 @code{gnus-cache-directory} to some other location.  You get asked to
7587 where, isn't that cool?
7588
7589 @node Persistent Articles
7590 @section Persistent Articles
7591 @cindex persistent articles
7592
7593 Closely related to article caching, we have @dfn{persistent articles}.
7594 In fact, it's just a different way of looking at caching, and much more
7595 useful in my opinion.
7596
7597 Say you're reading a newsgroup, and you happen on to some valuable gem
7598 that you want to keep and treasure forever.  You'd normally just save it
7599 (using one of the many saving commands) in some file.  The problem with
7600 that is that it's just, well, yucky.  Ideally you'd prefer just having
7601 the article remain in the group where you found it forever; untouched by
7602 the expiry going on at the news server.
7603
7604 This is what a @dfn{persistent article} is---an article that just won't
7605 be deleted.  It's implemented using the normal cache functions, but
7606 you use two explicit commands for managing persistent articles:
7607
7608 @table @kbd
7609
7610 @item *
7611 @kindex * (Summary)
7612 @findex gnus-cache-enter-article
7613 Make the current article persistent (@code{gnus-cache-enter-article}).
7614
7615 @item M-*
7616 @kindex M-* (Summary)
7617 @findex gnus-cache-remove-article
7618 Remove the current article from the persistent articles
7619 (@code{gnus-cache-remove-article}).  This will normally delete the
7620 article.
7621 @end table
7622
7623 Both these commands understand the process/prefix convention.
7624
7625 To avoid having all ticked articles (and stuff) entered into the cache,
7626 you should set @code{gnus-use-cache} to @code{passive} if you're just
7627 interested in persistent articles:
7628
7629 @lisp
7630 (setq gnus-use-cache 'passive)
7631 @end lisp
7632
7633 @node Sticky Articles
7634 @section Sticky Articles
7635 @cindex sticky articles
7636
7637 When you select an article the current article buffer will be reused
7638 according to the value of the variable
7639 @code{gnus-single-article-buffer}.  If its value is non-@code{nil} (the
7640 default) all articles reuse the same article buffer.  Else each group
7641 has its own article buffer.
7642
7643 This implies that it's not possible to have more than one article buffer
7644 in a group at a time.  But sometimes you might want to display all the
7645 latest emails from your mother, your father, your aunt, your uncle and
7646 your 17 cousins to coordinate the next christmas party.
7647
7648 That's where sticky articles come in handy.  A sticky article buffer
7649 basically is a normal article buffer, but it won't be reused when you
7650 select another article.  You can make an article sticky with:
7651
7652 @table @kbd
7653 @item A S
7654 @kindex A S (Summary)
7655 @findex gnus-sticky-article
7656 Make the current article sticky.  If a prefix arg is given, ask for a
7657 name for this sticky article buffer.
7658 @end table
7659
7660 To close a sticky article buffer you can use these commands:
7661
7662 @table @kbd
7663 @item q
7664 @kindex q (Article)
7665 @findex bury-buffer
7666 Puts this sticky article buffer at the end of the list of all buffers.
7667
7668 @item k
7669 @kindex k (Article)
7670 @findex gnus-kill-sticky-article-buffer
7671 Kills this sticky article buffer.
7672 @end table
7673
7674 To kill all sticky article buffers you can use:
7675
7676 @defun gnus-kill-sticky-article-buffers ARG
7677 Kill all sticky article buffers.
7678 If a prefix ARG is given, ask for confirmation.
7679 @end defun
7680
7681 @node Article Backlog
7682 @section Article Backlog
7683 @cindex backlog
7684 @cindex article backlog
7685
7686 If you have a slow connection, but the idea of using caching seems
7687 unappealing to you (and it is, really), you can help the situation some
7688 by switching on the @dfn{backlog}.  This is where Gnus will buffer
7689 already read articles so that it doesn't have to re-fetch articles
7690 you've already read.  This only helps if you are in the habit of
7691 re-selecting articles you've recently read, of course.  If you never do
7692 that, turning the backlog on will slow Gnus down a little bit, and
7693 increase memory usage some.
7694
7695 @vindex gnus-keep-backlog
7696 If you set @code{gnus-keep-backlog} to a number @var{n}, Gnus will store
7697 at most @var{n} old articles in a buffer for later re-fetching.  If this
7698 variable is non-@code{nil} and is not a number, Gnus will store
7699 @emph{all} read articles, which means that your Emacs will grow without
7700 bound before exploding and taking your machine down with you.  I put
7701 that in there just to keep y'all on your toes.
7702
7703 The default value is 20.
7704
7705
7706 @node Saving Articles
7707 @section Saving Articles
7708 @cindex saving articles
7709
7710 Gnus can save articles in a number of ways.  Below is the documentation
7711 for saving articles in a fairly straight-forward fashion (i.e., little
7712 processing of the article is done before it is saved).  For a different
7713 approach (uudecoding, unsharing) you should use @code{gnus-uu}
7714 (@pxref{Decoding Articles}).
7715
7716 For the commands listed here, the target is a file.  If you want to
7717 save to a group, see the @kbd{B c} (@code{gnus-summary-copy-article})
7718 command (@pxref{Mail Group Commands}).
7719
7720 @vindex gnus-save-all-headers
7721 If @code{gnus-save-all-headers} is non-@code{nil}, Gnus will not delete
7722 unwanted headers before saving the article.
7723
7724 @vindex gnus-saved-headers
7725 If the preceding variable is @code{nil}, all headers that match the
7726 @code{gnus-saved-headers} regexp will be kept, while the rest will be
7727 deleted before saving.
7728
7729 @table @kbd
7730
7731 @item O o
7732 @itemx o
7733 @kindex O o (Summary)
7734 @kindex o (Summary)
7735 @findex gnus-summary-save-article
7736 @c @icon{gnus-summary-save-article}
7737 Save the current article using the default article saver
7738 (@code{gnus-summary-save-article}).
7739
7740 @item O m
7741 @kindex O m (Summary)
7742 @findex gnus-summary-save-article-mail
7743 Save the current article in a Unix mail box (mbox) file
7744 (@code{gnus-summary-save-article-mail}).
7745
7746 @item O r
7747 @kindex O r (Summary)
7748 @findex gnus-summary-save-article-rmail
7749 Save the current article in Rmail format
7750 (@code{gnus-summary-save-article-rmail}).  This is mbox since Emacs 23,
7751 Babyl in older versions.
7752
7753 @item O f
7754 @kindex O f (Summary)
7755 @findex gnus-summary-save-article-file
7756 @c @icon{gnus-summary-save-article-file}
7757 Save the current article in plain file format
7758 (@code{gnus-summary-save-article-file}).
7759
7760 @item O F
7761 @kindex O F (Summary)
7762 @findex gnus-summary-write-article-file
7763 Write the current article in plain file format, overwriting any previous
7764 file contents (@code{gnus-summary-write-article-file}).
7765
7766 @item O b
7767 @kindex O b (Summary)
7768 @findex gnus-summary-save-article-body-file
7769 Save the current article body in plain file format
7770 (@code{gnus-summary-save-article-body-file}).
7771
7772 @item O h
7773 @kindex O h (Summary)
7774 @findex gnus-summary-save-article-folder
7775 Save the current article in mh folder format
7776 (@code{gnus-summary-save-article-folder}).
7777
7778 @item O v
7779 @kindex O v (Summary)
7780 @findex gnus-summary-save-article-vm
7781 Save the current article in a VM folder
7782 (@code{gnus-summary-save-article-vm}).
7783
7784 @item O p
7785 @itemx |
7786 @kindex O p (Summary)
7787 @kindex | (Summary)
7788 @findex gnus-summary-pipe-output
7789 @vindex gnus-summary-pipe-output-default-command
7790 Save the current article in a pipe.  Uhm, like, what I mean is---Pipe
7791 the current article to a process (@code{gnus-summary-pipe-output}).
7792 If given a symbolic prefix (@pxref{Symbolic Prefixes}), include the
7793 complete headers in the piped output.  The symbolic prefix @code{r} is
7794 special; it lets this command pipe a raw article including all headers.
7795 The @code{gnus-summary-pipe-output-default-command} variable can be set
7796 to a string containing the default command and options (default
7797 @code{nil}).
7798
7799 @item O P
7800 @kindex O P (Summary)
7801 @findex gnus-summary-muttprint
7802 @vindex gnus-summary-muttprint-program
7803 Save the current article into muttprint.  That is, print it using the
7804 external program @uref{http://muttprint.sourceforge.net/,
7805 Muttprint}.  The program name and options to use is controlled by the
7806 variable @code{gnus-summary-muttprint-program}.
7807 (@code{gnus-summary-muttprint}).
7808
7809 @end table
7810
7811 @vindex gnus-prompt-before-saving
7812 All these commands use the process/prefix convention
7813 (@pxref{Process/Prefix}).  If you save bunches of articles using these
7814 functions, you might get tired of being prompted for files to save each
7815 and every article in.  The prompting action is controlled by
7816 the @code{gnus-prompt-before-saving} variable, which is @code{always} by
7817 default, giving you that excessive prompting action you know and
7818 loathe.  If you set this variable to @code{t} instead, you'll be prompted
7819 just once for each series of articles you save.  If you like to really
7820 have Gnus do all your thinking for you, you can even set this variable
7821 to @code{nil}, which means that you will never be prompted for files to
7822 save articles in.  Gnus will simply save all the articles in the default
7823 files.
7824
7825
7826 @vindex gnus-default-article-saver
7827 You can customize the @code{gnus-default-article-saver} variable to make
7828 Gnus do what you want it to.  You can use any of the eight ready-made
7829 functions below, or you can create your own.
7830
7831 @table @code
7832
7833 @item gnus-summary-save-in-rmail
7834 @findex gnus-summary-save-in-rmail
7835 @vindex gnus-rmail-save-name
7836 @findex gnus-plain-save-name
7837 This is the default format, that used by the Rmail package.  Since Emacs
7838 23, Rmail uses standard mbox format.  Before this, it used the
7839 @dfn{Babyl} format.  Accordingly, this command writes mbox format since
7840 Emacs 23, unless appending to an existing Babyl file.  In older versions
7841 of Emacs, it always uses Babyl format.  Uses the function in the
7842 @code{gnus-rmail-save-name} variable to get a file name to save the
7843 article in.  The default is @code{gnus-plain-save-name}.
7844
7845 @item gnus-summary-save-in-mail
7846 @findex gnus-summary-save-in-mail
7847 @vindex gnus-mail-save-name
7848 Save in a Unix mail (mbox) file.  Uses the function in the
7849 @code{gnus-mail-save-name} variable to get a file name to save the
7850 article in.  The default is @code{gnus-plain-save-name}.
7851
7852 @item gnus-summary-save-in-file
7853 @findex gnus-summary-save-in-file
7854 @vindex gnus-file-save-name
7855 @findex gnus-numeric-save-name
7856 Append the article straight to an ordinary file.  Uses the function in
7857 the @code{gnus-file-save-name} variable to get a file name to save the
7858 article in.  The default is @code{gnus-numeric-save-name}.
7859
7860 @item gnus-summary-write-to-file
7861 @findex gnus-summary-write-to-file
7862 Write the article straight to an ordinary file.  The file is
7863 overwritten if it exists.  Uses the function in the
7864 @code{gnus-file-save-name} variable to get a file name to save the
7865 article in.  The default is @code{gnus-numeric-save-name}.
7866
7867 @item gnus-summary-save-body-in-file
7868 @findex gnus-summary-save-body-in-file
7869 Append the article body to an ordinary file.  Uses the function in the
7870 @code{gnus-file-save-name} variable to get a file name to save the
7871 article in.  The default is @code{gnus-numeric-save-name}.
7872
7873 @item gnus-summary-write-body-to-file
7874 @findex gnus-summary-write-body-to-file
7875 Write the article body straight to an ordinary file.  The file is
7876 overwritten if it exists.  Uses the function in the
7877 @code{gnus-file-save-name} variable to get a file name to save the
7878 article in.  The default is @code{gnus-numeric-save-name}.
7879
7880 @item gnus-summary-save-in-folder
7881 @findex gnus-summary-save-in-folder
7882 @findex gnus-folder-save-name
7883 @findex gnus-Folder-save-name
7884 @vindex gnus-folder-save-name
7885 @cindex rcvstore
7886 @cindex MH folders
7887 Save the article to an MH folder using @code{rcvstore} from the MH
7888 library.  Uses the function in the @code{gnus-folder-save-name} variable
7889 to get a file name to save the article in.  The default is
7890 @code{gnus-folder-save-name}, but you can also use
7891 @code{gnus-Folder-save-name}, which creates capitalized names.
7892
7893 @item gnus-summary-save-in-vm
7894 @findex gnus-summary-save-in-vm
7895 Save the article in a VM folder.  You have to have the VM mail
7896 reader to use this setting.
7897
7898 @item gnus-summary-save-in-pipe
7899 @findex gnus-summary-save-in-pipe
7900 Pipe the article to a shell command.  This function takes optional two
7901 arguments COMMAND and RAW.  Valid values for COMMAND include:
7902
7903 @itemize @bullet
7904 @item a string@*
7905 The executable command name and possibly arguments.
7906 @item @code{nil}@*
7907 You will be prompted for the command in the minibuffer.
7908 @item the symbol @code{default}@*
7909 It will be replaced with the command which the variable
7910 @code{gnus-summary-pipe-output-default-command} holds or the command
7911 last used for saving.
7912 @end itemize
7913
7914 Non-@code{nil} value for RAW overrides @code{:decode} and
7915 @code{:headers} properties (see below) and the raw article including all
7916 headers will be piped.
7917 @end table
7918
7919 The symbol of each function may have the following properties:
7920
7921 @table @code
7922 @item :decode
7923 The value non-@code{nil} means save decoded articles.  This is
7924 meaningful only with @code{gnus-summary-save-in-file},
7925 @code{gnus-summary-save-body-in-file},
7926 @code{gnus-summary-write-to-file},
7927 @code{gnus-summary-write-body-to-file}, and
7928 @code{gnus-summary-save-in-pipe}.
7929
7930 @item :function
7931 The value specifies an alternative function which appends, not
7932 overwrites, articles to a file.  This implies that when saving many
7933 articles at a time, @code{gnus-prompt-before-saving} is bound to
7934 @code{t} and all articles are saved in a single file.  This is
7935 meaningful only with @code{gnus-summary-write-to-file} and
7936 @code{gnus-summary-write-body-to-file}.
7937
7938 @item :headers
7939 The value specifies the symbol of a variable of which the value
7940 specifies headers to be saved.  If it is omitted,
7941 @code{gnus-save-all-headers} and @code{gnus-saved-headers} control what
7942 headers should be saved.
7943 @end table
7944
7945 @vindex gnus-article-save-directory
7946 All of these functions, except for the last one, will save the article
7947 in the @code{gnus-article-save-directory}, which is initialized from the
7948 @env{SAVEDIR} environment variable.  This is @file{~/News/} by
7949 default.
7950
7951 As you can see above, the functions use different functions to find a
7952 suitable name of a file to save the article in.  Below is a list of
7953 available functions that generate names:
7954
7955 @table @code
7956
7957 @item gnus-Numeric-save-name
7958 @findex gnus-Numeric-save-name
7959 File names like @file{~/News/Alt.andrea-dworkin/45}.
7960
7961 @item gnus-numeric-save-name
7962 @findex gnus-numeric-save-name
7963 File names like @file{~/News/alt.andrea-dworkin/45}.
7964
7965 @item gnus-Plain-save-name
7966 @findex gnus-Plain-save-name
7967 File names like @file{~/News/Alt.andrea-dworkin}.
7968
7969 @item gnus-plain-save-name
7970 @findex gnus-plain-save-name
7971 File names like @file{~/News/alt.andrea-dworkin}.
7972
7973 @item gnus-sender-save-name
7974 @findex gnus-sender-save-name
7975 File names like @file{~/News/larsi}.
7976 @end table
7977
7978 @vindex gnus-split-methods
7979 You can have Gnus suggest where to save articles by plonking a regexp into
7980 the @code{gnus-split-methods} alist.  For instance, if you would like to
7981 save articles related to Gnus in the file @file{gnus-stuff}, and articles
7982 related to VM in @file{vm-stuff}, you could set this variable to something
7983 like:
7984
7985 @lisp
7986 (("^Subject:.*gnus\\|^Newsgroups:.*gnus" "gnus-stuff")
7987  ("^Subject:.*vm\\|^Xref:.*vm" "vm-stuff")
7988  (my-choosing-function "../other-dir/my-stuff")
7989  ((equal gnus-newsgroup-name "mail.misc") "mail-stuff"))
7990 @end lisp
7991
7992 We see that this is a list where each element is a list that has two
7993 elements---the @dfn{match} and the @dfn{file}.  The match can either be
7994 a string (in which case it is used as a regexp to match on the article
7995 head); it can be a symbol (which will be called as a function with the
7996 group name as a parameter); or it can be a list (which will be
7997 @code{eval}ed).  If any of these actions have a non-@code{nil} result,
7998 the @dfn{file} will be used as a default prompt.  In addition, the
7999 result of the operation itself will be used if the function or form
8000 called returns a string or a list of strings.
8001
8002 You basically end up with a list of file names that might be used when
8003 saving the current article.  (All ``matches'' will be used.)  You will
8004 then be prompted for what you really want to use as a name, with file
8005 name completion over the results from applying this variable.
8006
8007 This variable is @code{((gnus-article-archive-name))} by default, which
8008 means that Gnus will look at the articles it saves for an
8009 @code{Archive-name} line and use that as a suggestion for the file
8010 name.
8011
8012 Here's an example function to clean up file names somewhat.  If you have
8013 lots of mail groups called things like
8014 @samp{nnml:mail.whatever}, you may want to chop off the beginning of
8015 these group names before creating the file name to save to.  The
8016 following will do just that:
8017
8018 @lisp
8019 (defun my-save-name (group)
8020   (when (string-match "^nnml:mail." group)
8021     (substring group (match-end 0))))
8022
8023 (setq gnus-split-methods
8024       '((gnus-article-archive-name)
8025         (my-save-name)))
8026 @end lisp
8027
8028
8029 @vindex gnus-use-long-file-name
8030 Finally, you have the @code{gnus-use-long-file-name} variable.  If it is
8031 @code{nil}, all the preceding functions will replace all periods
8032 (@samp{.}) in the group names with slashes (@samp{/})---which means that
8033 the functions will generate hierarchies of directories instead of having
8034 all the files in the top level directory
8035 (@file{~/News/alt/andrea-dworkin} instead of
8036 @file{~/News/alt.andrea-dworkin}.)  This variable is @code{t} by default
8037 on most systems.  However, for historical reasons, this is @code{nil} on
8038 Xenix and usg-unix-v machines by default.
8039
8040 This function also affects kill and score file names.  If this variable
8041 is a list, and the list contains the element @code{not-score}, long file
8042 names will not be used for score files, if it contains the element
8043 @code{not-save}, long file names will not be used for saving, and if it
8044 contains the element @code{not-kill}, long file names will not be used
8045 for kill files.
8046
8047 If you'd like to save articles in a hierarchy that looks something like
8048 a spool, you could
8049
8050 @lisp
8051 (setq gnus-use-long-file-name '(not-save)) ; @r{to get a hierarchy}
8052 (setq gnus-default-article-saver
8053       'gnus-summary-save-in-file)          ; @r{no encoding}
8054 @end lisp
8055
8056 Then just save with @kbd{o}.  You'd then read this hierarchy with
8057 ephemeral @code{nneething} groups---@kbd{G D} in the group buffer, and
8058 the top level directory as the argument (@file{~/News/}).  Then just walk
8059 around to the groups/directories with @code{nneething}.
8060
8061
8062 @node Decoding Articles
8063 @section Decoding Articles
8064 @cindex decoding articles
8065
8066 Sometime users post articles (or series of articles) that have been
8067 encoded in some way or other.  Gnus can decode them for you.
8068
8069 @menu
8070 * Uuencoded Articles::          Uudecode articles.
8071 * Shell Archives::              Unshar articles.
8072 * PostScript Files::            Split PostScript.
8073 * Other Files::                 Plain save and binhex.
8074 * Decoding Variables::          Variables for a happy decoding.
8075 * Viewing Files::               You want to look at the result of the decoding?
8076 @end menu
8077
8078 @cindex series
8079 @cindex article series
8080 All these functions use the process/prefix convention
8081 (@pxref{Process/Prefix}) for finding out what articles to work on, with
8082 the extension that a ``single article'' means ``a single series''.  Gnus
8083 can find out by itself what articles belong to a series, decode all the
8084 articles and unpack/view/save the resulting file(s).
8085
8086 Gnus guesses what articles are in the series according to the following
8087 simplish rule: The subjects must be (nearly) identical, except for the
8088 last two numbers of the line.  (Spaces are largely ignored, however.)
8089
8090 For example: If you choose a subject called @samp{cat.gif (2/3)}, Gnus
8091 will find all the articles that match the regexp @samp{^cat.gif
8092 ([0-9]+/[0-9]+).*$}.
8093
8094 Subjects that are non-standard, like @samp{cat.gif (2/3) Part 6 of a
8095 series}, will not be properly recognized by any of the automatic viewing
8096 commands, and you have to mark the articles manually with @kbd{#}.
8097
8098
8099 @node Uuencoded Articles
8100 @subsection Uuencoded Articles
8101 @cindex uudecode
8102 @cindex uuencoded articles
8103
8104 @table @kbd
8105
8106 @item X u
8107 @kindex X u (Summary)
8108 @findex gnus-uu-decode-uu
8109 @c @icon{gnus-uu-decode-uu}
8110 Uudecodes the current series (@code{gnus-uu-decode-uu}).
8111
8112 @item X U
8113 @kindex X U (Summary)
8114 @findex gnus-uu-decode-uu-and-save
8115 Uudecodes and saves the current series
8116 (@code{gnus-uu-decode-uu-and-save}).
8117
8118 @item X v u
8119 @kindex X v u (Summary)
8120 @findex gnus-uu-decode-uu-view
8121 Uudecodes and views the current series (@code{gnus-uu-decode-uu-view}).
8122
8123 @item X v U
8124 @kindex X v U (Summary)
8125 @findex gnus-uu-decode-uu-and-save-view
8126 Uudecodes, views and saves the current series
8127 (@code{gnus-uu-decode-uu-and-save-view}).
8128
8129 @end table
8130
8131 Remember that these all react to the presence of articles marked with
8132 the process mark.  If, for instance, you'd like to decode and save an
8133 entire newsgroup, you'd typically do @kbd{M P a}
8134 (@code{gnus-uu-mark-all}) and then @kbd{X U}
8135 (@code{gnus-uu-decode-uu-and-save}).
8136
8137 All this is very much different from how @code{gnus-uu} worked with
8138 @sc{gnus 4.1}, where you had explicit keystrokes for everything under
8139 the sun.  This version of @code{gnus-uu} generally assumes that you mark
8140 articles in some way (@pxref{Setting Process Marks}) and then press
8141 @kbd{X u}.
8142
8143 @vindex gnus-uu-notify-files
8144 Note: When trying to decode articles that have names matching
8145 @code{gnus-uu-notify-files}, which is hard-coded to
8146 @samp{[Cc][Ii][Nn][Dd][Yy][0-9]+.\\(gif\\|jpg\\)}, @code{gnus-uu} will
8147 automatically post an article on @samp{comp.unix.wizards} saying that
8148 you have just viewed the file in question.  This feature can't be turned
8149 off.
8150
8151
8152 @node Shell Archives
8153 @subsection Shell Archives
8154 @cindex unshar
8155 @cindex shell archives
8156 @cindex shared articles
8157
8158 Shell archives (``shar files'') used to be a popular way to distribute
8159 sources, but it isn't used all that much today.  In any case, we have
8160 some commands to deal with these:
8161
8162 @table @kbd
8163
8164 @item X s
8165 @kindex X s (Summary)
8166 @findex gnus-uu-decode-unshar
8167 Unshars the current series (@code{gnus-uu-decode-unshar}).
8168
8169 @item X S
8170 @kindex X S (Summary)
8171 @findex gnus-uu-decode-unshar-and-save
8172 Unshars and saves the current series (@code{gnus-uu-decode-unshar-and-save}).
8173
8174 @item X v s
8175 @kindex X v s (Summary)
8176 @findex gnus-uu-decode-unshar-view
8177 Unshars and views the current series (@code{gnus-uu-decode-unshar-view}).
8178
8179 @item X v S
8180 @kindex X v S (Summary)
8181 @findex gnus-uu-decode-unshar-and-save-view
8182 Unshars, views and saves the current series
8183 (@code{gnus-uu-decode-unshar-and-save-view}).
8184 @end table
8185
8186
8187 @node PostScript Files
8188 @subsection PostScript Files
8189 @cindex PostScript
8190
8191 @table @kbd
8192
8193 @item X p
8194 @kindex X p (Summary)
8195 @findex gnus-uu-decode-postscript
8196 Unpack the current PostScript series (@code{gnus-uu-decode-postscript}).
8197
8198 @item X P
8199 @kindex X P (Summary)
8200 @findex gnus-uu-decode-postscript-and-save
8201 Unpack and save the current PostScript series
8202 (@code{gnus-uu-decode-postscript-and-save}).
8203
8204 @item X v p
8205 @kindex X v p (Summary)
8206 @findex gnus-uu-decode-postscript-view
8207 View the current PostScript series
8208 (@code{gnus-uu-decode-postscript-view}).
8209
8210 @item X v P
8211 @kindex X v P (Summary)
8212 @findex gnus-uu-decode-postscript-and-save-view
8213 View and save the current PostScript series
8214 (@code{gnus-uu-decode-postscript-and-save-view}).
8215 @end table
8216
8217
8218 @node Other Files
8219 @subsection Other Files
8220
8221 @table @kbd
8222 @item X o
8223 @kindex X o (Summary)
8224 @findex gnus-uu-decode-save
8225 Save the current series
8226 (@code{gnus-uu-decode-save}).
8227
8228 @item X b
8229 @kindex X b (Summary)
8230 @findex gnus-uu-decode-binhex
8231 Unbinhex the current series (@code{gnus-uu-decode-binhex}).  This
8232 doesn't really work yet.
8233
8234 @item X Y
8235 @kindex X Y (Summary)
8236 @findex gnus-uu-decode-yenc
8237 yEnc-decode the current series and save it (@code{gnus-uu-decode-yenc}).
8238 @end table
8239
8240
8241 @node Decoding Variables
8242 @subsection Decoding Variables
8243
8244 Adjective, not verb.
8245
8246 @menu
8247 * Rule Variables::              Variables that say how a file is to be viewed.
8248 * Other Decode Variables::      Other decode variables.
8249 * Uuencoding and Posting::      Variables for customizing uuencoding.
8250 @end menu
8251
8252
8253 @node Rule Variables
8254 @subsubsection Rule Variables
8255 @cindex rule variables
8256
8257 Gnus uses @dfn{rule variables} to decide how to view a file.  All these
8258 variables are of the form
8259
8260 @lisp
8261       (list '(regexp1 command2)
8262             '(regexp2 command2)
8263             ...)
8264 @end lisp
8265
8266 @table @code
8267
8268 @item gnus-uu-user-view-rules
8269 @vindex gnus-uu-user-view-rules
8270 @cindex sox
8271 This variable is consulted first when viewing files.  If you wish to use,
8272 for instance, @code{sox} to convert an @file{.au} sound file, you could
8273 say something like:
8274 @lisp
8275 (setq gnus-uu-user-view-rules
8276       (list '("\\\\.au$" "sox %s -t .aiff > /dev/audio")))
8277 @end lisp
8278
8279 @item gnus-uu-user-view-rules-end
8280 @vindex gnus-uu-user-view-rules-end
8281 This variable is consulted if Gnus couldn't make any matches from the
8282 user and default view rules.
8283
8284 @item gnus-uu-user-archive-rules
8285 @vindex gnus-uu-user-archive-rules
8286 This variable can be used to say what commands should be used to unpack
8287 archives.
8288 @end table
8289
8290
8291 @node Other Decode Variables
8292 @subsubsection Other Decode Variables
8293
8294 @table @code
8295 @vindex gnus-uu-grabbed-file-functions
8296
8297 @item gnus-uu-grabbed-file-functions
8298 All functions in this list will be called right after each file has been
8299 successfully decoded---so that you can move or view files right away,
8300 and don't have to wait for all files to be decoded before you can do
8301 anything.  Ready-made functions you can put in this list are:
8302
8303 @table @code
8304
8305 @item gnus-uu-grab-view
8306 @findex gnus-uu-grab-view
8307 View the file.
8308
8309 @item gnus-uu-grab-move
8310 @findex gnus-uu-grab-move
8311 Move the file (if you're using a saving function.)
8312 @end table
8313
8314 @item gnus-uu-be-dangerous
8315 @vindex gnus-uu-be-dangerous
8316 Specifies what to do if unusual situations arise during decoding.  If
8317 @code{nil}, be as conservative as possible.  If @code{t}, ignore things
8318 that didn't work, and overwrite existing files.  Otherwise, ask each
8319 time.
8320
8321 @item gnus-uu-ignore-files-by-name
8322 @vindex gnus-uu-ignore-files-by-name
8323 Files with name matching this regular expression won't be viewed.
8324
8325 @item gnus-uu-ignore-files-by-type
8326 @vindex gnus-uu-ignore-files-by-type
8327 Files with a @acronym{MIME} type matching this variable won't be viewed.
8328 Note that Gnus tries to guess what type the file is based on the name.
8329 @code{gnus-uu} is not a @acronym{MIME} package (yet), so this is slightly
8330 kludgey.
8331
8332 @item gnus-uu-tmp-dir
8333 @vindex gnus-uu-tmp-dir
8334 Where @code{gnus-uu} does its work.
8335
8336 @item gnus-uu-do-not-unpack-archives
8337 @vindex gnus-uu-do-not-unpack-archives
8338 Non-@code{nil} means that @code{gnus-uu} won't peek inside archives
8339 looking for files to display.
8340
8341 @item gnus-uu-view-and-save
8342 @vindex gnus-uu-view-and-save
8343 Non-@code{nil} means that the user will always be asked to save a file
8344 after viewing it.
8345
8346 @item gnus-uu-ignore-default-view-rules
8347 @vindex gnus-uu-ignore-default-view-rules
8348 Non-@code{nil} means that @code{gnus-uu} will ignore the default viewing
8349 rules.
8350
8351 @item gnus-uu-ignore-default-archive-rules
8352 @vindex gnus-uu-ignore-default-archive-rules
8353 Non-@code{nil} means that @code{gnus-uu} will ignore the default archive
8354 unpacking commands.
8355
8356 @item gnus-uu-kill-carriage-return
8357 @vindex gnus-uu-kill-carriage-return
8358 Non-@code{nil} means that @code{gnus-uu} will strip all carriage returns
8359 from articles.
8360
8361 @item gnus-uu-unmark-articles-not-decoded
8362 @vindex gnus-uu-unmark-articles-not-decoded
8363 Non-@code{nil} means that @code{gnus-uu} will mark unsuccessfully
8364 decoded articles as unread.
8365
8366 @item gnus-uu-correct-stripped-uucode
8367 @vindex gnus-uu-correct-stripped-uucode
8368 Non-@code{nil} means that @code{gnus-uu} will @emph{try} to fix
8369 uuencoded files that have had trailing spaces deleted.
8370
8371 @item gnus-uu-pre-uudecode-hook
8372 @vindex gnus-uu-pre-uudecode-hook
8373 Hook run before sending a message to @code{uudecode}.
8374
8375 @item gnus-uu-view-with-metamail
8376 @vindex gnus-uu-view-with-metamail
8377 @cindex metamail
8378 Non-@code{nil} means that @code{gnus-uu} will ignore the viewing
8379 commands defined by the rule variables and just fudge a @acronym{MIME}
8380 content type based on the file name.  The result will be fed to
8381 @code{metamail} for viewing.
8382
8383 @item gnus-uu-save-in-digest
8384 @vindex gnus-uu-save-in-digest
8385 Non-@code{nil} means that @code{gnus-uu}, when asked to save without
8386 decoding, will save in digests.  If this variable is @code{nil},
8387 @code{gnus-uu} will just save everything in a file without any
8388 embellishments.  The digesting almost conforms to RFC 1153---no easy way
8389 to specify any meaningful volume and issue numbers were found, so I
8390 simply dropped them.
8391
8392 @end table
8393
8394
8395 @node Uuencoding and Posting
8396 @subsubsection Uuencoding and Posting
8397
8398 @table @code
8399
8400 @item gnus-uu-post-include-before-composing
8401 @vindex gnus-uu-post-include-before-composing
8402 Non-@code{nil} means that @code{gnus-uu} will ask for a file to encode
8403 before you compose the article.  If this variable is @code{t}, you can
8404 either include an encoded file with @kbd{C-c C-i} or have one included
8405 for you when you post the article.
8406
8407 @item gnus-uu-post-length
8408 @vindex gnus-uu-post-length
8409 Maximum length of an article.  The encoded file will be split into how
8410 many articles it takes to post the entire file.
8411
8412 @item gnus-uu-post-threaded
8413 @vindex gnus-uu-post-threaded
8414 Non-@code{nil} means that @code{gnus-uu} will post the encoded file in a
8415 thread.  This may not be smart, as no other decoder I have seen is able
8416 to follow threads when collecting uuencoded articles.  (Well, I have
8417 seen one package that does that---@code{gnus-uu}, but somehow, I don't
8418 think that counts@dots{}) Default is @code{nil}.
8419
8420 @item gnus-uu-post-separate-description
8421 @vindex gnus-uu-post-separate-description
8422 Non-@code{nil} means that the description will be posted in a separate
8423 article.  The first article will typically be numbered (0/x).  If this
8424 variable is @code{nil}, the description the user enters will be included
8425 at the beginning of the first article, which will be numbered (1/x).
8426 Default is @code{t}.
8427
8428 @end table
8429
8430
8431 @node Viewing Files
8432 @subsection Viewing Files
8433 @cindex viewing files
8434 @cindex pseudo-articles
8435
8436 After decoding, if the file is some sort of archive, Gnus will attempt
8437 to unpack the archive and see if any of the files in the archive can be
8438 viewed.  For instance, if you have a gzipped tar file @file{pics.tar.gz}
8439 containing the files @file{pic1.jpg} and @file{pic2.gif}, Gnus will
8440 uncompress and de-tar the main file, and then view the two pictures.
8441 This unpacking process is recursive, so if the archive contains archives
8442 of archives, it'll all be unpacked.
8443
8444 Finally, Gnus will normally insert a @dfn{pseudo-article} for each
8445 extracted file into the summary buffer.  If you go to these
8446 ``articles'', you will be prompted for a command to run (usually Gnus
8447 will make a suggestion), and then the command will be run.
8448
8449 @vindex gnus-view-pseudo-asynchronously
8450 If @code{gnus-view-pseudo-asynchronously} is @code{nil}, Emacs will wait
8451 until the viewing is done before proceeding.
8452
8453 @vindex gnus-view-pseudos
8454 If @code{gnus-view-pseudos} is @code{automatic}, Gnus will not insert
8455 the pseudo-articles into the summary buffer, but view them
8456 immediately.  If this variable is @code{not-confirm}, the user won't even
8457 be asked for a confirmation before viewing is done.
8458
8459 @vindex gnus-view-pseudos-separately
8460 If @code{gnus-view-pseudos-separately} is non-@code{nil}, one
8461 pseudo-article will be created for each file to be viewed.  If
8462 @code{nil}, all files that use the same viewing command will be given as
8463 a list of parameters to that command.
8464
8465 @vindex gnus-insert-pseudo-articles
8466 If @code{gnus-insert-pseudo-articles} is non-@code{nil}, insert
8467 pseudo-articles when decoding.  It is @code{t} by default.
8468
8469 So; there you are, reading your @emph{pseudo-articles} in your
8470 @emph{virtual newsgroup} from the @emph{virtual server}; and you think:
8471 Why isn't anything real anymore? How did we get here?
8472
8473
8474 @node Article Treatment
8475 @section Article Treatment
8476
8477 Reading through this huge manual, you may have quite forgotten that the
8478 object of newsreaders is to actually, like, read what people have
8479 written.  Reading articles.  Unfortunately, people are quite bad at
8480 writing, so there are tons of functions and variables to make reading
8481 these articles easier.
8482
8483 @menu
8484 * Article Highlighting::        You want to make the article look like fruit salad.
8485 * Article Fontisizing::         Making emphasized text look nice.
8486 * Article Hiding::              You also want to make certain info go away.
8487 * Article Washing::             Lots of way-neat functions to make life better.
8488 * Article Header::              Doing various header transformations.
8489 * Article Buttons::             Click on URLs, Message-IDs, addresses and the like.
8490 * Article Button Levels::       Controlling appearance of buttons.
8491 * Article Date::                Grumble, UT!
8492 * Article Display::             Display various stuff:
8493                                 X-Face, Picons, Gravatars, Smileys.
8494 * Article Signature::           What is a signature?
8495 * Article Miscellanea::         Various other stuff.
8496 @end menu
8497
8498
8499 @node Article Highlighting
8500 @subsection Article Highlighting
8501 @cindex highlighting
8502
8503 Not only do you want your article buffer to look like fruit salad, but
8504 you want it to look like technicolor fruit salad.
8505
8506 @table @kbd
8507
8508 @item W H a
8509 @kindex W H a (Summary)
8510 @findex gnus-article-highlight
8511 @findex gnus-article-maybe-highlight
8512 Do much highlighting of the current article
8513 (@code{gnus-article-highlight}).  This function highlights header, cited
8514 text, the signature, and adds buttons to the body and the head.
8515
8516 @item W H h
8517 @kindex W H h (Summary)
8518 @findex gnus-article-highlight-headers
8519 @vindex gnus-header-face-alist
8520 Highlight the headers (@code{gnus-article-highlight-headers}).  The
8521 highlighting will be done according to the @code{gnus-header-face-alist}
8522 variable, which is a list where each element has the form
8523 @code{(@var{regexp} @var{name} @var{content})}.
8524 @var{regexp} is a regular expression for matching the
8525 header, @var{name} is the face used for highlighting the header name
8526 (@pxref{Faces and Fonts}) and @var{content} is the face for highlighting
8527 the header value.  The first match made will be used.  Note that
8528 @var{regexp} shouldn't have @samp{^} prepended---Gnus will add one.
8529
8530 @item W H c
8531 @kindex W H c (Summary)
8532 @findex gnus-article-highlight-citation
8533 Highlight cited text (@code{gnus-article-highlight-citation}).
8534
8535 Some variables to customize the citation highlights:
8536
8537 @table @code
8538 @vindex gnus-cite-parse-max-size
8539
8540 @item gnus-cite-parse-max-size
8541 If the article size in bytes is bigger than this variable (which is
8542 25000 by default), no citation highlighting will be performed.
8543
8544 @item gnus-cite-max-prefix
8545 @vindex gnus-cite-max-prefix
8546 Maximum possible length for a citation prefix (default 20).
8547
8548 @item gnus-cite-face-list
8549 @vindex gnus-cite-face-list
8550 List of faces used for highlighting citations (@pxref{Faces and Fonts}).
8551 When there are citations from multiple articles in the same message,
8552 Gnus will try to give each citation from each article its own face.
8553 This should make it easier to see who wrote what.
8554
8555 @item gnus-supercite-regexp
8556 @vindex gnus-supercite-regexp
8557 Regexp matching normal Supercite attribution lines.
8558
8559 @item gnus-supercite-secondary-regexp
8560 @vindex gnus-supercite-secondary-regexp
8561 Regexp matching mangled Supercite attribution lines.
8562
8563 @item gnus-cite-minimum-match-count
8564 @vindex gnus-cite-minimum-match-count
8565 Minimum number of identical prefixes we have to see before we believe
8566 that it's a citation.
8567
8568 @item gnus-cite-attribution-prefix
8569 @vindex gnus-cite-attribution-prefix
8570 Regexp matching the beginning of an attribution line.
8571
8572 @item gnus-cite-attribution-suffix
8573 @vindex gnus-cite-attribution-suffix
8574 Regexp matching the end of an attribution line.
8575
8576 @item gnus-cite-attribution-face
8577 @vindex gnus-cite-attribution-face
8578 Face used for attribution lines.  It is merged with the face for the
8579 cited text belonging to the attribution.
8580
8581 @item gnus-cite-ignore-quoted-from
8582 @vindex gnus-cite-ignore-quoted-from
8583 If non-@code{nil}, no citation highlighting will be performed on lines
8584 beginning with @samp{>From }.  Those lines may have been quoted by MTAs
8585 in order not to mix up with the envelope From line.  The default value
8586 is @code{t}.
8587
8588 @end table
8589
8590
8591 @item W H s
8592 @kindex W H s (Summary)
8593 @vindex gnus-signature-separator
8594 @vindex gnus-signature-face
8595 @findex gnus-article-highlight-signature
8596 Highlight the signature (@code{gnus-article-highlight-signature}).
8597 Everything after @code{gnus-signature-separator} (@pxref{Article
8598 Signature}) in an article will be considered a signature and will be
8599 highlighted with @code{gnus-signature-face}, which is @code{italic} by
8600 default.
8601
8602 @end table
8603
8604 @xref{Customizing Articles}, for how to highlight articles automatically.
8605
8606
8607 @node Article Fontisizing
8608 @subsection Article Fontisizing
8609 @cindex emphasis
8610 @cindex article emphasis
8611
8612 @findex gnus-article-emphasize
8613 @kindex W e (Summary)
8614 People commonly add emphasis to words in news articles by writing things
8615 like @samp{_this_} or @samp{*this*} or @samp{/this/}.  Gnus can make
8616 this look nicer by running the article through the @kbd{W e}
8617 (@code{gnus-article-emphasize}) command.
8618
8619 @vindex gnus-emphasis-alist
8620 How the emphasis is computed is controlled by the
8621 @code{gnus-emphasis-alist} variable.  This is an alist where the first
8622 element is a regular expression to be matched.  The second is a number
8623 that says what regular expression grouping is used to find the entire
8624 emphasized word.  The third is a number that says what regexp grouping
8625 should be displayed and highlighted.  (The text between these two
8626 groupings will be hidden.)  The fourth is the face used for
8627 highlighting.
8628
8629 @lisp
8630 (setq gnus-emphasis-alist
8631       '(("_\\(\\w+\\)_" 0 1 gnus-emphasis-underline)
8632         ("\\*\\(\\w+\\)\\*" 0 1 gnus-emphasis-bold)))
8633 @end lisp
8634
8635 @cindex slash
8636 @cindex asterisk
8637 @cindex underline
8638 @cindex /
8639 @cindex *
8640
8641 @vindex gnus-emphasis-underline
8642 @vindex gnus-emphasis-bold
8643 @vindex gnus-emphasis-italic
8644 @vindex gnus-emphasis-underline-bold
8645 @vindex gnus-emphasis-underline-italic
8646 @vindex gnus-emphasis-bold-italic
8647 @vindex gnus-emphasis-underline-bold-italic
8648 By default, there are seven rules, and they use the following faces:
8649 @code{gnus-emphasis-bold}, @code{gnus-emphasis-italic},
8650 @code{gnus-emphasis-underline}, @code{gnus-emphasis-bold-italic},
8651 @code{gnus-emphasis-underline-italic},
8652 @code{gnus-emphasis-underline-bold}, and
8653 @code{gnus-emphasis-underline-bold-italic}.
8654
8655 If you want to change these faces, you can either use @kbd{M-x
8656 customize}, or you can use @code{copy-face}.  For instance, if you want
8657 to make @code{gnus-emphasis-italic} use a red face instead, you could
8658 say something like:
8659
8660 @lisp
8661 (copy-face 'red 'gnus-emphasis-italic)
8662 @end lisp
8663
8664 @vindex gnus-group-highlight-words-alist
8665
8666 If you want to highlight arbitrary words, you can use the
8667 @code{gnus-group-highlight-words-alist} variable, which uses the same
8668 syntax as @code{gnus-emphasis-alist}.  The @code{highlight-words} group
8669 parameter (@pxref{Group Parameters}) can also be used.
8670
8671 @xref{Customizing Articles}, for how to fontize articles automatically.
8672
8673
8674 @node Article Hiding
8675 @subsection Article Hiding
8676 @cindex article hiding
8677
8678 Or rather, hiding certain things in each article.  There usually is much
8679 too much cruft in most articles.
8680
8681 @table @kbd
8682
8683 @item W W a
8684 @kindex W W a (Summary)
8685 @findex gnus-article-hide
8686 Do quite a lot of hiding on the article buffer
8687 (@kbd{gnus-article-hide}).  In particular, this function will hide
8688 headers, @acronym{PGP}, cited text and the signature.
8689
8690 @item W W h
8691 @kindex W W h (Summary)
8692 @findex gnus-article-hide-headers
8693 Hide headers (@code{gnus-article-hide-headers}).  @xref{Hiding
8694 Headers}.
8695
8696 @item W W b
8697 @kindex W W b (Summary)
8698 @findex gnus-article-hide-boring-headers
8699 Hide headers that aren't particularly interesting
8700 (@code{gnus-article-hide-boring-headers}).  @xref{Hiding Headers}.
8701
8702 @item W W s
8703 @kindex W W s (Summary)
8704 @findex gnus-article-hide-signature
8705 Hide signature (@code{gnus-article-hide-signature}).  @xref{Article
8706 Signature}.
8707
8708 @item W W l
8709 @kindex W W l (Summary)
8710 @findex gnus-article-hide-list-identifiers
8711 @vindex gnus-list-identifiers
8712 Strip list identifiers specified in @code{gnus-list-identifiers}.  These
8713 are strings some mailing list servers add to the beginning of all
8714 @code{Subject} headers---for example, @samp{[zebra 4711]}.  Any leading
8715 @samp{Re: } is skipped before stripping.  @code{gnus-list-identifiers}
8716 may not contain @code{\\(..\\)}.
8717
8718 @table @code
8719
8720 @item gnus-list-identifiers
8721 @vindex gnus-list-identifiers
8722 A regular expression that matches list identifiers to be removed from
8723 subject.  This can also be a list of regular expressions.
8724
8725 @end table
8726
8727 @item W W P
8728 @kindex W W P (Summary)
8729 @findex gnus-article-hide-pem
8730 Hide @acronym{PEM} (privacy enhanced messages) cruft
8731 (@code{gnus-article-hide-pem}).
8732
8733 @item W W B
8734 @kindex W W B (Summary)
8735 @findex gnus-article-strip-banner
8736 @vindex gnus-article-banner-alist
8737 @vindex gnus-article-address-banner-alist
8738 @cindex banner
8739 @cindex OneList
8740 @cindex stripping advertisements
8741 @cindex advertisements
8742 Strip the banner specified by the @code{banner} group parameter
8743 (@code{gnus-article-strip-banner}).  This is mainly used to hide those
8744 annoying banners and/or signatures that some mailing lists and moderated
8745 groups adds to all the messages.  The way to use this function is to add
8746 the @code{banner} group parameter (@pxref{Group Parameters}) to the
8747 group you want banners stripped from.  The parameter either be a string,
8748 which will be interpreted as a regular expression matching text to be
8749 removed, or the symbol @code{signature}, meaning that the (last)
8750 signature should be removed, or other symbol, meaning that the
8751 corresponding regular expression in @code{gnus-article-banner-alist} is
8752 used.
8753
8754 For instance:
8755
8756 @lisp
8757 (setq gnus-article-banner-alist
8758       ((googleGroups .
8759        "^\n*--~--~---------\\(.+\n\\)+")))
8760 @end lisp
8761
8762 Regardless of a group, you can hide things like advertisements only when
8763 the sender of an article has a certain mail address specified in
8764 @code{gnus-article-address-banner-alist}.
8765
8766 @table @code
8767
8768 @item gnus-article-address-banner-alist
8769 @vindex gnus-article-address-banner-alist
8770 Alist of mail addresses and banners.  Each element has the form
8771 @code{(@var{address} . @var{banner})}, where @var{address} is a regexp
8772 matching a mail address in the From header, @var{banner} is one of a
8773 symbol @code{signature}, an item in @code{gnus-article-banner-alist},
8774 a regexp and @code{nil}.  If @var{address} matches author's mail
8775 address, it will remove things like advertisements.  For example, if a
8776 sender has the mail address @samp{hail@@yoo-hoo.co.jp} and there is a
8777 banner something like @samp{Do You Yoo-hoo!?} in all articles he
8778 sends, you can use the following element to remove them:
8779
8780 @lisp
8781 ("@@yoo-hoo\\.co\\.jp\\'" .
8782  "\n_+\nDo You Yoo-hoo!\\?\n.*\n.*\n")
8783 @end lisp
8784
8785 @end table
8786
8787 @item W W c
8788 @kindex W W c (Summary)
8789 @findex gnus-article-hide-citation
8790 Hide citation (@code{gnus-article-hide-citation}).  Some variables for
8791 customizing the hiding:
8792
8793 @table @code
8794
8795 @item gnus-cited-opened-text-button-line-format
8796 @itemx gnus-cited-closed-text-button-line-format
8797 @vindex gnus-cited-closed-text-button-line-format
8798 @vindex gnus-cited-opened-text-button-line-format
8799 Gnus adds buttons to show where the cited text has been hidden, and to
8800 allow toggle hiding the text.  The format of the variable is specified
8801 by these format-like variable (@pxref{Formatting Variables}).  These
8802 specs are valid:
8803
8804 @table @samp
8805 @item b
8806 Starting point of the hidden text.
8807 @item e
8808 Ending point of the hidden text.
8809 @item l
8810 Number of characters in the hidden region.
8811 @item n
8812 Number of lines of hidden text.
8813 @end table
8814
8815 @item gnus-cited-lines-visible
8816 @vindex gnus-cited-lines-visible
8817 The number of lines at the beginning of the cited text to leave
8818 shown.  This can also be a cons cell with the number of lines at the top
8819 and bottom of the text, respectively, to remain visible.
8820
8821 @end table
8822
8823 @item W W C-c
8824 @kindex W W C-c (Summary)
8825 @findex gnus-article-hide-citation-maybe
8826
8827 Hide citation (@code{gnus-article-hide-citation-maybe}) depending on the
8828 following two variables:
8829
8830 @table @code
8831 @item gnus-cite-hide-percentage
8832 @vindex gnus-cite-hide-percentage
8833 If the cited text is of a bigger percentage than this variable (default
8834 50), hide the cited text.
8835
8836 @item gnus-cite-hide-absolute
8837 @vindex gnus-cite-hide-absolute
8838 The cited text must have at least this length (default 10) before it
8839 is hidden.
8840 @end table
8841
8842 @item W W C
8843 @kindex W W C (Summary)
8844 @findex gnus-article-hide-citation-in-followups
8845 Hide cited text in articles that aren't roots
8846 (@code{gnus-article-hide-citation-in-followups}).  This isn't very
8847 useful as an interactive command, but might be a handy function to stick
8848 have happen automatically (@pxref{Customizing Articles}).
8849
8850 @end table
8851
8852 All these ``hiding'' commands are toggles, but if you give a negative
8853 prefix to these commands, they will show what they have previously
8854 hidden.  If you give a positive prefix, they will always hide.
8855
8856 Also @pxref{Article Highlighting} for further variables for
8857 citation customization.
8858
8859 @xref{Customizing Articles}, for how to hide article elements
8860 automatically.
8861
8862
8863 @node Article Washing
8864 @subsection Article Washing
8865 @cindex washing
8866 @cindex article washing
8867
8868 We call this ``article washing'' for a really good reason.  Namely, the
8869 @kbd{A} key was taken, so we had to use the @kbd{W} key instead.
8870
8871 @dfn{Washing} is defined by us as ``changing something from something to
8872 something else'', but normally results in something looking better.
8873 Cleaner, perhaps.
8874
8875 @xref{Customizing Articles}, if you want to change how Gnus displays
8876 articles by default.
8877
8878 @table @kbd
8879
8880 @item C-u g
8881 This is not really washing, it's sort of the opposite of washing.  If
8882 you type this, you see the article exactly as it exists on disk or on
8883 the server.
8884
8885 @item g
8886 Force redisplaying of the current article
8887 (@code{gnus-summary-show-article}).  This is also not really washing.
8888 If you type this, you see the article without any previously applied
8889 interactive Washing functions but with all default treatments
8890 (@pxref{Customizing Articles}).
8891
8892 @item W l
8893 @kindex W l (Summary)
8894 @findex gnus-summary-stop-page-breaking
8895 Remove page breaks from the current article
8896 (@code{gnus-summary-stop-page-breaking}).  @xref{Misc Article}, for page
8897 delimiters.
8898
8899 @item W r
8900 @kindex W r (Summary)
8901 @findex gnus-summary-caesar-message
8902 @c @icon{gnus-summary-caesar-message}
8903 Do a Caesar rotate (rot13) on the article buffer
8904 (@code{gnus-summary-caesar-message}).
8905 Unreadable articles that tell you to read them with Caesar rotate or rot13.
8906 (Typically offensive jokes and such.)
8907
8908 It's commonly called ``rot13'' because each letter is rotated 13
8909 positions in the alphabet, e. g. @samp{B} (letter #2) -> @samp{O} (letter
8910 #15).  It is sometimes referred to as ``Caesar rotate'' because Caesar
8911 is rumored to have employed this form of, uh, somewhat weak encryption.
8912
8913 @item W m
8914 @kindex W m (Summary)
8915 @findex gnus-summary-morse-message
8916 Morse decode the article buffer (@code{gnus-summary-morse-message}).
8917
8918 @item W i
8919 @kindex W i (Summary)
8920 @findex gnus-summary-idna-message
8921 Decode IDNA encoded domain names in the current articles.  IDNA
8922 encoded domain names looks like @samp{xn--bar}.  If a string remain
8923 unencoded after running invoking this, it is likely an invalid IDNA
8924 string (@samp{xn--bar} is invalid).  You must have GNU Libidn
8925 (@url{http://www.gnu.org/software/libidn/}) installed for this command
8926 to work.
8927
8928 @item W t
8929 @item t
8930 @kindex W t (Summary)
8931 @kindex t (Summary)
8932 @findex gnus-summary-toggle-header
8933 Toggle whether to display all headers in the article buffer
8934 (@code{gnus-summary-toggle-header}).
8935
8936 @item W v
8937 @kindex W v (Summary)
8938 @findex gnus-summary-verbose-headers
8939 Toggle whether to display all headers in the article buffer permanently
8940 (@code{gnus-summary-verbose-headers}).
8941
8942 @item W o
8943 @kindex W o (Summary)
8944 @findex gnus-article-treat-overstrike
8945 Treat overstrike (@code{gnus-article-treat-overstrike}).
8946
8947 @item W d
8948 @kindex W d (Summary)
8949 @findex gnus-article-treat-dumbquotes
8950 @vindex gnus-article-dumbquotes-map
8951 @cindex Smartquotes
8952 @cindex M****s*** sm*rtq**t*s
8953 @cindex Latin 1
8954 Treat M****s*** sm*rtq**t*s according to
8955 @code{gnus-article-dumbquotes-map}
8956 (@code{gnus-article-treat-dumbquotes}).  Note that this function guesses
8957 whether a character is a sm*rtq**t* or not, so it should only be used
8958 interactively.
8959
8960 Sm*rtq**t*s are M****s***'s unilateral extension to the character map in
8961 an attempt to provide more quoting characters.  If you see something
8962 like @code{\222} or @code{\264} where you're expecting some kind of
8963 apostrophe or quotation mark, then try this wash.
8964
8965 @item W U
8966 @kindex W U (Summary)
8967 @findex gnus-article-treat-non-ascii
8968 @cindex Unicode
8969 @cindex Non-@acronym{ASCII}
8970 Translate many non-@acronym{ASCII} characters into their
8971 @acronym{ASCII} equivalents (@code{gnus-article-treat-non-ascii}).
8972 This is mostly useful if you're on a terminal that has a limited font
8973 and does't show accented characters, ``advanced'' punctuation, and the
8974 like.  For instance, @samp{»} is tranlated into @samp{>>}, and so on.
8975
8976 @item W Y f
8977 @kindex W Y f (Summary)
8978 @findex gnus-article-outlook-deuglify-article
8979 @cindex Outlook Express
8980 Full deuglify of broken Outlook (Express) articles: Treat dumbquotes,
8981 unwrap lines, repair attribution and rearrange citation.
8982 (@code{gnus-article-outlook-deuglify-article}).
8983
8984 @item W Y u
8985 @kindex W Y u (Summary)
8986 @findex gnus-article-outlook-unwrap-lines
8987 @vindex gnus-outlook-deuglify-unwrap-min
8988 @vindex gnus-outlook-deuglify-unwrap-max
8989 Unwrap lines that appear to be wrapped citation lines.  You can control
8990 what lines will be unwrapped by frobbing
8991 @code{gnus-outlook-deuglify-unwrap-min} and
8992 @code{gnus-outlook-deuglify-unwrap-max}, indicating the minimum and
8993 maximum length of an unwrapped citation line.
8994 (@code{gnus-article-outlook-unwrap-lines}).
8995
8996 @item W Y a
8997 @kindex W Y a (Summary)
8998 @findex gnus-article-outlook-repair-attribution
8999 Repair a broken attribution line.@*
9000 (@code{gnus-article-outlook-repair-attribution}).
9001
9002 @item W Y c
9003 @kindex W Y c (Summary)
9004 @findex gnus-article-outlook-rearrange-citation
9005 Repair broken citations by rearranging the text.
9006 (@code{gnus-article-outlook-rearrange-citation}).
9007
9008 @item W w
9009 @kindex W w (Summary)
9010 @findex gnus-article-fill-cited-article
9011 Do word wrap (@code{gnus-article-fill-cited-article}).
9012
9013 You can give the command a numerical prefix to specify the width to use
9014 when filling.
9015
9016 @item W Q
9017 @kindex W Q (Summary)
9018 @findex gnus-article-fill-long-lines
9019 Fill long lines (@code{gnus-article-fill-long-lines}).
9020
9021 @item W C
9022 @kindex W C (Summary)
9023 @findex gnus-article-capitalize-sentences
9024 Capitalize the first word in each sentence
9025 (@code{gnus-article-capitalize-sentences}).
9026
9027 @item W c
9028 @kindex W c (Summary)
9029 @findex gnus-article-remove-cr
9030 Translate CRLF pairs (i. e., @samp{^M}s on the end of the lines) into LF
9031 (this takes care of DOS line endings), and then translate any remaining
9032 CRs into LF (this takes care of Mac line endings)
9033 (@code{gnus-article-remove-cr}).
9034
9035 @item W q
9036 @kindex W q (Summary)
9037 @findex gnus-article-de-quoted-unreadable
9038 Treat quoted-printable (@code{gnus-article-de-quoted-unreadable}).
9039 Quoted-Printable is one common @acronym{MIME} encoding employed when
9040 sending non-@acronym{ASCII} (i.e., 8-bit) articles.  It typically
9041 makes strings like @samp{d@'ej@`a vu} look like @samp{d=E9j=E0 vu},
9042 which doesn't look very readable to me.  Note that this is usually
9043 done automatically by Gnus if the message in question has a
9044 @code{Content-Transfer-Encoding} header that says that this encoding
9045 has been done.  If a prefix is given, a charset will be asked for.
9046
9047 @item W 6
9048 @kindex W 6 (Summary)
9049 @findex gnus-article-de-base64-unreadable
9050 Treat base64 (@code{gnus-article-de-base64-unreadable}).  Base64 is
9051 one common @acronym{MIME} encoding employed when sending
9052 non-@acronym{ASCII} (i.e., 8-bit) articles.  Note that this is
9053 usually done automatically by Gnus if the message in question has a
9054 @code{Content-Transfer-Encoding} header that says that this encoding
9055 has been done.  If a prefix is given, a charset will be asked for.
9056
9057 @item W Z
9058 @kindex W Z (Summary)
9059 @findex gnus-article-decode-HZ
9060 Treat HZ or HZP (@code{gnus-article-decode-HZ}).  HZ (or HZP) is one
9061 common encoding employed when sending Chinese articles.  It typically
9062 makes strings look like @samp{~@{<:Ky2;S@{#,NpJ)l6HK!#~@}}.
9063
9064 @item W A
9065 @kindex W A (Summary)
9066 @findex gnus-article-treat-ansi-sequences
9067 @cindex @acronym{ANSI} control sequences
9068 Translate @acronym{ANSI} SGR control sequences into overlays or
9069 extents (@code{gnus-article-treat-ansi-sequences}).  @acronym{ANSI}
9070 sequences are used in some Chinese hierarchies for highlighting.
9071
9072 @item W u
9073 @kindex W u (Summary)
9074 @findex gnus-article-unsplit-urls
9075 Remove newlines from within URLs.  Some mailers insert newlines into
9076 outgoing email messages to keep lines short.  This reformatting can
9077 split long URLs onto multiple lines.  Repair those URLs by removing
9078 the newlines (@code{gnus-article-unsplit-urls}).
9079
9080 @item W h
9081 @kindex W h (Summary)
9082 @findex gnus-article-wash-html
9083 Treat @acronym{HTML} (@code{gnus-article-wash-html}).  Note that this is
9084 usually done automatically by Gnus if the message in question has a
9085 @code{Content-Type} header that says that the message is @acronym{HTML}.
9086
9087 If a prefix is given, a charset will be asked for.  If it is a number,
9088 the charset defined in @code{gnus-summary-show-article-charset-alist}
9089 (@pxref{Paging the Article}) will be used.
9090
9091 The default is to use the function specified by
9092 @code{mm-text-html-renderer} (@pxref{Display Customization, ,Display
9093 Customization, emacs-mime, The Emacs MIME Manual}) to convert the
9094 @acronym{HTML}.  Pre-defined functions you can use include:
9095
9096 @table @code
9097 @item shr
9098 Use Gnus simple html renderer.
9099
9100 @item gnus-w3m
9101 Use Gnus rendered based on w3m.
9102
9103 @item w3
9104 Use Emacs/W3.
9105
9106 @item w3m
9107 Use @uref{http://emacs-w3m.namazu.org/, emacs-w3m}.
9108
9109 @item w3m-standalone
9110 Use @uref{http://w3m.sourceforge.net/, w3m}.
9111
9112 @item links
9113 Use @uref{http://links.sf.net/, Links}.
9114
9115 @item lynx
9116 Use @uref{http://lynx.isc.org/, Lynx}.
9117
9118 @item html2text
9119 Use html2text---a simple @acronym{HTML} converter included with Gnus.
9120
9121 @end table
9122
9123 @item W b
9124 @kindex W b (Summary)
9125 @findex gnus-article-add-buttons
9126 Add clickable buttons to the article (@code{gnus-article-add-buttons}).
9127 @xref{Article Buttons}.
9128
9129 @item W B
9130 @kindex W B (Summary)
9131 @findex gnus-article-add-buttons-to-head
9132 Add clickable buttons to the article headers
9133 (@code{gnus-article-add-buttons-to-head}).
9134
9135 @item W p
9136 @kindex W p (Summary)
9137 @findex gnus-article-verify-x-pgp-sig
9138 Verify a signed control message
9139 (@code{gnus-article-verify-x-pgp-sig}).  Control messages such as
9140 @code{newgroup} and @code{checkgroups} are usually signed by the
9141 hierarchy maintainer.  You need to add the @acronym{PGP} public key of
9142 the maintainer to your keyring to verify the
9143 message.@footnote{@acronym{PGP} keys for many hierarchies are
9144 available at @uref{ftp://ftp.isc.org/pub/pgpcontrol/README.html}}
9145
9146 @item W s
9147 @kindex W s (Summary)
9148 @findex gnus-summary-force-verify-and-decrypt
9149 Verify a signed (@acronym{PGP}, @acronym{PGP/MIME} or
9150 @acronym{S/MIME}) message
9151 (@code{gnus-summary-force-verify-and-decrypt}). @xref{Security}.
9152
9153 @item W a
9154 @kindex W a (Summary)
9155 @findex gnus-article-strip-headers-in-body
9156 Strip headers like the @code{X-No-Archive} header from the beginning of
9157 article bodies (@code{gnus-article-strip-headers-in-body}).
9158
9159 @item W E l
9160 @kindex W E l (Summary)
9161 @findex gnus-article-strip-leading-blank-lines
9162 Remove all blank lines from the beginning of the article
9163 (@code{gnus-article-strip-leading-blank-lines}).
9164
9165 @item W E m
9166 @kindex W E m (Summary)
9167 @findex gnus-article-strip-multiple-blank-lines
9168 Replace all blank lines with empty lines and then all multiple empty
9169 lines with a single empty line.
9170 (@code{gnus-article-strip-multiple-blank-lines}).
9171
9172 @item W E t
9173 @kindex W E t (Summary)
9174 @findex gnus-article-remove-trailing-blank-lines
9175 Remove all blank lines at the end of the article
9176 (@code{gnus-article-remove-trailing-blank-lines}).
9177
9178 @item W E a
9179 @kindex W E a (Summary)
9180 @findex gnus-article-strip-blank-lines
9181 Do all the three commands above
9182 (@code{gnus-article-strip-blank-lines}).
9183
9184 @item W E A
9185 @kindex W E A (Summary)
9186 @findex gnus-article-strip-all-blank-lines
9187 Remove all blank lines
9188 (@code{gnus-article-strip-all-blank-lines}).
9189
9190 @item W E s
9191 @kindex W E s (Summary)
9192 @findex gnus-article-strip-leading-space
9193 Remove all white space from the beginning of all lines of the article
9194 body (@code{gnus-article-strip-leading-space}).
9195
9196 @item W E e
9197 @kindex W E e (Summary)
9198 @findex gnus-article-strip-trailing-space
9199 Remove all white space from the end of all lines of the article
9200 body (@code{gnus-article-strip-trailing-space}).
9201
9202 @end table
9203
9204 @xref{Customizing Articles}, for how to wash articles automatically.
9205
9206
9207 @node Article Header
9208 @subsection Article Header
9209
9210 These commands perform various transformations of article header.
9211
9212 @table @kbd
9213
9214 @item W G u
9215 @kindex W G u (Summary)
9216 @findex gnus-article-treat-unfold-headers
9217 Unfold folded header lines (@code{gnus-article-treat-unfold-headers}).
9218
9219 @item W G n
9220 @kindex W G n (Summary)
9221 @findex gnus-article-treat-fold-newsgroups
9222 Fold the @code{Newsgroups} and @code{Followup-To} headers
9223 (@code{gnus-article-treat-fold-newsgroups}).
9224
9225 @item W G f
9226 @kindex W G f (Summary)
9227 @findex gnus-article-treat-fold-headers
9228 Fold all the message headers
9229 (@code{gnus-article-treat-fold-headers}).
9230
9231 @item W E w
9232 @kindex W E w (Summary)
9233 @findex gnus-article-remove-leading-whitespace
9234 Remove excessive whitespace from all headers
9235 (@code{gnus-article-remove-leading-whitespace}).
9236
9237 @end table
9238
9239
9240 @node Article Buttons
9241 @subsection Article Buttons
9242 @cindex buttons
9243
9244 People often include references to other stuff in articles, and it would
9245 be nice if Gnus could just fetch whatever it is that people talk about
9246 with the minimum of fuzz when you hit @kbd{RET} or use the middle mouse
9247 button on these references.
9248
9249 @vindex gnus-button-man-handler
9250 Gnus adds @dfn{buttons} to certain standard references by default:
9251 Well-formed URLs, mail addresses, Message-IDs, Info links, man pages and
9252 Emacs or Gnus related references.  This is controlled by two variables,
9253 one that handles article bodies and one that handles article heads:
9254
9255 @table @code
9256
9257 @item gnus-button-alist
9258 @vindex gnus-button-alist
9259 This is an alist where each entry has this form:
9260
9261 @lisp
9262 (@var{regexp} @var{button-par} @var{use-p} @var{function} @var{data-par})
9263 @end lisp
9264
9265 @table @var
9266
9267 @item regexp
9268 All text that match this regular expression (case insensitive) will be
9269 considered an external reference.  Here's a typical regexp that matches
9270 embedded URLs: @samp{<URL:\\([^\n\r>]*\\)>}.  This can also be a
9271 variable containing a regexp, useful variables to use include
9272 @code{gnus-button-url-regexp} and @code{gnus-button-mid-or-mail-regexp}.
9273
9274 @item button-par
9275 Gnus has to know which parts of the matches is to be highlighted.  This
9276 is a number that says what sub-expression of the regexp is to be
9277 highlighted.  If you want it all highlighted, you use 0 here.
9278
9279 @item use-p
9280 This form will be @code{eval}ed, and if the result is non-@code{nil},
9281 this is considered a match.  This is useful if you want extra sifting to
9282 avoid false matches.  Often variables named
9283 @code{gnus-button-@var{*}-level} are used here, @xref{Article Button
9284 Levels}, but any other form may be used too.
9285
9286 @c @code{use-p} is @code{eval}ed only if @code{regexp} matches.
9287
9288 @item function
9289 This function will be called when you click on this button.
9290
9291 @item data-par
9292 As with @var{button-par}, this is a sub-expression number, but this one
9293 says which part of the match is to be sent as data to @var{function}.
9294
9295 @end table
9296
9297 So the full entry for buttonizing URLs is then
9298
9299 @lisp
9300 ("<URL:\\([^\n\r>]*\\)>" 0 t gnus-button-url 1)
9301 @end lisp
9302
9303 @item gnus-header-button-alist
9304 @vindex gnus-header-button-alist
9305 This is just like the other alist, except that it is applied to the
9306 article head only, and that each entry has an additional element that is
9307 used to say what headers to apply the buttonize coding to:
9308
9309 @lisp
9310 (@var{header} @var{regexp} @var{button-par} @var{use-p} @var{function} @var{data-par})
9311 @end lisp
9312
9313 @var{header} is a regular expression.
9314 @end table
9315
9316 @subsubsection Related variables and functions
9317
9318 @table @code
9319 @item gnus-button-@var{*}-level
9320 @xref{Article Button Levels}.
9321
9322 @c Stuff related to gnus-button-browse-level
9323
9324 @item gnus-button-url-regexp
9325 @vindex gnus-button-url-regexp
9326 A regular expression that matches embedded URLs.  It is used in the
9327 default values of the variables above.
9328
9329 @c Stuff related to gnus-button-man-level
9330
9331 @item gnus-button-man-handler
9332 @vindex gnus-button-man-handler
9333 The function to use for displaying man pages.  It must take at least one
9334 argument with a string naming the man page.
9335
9336 @c Stuff related to gnus-button-message-level
9337
9338 @item gnus-button-mid-or-mail-regexp
9339 @vindex gnus-button-mid-or-mail-regexp
9340 Regular expression that matches a message ID or a mail address.
9341
9342 @item gnus-button-prefer-mid-or-mail
9343 @vindex gnus-button-prefer-mid-or-mail
9344 This variable determines what to do when the button on a string as
9345 @samp{foo123@@bar.invalid} is pushed.  Strings like this can be either a
9346 message ID or a mail address.  If it is one of the symbols @code{mid} or
9347 @code{mail}, Gnus will always assume that the string is a message ID or
9348 a mail address, respectively.  If this variable is set to the symbol
9349 @code{ask}, always query the user what to do.  If it is a function, this
9350 function will be called with the string as its only argument.  The
9351 function must return @code{mid}, @code{mail}, @code{invalid} or
9352 @code{ask}.  The default value is the function
9353 @code{gnus-button-mid-or-mail-heuristic}.
9354
9355 @item gnus-button-mid-or-mail-heuristic
9356 @findex gnus-button-mid-or-mail-heuristic
9357 Function that guesses whether its argument is a message ID or a mail
9358 address.  Returns @code{mid} if it's a message IDs, @code{mail} if
9359 it's a mail address, @code{ask} if unsure and @code{invalid} if the
9360 string is invalid.
9361
9362 @item gnus-button-mid-or-mail-heuristic-alist
9363 @vindex gnus-button-mid-or-mail-heuristic-alist
9364 An alist of @code{(RATE . REGEXP)} pairs used by the function
9365 @code{gnus-button-mid-or-mail-heuristic}.
9366
9367 @c Misc stuff
9368
9369 @item gnus-article-button-face
9370 @vindex gnus-article-button-face
9371 Face used on buttons.
9372
9373 @item gnus-article-mouse-face
9374 @vindex gnus-article-mouse-face
9375 Face used when the mouse cursor is over a button.
9376
9377 @end table
9378
9379 @xref{Customizing Articles}, for how to buttonize articles automatically.
9380
9381
9382 @node Article Button Levels
9383 @subsection Article button levels
9384 @cindex button levels
9385 The higher the value of the variables @code{gnus-button-@var{*}-level},
9386 the more buttons will appear.  If the level is zero, no corresponding
9387 buttons are displayed.  With the default value (which is 5) you should
9388 already see quite a lot of buttons.  With higher levels, you will see
9389 more buttons, but you may also get more false positives.  To avoid them,
9390 you can set the variables @code{gnus-button-@var{*}-level} local to
9391 specific groups (@pxref{Group Parameters}).  Here's an example for the
9392 variable @code{gnus-parameters}:
9393
9394 @lisp
9395 ;; @r{increase @code{gnus-button-*-level} in some groups:}
9396 (setq gnus-parameters
9397       '(("\\<\\(emacs\\|gnus\\)\\>" (gnus-button-emacs-level 10))
9398         ("\\<unix\\>"               (gnus-button-man-level 10))
9399         ("\\<tex\\>"                (gnus-button-tex-level 10))))
9400 @end lisp
9401
9402 @table @code
9403
9404 @item gnus-button-browse-level
9405 @vindex gnus-button-browse-level
9406 Controls the display of references to message IDs, mail addresses and
9407 news URLs.  Related variables and functions include
9408 @code{gnus-button-url-regexp}, @code{browse-url}, and
9409 @code{browse-url-browser-function}.
9410
9411 @item gnus-button-emacs-level
9412 @vindex gnus-button-emacs-level
9413 Controls the display of Emacs or Gnus references.  Related functions are
9414 @code{gnus-button-handle-custom},
9415 @code{gnus-button-handle-describe-function},
9416 @code{gnus-button-handle-describe-variable},
9417 @code{gnus-button-handle-symbol},
9418 @code{gnus-button-handle-describe-key},
9419 @code{gnus-button-handle-apropos},
9420 @code{gnus-button-handle-apropos-command},
9421 @code{gnus-button-handle-apropos-variable},
9422 @code{gnus-button-handle-apropos-documentation}, and
9423 @code{gnus-button-handle-library}.
9424
9425 @item gnus-button-man-level
9426 @vindex gnus-button-man-level
9427 Controls the display of references to (Unix) man pages.
9428 See @code{gnus-button-man-handler}.
9429
9430 @item gnus-button-message-level
9431 @vindex gnus-button-message-level
9432 Controls the display of message IDs, mail addresses and news URLs.
9433 Related variables and functions include
9434 @code{gnus-button-mid-or-mail-regexp},
9435 @code{gnus-button-prefer-mid-or-mail},
9436 @code{gnus-button-mid-or-mail-heuristic}, and
9437 @code{gnus-button-mid-or-mail-heuristic-alist}.
9438
9439 @end table
9440
9441
9442 @node Article Date
9443 @subsection Article Date
9444
9445 The date is most likely generated in some obscure timezone you've never
9446 heard of, so it's quite nice to be able to find out what the time was
9447 when the article was sent.
9448
9449 @table @kbd
9450
9451 @item W T u
9452 @kindex W T u (Summary)
9453 @findex gnus-article-date-ut
9454 Display the date in UT (aka. GMT, aka ZULU)
9455 (@code{gnus-article-date-ut}).
9456
9457 @item W T i
9458 @kindex W T i (Summary)
9459 @findex gnus-article-date-iso8601
9460 @cindex ISO 8601
9461 Display the date in international format, aka. ISO 8601
9462 (@code{gnus-article-date-iso8601}).
9463
9464 @item W T l
9465 @kindex W T l (Summary)
9466 @findex gnus-article-date-local
9467 Display the date in the local timezone (@code{gnus-article-date-local}).
9468
9469 @item W T p
9470 @kindex W T p (Summary)
9471 @findex gnus-article-date-english
9472 Display the date in a format that's easily pronounceable in English
9473 (@code{gnus-article-date-english}).
9474
9475 @item W T s
9476 @kindex W T s (Summary)
9477 @vindex gnus-article-time-format
9478 @findex gnus-article-date-user
9479 @findex format-time-string
9480 Display the date using a user-defined format
9481 (@code{gnus-article-date-user}).  The format is specified by the
9482 @code{gnus-article-time-format} variable, and is a string that's passed
9483 to @code{format-time-string}.  See the documentation of that variable
9484 for a list of possible format specs.
9485
9486 @item W T e
9487 @kindex W T e (Summary)
9488 @findex gnus-article-date-lapsed
9489 @findex gnus-start-date-timer
9490 @findex gnus-stop-date-timer
9491 Say how much time has elapsed between the article was posted and now
9492 (@code{gnus-article-date-lapsed}).  It looks something like:
9493
9494 @example
9495 X-Sent: 6 weeks, 4 days, 1 hour, 3 minutes, 8 seconds ago
9496 @end example
9497
9498 @vindex gnus-article-date-lapsed-new-header
9499 The value of @code{gnus-article-date-lapsed-new-header} determines
9500 whether this header will just be added below the old Date one, or will
9501 replace it.
9502
9503 An advantage of using Gnus to read mail is that it converts simple bugs
9504 into wonderful absurdities.
9505
9506 This line is updated continually by default.  If you wish to switch
9507 that off, say:
9508
9509 @vindex gnus-article-update-lapsed-header
9510 @lisp
9511 (setq gnus-article-update-lapsed-header nil)
9512 @end lisp
9513
9514 in your @file{~/.gnus.el} file.  If you want to stop the updating
9515 dynamically, you can use the @code{gnus-stop-date-timer} command.
9516
9517 @item W T o
9518 @kindex W T o (Summary)
9519 @findex gnus-article-date-original
9520 Display the original date (@code{gnus-article-date-original}).  This can
9521 be useful if you normally use some other conversion function and are
9522 worried that it might be doing something totally wrong.  Say, claiming
9523 that the article was posted in 1854.  Although something like that is
9524 @emph{totally} impossible.  Don't you trust me? *titter*
9525
9526 @end table
9527
9528 @xref{Customizing Articles}, for how to display the date in your
9529 preferred format automatically.
9530
9531
9532 @node Article Display
9533 @subsection Article Display
9534 @cindex picons
9535 @cindex x-face
9536 @cindex smileys
9537 @cindex gravatars
9538
9539 These commands add various frivolous display gimmicks to the article
9540 buffer in Emacs versions that support them.
9541
9542 @code{X-Face} headers are small black-and-white images supplied by the
9543 message headers (@pxref{X-Face}).
9544
9545 @code{Face} headers are small colored images supplied by the message
9546 headers (@pxref{Face}).
9547
9548 Smileys are those little @samp{:-)} symbols that people like to litter
9549 their messages with (@pxref{Smileys}).
9550
9551 Picons, on the other hand, reside on your own system, and Gnus will
9552 try to match the headers to what you have (@pxref{Picons}).
9553
9554 Gravatars reside on-line and are fetched from
9555 @uref{http://www.gravatar.com/} (@pxref{Gravatars}).
9556
9557 All these functions are toggles---if the elements already exist,
9558 they'll be removed.
9559
9560 @table @kbd
9561 @item W D x
9562 @kindex W D x (Summary)
9563 @findex gnus-article-display-x-face
9564 Display an @code{X-Face} in the @code{From} header.
9565 (@code{gnus-article-display-x-face}).
9566
9567 @item W D d
9568 @kindex W D d (Summary)
9569 @findex gnus-article-display-face
9570 Display a @code{Face} in the @code{From} header.
9571 (@code{gnus-article-display-face}).
9572
9573 @item W D s
9574 @kindex W D s (Summary)
9575 @findex gnus-treat-smiley
9576 Display smileys (@code{gnus-treat-smiley}).
9577
9578 @item W D f
9579 @kindex W D f (Summary)
9580 @findex gnus-treat-from-picon
9581 Piconify the @code{From} header (@code{gnus-treat-from-picon}).
9582
9583 @item W D m
9584 @kindex W D m (Summary)
9585 @findex gnus-treat-mail-picon
9586 Piconify all mail headers (i. e., @code{Cc}, @code{To})
9587 (@code{gnus-treat-mail-picon}).
9588
9589 @item W D n
9590 @kindex W D n (Summary)
9591 @findex gnus-treat-newsgroups-picon
9592 Piconify all news headers (i. e., @code{Newsgroups} and
9593 @code{Followup-To}) (@code{gnus-treat-newsgroups-picon}).
9594
9595 @item W D g
9596 @kindex W D g (Summary)
9597 @findex gnus-treat-from-gravatar
9598 Gravatarify the @code{From} header (@code{gnus-treat-from-gravatar}).
9599
9600 @item W D h
9601 @kindex W D h (Summary)
9602 @findex gnus-treat-mail-gravatar
9603 Gravatarify all mail headers (i. e., @code{Cc}, @code{To})
9604 (@code{gnus-treat-from-gravatar}).
9605
9606 @item W D D
9607 @kindex W D D (Summary)
9608 @findex gnus-article-remove-images
9609 Remove all images from the article buffer
9610 (@code{gnus-article-remove-images}).
9611
9612 @item W D W
9613 @kindex W D W (Summary)
9614 @findex gnus-html-show-images
9615 If you're reading an @acronym{HTML} article rendered with
9616 @code{gnus-article-html}, then you can insert any blocked images in
9617 the buffer with this command.
9618 (@code{gnus-html-show-images}).
9619
9620 @end table
9621
9622
9623
9624 @node Article Signature
9625 @subsection Article Signature
9626 @cindex signatures
9627 @cindex article signature
9628
9629 @vindex gnus-signature-separator
9630 Each article is divided into two parts---the head and the body.  The
9631 body can be divided into a signature part and a text part.  The variable
9632 that says what is to be considered a signature is
9633 @code{gnus-signature-separator}.  This is normally the standard
9634 @samp{^-- $} as mandated by son-of-RFC 1036.  However, many people use
9635 non-standard signature separators, so this variable can also be a list
9636 of regular expressions to be tested, one by one.  (Searches are done
9637 from the end of the body towards the beginning.)  One likely value is:
9638
9639 @lisp
9640 (setq gnus-signature-separator
9641       '("^-- $"         ; @r{The standard}
9642         "^-- *$"        ; @r{A common mangling}
9643         "^-------*$"    ; @r{Many people just use a looong}
9644                         ; @r{line of dashes.  Shame!}
9645         "^ *--------*$" ; @r{Double-shame!}
9646         "^________*$"   ; @r{Underscores are also popular}
9647         "^========*$")) ; @r{Pervert!}
9648 @end lisp
9649
9650 The more permissive you are, the more likely it is that you'll get false
9651 positives.
9652
9653 @vindex gnus-signature-limit
9654 @code{gnus-signature-limit} provides a limit to what is considered a
9655 signature when displaying articles.
9656
9657 @enumerate
9658 @item
9659 If it is an integer, no signature may be longer (in characters) than
9660 that integer.
9661 @item
9662 If it is a floating point number, no signature may be longer (in lines)
9663 than that number.
9664 @item
9665 If it is a function, the function will be called without any parameters,
9666 and if it returns @code{nil}, there is no signature in the buffer.
9667 @item
9668 If it is a string, it will be used as a regexp.  If it matches, the text
9669 in question is not a signature.
9670 @end enumerate
9671
9672 This variable can also be a list where the elements may be of the types
9673 listed above.  Here's an example:
9674
9675 @lisp
9676 (setq gnus-signature-limit
9677       '(200.0 "^---*Forwarded article"))
9678 @end lisp
9679
9680 This means that if there are more than 200 lines after the signature
9681 separator, or the text after the signature separator is matched by
9682 the regular expression @samp{^---*Forwarded article}, then it isn't a
9683 signature after all.
9684
9685
9686 @node Article Miscellanea
9687 @subsection Article Miscellanea
9688
9689 @table @kbd
9690 @item A t
9691 @kindex A t (Summary)
9692 @findex gnus-article-babel
9693 Translate the article from one language to another
9694 (@code{gnus-article-babel}).
9695
9696 @end table
9697
9698
9699 @node MIME Commands
9700 @section MIME Commands
9701 @cindex MIME decoding
9702 @cindex attachments
9703 @cindex viewing attachments
9704
9705 The following commands all understand the numerical prefix.  For
9706 instance, @kbd{3 K v} means ``view the third @acronym{MIME} part''.
9707
9708 @table @kbd
9709 @item b
9710 @itemx K v
9711 @kindex b (Summary)
9712 @kindex K v (Summary)
9713 View the @acronym{MIME} part.
9714
9715 @item K o
9716 @kindex K o (Summary)
9717 Save the @acronym{MIME} part.
9718
9719 @item K O
9720 @kindex K O (Summary)
9721 Prompt for a file name, then save the @acronym{MIME} part and strip it
9722 from the article.  The stripped @acronym{MIME} object will be referred
9723 via the message/external-body @acronym{MIME} type.
9724
9725 @item K r
9726 @kindex K r (Summary)
9727 Replace the @acronym{MIME} part with an external body.
9728
9729 @item K d
9730 @kindex K d (Summary)
9731 Delete the @acronym{MIME} part and add some information about the
9732 removed part.
9733
9734 @item K c
9735 @kindex K c (Summary)
9736 Copy the @acronym{MIME} part.
9737
9738 @item K e
9739 @kindex K e (Summary)
9740 View the @acronym{MIME} part externally.
9741
9742 @item K i
9743 @kindex K i (Summary)
9744 View the @acronym{MIME} part internally.
9745
9746 @item K |
9747 @kindex K | (Summary)
9748 Pipe the @acronym{MIME} part to an external command.
9749 @end table
9750
9751 The rest of these @acronym{MIME} commands do not use the numerical prefix in
9752 the same manner:
9753
9754 @table @kbd
9755 @item K H
9756 @kindex K H (Summary)
9757 @findex gnus-article-browse-html-article
9758 View @samp{text/html} parts of the current article with a WWW browser.
9759 Inline images embedded in a message using the @code{cid} scheme, as they
9760 are generally considered to be safe, will be processed properly.  The
9761 message header is added to the beginning of every @acronym{HTML} part
9762 unless the prefix argument is given.
9763
9764 Warning: Spammers use links to images (using the @code{http} scheme) in
9765 @acronym{HTML} articles to verify whether you have read the message.  As
9766 this command passes the @acronym{HTML} content to the browser without
9767 eliminating these ``web bugs'' you should only use it for mails from
9768 trusted senders.
9769
9770 If you always want to display @acronym{HTML} parts in the browser, set
9771 @code{mm-text-html-renderer} to @code{nil}.
9772
9773 This command creates temporary files to pass @acronym{HTML} contents
9774 including images if any to the browser, and deletes them when exiting
9775 the group (if you want).
9776
9777 @item K b
9778 @kindex K b (Summary)
9779 Make all the @acronym{MIME} parts have buttons in front of them.  This is
9780 mostly useful if you wish to save (or perform other actions) on inlined
9781 parts.
9782
9783 @item K m
9784 @kindex K m (Summary)
9785 @findex gnus-summary-repair-multipart
9786 Some multipart messages are transmitted with missing or faulty headers.
9787 This command will attempt to ``repair'' these messages so that they can
9788 be viewed in a more pleasant manner
9789 (@code{gnus-summary-repair-multipart}).
9790
9791 @item X m
9792 @kindex X m (Summary)
9793 @findex gnus-summary-save-parts
9794 Save all parts matching a @acronym{MIME} type to a directory
9795 (@code{gnus-summary-save-parts}).  Understands the process/prefix
9796 convention (@pxref{Process/Prefix}).
9797
9798 @item M-t
9799 @kindex M-t (Summary)
9800 @findex gnus-summary-toggle-display-buttonized
9801 Toggle the buttonized display of the article buffer
9802 (@code{gnus-summary-toggle-display-buttonized}).
9803
9804 @item W M w
9805 @kindex W M w (Summary)
9806 @findex gnus-article-decode-mime-words
9807 Decode RFC 2047-encoded words in the article headers
9808 (@code{gnus-article-decode-mime-words}).
9809
9810 @item W M c
9811 @kindex W M c (Summary)
9812 @findex gnus-article-decode-charset
9813 Decode encoded article bodies as well as charsets
9814 (@code{gnus-article-decode-charset}).
9815
9816 This command looks in the @code{Content-Type} header to determine the
9817 charset.  If there is no such header in the article, you can give it a
9818 prefix, which will prompt for the charset to decode as.  In regional
9819 groups where people post using some common encoding (but do not
9820 include @acronym{MIME} headers), you can set the @code{charset} group/topic
9821 parameter to the required charset (@pxref{Group Parameters}).
9822
9823 @item W M v
9824 @kindex W M v (Summary)
9825 @findex gnus-mime-view-all-parts
9826 View all the @acronym{MIME} parts in the current article
9827 (@code{gnus-mime-view-all-parts}).
9828
9829 @end table
9830
9831 Relevant variables:
9832
9833 @table @code
9834 @item gnus-ignored-mime-types
9835 @vindex gnus-ignored-mime-types
9836 This is a list of regexps.  @acronym{MIME} types that match a regexp from
9837 this list will be completely ignored by Gnus.  The default value is
9838 @code{nil}.
9839
9840 To have all Vcards be ignored, you'd say something like this:
9841
9842 @lisp
9843 (setq gnus-ignored-mime-types
9844       '("text/x-vcard"))
9845 @end lisp
9846
9847 @item gnus-article-loose-mime
9848 @vindex gnus-article-loose-mime
9849 If non-@code{nil}, Gnus won't require the @samp{MIME-Version} header
9850 before interpreting the message as a @acronym{MIME} message.  This helps
9851 when reading messages from certain broken mail user agents.  The
9852 default is @code{t}.
9853
9854 @item gnus-article-emulate-mime
9855 @vindex gnus-article-emulate-mime
9856 @cindex uuencode
9857 @cindex yEnc
9858 There are other, non-@acronym{MIME} encoding methods used.  The most common
9859 is @samp{uuencode}, but yEncode is also getting to be popular.  If
9860 this variable is non-@code{nil}, Gnus will look in message bodies to
9861 see if it finds these encodings, and if so, it'll run them through the
9862 Gnus @acronym{MIME} machinery.  The default is @code{t}.  Only
9863 single-part yEnc encoded attachments can be decoded.  There's no support
9864 for encoding in Gnus.
9865
9866 @item gnus-unbuttonized-mime-types
9867 @vindex gnus-unbuttonized-mime-types
9868 This is a list of regexps.  @acronym{MIME} types that match a regexp from
9869 this list won't have @acronym{MIME} buttons inserted unless they aren't
9870 displayed or this variable is overridden by
9871 @code{gnus-buttonized-mime-types}.  The default value is
9872 @code{(".*/.*")}.  This variable is only used when
9873 @code{gnus-inhibit-mime-unbuttonizing} is @code{nil}.
9874
9875 @item gnus-buttonized-mime-types
9876 @vindex gnus-buttonized-mime-types
9877 This is a list of regexps.  @acronym{MIME} types that match a regexp from
9878 this list will have @acronym{MIME} buttons inserted unless they aren't
9879 displayed.  This variable overrides
9880 @code{gnus-unbuttonized-mime-types}.  The default value is @code{nil}.
9881 This variable is only used when @code{gnus-inhibit-mime-unbuttonizing}
9882 is @code{nil}.
9883
9884 To see e.g. security buttons but no other buttons, you could set this
9885 variable to @code{("multipart/signed")} and leave
9886 @code{gnus-unbuttonized-mime-types} at the default value.
9887
9888 You could also add @code{"multipart/alternative"} to this list to
9889 display radio buttons that allow you to choose one of two media types
9890 those mails include.  See also @code{mm-discouraged-alternatives}
9891 (@pxref{Display Customization, ,Display Customization, emacs-mime, The
9892 Emacs MIME Manual}).
9893
9894 @item gnus-inhibit-mime-unbuttonizing
9895 @vindex gnus-inhibit-mime-unbuttonizing
9896 If this is non-@code{nil}, then all @acronym{MIME} parts get buttons.  The
9897 default value is @code{nil}.
9898
9899 @item gnus-article-mime-part-function
9900 @vindex gnus-article-mime-part-function
9901 For each @acronym{MIME} part, this function will be called with the @acronym{MIME}
9902 handle as the parameter.  The function is meant to be used to allow
9903 users to gather information from the article (e. g., add Vcard info to
9904 the bbdb database) or to do actions based on parts (e. g., automatically
9905 save all jpegs into some directory).
9906
9907 Here's an example function the does the latter:
9908
9909 @lisp
9910 (defun my-save-all-jpeg-parts (handle)
9911   (when (equal (car (mm-handle-type handle)) "image/jpeg")
9912     (with-temp-buffer
9913       (insert (mm-get-part handle))
9914       (write-region (point-min) (point-max)
9915                     (read-file-name "Save jpeg to: ")))))
9916 (setq gnus-article-mime-part-function
9917       'my-save-all-jpeg-parts)
9918 @end lisp
9919
9920 @vindex gnus-mime-multipart-functions
9921 @item gnus-mime-multipart-functions
9922 Alist of @acronym{MIME} multipart types and functions to handle them.
9923
9924 @vindex gnus-mime-display-multipart-alternative-as-mixed
9925 @item gnus-mime-display-multipart-alternative-as-mixed
9926 Display "multipart/alternative" parts as "multipart/mixed".
9927
9928 @vindex gnus-mime-display-multipart-related-as-mixed
9929 @item gnus-mime-display-multipart-related-as-mixed
9930 Display "multipart/related" parts as "multipart/mixed".
9931
9932 If displaying @samp{text/html} is discouraged, see
9933 @code{mm-discouraged-alternatives}, images or other material inside a
9934 "multipart/related" part might be overlooked when this variable is
9935 @code{nil}.  @ref{Display Customization, Display Customization, ,
9936 emacs-mime, Emacs-Mime Manual}.
9937
9938 @vindex gnus-mime-display-multipart-as-mixed
9939 @item gnus-mime-display-multipart-as-mixed
9940 Display "multipart" parts as "multipart/mixed".  If @code{t}, it
9941 overrides @code{nil} values of
9942 @code{gnus-mime-display-multipart-alternative-as-mixed} and
9943 @code{gnus-mime-display-multipart-related-as-mixed}.
9944
9945 @vindex mm-file-name-rewrite-functions
9946 @item mm-file-name-rewrite-functions
9947 List of functions used for rewriting file names of @acronym{MIME} parts.
9948 Each function takes a file name as input and returns a file name.
9949
9950 Ready-made functions include@*
9951 @code{mm-file-name-delete-whitespace},
9952 @code{mm-file-name-trim-whitespace},
9953 @code{mm-file-name-collapse-whitespace}, and
9954 @code{mm-file-name-replace-whitespace}.  The later uses the value of
9955 the variable @code{mm-file-name-replace-whitespace} to replace each
9956 whitespace character in a file name with that string; default value
9957 is @code{"_"} (a single underscore).
9958 @findex mm-file-name-delete-whitespace
9959 @findex mm-file-name-trim-whitespace
9960 @findex mm-file-name-collapse-whitespace
9961 @findex mm-file-name-replace-whitespace
9962 @vindex mm-file-name-replace-whitespace
9963
9964 The standard functions @code{capitalize}, @code{downcase},
9965 @code{upcase}, and @code{upcase-initials} may be useful, too.
9966
9967 Everybody knows that whitespace characters in file names are evil,
9968 except those who don't know.  If you receive lots of attachments from
9969 such unenlightened users, you can make live easier by adding
9970
9971 @lisp
9972 (setq mm-file-name-rewrite-functions
9973       '(mm-file-name-trim-whitespace
9974         mm-file-name-collapse-whitespace
9975         mm-file-name-replace-whitespace))
9976 @end lisp
9977
9978 @noindent
9979 to your @file{~/.gnus.el} file.
9980
9981 @end table
9982
9983
9984 @node Charsets
9985 @section Charsets
9986 @cindex charsets
9987
9988 People use different charsets, and we have @acronym{MIME} to let us know what
9989 charsets they use.  Or rather, we wish we had.  Many people use
9990 newsreaders and mailers that do not understand or use @acronym{MIME}, and
9991 just send out messages without saying what character sets they use.  To
9992 help a bit with this, some local news hierarchies have policies that say
9993 what character set is the default.  For instance, the @samp{fj}
9994 hierarchy uses @code{iso-2022-jp}.
9995
9996 @vindex gnus-group-charset-alist
9997 This knowledge is encoded in the @code{gnus-group-charset-alist}
9998 variable, which is an alist of regexps (use the first item to match full
9999 group names) and default charsets to be used when reading these groups.
10000
10001 @vindex gnus-newsgroup-ignored-charsets
10002 In addition, some people do use soi-disant @acronym{MIME}-aware agents that
10003 aren't.  These blithely mark messages as being in @code{iso-8859-1}
10004 even if they really are in @code{koi-8}.  To help here, the
10005 @code{gnus-newsgroup-ignored-charsets} variable can be used.  The
10006 charsets that are listed here will be ignored.  The variable can be
10007 set on a group-by-group basis using the group parameters (@pxref{Group
10008 Parameters}).  The default value is @code{(unknown-8bit x-unknown)},
10009 which includes values some agents insist on having in there.
10010
10011 @vindex gnus-group-posting-charset-alist
10012 When posting, @code{gnus-group-posting-charset-alist} is used to
10013 determine which charsets should not be encoded using the @acronym{MIME}
10014 encodings.  For instance, some hierarchies discourage using
10015 quoted-printable header encoding.
10016
10017 This variable is an alist of regexps and permitted unencoded charsets
10018 for posting.  Each element of the alist has the form @code{(}@var{test
10019 header body-list}@code{)}, where:
10020
10021 @table @var
10022 @item test
10023 is either a regular expression matching the newsgroup header or a
10024 variable to query,
10025 @item header
10026 is the charset which may be left unencoded in the header (@code{nil}
10027 means encode all charsets),
10028 @item body-list
10029 is a list of charsets which may be encoded using 8bit content-transfer
10030 encoding in the body, or one of the special values @code{nil} (always
10031 encode using quoted-printable) or @code{t} (always use 8bit).
10032 @end table
10033
10034 @cindex Russian
10035 @cindex koi8-r
10036 @cindex koi8-u
10037 @cindex iso-8859-5
10038 @cindex coding system aliases
10039 @cindex preferred charset
10040
10041 @xref{Encoding Customization, , Encoding Customization, emacs-mime,
10042 The Emacs MIME Manual}, for additional variables that control which
10043 MIME charsets are used when sending messages.
10044
10045 Other charset tricks that may be useful, although not Gnus-specific:
10046
10047 If there are several @acronym{MIME} charsets that encode the same Emacs
10048 charset, you can choose what charset to use by saying the following:
10049
10050 @lisp
10051 (put-charset-property 'cyrillic-iso8859-5
10052                       'preferred-coding-system 'koi8-r)
10053 @end lisp
10054
10055 This means that Russian will be encoded using @code{koi8-r} instead of
10056 the default @code{iso-8859-5} @acronym{MIME} charset.
10057
10058 If you want to read messages in @code{koi8-u}, you can cheat and say
10059
10060 @lisp
10061 (define-coding-system-alias 'koi8-u 'koi8-r)
10062 @end lisp
10063
10064 This will almost do the right thing.
10065
10066 And finally, to read charsets like @code{windows-1251}, you can say
10067 something like
10068
10069 @lisp
10070 (codepage-setup 1251)
10071 (define-coding-system-alias 'windows-1251 'cp1251)
10072 @end lisp
10073
10074
10075 @node Article Commands
10076 @section Article Commands
10077
10078 @table @kbd
10079
10080 @item A P
10081 @cindex PostScript
10082 @cindex printing
10083 @kindex A P (Summary)
10084 @vindex gnus-ps-print-hook
10085 @findex gnus-summary-print-article
10086 Generate and print a PostScript image of the article buffer
10087 (@code{gnus-summary-print-article}).  @code{gnus-ps-print-hook} will
10088 be run just before printing the buffer.  An alternative way to print
10089 article is to use Muttprint (@pxref{Saving Articles}).
10090
10091 @item A C
10092 @vindex gnus-fetch-partial-articles
10093 @findex gnus-summary-show-complete-article
10094 If @code{<backend>-fetch-partial-articles} is non-@code{nil}, Gnus will
10095 fetch partial articles, if the backend it fetches them from supports
10096 it.  Currently only @code{nnimap} does.  If you're looking at a
10097 partial article, and want to see the complete article instead, then
10098 the @kbd{A C} command (@code{gnus-summary-show-complete-article}) will
10099 do so.
10100
10101 @end table
10102
10103
10104 @node Summary Sorting
10105 @section Summary Sorting
10106 @cindex summary sorting
10107
10108 You can have the summary buffer sorted in various ways, even though I
10109 can't really see why you'd want that.
10110
10111 @table @kbd
10112
10113 @item C-c C-s C-n
10114 @kindex C-c C-s C-n (Summary)
10115 @findex gnus-summary-sort-by-number
10116 Sort by article number (@code{gnus-summary-sort-by-number}).
10117
10118 @item C-c C-s C-m C-n
10119 @kindex C-c C-s C-n (Summary)
10120 @findex gnus-summary-sort-by-most-recent-number
10121 Sort by most recent article number
10122 (@code{gnus-summary-sort-by-most-recent-number}).
10123
10124 @item C-c C-s C-a
10125 @kindex C-c C-s C-a (Summary)
10126 @findex gnus-summary-sort-by-author
10127 Sort by author (@code{gnus-summary-sort-by-author}).
10128
10129 @item C-c C-s C-t
10130 @kindex C-c C-s C-t (Summary)
10131 @findex gnus-summary-sort-by-recipient
10132 Sort by recipient (@code{gnus-summary-sort-by-recipient}).
10133
10134 @item C-c C-s C-s
10135 @kindex C-c C-s C-s (Summary)
10136 @findex gnus-summary-sort-by-subject
10137 Sort by subject (@code{gnus-summary-sort-by-subject}).
10138
10139 @item C-c C-s C-d
10140 @kindex C-c C-s C-d (Summary)
10141 @findex gnus-summary-sort-by-date
10142 Sort by date (@code{gnus-summary-sort-by-date}).
10143
10144 @item C-c C-s C-m C-d
10145 @kindex C-c C-s C-m C-d (Summary)
10146 @findex gnus-summary-sort-by-most-recent-date
10147 Sort by most recent date (@code{gnus-summary-sort-by-most-recent-date}).
10148
10149 @item C-c C-s C-l
10150 @kindex C-c C-s C-l (Summary)
10151 @findex gnus-summary-sort-by-lines
10152 Sort by lines (@code{gnus-summary-sort-by-lines}).
10153
10154 @item C-c C-s C-c
10155 @kindex C-c C-s C-c (Summary)
10156 @findex gnus-summary-sort-by-chars
10157 Sort by article length (@code{gnus-summary-sort-by-chars}).
10158
10159 @item C-c C-s C-i
10160 @kindex C-c C-s C-i (Summary)
10161 @findex gnus-summary-sort-by-score
10162 Sort by score (@code{gnus-summary-sort-by-score}).
10163
10164 @item C-c C-s C-r
10165 @kindex C-c C-s C-r (Summary)
10166 @findex gnus-summary-sort-by-random
10167 Randomize (@code{gnus-summary-sort-by-random}).
10168
10169 @item C-c C-s C-o
10170 @kindex C-c C-s C-o (Summary)
10171 @findex gnus-summary-sort-by-original
10172 Sort using the default sorting method
10173 (@code{gnus-summary-sort-by-original}).
10174 @end table
10175
10176 These functions will work both when you use threading and when you don't
10177 use threading.  In the latter case, all summary lines will be sorted,
10178 line by line.  In the former case, sorting will be done on a
10179 root-by-root basis, which might not be what you were looking for.  To
10180 toggle whether to use threading, type @kbd{T T} (@pxref{Thread
10181 Commands}).
10182
10183 If a prefix argument if given, the sort order is reversed.
10184
10185
10186 @node Finding the Parent
10187 @section Finding the Parent
10188 @cindex parent articles
10189 @cindex referring articles
10190
10191 @table @kbd
10192 @item ^
10193 @kindex ^ (Summary)
10194 @findex gnus-summary-refer-parent-article
10195 If you'd like to read the parent of the current article, and it is not
10196 displayed in the summary buffer, you might still be able to.  That is,
10197 if the current group is fetched by @acronym{NNTP}, the parent hasn't expired
10198 and the @code{References} in the current article are not mangled, you
10199 can just press @kbd{^} or @kbd{A r}
10200 (@code{gnus-summary-refer-parent-article}).  If everything goes well,
10201 you'll get the parent.  If the parent is already displayed in the
10202 summary buffer, point will just move to this article.
10203
10204 If given a positive numerical prefix, fetch that many articles back into
10205 the ancestry.  If given a negative numerical prefix, fetch just that
10206 ancestor.  So if you say @kbd{3 ^}, Gnus will fetch the parent, the
10207 grandparent and the grandgrandparent of the current article.  If you say
10208 @kbd{-3 ^}, Gnus will only fetch the grandgrandparent of the current
10209 article.
10210
10211 @item A R (Summary)
10212 @findex gnus-summary-refer-references
10213 @kindex A R (Summary)
10214 Fetch all articles mentioned in the @code{References} header of the
10215 article (@code{gnus-summary-refer-references}).
10216
10217 @item A T (Summary)
10218 @findex gnus-summary-refer-thread
10219 @kindex A T (Summary)
10220 Display the full thread where the current article appears
10221 (@code{gnus-summary-refer-thread}).  This command has to fetch all the
10222 headers in the current group to work, so it usually takes a while.  If
10223 you do it often, you may consider setting @code{gnus-fetch-old-headers}
10224 to @code{invisible} (@pxref{Filling In Threads}).  This won't have any
10225 visible effects normally, but it'll make this command work a whole lot
10226 faster.  Of course, it'll make group entry somewhat slow.
10227
10228 @vindex gnus-refer-thread-limit
10229 The @code{gnus-refer-thread-limit} variable says how many old (i. e.,
10230 articles before the first displayed in the current group) headers to
10231 fetch when doing this command.  The default is 200.  If @code{t}, all
10232 the available headers will be fetched.  This variable can be overridden
10233 by giving the @kbd{A T} command a numerical prefix.
10234
10235 @item M-^ (Summary)
10236 @findex gnus-summary-refer-article
10237 @kindex M-^ (Summary)
10238 @cindex Message-ID
10239 @cindex fetching by Message-ID
10240 You can also ask Gnus for an arbitrary article, no matter what group it
10241 belongs to.  @kbd{M-^} (@code{gnus-summary-refer-article}) will ask you
10242 for a @code{Message-ID}, which is one of those long, hard-to-read
10243 thingies that look something like @samp{<38o6up$6f2@@hymir.ifi.uio.no>}.
10244 You have to get it all exactly right.  No fuzzy searches, I'm afraid.
10245
10246 Gnus looks for the @code{Message-ID} in the headers that have already
10247 been fetched, but also tries all the select methods specified by
10248 @code{gnus-refer-article-method} if it is not found.
10249 @end table
10250
10251 @vindex gnus-refer-article-method
10252 If the group you are reading is located on a back end that does not
10253 support fetching by @code{Message-ID} very well (like @code{nnspool}),
10254 you can set @code{gnus-refer-article-method} to an @acronym{NNTP} method.  It
10255 would, perhaps, be best if the @acronym{NNTP} server you consult is the one
10256 updating the spool you are reading from, but that's not really
10257 necessary.
10258
10259 It can also be a list of select methods, as well as the special symbol
10260 @code{current}, which means to use the current select method.  If it
10261 is a list, Gnus will try all the methods in the list until it finds a
10262 match.
10263
10264 Here's an example setting that will first try the current method, and
10265 then ask Google if that fails:
10266
10267 @lisp
10268 (setq gnus-refer-article-method
10269       '(current
10270         (nnweb "google" (nnweb-type google))))
10271 @end lisp
10272
10273 Most of the mail back ends support fetching by @code{Message-ID}, but
10274 do not do a particularly excellent job at it.  That is, @code{nnmbox},
10275 @code{nnbabyl}, @code{nnmaildir}, @code{nnml}, are able to locate
10276 articles from any groups, while @code{nnfolder}, and @code{nnimap} are
10277 only able to locate articles that have been posted to the current
10278 group.  @code{nnmh} does not support this at all.
10279
10280 Fortunately, the special @code{nnregistry} back end is able to locate
10281 articles in any groups, regardless of their back end (@pxref{Registry
10282 Article Refer Method, fetching by @code{Message-ID} using the
10283 registry}).
10284
10285 @node Alternative Approaches
10286 @section Alternative Approaches
10287
10288 Different people like to read news using different methods.  This being
10289 Gnus, we offer a small selection of minor modes for the summary buffers.
10290
10291 @menu
10292 * Pick and Read::               First mark articles and then read them.
10293 * Binary Groups::               Auto-decode all articles.
10294 @end menu
10295
10296
10297 @node Pick and Read
10298 @subsection Pick and Read
10299 @cindex pick and read
10300
10301 Some newsreaders (like @code{nn} and, uhm, @code{Netnews} on VM/CMS) use
10302 a two-phased reading interface.  The user first marks in a summary
10303 buffer the articles she wants to read.  Then she starts reading the
10304 articles with just an article buffer displayed.
10305
10306 @findex gnus-pick-mode
10307 @kindex M-x gnus-pick-mode
10308 Gnus provides a summary buffer minor mode that allows
10309 this---@code{gnus-pick-mode}.  This basically means that a few process
10310 mark commands become one-keystroke commands to allow easy marking, and
10311 it provides one additional command for switching to the summary buffer.
10312
10313 Here are the available keystrokes when using pick mode:
10314
10315 @table @kbd
10316 @item .
10317 @kindex . (Pick)
10318 @findex gnus-pick-article-or-thread
10319 Pick the article or thread on the current line
10320 (@code{gnus-pick-article-or-thread}).  If the variable
10321 @code{gnus-thread-hide-subtree} is true, then this key selects the
10322 entire thread when used at the first article of the thread.  Otherwise,
10323 it selects just the article.  If given a numerical prefix, go to that
10324 thread or article and pick it.  (The line number is normally displayed
10325 at the beginning of the summary pick lines.)
10326
10327 @item SPACE
10328 @kindex SPACE (Pick)
10329 @findex gnus-pick-next-page
10330 Scroll the summary buffer up one page (@code{gnus-pick-next-page}).  If
10331 at the end of the buffer, start reading the picked articles.
10332
10333 @item u
10334 @kindex u (Pick)
10335 @findex gnus-pick-unmark-article-or-thread.
10336 Unpick the thread or article
10337 (@code{gnus-pick-unmark-article-or-thread}).  If the variable
10338 @code{gnus-thread-hide-subtree} is true, then this key unpicks the
10339 thread if used at the first article of the thread.  Otherwise it unpicks
10340 just the article.  You can give this key a numerical prefix to unpick
10341 the thread or article at that line.
10342
10343 @item RET
10344 @kindex RET (Pick)
10345 @findex gnus-pick-start-reading
10346 @vindex gnus-pick-display-summary
10347 Start reading the picked articles (@code{gnus-pick-start-reading}).  If
10348 given a prefix, mark all unpicked articles as read first.  If
10349 @code{gnus-pick-display-summary} is non-@code{nil}, the summary buffer
10350 will still be visible when you are reading.
10351
10352 @end table
10353
10354 All the normal summary mode commands are still available in the
10355 pick-mode, with the exception of @kbd{u}.  However @kbd{!} is available
10356 which is mapped to the same function
10357 @code{gnus-summary-tick-article-forward}.
10358
10359 If this sounds like a good idea to you, you could say:
10360
10361 @lisp
10362 (add-hook 'gnus-summary-mode-hook 'gnus-pick-mode)
10363 @end lisp
10364
10365 @vindex gnus-pick-mode-hook
10366 @code{gnus-pick-mode-hook} is run in pick minor mode buffers.
10367
10368 @vindex gnus-mark-unpicked-articles-as-read
10369 If @code{gnus-mark-unpicked-articles-as-read} is non-@code{nil}, mark
10370 all unpicked articles as read.  The default is @code{nil}.
10371
10372 @vindex gnus-summary-pick-line-format
10373 The summary line format in pick mode is slightly different from the
10374 standard format.  At the beginning of each line the line number is
10375 displayed.  The pick mode line format is controlled by the
10376 @code{gnus-summary-pick-line-format} variable (@pxref{Formatting
10377 Variables}).  It accepts the same format specs that
10378 @code{gnus-summary-line-format} does (@pxref{Summary Buffer Lines}).
10379
10380
10381 @node Binary Groups
10382 @subsection Binary Groups
10383 @cindex binary groups
10384
10385 @findex gnus-binary-mode
10386 @kindex M-x gnus-binary-mode
10387 If you spend much time in binary groups, you may grow tired of hitting
10388 @kbd{X u}, @kbd{n}, @kbd{RET} all the time.  @kbd{M-x gnus-binary-mode}
10389 is a minor mode for summary buffers that makes all ordinary Gnus article
10390 selection functions uudecode series of articles and display the result
10391 instead of just displaying the articles the normal way.
10392
10393 @kindex g (Binary)
10394 @findex gnus-binary-show-article
10395 The only way, in fact, to see the actual articles is the @kbd{g}
10396 command, when you have turned on this mode
10397 (@code{gnus-binary-show-article}).
10398
10399 @vindex gnus-binary-mode-hook
10400 @code{gnus-binary-mode-hook} is called in binary minor mode buffers.
10401
10402
10403 @node Tree Display
10404 @section Tree Display
10405 @cindex trees
10406
10407 @vindex gnus-use-trees
10408 If you don't like the normal Gnus summary display, you might try setting
10409 @code{gnus-use-trees} to @code{t}.  This will create (by default) an
10410 additional @dfn{tree buffer}.  You can execute all summary mode commands
10411 in the tree buffer.
10412
10413 There are a few variables to customize the tree display, of course:
10414
10415 @table @code
10416 @item gnus-tree-mode-hook
10417 @vindex gnus-tree-mode-hook
10418 A hook called in all tree mode buffers.
10419
10420 @item gnus-tree-mode-line-format
10421 @vindex gnus-tree-mode-line-format
10422 A format string for the mode bar in the tree mode buffers (@pxref{Mode
10423 Line Formatting}).  The default is @samp{Gnus: %%b %S %Z}.  For a list
10424 of valid specs, @pxref{Summary Buffer Mode Line}.
10425
10426 @item gnus-selected-tree-face
10427 @vindex gnus-selected-tree-face
10428 Face used for highlighting the selected article in the tree buffer.  The
10429 default is @code{modeline}.
10430
10431 @item gnus-tree-line-format
10432 @vindex gnus-tree-line-format
10433 A format string for the tree nodes.  The name is a bit of a misnomer,
10434 though---it doesn't define a line, but just the node.  The default value
10435 is @samp{%(%[%3,3n%]%)}, which displays the first three characters of
10436 the name of the poster.  It is vital that all nodes are of the same
10437 length, so you @emph{must} use @samp{%4,4n}-like specifiers.
10438
10439 Valid specs are:
10440
10441 @table @samp
10442 @item n
10443 The name of the poster.
10444 @item f
10445 The @code{From} header.
10446 @item N
10447 The number of the article.
10448 @item [
10449 The opening bracket.
10450 @item ]
10451 The closing bracket.
10452 @item s
10453 The subject.
10454 @end table
10455
10456 @xref{Formatting Variables}.
10457
10458 Variables related to the display are:
10459
10460 @table @code
10461 @item gnus-tree-brackets
10462 @vindex gnus-tree-brackets
10463 This is used for differentiating between ``real'' articles and
10464 ``sparse'' articles.  The format is
10465 @example
10466 ((@var{real-open} . @var{real-close})
10467  (@var{sparse-open} . @var{sparse-close})
10468  (@var{dummy-open} . @var{dummy-close}))
10469 @end example
10470 and the default is @code{((?[ . ?]) (?( . ?)) (?@{ . ?@}) (?< . ?>))}.
10471
10472 @item gnus-tree-parent-child-edges
10473 @vindex gnus-tree-parent-child-edges
10474 This is a list that contains the characters used for connecting parent
10475 nodes to their children.  The default is @code{(?- ?\\ ?|)}.
10476
10477 @end table
10478
10479 @item gnus-tree-minimize-window
10480 @vindex gnus-tree-minimize-window
10481 If this variable is non-@code{nil}, Gnus will try to keep the tree
10482 buffer as small as possible to allow more room for the other Gnus
10483 windows.  If this variable is a number, the tree buffer will never be
10484 higher than that number.  The default is @code{t}.  Note that if you
10485 have several windows displayed side-by-side in a frame and the tree
10486 buffer is one of these, minimizing the tree window will also resize all
10487 other windows displayed next to it.
10488
10489 You may also wish to add the following hook to keep the window minimized
10490 at all times:
10491
10492 @lisp
10493 (add-hook 'gnus-configure-windows-hook
10494           'gnus-tree-perhaps-minimize)
10495 @end lisp
10496
10497 @item gnus-generate-tree-function
10498 @vindex gnus-generate-tree-function
10499 @findex gnus-generate-horizontal-tree
10500 @findex gnus-generate-vertical-tree
10501 The function that actually generates the thread tree.  Two predefined
10502 functions are available: @code{gnus-generate-horizontal-tree} and
10503 @code{gnus-generate-vertical-tree} (which is the default).
10504
10505 @end table
10506
10507 Here's an example from a horizontal tree buffer:
10508
10509 @example
10510 @{***@}-(***)-[odd]-[Gun]
10511      |      \[Jan]
10512      |      \[odd]-[Eri]
10513      |      \(***)-[Eri]
10514      |            \[odd]-[Paa]
10515      \[Bjo]
10516      \[Gun]
10517      \[Gun]-[Jor]
10518 @end example
10519
10520 Here's the same thread displayed in a vertical tree buffer:
10521
10522 @example
10523 @group
10524 @{***@}
10525   |--------------------------\-----\-----\
10526 (***)                         [Bjo] [Gun] [Gun]
10527   |--\-----\-----\                          |
10528 [odd] [Jan] [odd] (***)                   [Jor]
10529   |           |     |--\
10530 [Gun]       [Eri] [Eri] [odd]
10531                           |
10532                         [Paa]
10533 @end group
10534 @end example
10535
10536 If you're using horizontal trees, it might be nice to display the trees
10537 side-by-side with the summary buffer.  You could add something like the
10538 following to your @file{~/.gnus.el} file:
10539
10540 @lisp
10541 (setq gnus-use-trees t
10542       gnus-generate-tree-function 'gnus-generate-horizontal-tree
10543       gnus-tree-minimize-window nil)
10544 (gnus-add-configuration
10545  '(article
10546    (vertical 1.0
10547              (horizontal 0.25
10548                          (summary 0.75 point)
10549                          (tree 1.0))
10550              (article 1.0))))
10551 @end lisp
10552
10553 @xref{Window Layout}.
10554
10555
10556 @node Mail Group Commands
10557 @section Mail Group Commands
10558 @cindex mail group commands
10559
10560 Some commands only make sense in mail groups.  If these commands are
10561 invalid in the current group, they will raise a hell and let you know.
10562
10563 All these commands (except the expiry and edit commands) use the
10564 process/prefix convention (@pxref{Process/Prefix}).
10565
10566 @table @kbd
10567
10568 @item B e
10569 @kindex B e (Summary)
10570 @findex gnus-summary-expire-articles
10571 @cindex expiring mail
10572 Run all expirable articles in the current group through the expiry
10573 process (@code{gnus-summary-expire-articles}).  That is, delete all
10574 expirable articles in the group that have been around for a while.
10575 (@pxref{Expiring Mail}).
10576
10577 @item B C-M-e
10578 @kindex B C-M-e (Summary)
10579 @findex gnus-summary-expire-articles-now
10580 @cindex expiring mail
10581 Delete all the expirable articles in the group
10582 (@code{gnus-summary-expire-articles-now}).  This means that @strong{all}
10583 articles eligible for expiry in the current group will
10584 disappear forever into that big @file{/dev/null} in the sky.
10585
10586 @item B DEL
10587 @kindex B DEL (Summary)
10588 @cindex deleting mail
10589 @findex gnus-summary-delete-article
10590 @c @icon{gnus-summary-mail-delete}
10591 Delete the mail article.  This is ``delete'' as in ``delete it from your
10592 disk forever and ever, never to return again.'' Use with caution.
10593 (@code{gnus-summary-delete-article}).
10594
10595 @item B m
10596 @kindex B m (Summary)
10597 @cindex move mail
10598 @findex gnus-summary-move-article
10599 @vindex gnus-preserve-marks
10600 Move the article from one mail group to another
10601 (@code{gnus-summary-move-article}).  Marks will be preserved if
10602 @code{gnus-preserve-marks} is non-@code{nil} (which is the default).
10603
10604 @item B c
10605 @kindex B c (Summary)
10606 @cindex copy mail
10607 @findex gnus-summary-copy-article
10608 @c @icon{gnus-summary-mail-copy}
10609 Copy the article from one group (mail group or not) to a mail group
10610 (@code{gnus-summary-copy-article}).  Marks will be preserved if
10611 @code{gnus-preserve-marks} is non-@code{nil} (which is the default).
10612
10613 @item B B
10614 @kindex B B (Summary)
10615 @cindex crosspost mail
10616 @findex gnus-summary-crosspost-article
10617 Crosspost the current article to some other group
10618 (@code{gnus-summary-crosspost-article}).  This will create a new copy of
10619 the article in the other group, and the Xref headers of the article will
10620 be properly updated.
10621
10622 @item B i
10623 @kindex B i (Summary)
10624 @findex gnus-summary-import-article
10625 Import an arbitrary file into the current mail newsgroup
10626 (@code{gnus-summary-import-article}).  You will be prompted for a file
10627 name, a @code{From} header and a @code{Subject} header.
10628
10629 @item B I
10630 @kindex B I (Summary)
10631 @findex gnus-summary-create-article
10632 Create an empty article in the current mail newsgroups
10633 (@code{gnus-summary-create-article}).  You will be prompted for a
10634 @code{From} header and a @code{Subject} header.
10635
10636 @item B r
10637 @kindex B r (Summary)
10638 @findex gnus-summary-respool-article
10639 @vindex gnus-summary-respool-default-method
10640 Respool the mail article (@code{gnus-summary-respool-article}).
10641 @code{gnus-summary-respool-default-method} will be used as the default
10642 select method when respooling.  This variable is @code{nil} by default,
10643 which means that the current group select method will be used instead.
10644 Marks will be preserved if @code{gnus-preserve-marks} is non-@code{nil}
10645 (which is the default).
10646
10647 @item B w
10648 @itemx e
10649 @kindex B w (Summary)
10650 @kindex e (Summary)
10651 @findex gnus-summary-edit-article
10652 @kindex C-c C-c (Article)
10653 @findex gnus-summary-edit-article-done
10654 Edit the current article (@code{gnus-summary-edit-article}).  To finish
10655 editing and make the changes permanent, type @kbd{C-c C-c}
10656 (@code{gnus-summary-edit-article-done}).  If you give a prefix to the
10657 @kbd{C-c C-c} command, Gnus won't re-highlight the article.
10658
10659 @item B q
10660 @kindex B q (Summary)
10661 @findex gnus-summary-respool-query
10662 If you want to re-spool an article, you might be curious as to what group
10663 the article will end up in before you do the re-spooling.  This command
10664 will tell you (@code{gnus-summary-respool-query}).
10665
10666 @item B t
10667 @kindex B t (Summary)
10668 @findex gnus-summary-respool-trace
10669 Similarly, this command will display all fancy splitting patterns used
10670 when respooling, if any (@code{gnus-summary-respool-trace}).
10671
10672 @item B p
10673 @kindex B p (Summary)
10674 @findex gnus-summary-article-posted-p
10675 Some people have a tendency to send you ``courtesy'' copies when they
10676 follow up to articles you have posted.  These usually have a
10677 @code{Newsgroups} header in them, but not always.  This command
10678 (@code{gnus-summary-article-posted-p}) will try to fetch the current
10679 article from your news server (or rather, from
10680 @code{gnus-refer-article-method} or @code{gnus-select-method}) and will
10681 report back whether it found the article or not.  Even if it says that
10682 it didn't find the article, it may have been posted anyway---mail
10683 propagation is much faster than news propagation, and the news copy may
10684 just not have arrived yet.
10685
10686 @item K E
10687 @kindex K E (Summary)
10688 @findex gnus-article-encrypt-body
10689 @vindex gnus-article-encrypt-protocol
10690 Encrypt the body of an article (@code{gnus-article-encrypt-body}).
10691 The body is encrypted with the encryption protocol specified by the
10692 variable @code{gnus-article-encrypt-protocol}.
10693
10694 @end table
10695
10696 @vindex gnus-move-split-methods
10697 @cindex moving articles
10698 If you move (or copy) articles regularly, you might wish to have Gnus
10699 suggest where to put the articles.  @code{gnus-move-split-methods} is a
10700 variable that uses the same syntax as @code{gnus-split-methods}
10701 (@pxref{Saving Articles}).  You may customize that variable to create
10702 suggestions you find reasonable.  (Note that
10703 @code{gnus-move-split-methods} uses group names where
10704 @code{gnus-split-methods} uses file names.)
10705
10706 @lisp
10707 (setq gnus-move-split-methods
10708       '(("^From:.*Lars Magne" "nnml:junk")
10709         ("^Subject:.*gnus" "nnfolder:important")
10710         (".*" "nnml:misc")))
10711 @end lisp
10712
10713
10714 @node Various Summary Stuff
10715 @section Various Summary Stuff
10716
10717 @menu
10718 * Summary Group Information::   Information oriented commands.
10719 * Searching for Articles::      Multiple article commands.
10720 * Summary Generation Commands::
10721 * Really Various Summary Commands::  Those pesky non-conformant commands.
10722 @end menu
10723
10724 @table @code
10725 @vindex gnus-summary-display-while-building
10726 @item gnus-summary-display-while-building
10727 If non-@code{nil}, show and update the summary buffer as it's being
10728 built.  If @code{t}, update the buffer after every line is inserted.
10729 If the value is an integer, @var{n}, update the display every @var{n}
10730 lines.  The default is @code{nil}.
10731
10732 @vindex gnus-summary-display-arrow
10733 @item gnus-summary-display-arrow
10734 If non-@code{nil}, display an arrow in the fringe to indicate the
10735 current article.
10736
10737 @vindex gnus-summary-mode-hook
10738 @item gnus-summary-mode-hook
10739 This hook is called when creating a summary mode buffer.
10740
10741 @vindex gnus-summary-generate-hook
10742 @item gnus-summary-generate-hook
10743 This is called as the last thing before doing the threading and the
10744 generation of the summary buffer.  It's quite convenient for customizing
10745 the threading variables based on what data the newsgroup has.  This hook
10746 is called from the summary buffer after most summary buffer variables
10747 have been set.
10748
10749 @vindex gnus-summary-prepare-hook
10750 @item gnus-summary-prepare-hook
10751 It is called after the summary buffer has been generated.  You might use
10752 it to, for instance, highlight lines or modify the look of the buffer in
10753 some other ungodly manner.  I don't care.
10754
10755 @vindex gnus-summary-prepared-hook
10756 @item gnus-summary-prepared-hook
10757 A hook called as the very last thing after the summary buffer has been
10758 generated.
10759
10760 @vindex gnus-summary-ignore-duplicates
10761 @item gnus-summary-ignore-duplicates
10762 When Gnus discovers two articles that have the same @code{Message-ID},
10763 it has to do something drastic.  No articles are allowed to have the
10764 same @code{Message-ID}, but this may happen when reading mail from some
10765 sources.  Gnus allows you to customize what happens with this variable.
10766 If it is @code{nil} (which is the default), Gnus will rename the
10767 @code{Message-ID} (for display purposes only) and display the article as
10768 any other article.  If this variable is @code{t}, it won't display the
10769 article---it'll be as if it never existed.
10770
10771 @vindex gnus-alter-articles-to-read-function
10772 @item gnus-alter-articles-to-read-function
10773 This function, which takes two parameters (the group name and the list
10774 of articles to be selected), is called to allow the user to alter the
10775 list of articles to be selected.
10776
10777 For instance, the following function adds the list of cached articles to
10778 the list in one particular group:
10779
10780 @lisp
10781 (defun my-add-cached-articles (group articles)
10782   (if (string= group "some.group")
10783       (append gnus-newsgroup-cached articles)
10784     articles))
10785 @end lisp
10786
10787 @vindex gnus-newsgroup-variables
10788 @item gnus-newsgroup-variables
10789 A list of newsgroup (summary buffer) local variables, or cons of
10790 variables and their default expressions to be evalled (when the default
10791 values are not @code{nil}), that should be made global while the summary
10792 buffer is active.
10793
10794 Note: The default expressions will be evaluated (using function
10795 @code{eval}) before assignment to the local variable rather than just
10796 assigned to it.  If the default expression is the symbol @code{global},
10797 that symbol will not be evaluated but the global value of the local
10798 variable will be used instead.
10799
10800 These variables can be used to set variables in the group parameters
10801 while still allowing them to affect operations done in other
10802 buffers.  For example:
10803
10804 @lisp
10805 (setq gnus-newsgroup-variables
10806       '(message-use-followup-to
10807         (gnus-visible-headers .
10808  "^From:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^To:")))
10809 @end lisp
10810
10811 Also @pxref{Group Parameters}.
10812
10813 @vindex gnus-propagate-marks
10814 @item gnus-propagate-marks
10815 If non-@code{nil}, propagate marks to the backends for possible
10816 storing.  @xref{NNTP marks}, and friends, for a more fine-grained
10817 sieve.
10818
10819 @end table
10820
10821
10822 @node Summary Group Information
10823 @subsection Summary Group Information
10824
10825 @table @kbd
10826
10827 @item H d
10828 @kindex H d (Summary)
10829 @findex gnus-summary-describe-group
10830 Give a brief description of the current group
10831 (@code{gnus-summary-describe-group}).  If given a prefix, force
10832 rereading the description from the server.
10833
10834 @item H h
10835 @kindex H h (Summary)
10836 @findex gnus-summary-describe-briefly
10837 Give an extremely brief description of the most important summary
10838 keystrokes (@code{gnus-summary-describe-briefly}).
10839
10840 @item H i
10841 @kindex H i (Summary)
10842 @findex gnus-info-find-node
10843 Go to the Gnus info node (@code{gnus-info-find-node}).
10844 @end table
10845
10846
10847 @node Searching for Articles
10848 @subsection Searching for Articles
10849
10850 @table @kbd
10851
10852 @item M-s
10853 @kindex M-s (Summary)
10854 @findex gnus-summary-search-article-forward
10855 Search through all subsequent (raw) articles for a regexp
10856 (@code{gnus-summary-search-article-forward}).
10857
10858 @item M-r
10859 @kindex M-r (Summary)
10860 @findex gnus-summary-search-article-backward
10861 Search through all previous (raw) articles for a regexp
10862 (@code{gnus-summary-search-article-backward}).
10863
10864 @item M-S
10865 @kindex M-S (Summary)
10866 @findex gnus-summary-repeat-search-article-forward
10867 Repeat the previous search forwards
10868 (@code{gnus-summary-repeat-search-article-forward}).
10869
10870 @item M-R
10871 @kindex M-R (Summary)
10872 @findex gnus-summary-repeat-search-article-backward
10873 Repeat the previous search backwards
10874 (@code{gnus-summary-repeat-search-article-backward}).
10875
10876 @item &
10877 @kindex & (Summary)
10878 @findex gnus-summary-execute-command
10879 This command will prompt you for a header, a regular expression to match
10880 on this field, and a command to be executed if the match is made
10881 (@code{gnus-summary-execute-command}).  If the header is an empty
10882 string, the match is done on the entire article.  If given a prefix,
10883 search backward instead.
10884
10885 For instance, @kbd{& RET some.*string RET #} will put the process mark on
10886 all articles that have heads or bodies that match @samp{some.*string}.
10887
10888 @item M-&
10889 @kindex M-& (Summary)
10890 @findex gnus-summary-universal-argument
10891 Perform any operation on all articles that have been marked with
10892 the process mark (@code{gnus-summary-universal-argument}).
10893 @end table
10894
10895 @node Summary Generation Commands
10896 @subsection Summary Generation Commands
10897
10898 @table @kbd
10899
10900 @item Y g
10901 @kindex Y g (Summary)
10902 @findex gnus-summary-prepare
10903 Regenerate the current summary buffer (@code{gnus-summary-prepare}).
10904
10905 @item Y c
10906 @kindex Y c (Summary)
10907 @findex gnus-summary-insert-cached-articles
10908 Pull all cached articles (for the current group) into the summary buffer
10909 (@code{gnus-summary-insert-cached-articles}).
10910
10911 @item Y d
10912 @kindex Y d (Summary)
10913 @findex gnus-summary-insert-dormant-articles
10914 Pull all dormant articles (for the current group) into the summary buffer
10915 (@code{gnus-summary-insert-dormant-articles}).
10916
10917 @item Y t
10918 @kindex Y t (Summary)
10919 @findex gnus-summary-insert-ticked-articles
10920 Pull all ticked articles (for the current group) into the summary buffer
10921 (@code{gnus-summary-insert-ticked-articles}).
10922
10923 @end table
10924
10925
10926 @node Really Various Summary Commands
10927 @subsection Really Various Summary Commands
10928
10929 @table @kbd
10930
10931 @item A D
10932 @itemx C-d
10933 @kindex C-d (Summary)
10934 @kindex A D (Summary)
10935 @findex gnus-summary-enter-digest-group
10936 If the current article is a collection of other articles (for instance,
10937 a digest), you might use this command to enter a group based on the that
10938 article (@code{gnus-summary-enter-digest-group}).  Gnus will try to
10939 guess what article type is currently displayed unless you give a prefix
10940 to this command, which forces a ``digest'' interpretation.  Basically,
10941 whenever you see a message that is a collection of other messages of
10942 some format, you @kbd{C-d} and read these messages in a more convenient
10943 fashion.
10944
10945 @vindex gnus-auto-select-on-ephemeral-exit
10946 The variable @code{gnus-auto-select-on-ephemeral-exit} controls what
10947 article should be selected after exiting a digest group.  Valid values
10948 include:
10949
10950 @table @code
10951 @item next
10952 Select the next article.
10953
10954 @item next-unread
10955 Select the next unread article.
10956
10957 @item next-noselect
10958 Move the cursor to the next article.  This is the default.
10959
10960 @item next-unread-noselect
10961 Move the cursor to the next unread article.
10962 @end table
10963
10964 If it has any other value or there is no next (unread) article, the
10965 article selected before entering to the digest group will appear.
10966
10967 @item C-M-d
10968 @kindex C-M-d (Summary)
10969 @findex gnus-summary-read-document
10970 This command is very similar to the one above, but lets you gather
10971 several documents into one biiig group
10972 (@code{gnus-summary-read-document}).  It does this by opening several
10973 @code{nndoc} groups for each document, and then opening an
10974 @code{nnvirtual} group on top of these @code{nndoc} groups.  This
10975 command understands the process/prefix convention
10976 (@pxref{Process/Prefix}).
10977
10978 @item C-t
10979 @kindex C-t (Summary)
10980 @findex gnus-summary-toggle-truncation
10981 Toggle truncation of summary lines
10982 (@code{gnus-summary-toggle-truncation}).  This will probably confuse the
10983 line centering function in the summary buffer, so it's not a good idea
10984 to have truncation switched off while reading articles.
10985
10986 @item =
10987 @kindex = (Summary)
10988 @findex gnus-summary-expand-window
10989 Expand the summary buffer window (@code{gnus-summary-expand-window}).
10990 If given a prefix, force an @code{article} window configuration.
10991
10992 @item C-M-e
10993 @kindex C-M-e (Summary)
10994 @findex gnus-summary-edit-parameters
10995 Edit the group parameters (@pxref{Group Parameters}) of the current
10996 group (@code{gnus-summary-edit-parameters}).
10997
10998 @item C-M-a
10999 @kindex C-M-a (Summary)
11000 @findex gnus-summary-customize-parameters
11001 Customize the group parameters (@pxref{Group Parameters}) of the current
11002 group (@code{gnus-summary-customize-parameters}).
11003
11004 @end table
11005
11006
11007 @node Exiting the Summary Buffer
11008 @section Exiting the Summary Buffer
11009 @cindex summary exit
11010 @cindex exiting groups
11011
11012 Exiting from the summary buffer will normally update all info on the
11013 group and return you to the group buffer.
11014
11015 @table @kbd
11016
11017 @item Z Z
11018 @itemx Z Q
11019 @itemx q
11020 @kindex Z Z (Summary)
11021 @kindex Z Q (Summary)
11022 @kindex q (Summary)
11023 @findex gnus-summary-exit
11024 @vindex gnus-summary-exit-hook
11025 @vindex gnus-summary-prepare-exit-hook
11026 @vindex gnus-group-no-more-groups-hook
11027 @c @icon{gnus-summary-exit}
11028 Exit the current group and update all information on the group
11029 (@code{gnus-summary-exit}).  @code{gnus-summary-prepare-exit-hook} is
11030 called before doing much of the exiting, which calls
11031 @code{gnus-summary-expire-articles} by default.
11032 @code{gnus-summary-exit-hook} is called after finishing the exit
11033 process.  @code{gnus-group-no-more-groups-hook} is run when returning to
11034 group mode having no more (unread) groups.
11035
11036 @item Z E
11037 @itemx Q
11038 @kindex Z E (Summary)
11039 @kindex Q (Summary)
11040 @findex gnus-summary-exit-no-update
11041 Exit the current group without updating any information on the group
11042 (@code{gnus-summary-exit-no-update}).
11043
11044 @item Z c
11045 @itemx c
11046 @kindex Z c (Summary)
11047 @kindex c (Summary)
11048 @findex gnus-summary-catchup-and-exit
11049 @c @icon{gnus-summary-catchup-and-exit}
11050 Mark all unticked articles in the group as read and then exit
11051 (@code{gnus-summary-catchup-and-exit}).
11052
11053 @item Z C
11054 @kindex Z C (Summary)
11055 @findex gnus-summary-catchup-all-and-exit
11056 Mark all articles, even the ticked ones, as read and then exit
11057 (@code{gnus-summary-catchup-all-and-exit}).
11058
11059 @item Z n
11060 @kindex Z n (Summary)
11061 @findex gnus-summary-catchup-and-goto-next-group
11062 Mark all articles as read and go to the next group
11063 (@code{gnus-summary-catchup-and-goto-next-group}).
11064
11065 @item Z p
11066 @kindex Z p (Summary)
11067 @findex gnus-summary-catchup-and-goto-prev-group
11068 Mark all articles as read and go to the previous group
11069 (@code{gnus-summary-catchup-and-goto-prev-group}).
11070
11071 @item Z R
11072 @itemx C-x C-s
11073 @kindex Z R (Summary)
11074 @kindex C-x C-s (Summary)
11075 @findex gnus-summary-reselect-current-group
11076 Exit this group, and then enter it again
11077 (@code{gnus-summary-reselect-current-group}).  If given a prefix, select
11078 all articles, both read and unread.
11079
11080 @item Z G
11081 @itemx M-g
11082 @kindex Z G (Summary)
11083 @kindex M-g (Summary)
11084 @findex gnus-summary-rescan-group
11085 @c @icon{gnus-summary-mail-get}
11086 Exit the group, check for new articles in the group, and select the
11087 group (@code{gnus-summary-rescan-group}).  If given a prefix, select all
11088 articles, both read and unread.
11089
11090 @item Z N
11091 @kindex Z N (Summary)
11092 @findex gnus-summary-next-group
11093 Exit the group and go to the next group
11094 (@code{gnus-summary-next-group}).
11095
11096 @item Z P
11097 @kindex Z P (Summary)
11098 @findex gnus-summary-prev-group
11099 Exit the group and go to the previous group
11100 (@code{gnus-summary-prev-group}).
11101
11102 @item Z s
11103 @kindex Z s (Summary)
11104 @findex gnus-summary-save-newsrc
11105 Save the current number of read/marked articles in the dribble buffer
11106 and then save the dribble buffer (@code{gnus-summary-save-newsrc}).  If
11107 given a prefix, also save the @file{.newsrc} file(s).  Using this
11108 command will make exit without updating (the @kbd{Q} command) worthless.
11109 @end table
11110
11111 @vindex gnus-exit-group-hook
11112 @code{gnus-exit-group-hook} is called when you exit the current group
11113 with an ``updating'' exit.  For instance @kbd{Q}
11114 (@code{gnus-summary-exit-no-update}) does not call this hook.
11115
11116 @findex gnus-summary-wake-up-the-dead
11117 @findex gnus-dead-summary-mode
11118 @vindex gnus-kill-summary-on-exit
11119 If you're in the habit of exiting groups, and then changing your mind
11120 about it, you might set @code{gnus-kill-summary-on-exit} to @code{nil}.
11121 If you do that, Gnus won't kill the summary buffer when you exit it.
11122 (Quelle surprise!)  Instead it will change the name of the buffer to
11123 something like @samp{*Dead Summary ... *} and install a minor mode
11124 called @code{gnus-dead-summary-mode}.  Now, if you switch back to this
11125 buffer, you'll find that all keys are mapped to a function called
11126 @code{gnus-summary-wake-up-the-dead}.  So tapping any keys in a dead
11127 summary buffer will result in a live, normal summary buffer.
11128
11129 There will never be more than one dead summary buffer at any one time.
11130
11131 @vindex gnus-use-cross-reference
11132 The data on the current group will be updated (which articles you have
11133 read, which articles you have replied to, etc.) when you exit the
11134 summary buffer.  If the @code{gnus-use-cross-reference} variable is
11135 @code{t} (which is the default), articles that are cross-referenced to
11136 this group and are marked as read, will also be marked as read in the
11137 other subscribed groups they were cross-posted to.  If this variable is
11138 neither @code{nil} nor @code{t}, the article will be marked as read in
11139 both subscribed and unsubscribed groups (@pxref{Crosspost Handling}).
11140
11141
11142 @node Crosspost Handling
11143 @section Crosspost Handling
11144
11145 @cindex velveeta
11146 @cindex spamming
11147 Marking cross-posted articles as read ensures that you'll never have to
11148 read the same article more than once.  Unless, of course, somebody has
11149 posted it to several groups separately.  Posting the same article to
11150 several groups (not cross-posting) is called @dfn{spamming}, and you are
11151 by law required to send nasty-grams to anyone who perpetrates such a
11152 heinous crime.
11153
11154 Remember: Cross-posting is kinda ok, but posting the same article
11155 separately to several groups is not.  Massive cross-posting (aka.
11156 @dfn{velveeta}) is to be avoided at all costs, and you can even use the
11157 @code{gnus-summary-mail-crosspost-complaint} command to complain about
11158 excessive crossposting (@pxref{Summary Mail Commands}).
11159
11160 @cindex cross-posting
11161 @cindex Xref
11162 @cindex @acronym{NOV}
11163 One thing that may cause Gnus to not do the cross-posting thing
11164 correctly is if you use an @acronym{NNTP} server that supports @sc{xover}
11165 (which is very nice, because it speeds things up considerably) which
11166 does not include the @code{Xref} header in its @acronym{NOV} lines.  This is
11167 Evil, but all too common, alas, alack.  Gnus tries to Do The Right Thing
11168 even with @sc{xover} by registering the @code{Xref} lines of all
11169 articles you actually read, but if you kill the articles, or just mark
11170 them as read without reading them, Gnus will not get a chance to snoop
11171 the @code{Xref} lines out of these articles, and will be unable to use
11172 the cross reference mechanism.
11173
11174 @cindex LIST overview.fmt
11175 @cindex overview.fmt
11176 To check whether your @acronym{NNTP} server includes the @code{Xref} header
11177 in its overview files, try @samp{telnet your.nntp.server nntp},
11178 @samp{MODE READER} on @code{inn} servers, and then say @samp{LIST
11179 overview.fmt}.  This may not work, but if it does, and the last line you
11180 get does not read @samp{Xref:full}, then you should shout and whine at
11181 your news admin until she includes the @code{Xref} header in the
11182 overview files.
11183
11184 If you want Gnus to get the @code{Xref}s right all the time, you have to
11185 set @code{nntp-nov-is-evil} to @code{t}, which slows things down
11186 considerably.  Also @pxref{Slow/Expensive Connection}.
11187
11188 C'est la vie.
11189
11190 For an alternative approach, @pxref{Duplicate Suppression}.
11191
11192
11193 @node Duplicate Suppression
11194 @section Duplicate Suppression
11195
11196 By default, Gnus tries to make sure that you don't have to read the same
11197 article more than once by utilizing the crossposting mechanism
11198 (@pxref{Crosspost Handling}).  However, that simple and efficient
11199 approach may not work satisfactory for some users for various
11200 reasons.
11201
11202 @enumerate
11203 @item
11204 The @acronym{NNTP} server may fail to generate the @code{Xref} header.  This
11205 is evil and not very common.
11206
11207 @item
11208 The @acronym{NNTP} server may fail to include the @code{Xref} header in the
11209 @file{.overview} data bases.  This is evil and all too common, alas.
11210
11211 @item
11212 You may be reading the same group (or several related groups) from
11213 different @acronym{NNTP} servers.
11214
11215 @item
11216 You may be getting mail that duplicates articles posted to groups.
11217 @end enumerate
11218
11219 I'm sure there are other situations where @code{Xref} handling fails as
11220 well, but these four are the most common situations.
11221
11222 If, and only if, @code{Xref} handling fails for you, then you may
11223 consider switching on @dfn{duplicate suppression}.  If you do so, Gnus
11224 will remember the @code{Message-ID}s of all articles you have read or
11225 otherwise marked as read, and then, as if by magic, mark them as read
11226 all subsequent times you see them---in @emph{all} groups.  Using this
11227 mechanism is quite likely to be somewhat inefficient, but not overly
11228 so.  It's certainly preferable to reading the same articles more than
11229 once.
11230
11231 Duplicate suppression is not a very subtle instrument.  It's more like a
11232 sledge hammer than anything else.  It works in a very simple
11233 fashion---if you have marked an article as read, it adds this Message-ID
11234 to a cache.  The next time it sees this Message-ID, it will mark the
11235 article as read with the @samp{M} mark.  It doesn't care what group it
11236 saw the article in.
11237
11238 @table @code
11239 @item gnus-suppress-duplicates
11240 @vindex gnus-suppress-duplicates
11241 If non-@code{nil}, suppress duplicates.
11242
11243 @item gnus-save-duplicate-list
11244 @vindex gnus-save-duplicate-list
11245 If non-@code{nil}, save the list of duplicates to a file.  This will
11246 make startup and shutdown take longer, so the default is @code{nil}.
11247 However, this means that only duplicate articles read in a single Gnus
11248 session are suppressed.
11249
11250 @item gnus-duplicate-list-length
11251 @vindex gnus-duplicate-list-length
11252 This variable says how many @code{Message-ID}s to keep in the duplicate
11253 suppression list.  The default is 10000.
11254
11255 @item gnus-duplicate-file
11256 @vindex gnus-duplicate-file
11257 The name of the file to store the duplicate suppression list in.  The
11258 default is @file{~/News/suppression}.
11259 @end table
11260
11261 If you have a tendency to stop and start Gnus often, setting
11262 @code{gnus-save-duplicate-list} to @code{t} is probably a good idea.  If
11263 you leave Gnus running for weeks on end, you may have it @code{nil}.  On
11264 the other hand, saving the list makes startup and shutdown much slower,
11265 so that means that if you stop and start Gnus often, you should set
11266 @code{gnus-save-duplicate-list} to @code{nil}.  Uhm.  I'll leave this up
11267 to you to figure out, I think.
11268
11269 @node Security
11270 @section Security
11271
11272 Gnus is able to verify signed messages or decrypt encrypted messages.
11273 The formats that are supported are @acronym{PGP}, @acronym{PGP/MIME}
11274 and @acronym{S/MIME}, however you need some external programs to get
11275 things to work:
11276
11277 @enumerate
11278 @item
11279 To handle @acronym{PGP} and @acronym{PGP/MIME} messages, you have to
11280 install an OpenPGP implementation such as GnuPG.  The Lisp interface
11281 to GnuPG included with Emacs is called EasyPG (@pxref{Top, ,EasyPG,
11282 epa, EasyPG Assistant user's manual}), but PGG (@pxref{Top, ,PGG, pgg,
11283 PGG Manual}), and Mailcrypt are also supported.
11284
11285 @item
11286 To handle @acronym{S/MIME} message, you need to install OpenSSL.  OpenSSL 0.9.6
11287 or newer is recommended.
11288
11289 @end enumerate
11290
11291 The variables that control security functionality on reading/composing
11292 messages include:
11293
11294 @table @code
11295 @item mm-verify-option
11296 @vindex mm-verify-option
11297 Option of verifying signed parts.  @code{never}, not verify;
11298 @code{always}, always verify; @code{known}, only verify known
11299 protocols.  Otherwise, ask user.
11300
11301 @item mm-decrypt-option
11302 @vindex mm-decrypt-option
11303 Option of decrypting encrypted parts.  @code{never}, no decryption;
11304 @code{always}, always decrypt; @code{known}, only decrypt known
11305 protocols.  Otherwise, ask user.
11306
11307 @item mm-sign-option
11308 @vindex mm-sign-option
11309 Option of creating signed parts.  @code{nil}, use default signing
11310 keys; @code{guided}, ask user to select signing keys from the menu.
11311
11312 @item mm-encrypt-option
11313 @vindex mm-encrypt-option
11314 Option of creating encrypted parts.  @code{nil}, use the first
11315 public-key matching the @samp{From:} header as the recipient;
11316 @code{guided}, ask user to select recipient keys from the menu.
11317
11318 @item mml1991-use
11319 @vindex mml1991-use
11320 Symbol indicating elisp interface to OpenPGP implementation for
11321 @acronym{PGP} messages.  The default is @code{epg}, but @code{pgg},
11322 and @code{mailcrypt} are also supported although
11323 deprecated.  By default, Gnus uses the first available interface in
11324 this order.
11325
11326 @item mml2015-use
11327 @vindex mml2015-use
11328 Symbol indicating elisp interface to OpenPGP implementation for
11329 @acronym{PGP/MIME} messages.  The default is @code{epg}, but
11330 @code{pgg}, and @code{mailcrypt} are also supported
11331 although deprecated.  By default, Gnus uses the first available
11332 interface in this order.
11333
11334 @end table
11335
11336 By default the buttons that display security information are not
11337 shown, because they clutter reading the actual e-mail.  You can type
11338 @kbd{K b} manually to display the information.  Use the
11339 @code{gnus-buttonized-mime-types} and
11340 @code{gnus-unbuttonized-mime-types} variables to control this
11341 permanently.  @ref{MIME Commands} for further details, and hints on
11342 how to customize these variables to always display security
11343 information.
11344
11345 @cindex snarfing keys
11346 @cindex importing PGP keys
11347 @cindex PGP key ring import
11348 Snarfing OpenPGP keys (i.e., importing keys from articles into your
11349 key ring) is not supported explicitly through a menu item or command,
11350 rather Gnus do detect and label keys as @samp{application/pgp-keys},
11351 allowing you to specify whatever action you think is appropriate
11352 through the usual @acronym{MIME} infrastructure.  You can use a
11353 @file{~/.mailcap} entry (@pxref{mailcap, , mailcap, emacs-mime, The
11354 Emacs MIME Manual}) such as the following to import keys using GNU
11355 Privacy Guard when you click on the @acronym{MIME} button
11356 (@pxref{Using MIME}).
11357
11358 @example
11359 application/pgp-keys; gpg --import --interactive --verbose; needsterminal
11360 @end example
11361 @noindent
11362 This happens to also be the default action defined in
11363 @code{mailcap-mime-data}.
11364
11365 More information on how to set things for sending outgoing signed and
11366 encrypted messages up can be found in the message manual
11367 (@pxref{Security, ,Security, message, Message Manual}).
11368
11369 @node Mailing List
11370 @section Mailing List
11371 @cindex mailing list
11372 @cindex RFC 2396
11373
11374 @kindex A M (summary)
11375 @findex gnus-mailing-list-insinuate
11376 Gnus understands some mailing list fields of RFC 2369.  To enable it,
11377 add a @code{to-list} group parameter (@pxref{Group Parameters}),
11378 possibly using @kbd{A M} (@code{gnus-mailing-list-insinuate}) in the
11379 summary buffer.
11380
11381 That enables the following commands to the summary buffer:
11382
11383 @table @kbd
11384
11385 @item C-c C-n h
11386 @kindex C-c C-n h (Summary)
11387 @findex gnus-mailing-list-help
11388 Send a message to fetch mailing list help, if List-Help field exists.
11389
11390 @item C-c C-n s
11391 @kindex C-c C-n s (Summary)
11392 @findex gnus-mailing-list-subscribe
11393 Send a message to subscribe the mailing list, if List-Subscribe field exists.
11394
11395 @item C-c C-n u
11396 @kindex C-c C-n u (Summary)
11397 @findex gnus-mailing-list-unsubscribe
11398 Send a message to unsubscribe the mailing list, if List-Unsubscribe
11399 field exists.
11400
11401 @item C-c C-n p
11402 @kindex C-c C-n p (Summary)
11403 @findex gnus-mailing-list-post
11404 Post to the mailing list, if List-Post field exists.
11405
11406 @item C-c C-n o
11407 @kindex C-c C-n o (Summary)
11408 @findex gnus-mailing-list-owner
11409 Send a message to the mailing list owner, if List-Owner field exists.
11410
11411 @item C-c C-n a
11412 @kindex C-c C-n a (Summary)
11413 @findex gnus-mailing-list-archive
11414 Browse the mailing list archive, if List-Archive field exists.
11415
11416 @end table
11417
11418
11419 @node Article Buffer
11420 @chapter Article Buffer
11421 @cindex article buffer
11422
11423 The articles are displayed in the article buffer, of which there is only
11424 one.  All the summary buffers share the same article buffer unless you
11425 tell Gnus otherwise.
11426
11427 @menu
11428 * Hiding Headers::              Deciding what headers should be displayed.
11429 * Using MIME::                  Pushing articles through @acronym{MIME} before reading them.
11430 * HTML::                        Reading @acronym{HTML} messages.
11431 * Customizing Articles::        Tailoring the look of the articles.
11432 * Article Keymap::              Keystrokes available in the article buffer.
11433 * Misc Article::                Other stuff.
11434 @end menu
11435
11436
11437 @node Hiding Headers
11438 @section Hiding Headers
11439 @cindex hiding headers
11440 @cindex deleting headers
11441
11442 The top section of each article is the @dfn{head}.  (The rest is the
11443 @dfn{body}, but you may have guessed that already.)
11444
11445 @vindex gnus-show-all-headers
11446 There is a lot of useful information in the head: the name of the person
11447 who wrote the article, the date it was written and the subject of the
11448 article.  That's well and nice, but there's also lots of information
11449 most people do not want to see---what systems the article has passed
11450 through before reaching you, the @code{Message-ID}, the
11451 @code{References}, etc. ad nauseam---and you'll probably want to get rid
11452 of some of those lines.  If you want to keep all those lines in the
11453 article buffer, you can set @code{gnus-show-all-headers} to @code{t}.
11454
11455 Gnus provides you with two variables for sifting headers:
11456
11457 @table @code
11458
11459 @item gnus-visible-headers
11460 @vindex gnus-visible-headers
11461 If this variable is non-@code{nil}, it should be a regular expression
11462 that says what headers you wish to keep in the article buffer.  All
11463 headers that do not match this variable will be hidden.
11464
11465 For instance, if you only want to see the name of the person who wrote
11466 the article and the subject, you'd say:
11467
11468 @lisp
11469 (setq gnus-visible-headers "^From:\\|^Subject:")
11470 @end lisp
11471
11472 This variable can also be a list of regexps to match headers to
11473 remain visible.
11474
11475 @item gnus-ignored-headers
11476 @vindex gnus-ignored-headers
11477 This variable is the reverse of @code{gnus-visible-headers}.  If this
11478 variable is set (and @code{gnus-visible-headers} is @code{nil}), it
11479 should be a regular expression that matches all lines that you want to
11480 hide.  All lines that do not match this variable will remain visible.
11481
11482 For instance, if you just want to get rid of the @code{References} line
11483 and the @code{Xref} line, you might say:
11484
11485 @lisp
11486 (setq gnus-ignored-headers "^References:\\|^Xref:")
11487 @end lisp
11488
11489 This variable can also be a list of regexps to match headers to
11490 be removed.
11491
11492 Note that if @code{gnus-visible-headers} is non-@code{nil}, this
11493 variable will have no effect.
11494
11495 @end table
11496
11497 @vindex gnus-sorted-header-list
11498 Gnus can also sort the headers for you.  (It does this by default.)  You
11499 can control the sorting by setting the @code{gnus-sorted-header-list}
11500 variable.  It is a list of regular expressions that says in what order
11501 the headers are to be displayed.
11502
11503 For instance, if you want the name of the author of the article first,
11504 and then the subject, you might say something like:
11505
11506 @lisp
11507 (setq gnus-sorted-header-list '("^From:" "^Subject:"))
11508 @end lisp
11509
11510 Any headers that are to remain visible, but are not listed in this
11511 variable, will be displayed in random order after all the headers listed in this variable.
11512
11513 @findex gnus-article-hide-boring-headers
11514 @vindex gnus-boring-article-headers
11515 You can hide further boring headers by setting
11516 @code{gnus-treat-hide-boring-headers} to @code{head}.  What this function
11517 does depends on the @code{gnus-boring-article-headers} variable.  It's a
11518 list, but this list doesn't actually contain header names.  Instead it
11519 lists various @dfn{boring conditions} that Gnus can check and remove
11520 from sight.
11521
11522 These conditions are:
11523 @table @code
11524 @item empty
11525 Remove all empty headers.
11526 @item followup-to
11527 Remove the @code{Followup-To} header if it is identical to the
11528 @code{Newsgroups} header.
11529 @item reply-to
11530 Remove the @code{Reply-To} header if it lists the same addresses as
11531 the @code{From} header, or if the @code{broken-reply-to} group
11532 parameter is set.
11533 @item newsgroups
11534 Remove the @code{Newsgroups} header if it only contains the current group
11535 name.
11536 @item to-address
11537 Remove the @code{To} header if it only contains the address identical to
11538 the current group's @code{to-address} parameter.
11539 @item to-list
11540 Remove the @code{To} header if it only contains the address identical to
11541 the current group's @code{to-list} parameter.
11542 @item cc-list
11543 Remove the @code{Cc} header if it only contains the address identical to
11544 the current group's @code{to-list} parameter.
11545 @item date
11546 Remove the @code{Date} header if the article is less than three days
11547 old.
11548 @item long-to
11549 Remove the @code{To} and/or @code{Cc} header if it is very long.
11550 @item many-to
11551 Remove all @code{To} and/or @code{Cc} headers if there are more than one.
11552 @end table
11553
11554 To include these three elements, you could say something like:
11555
11556 @lisp
11557 (setq gnus-boring-article-headers
11558       '(empty followup-to reply-to))
11559 @end lisp
11560
11561 This is also the default value for this variable.
11562
11563
11564 @node Using MIME
11565 @section Using MIME
11566 @cindex @acronym{MIME}
11567
11568 Mime is a standard for waving your hands through the air, aimlessly,
11569 while people stand around yawning.
11570
11571 @acronym{MIME}, however, is a standard for encoding your articles, aimlessly,
11572 while all newsreaders die of fear.
11573
11574 @acronym{MIME} may specify what character set the article uses, the encoding
11575 of the characters, and it also makes it possible to embed pictures and
11576 other naughty stuff in innocent-looking articles.
11577
11578 @vindex gnus-display-mime-function
11579 @findex gnus-display-mime
11580 Gnus pushes @acronym{MIME} articles through @code{gnus-display-mime-function}
11581 to display the @acronym{MIME} parts.  This is @code{gnus-display-mime} by
11582 default, which creates a bundle of clickable buttons that can be used to
11583 display, save and manipulate the @acronym{MIME} objects.
11584
11585 The following commands are available when you have placed point over a
11586 @acronym{MIME} button:
11587
11588 @table @kbd
11589 @findex gnus-article-press-button
11590 @item RET (Article)
11591 @kindex RET (Article)
11592 @itemx BUTTON-2 (Article)
11593 Toggle displaying of the @acronym{MIME} object
11594 (@code{gnus-article-press-button}).  If built-in viewers can not display
11595 the object, Gnus resorts to external viewers in the @file{mailcap}
11596 files.  If a viewer has the @samp{copiousoutput} specification, the
11597 object is displayed inline.
11598
11599 @findex gnus-mime-view-part
11600 @item M-RET (Article)
11601 @kindex M-RET (Article)
11602 @itemx v (Article)
11603 Prompt for a method, and then view the @acronym{MIME} object using this
11604 method (@code{gnus-mime-view-part}).
11605
11606 @findex gnus-mime-view-part-as-type
11607 @item t (Article)
11608 @kindex t (Article)
11609 View the @acronym{MIME} object as if it were a different @acronym{MIME} media type
11610 (@code{gnus-mime-view-part-as-type}).
11611
11612 @findex gnus-mime-view-part-as-charset
11613 @item C (Article)
11614 @kindex C (Article)
11615 Prompt for a charset, and then view the @acronym{MIME} object using this
11616 charset (@code{gnus-mime-view-part-as-charset}).
11617
11618 @findex gnus-mime-save-part
11619 @item o (Article)
11620 @kindex o (Article)
11621 Prompt for a file name, and then save the @acronym{MIME} object
11622 (@code{gnus-mime-save-part}).
11623
11624 @findex gnus-mime-save-part-and-strip
11625 @item C-o (Article)
11626 @kindex C-o (Article)
11627 Prompt for a file name, then save the @acronym{MIME} object and strip it from
11628 the article.  Then proceed to article editing, where a reasonable
11629 suggestion is being made on how the altered article should look
11630 like.  The stripped @acronym{MIME} object will be referred via the
11631 message/external-body @acronym{MIME} type.
11632 (@code{gnus-mime-save-part-and-strip}).
11633
11634 @findex gnus-mime-replace-part
11635 @item r (Article)
11636 @kindex r (Article)
11637 Prompt for a file name, replace the @acronym{MIME} object with an
11638 external body refering to the file via the message/external-body
11639 @acronym{MIME} type.  (@code{gnus-mime-replace-part}).
11640
11641 @findex gnus-mime-delete-part
11642 @item d (Article)
11643 @kindex d (Article)
11644 Delete the @acronym{MIME} object from the article and replace it with some
11645 information about the removed @acronym{MIME} object
11646 (@code{gnus-mime-delete-part}).
11647
11648 @c FIXME: gnus-auto-select-part should be documented here
11649
11650 @findex gnus-mime-copy-part
11651 @item c (Article)
11652 @kindex c (Article)
11653 Copy the @acronym{MIME} object to a fresh buffer and display this buffer
11654 (@code{gnus-mime-copy-part}).  If given a prefix, copy the raw contents
11655 without decoding.  If given a numerical prefix, you can do semi-manual
11656 charset stuff (see @code{gnus-summary-show-article-charset-alist} in
11657 @ref{Paging the Article}).  Compressed files like @file{.gz} and
11658 @file{.bz2} are automatically decompressed if
11659 @code{auto-compression-mode} is enabled (@pxref{Compressed Files,,
11660 Accessing Compressed Files, emacs, The Emacs Editor}).
11661
11662 @findex gnus-mime-print-part
11663 @item p (Article)
11664 @kindex p (Article)
11665 Print the @acronym{MIME} object (@code{gnus-mime-print-part}).  This
11666 command respects the @samp{print=} specifications in the
11667 @file{.mailcap} file.
11668
11669 @findex gnus-mime-inline-part
11670 @item i (Article)
11671 @kindex i (Article)
11672 Insert the contents of the @acronym{MIME} object into the buffer
11673 (@code{gnus-mime-inline-part}) as @samp{text/plain}.  If given a prefix, insert
11674 the raw contents without decoding.  If given a numerical prefix, you can
11675 do semi-manual charset stuff (see
11676 @code{gnus-summary-show-article-charset-alist} in @ref{Paging the
11677 Article}).  Compressed files like @file{.gz} and @file{.bz2} are
11678 automatically decompressed depending on @code{jka-compr} regardless of
11679 @code{auto-compression-mode} (@pxref{Compressed Files,, Accessing
11680 Compressed Files, emacs, The Emacs Editor}).
11681
11682 @findex gnus-mime-view-part-internally
11683 @item E (Article)
11684 @kindex E (Article)
11685 View the @acronym{MIME} object with an internal viewer.  If no internal
11686 viewer is available, use an external viewer
11687 (@code{gnus-mime-view-part-internally}).
11688
11689 @findex gnus-mime-view-part-externally
11690 @item e (Article)
11691 @kindex e (Article)
11692 View the @acronym{MIME} object with an external viewer.
11693 (@code{gnus-mime-view-part-externally}).
11694
11695 @findex gnus-mime-pipe-part
11696 @item | (Article)
11697 @kindex | (Article)
11698 Output the @acronym{MIME} object to a process (@code{gnus-mime-pipe-part}).
11699
11700 @findex gnus-mime-action-on-part
11701 @item . (Article)
11702 @kindex . (Article)
11703 Interactively run an action on the @acronym{MIME} object
11704 (@code{gnus-mime-action-on-part}).
11705
11706 @end table
11707
11708 Gnus will display some @acronym{MIME} objects automatically.  The way Gnus
11709 determines which parts to do this with is described in the Emacs
11710 @acronym{MIME} manual.
11711
11712 It might be best to just use the toggling functions from the article
11713 buffer to avoid getting nasty surprises.  (For instance, you enter the
11714 group @samp{alt.sing-a-long} and, before you know it, @acronym{MIME} has
11715 decoded the sound file in the article and some horrible sing-a-long song
11716 comes screaming out your speakers, and you can't find the volume button,
11717 because there isn't one, and people are starting to look at you, and you
11718 try to stop the program, but you can't, and you can't find the program
11719 to control the volume, and everybody else in the room suddenly decides
11720 to look at you disdainfully, and you'll feel rather stupid.)
11721
11722 Any similarity to real events and people is purely coincidental.  Ahem.
11723
11724 Also @pxref{MIME Commands}.
11725
11726
11727 @node HTML
11728 @section @acronym{HTML}
11729 @cindex @acronym{HTML}
11730
11731 If you have @code{w3m} installed on your system, Gnus can display
11732 @acronym{HTML} articles in the article buffer.  There are many Gnus
11733 add-ons for doing this, using various approaches, but there's one
11734 (sort of) built-in method that's used by default.
11735
11736 For a complete overview, consult @xref{Display Customization,
11737 ,Display Customization, emacs-mime, The Emacs MIME Manual}.  This
11738 section only describes the default method.
11739
11740 @table @code
11741 @item mm-text-html-renderer
11742 @vindex mm-text-html-renderer
11743 If set to @code{gnus-article-html}, Gnus will use the built-in method,
11744 that's based on @code{w3m}.
11745
11746 @item gnus-blocked-images
11747 @vindex gnus-blocked-images
11748 External images that have @acronym{URL}s that match this regexp won't
11749 be fetched and displayed.  For instance, do block all @acronym{URL}s
11750 that have the string ``ads'' in them, do the following:
11751
11752 @lisp
11753 (setq gnus-blocked-images "ads")
11754 @end lisp
11755
11756 This can also be a function to be evaluated.  If so, it will be
11757 called with the group name as the parameter.  The default value is
11758 @code{gnus-block-private-groups}, which will return @samp{"."} for
11759 anything that isn't a newsgroup.  This means that no external images
11760 will be fetched as a result of reading mail, so that nobody can use
11761 web bugs (and the like) to track whether you've read email.
11762
11763 Also @pxref{Misc Article} for @code{gnus-inhibit-images}.
11764
11765 @item gnus-html-cache-directory
11766 @vindex gnus-html-cache-directory
11767 Gnus will download and cache images according to how
11768 @code{gnus-blocked-images} is set.  These images will be stored in
11769 this directory.
11770
11771 @item gnus-html-cache-size
11772 @vindex gnus-html-cache-size
11773 When @code{gnus-html-cache-size} bytes have been used in that
11774 directory, the oldest files will be deleted.  The default is 500MB.
11775
11776 @item gnus-html-frame-width
11777 @vindex gnus-html-frame-width
11778 The width to use when rendering HTML.  The default is 70.
11779
11780 @item gnus-max-image-proportion
11781 @vindex gnus-max-image-proportion
11782 How big pictures displayed are in relation to the window they're in.
11783 A value of 0.7 (the default) means that they are allowed to take up
11784 70% of the width and height of the window.  If they are larger than
11785 this, and Emacs supports it, then the images will be rescaled down to
11786 fit these criteria.
11787
11788 @end table
11789
11790 To use this, make sure that you have @code{w3m} and @code{curl}
11791 installed.  If you have, then Gnus should display @acronym{HTML}
11792 automatically. 
11793
11794
11795
11796 @node Customizing Articles
11797 @section Customizing Articles
11798 @cindex article customization
11799
11800 A slew of functions for customizing how the articles are to look like
11801 exist.  You can call these functions interactively
11802 (@pxref{Article Washing}), or you can have them
11803 called automatically when you select the articles.
11804
11805 To have them called automatically, you should set the corresponding
11806 ``treatment'' variable.  For instance, to have headers hidden, you'd set
11807 @code{gnus-treat-hide-headers}.  Below is a list of variables that can
11808 be set, but first we discuss the values these variables can have.
11809
11810 Note: Some values, while valid, make little sense.  Check the list below
11811 for sensible values.
11812
11813 @enumerate
11814 @item
11815 @code{nil}: Don't do this treatment.
11816
11817 @item
11818 @code{t}: Do this treatment on all body parts.
11819
11820 @item
11821 @code{head}: Do the treatment on the headers.
11822
11823 @item
11824 @code{first}: Do this treatment on the first body part.
11825
11826 @item
11827 @code{last}: Do this treatment on the last body part.
11828
11829 @item
11830 An integer: Do this treatment on all body parts that have a length less
11831 than this number.
11832
11833 @item
11834 A list of strings: Do this treatment on all body parts that are in
11835 articles that are read in groups that have names that match one of the
11836 regexps in the list.
11837
11838 @item
11839 A list where the first element is not a string:
11840
11841 The list is evaluated recursively.  The first element of the list is a
11842 predicate.  The following predicates are recognized: @code{or},
11843 @code{and}, @code{not} and @code{typep}.  Here's an example:
11844
11845 @lisp
11846 (or last
11847     (typep "text/x-vcard"))
11848 @end lisp
11849
11850 @end enumerate
11851
11852 You may have noticed that the word @dfn{part} is used here.  This refers
11853 to the fact that some messages are @acronym{MIME} multipart articles that may
11854 be divided into several parts.  Articles that are not multiparts are
11855 considered to contain just a single part.
11856
11857 @vindex gnus-article-treat-types
11858 Are the treatments applied to all sorts of multipart parts?  Yes, if you
11859 want to, but by default, only @samp{text/plain} parts are given the
11860 treatment.  This is controlled by the @code{gnus-article-treat-types}
11861 variable, which is a list of regular expressions that are matched to the
11862 type of the part.  This variable is ignored if the value of the
11863 controlling variable is a predicate list, as described above.
11864
11865 @ifinfo
11866 @c Avoid sort of redundant entries in the same section for the printed
11867 @c manual, but add them in info to allow `i gnus-treat-foo-bar RET' or
11868 @c `i foo-bar'.
11869 @vindex gnus-treat-buttonize
11870 @vindex gnus-treat-buttonize-head
11871 @vindex gnus-treat-capitalize-sentences
11872 @vindex gnus-treat-overstrike
11873 @vindex gnus-treat-strip-cr
11874 @vindex gnus-treat-strip-headers-in-body
11875 @vindex gnus-treat-strip-leading-blank-lines
11876 @vindex gnus-treat-strip-multiple-blank-lines
11877 @vindex gnus-treat-strip-pem
11878 @vindex gnus-treat-strip-trailing-blank-lines
11879 @vindex gnus-treat-unsplit-urls
11880 @vindex gnus-treat-wash-html
11881 @vindex gnus-treat-date-english
11882 @vindex gnus-treat-date-iso8601
11883 @vindex gnus-treat-date-lapsed
11884 @vindex gnus-treat-date-local
11885 @vindex gnus-treat-date-original
11886 @vindex gnus-treat-date-user-defined
11887 @vindex gnus-treat-date-ut
11888 @vindex gnus-treat-from-picon
11889 @vindex gnus-treat-mail-picon
11890 @vindex gnus-treat-newsgroups-picon
11891 @vindex gnus-treat-from-gravatar
11892 @vindex gnus-treat-mail-gravatar
11893 @vindex gnus-treat-display-smileys
11894 @vindex gnus-treat-body-boundary
11895 @vindex gnus-treat-display-x-face
11896 @vindex gnus-treat-display-face
11897 @vindex gnus-treat-emphasize
11898 @vindex gnus-treat-fill-article
11899 @vindex gnus-treat-fill-long-lines
11900 @vindex gnus-treat-hide-boring-headers
11901 @vindex gnus-treat-hide-citation
11902 @vindex gnus-treat-hide-citation-maybe
11903 @vindex gnus-treat-hide-headers
11904 @vindex gnus-treat-hide-signature
11905 @vindex gnus-treat-strip-banner
11906 @vindex gnus-treat-strip-list-identifiers
11907 @vindex gnus-treat-highlight-citation
11908 @vindex gnus-treat-highlight-headers
11909 @vindex gnus-treat-highlight-signature
11910 @vindex gnus-treat-play-sounds
11911 @vindex gnus-treat-x-pgp-sig
11912 @vindex gnus-treat-unfold-headers
11913 @vindex gnus-treat-fold-headers
11914 @vindex gnus-treat-fold-newsgroups
11915 @vindex gnus-treat-leading-whitespace
11916 @end ifinfo
11917
11918 The following treatment options are available.  The easiest way to
11919 customize this is to examine the @code{gnus-article-treat} customization
11920 group.  Values in parenthesis are suggested sensible values.  Others are
11921 possible but those listed are probably sufficient for most people.
11922
11923 @table @code
11924 @item gnus-treat-buttonize (t, integer)
11925 @item gnus-treat-buttonize-head (head)
11926
11927 @xref{Article Buttons}.
11928
11929 @item gnus-treat-capitalize-sentences (t, integer)
11930 @item gnus-treat-overstrike (t, integer)
11931 @item gnus-treat-strip-cr (t, integer)
11932 @item gnus-treat-strip-headers-in-body (t, integer)
11933 @item gnus-treat-strip-leading-blank-lines (t, first, integer)
11934 @item gnus-treat-strip-multiple-blank-lines (t, integer)
11935 @item gnus-treat-strip-pem (t, last, integer)
11936 @item gnus-treat-strip-trailing-blank-lines (t, last, integer)
11937 @item gnus-treat-unsplit-urls (t, integer)
11938 @item gnus-treat-wash-html (t, integer)
11939
11940 @xref{Article Washing}.
11941
11942 @item gnus-treat-date-english (head)
11943 @item gnus-treat-date-iso8601 (head)
11944 @item gnus-treat-date-lapsed (head)
11945 @item gnus-treat-date-local (head)
11946 @item gnus-treat-date-original (head)
11947 @item gnus-treat-date-user-defined (head)
11948 @item gnus-treat-date-ut (head)
11949
11950 @xref{Article Date}.
11951
11952 @item gnus-treat-from-picon (head)
11953 @item gnus-treat-mail-picon (head)
11954 @item gnus-treat-newsgroups-picon (head)
11955
11956 @xref{Picons}.
11957
11958 @item gnus-treat-from-gravatar (head)
11959 @item gnus-treat-mail-gravatar (head)
11960
11961 @xref{Gravatars}.
11962
11963 @item gnus-treat-display-smileys (t, integer)
11964
11965 @item gnus-treat-body-boundary (head)
11966
11967 @vindex gnus-body-boundary-delimiter
11968 Adds a delimiter between header and body, the string used as delimiter
11969 is controlled by @code{gnus-body-boundary-delimiter}.
11970
11971 @xref{Smileys}.
11972
11973 @vindex gnus-treat-display-x-face
11974 @item gnus-treat-display-x-face (head)
11975
11976 @xref{X-Face}.
11977
11978 @vindex gnus-treat-display-face
11979 @item gnus-treat-display-face (head)
11980
11981 @xref{Face}.
11982
11983 @vindex gnus-treat-emphasize
11984 @item gnus-treat-emphasize (t, head, integer)
11985 @vindex gnus-treat-fill-article
11986 @item gnus-treat-fill-article (t, integer)
11987 @vindex gnus-treat-fill-long-lines
11988 @item gnus-treat-fill-long-lines (t, integer)
11989 @vindex gnus-treat-hide-boring-headers
11990 @item gnus-treat-hide-boring-headers (head)
11991 @vindex gnus-treat-hide-citation
11992 @item gnus-treat-hide-citation (t, integer)
11993 @vindex gnus-treat-hide-citation-maybe
11994 @item gnus-treat-hide-citation-maybe (t, integer)
11995 @vindex gnus-treat-hide-headers
11996 @item gnus-treat-hide-headers (head)
11997 @vindex gnus-treat-hide-signature
11998 @item gnus-treat-hide-signature (t, last)
11999 @vindex gnus-treat-strip-banner
12000 @item gnus-treat-strip-banner (t, last)
12001 @vindex gnus-treat-strip-list-identifiers
12002 @item gnus-treat-strip-list-identifiers (head)
12003
12004 @xref{Article Hiding}.
12005
12006 @vindex gnus-treat-highlight-citation
12007 @item gnus-treat-highlight-citation (t, integer)
12008 @vindex gnus-treat-highlight-headers
12009 @item gnus-treat-highlight-headers (head)
12010 @vindex gnus-treat-highlight-signature
12011 @item gnus-treat-highlight-signature (t, last, integer)
12012
12013 @xref{Article Highlighting}.
12014
12015 @vindex gnus-treat-play-sounds
12016 @item gnus-treat-play-sounds
12017 @item gnus-treat-ansi-sequences (t)
12018 @vindex gnus-treat-x-pgp-sig
12019 @item gnus-treat-x-pgp-sig (head)
12020
12021 @vindex gnus-treat-unfold-headers
12022 @item gnus-treat-unfold-headers (head)
12023 @vindex gnus-treat-fold-headers
12024 @item gnus-treat-fold-headers (head)
12025 @vindex gnus-treat-fold-newsgroups
12026 @item gnus-treat-fold-newsgroups (head)
12027 @vindex gnus-treat-leading-whitespace
12028 @item gnus-treat-leading-whitespace (head)
12029
12030 @xref{Article Header}.
12031
12032
12033 @end table
12034
12035 @vindex gnus-part-display-hook
12036 You can, of course, write your own functions to be called from
12037 @code{gnus-part-display-hook}.  The functions are called narrowed to the
12038 part, and you can do anything you like, pretty much.  There is no
12039 information that you have to keep in the buffer---you can change
12040 everything.
12041
12042
12043 @node Article Keymap
12044 @section Article Keymap
12045
12046 Most of the keystrokes in the summary buffer can also be used in the
12047 article buffer.  They should behave as if you typed them in the summary
12048 buffer, which means that you don't actually have to have a summary
12049 buffer displayed while reading.  You can do it all from the article
12050 buffer.
12051
12052 @kindex v (Article)
12053 @cindex keys, reserved for users (Article)
12054 The key @kbd{v} is reserved for users.  You can bind it to some
12055 command or better use it as a prefix key.
12056
12057 A few additional keystrokes are available:
12058
12059 @table @kbd
12060
12061 @item SPACE
12062 @kindex SPACE (Article)
12063 @findex gnus-article-next-page
12064 Scroll forwards one page (@code{gnus-article-next-page}).
12065 This is exactly the same as @kbd{h SPACE h}.
12066
12067 @item DEL
12068 @kindex DEL (Article)
12069 @findex gnus-article-prev-page
12070 Scroll backwards one page (@code{gnus-article-prev-page}).
12071 This is exactly the same as @kbd{h DEL h}.
12072
12073 @item C-c ^
12074 @kindex C-c ^ (Article)
12075 @findex gnus-article-refer-article
12076 If point is in the neighborhood of a @code{Message-ID} and you press
12077 @kbd{C-c ^}, Gnus will try to get that article from the server
12078 (@code{gnus-article-refer-article}).
12079
12080 @item C-c C-m
12081 @kindex C-c C-m (Article)
12082 @findex gnus-article-mail
12083 Send a reply to the address near point (@code{gnus-article-mail}).  If
12084 given a prefix, include the mail.
12085
12086 @item s
12087 @kindex s (Article)
12088 @findex gnus-article-show-summary
12089 Reconfigure the buffers so that the summary buffer becomes visible
12090 (@code{gnus-article-show-summary}).
12091
12092 @item ?
12093 @kindex ? (Article)
12094 @findex gnus-article-describe-briefly
12095 Give a very brief description of the available keystrokes
12096 (@code{gnus-article-describe-briefly}).
12097
12098 @item TAB
12099 @kindex TAB (Article)
12100 @findex gnus-article-next-button
12101 Go to the next button, if any (@code{gnus-article-next-button}).  This
12102 only makes sense if you have buttonizing turned on.
12103
12104 @item M-TAB
12105 @kindex M-TAB (Article)
12106 @findex gnus-article-prev-button
12107 Go to the previous button, if any (@code{gnus-article-prev-button}).
12108
12109 @item R
12110 @kindex R (Article)
12111 @findex gnus-article-reply-with-original
12112 Send a reply to the current article and yank the current article
12113 (@code{gnus-article-reply-with-original}).  If the region is active,
12114 only yank the text in the region.
12115
12116 @item S W
12117 @kindex S W (Article)
12118 @findex gnus-article-wide-reply-with-original
12119 Send a wide reply to the current article and yank the current article
12120 (@code{gnus-article-wide-reply-with-original}).  If the region is
12121 active, only yank the text in the region.
12122
12123 @item F
12124 @kindex F (Article)
12125 @findex gnus-article-followup-with-original
12126 Send a followup to the current article and yank the current article
12127 (@code{gnus-article-followup-with-original}).  If the region is active,
12128 only yank the text in the region.
12129
12130
12131 @end table
12132
12133
12134 @node Misc Article
12135 @section Misc Article
12136
12137 @table @code
12138
12139 @item gnus-single-article-buffer
12140 @vindex gnus-single-article-buffer
12141 @cindex article buffers, several
12142 If non-@code{nil}, use the same article buffer for all the groups.
12143 (This is the default.)  If @code{nil}, each group will have its own
12144 article buffer.
12145
12146 @item gnus-widen-article-window
12147 @cindex gnus-widen-article-window
12148 If non-@code{nil}, selecting the article buffer with the @kbd{h}
12149 command will ``widen'' the article window to take the entire frame.
12150
12151 @vindex gnus-article-decode-hook
12152 @item gnus-article-decode-hook
12153 @cindex @acronym{MIME}
12154 Hook used to decode @acronym{MIME} articles.  The default value is
12155 @code{(article-decode-charset article-decode-encoded-words)}
12156
12157 @vindex gnus-article-prepare-hook
12158 @item gnus-article-prepare-hook
12159 This hook is called right after the article has been inserted into the
12160 article buffer.  It is mainly intended for functions that do something
12161 depending on the contents; it should probably not be used for changing
12162 the contents of the article buffer.
12163
12164 @item gnus-article-mode-hook
12165 @vindex gnus-article-mode-hook
12166 Hook called in article mode buffers.
12167
12168 @item gnus-article-mode-syntax-table
12169 @vindex gnus-article-mode-syntax-table
12170 Syntax table used in article buffers.  It is initialized from
12171 @code{text-mode-syntax-table}.
12172
12173 @vindex gnus-article-over-scroll
12174 @item gnus-article-over-scroll
12175 If non-@code{nil}, allow scrolling the article buffer even when there
12176 no more new text to scroll in.  The default is @code{nil}.
12177
12178 @vindex gnus-article-mode-line-format
12179 @item gnus-article-mode-line-format
12180 This variable is a format string along the same lines as
12181 @code{gnus-summary-mode-line-format} (@pxref{Summary Buffer Mode
12182 Line}).  It accepts the same format specifications as that variable,
12183 with two extensions:
12184
12185 @table @samp
12186
12187 @item w
12188 The @dfn{wash status} of the article.  This is a short string with one
12189 character for each possible article wash operation that may have been
12190 performed.  The characters and their meaning:
12191
12192 @table @samp
12193
12194 @item c
12195 Displayed when cited text may be hidden in the article buffer.
12196
12197 @item h
12198 Displayed when headers are hidden in the article buffer.
12199
12200 @item p
12201 Displayed when article is digitally signed or encrypted, and Gnus has
12202 hidden the security headers.  (N.B. does not tell anything about
12203 security status, i.e. good or bad signature.)
12204
12205 @item s
12206 Displayed when the signature has been hidden in the Article buffer.
12207
12208 @item o
12209 Displayed when Gnus has treated overstrike characters in the article buffer.
12210
12211 @item e
12212 Displayed when Gnus has treated emphasized strings in the article buffer.
12213
12214 @end table
12215
12216 @item m
12217 The number of @acronym{MIME} parts in the article.
12218
12219 @end table
12220
12221 @vindex gnus-break-pages
12222
12223 @item gnus-break-pages
12224 Controls whether @dfn{page breaking} is to take place.  If this variable
12225 is non-@code{nil}, the articles will be divided into pages whenever a
12226 page delimiter appears in the article.  If this variable is @code{nil},
12227 paging will not be done.
12228
12229 @item gnus-page-delimiter
12230 @vindex gnus-page-delimiter
12231 This is the delimiter mentioned above.  By default, it is @samp{^L}
12232 (formfeed).
12233
12234 @cindex IDNA
12235 @cindex internationalized domain names
12236 @vindex gnus-use-idna
12237 @item gnus-use-idna
12238 This variable controls whether Gnus performs IDNA decoding of
12239 internationalized domain names inside @samp{From}, @samp{To} and
12240 @samp{Cc} headers.  @xref{IDNA, ,IDNA,message, The Message Manual},
12241 for how to compose such messages.  This requires
12242 @uref{http://www.gnu.org/software/libidn/, GNU Libidn}, and this
12243 variable is only enabled if you have installed it.
12244
12245 @vindex gnus-inhibit-images
12246 @item gnus-inhibit-images
12247 If this is non-@code{nil}, inhibit displaying of images inline in the
12248 article body.  It is effective to images that are in articles as
12249 @acronym{MIME} parts, and images in @acronym{HTML} articles rendered
12250 when @code{mm-text-html-renderer} (@pxref{Display Customization,
12251 ,Display Customization, emacs-mime, The Emacs MIME Manual}) is
12252 @code{shr} or @code{gnus-w3m}.
12253
12254 @end table
12255
12256
12257 @node Composing Messages
12258 @chapter Composing Messages
12259 @cindex composing messages
12260 @cindex messages
12261 @cindex mail
12262 @cindex sending mail
12263 @cindex reply
12264 @cindex followup
12265 @cindex post
12266 @cindex using gpg
12267 @cindex using s/mime
12268 @cindex using smime
12269
12270 @kindex C-c C-c (Post)
12271 All commands for posting and mailing will put you in a message buffer
12272 where you can edit the article all you like, before you send the
12273 article by pressing @kbd{C-c C-c}.  @xref{Top, , Overview, message,
12274 Message Manual}.  Where the message will be posted/mailed to depends
12275 on your setup (@pxref{Posting Server}).
12276
12277 @menu
12278 * Mail::                        Mailing and replying.
12279 * Posting Server::              What server should you post and mail via?
12280 * POP before SMTP::             You cannot send a mail unless you read a mail.
12281 * Mail and Post::               Mailing and posting at the same time.
12282 * Archived Messages::           Where Gnus stores the messages you've sent.
12283 * Posting Styles::              An easier way to specify who you are.
12284 * Drafts::                      Postponing messages and rejected messages.
12285 * Rejected Articles::           What happens if the server doesn't like your article?
12286 * Signing and encrypting::      How to compose secure messages.
12287 @end menu
12288
12289 Also @pxref{Canceling and Superseding} for information on how to
12290 remove articles you shouldn't have posted.
12291
12292
12293 @node Mail
12294 @section Mail
12295
12296 Variables for customizing outgoing mail:
12297
12298 @table @code
12299 @item gnus-uu-digest-headers
12300 @vindex gnus-uu-digest-headers
12301 List of regexps to match headers included in digested messages.  The
12302 headers will be included in the sequence they are matched.  If
12303 @code{nil} include all headers.
12304
12305 @item gnus-add-to-list
12306 @vindex gnus-add-to-list
12307 If non-@code{nil}, add a @code{to-list} group parameter to mail groups
12308 that have none when you do a @kbd{a}.
12309
12310 @item gnus-confirm-mail-reply-to-news
12311 @vindex gnus-confirm-mail-reply-to-news
12312 If non-@code{nil}, Gnus will ask you for a confirmation when you are
12313 about to reply to news articles by mail.  If it is @code{nil}, nothing
12314 interferes in what you want to do.  This can also be a function
12315 receiving the group name as the only parameter which should return
12316 non-@code{nil} if a confirmation is needed, or a regular expression
12317 matching group names, where confirmation should be asked for.
12318
12319 If you find yourself never wanting to reply to mail, but occasionally
12320 press @kbd{R} anyway, this variable might be for you.
12321
12322 @item gnus-confirm-treat-mail-like-news
12323 @vindex gnus-confirm-treat-mail-like-news
12324 If non-@code{nil}, Gnus also requests confirmation according to
12325 @code{gnus-confirm-mail-reply-to-news} when replying to mail.  This is
12326 useful for treating mailing lists like newsgroups.
12327
12328 @end table
12329
12330
12331 @node Posting Server
12332 @section Posting Server
12333
12334 When you press those magical @kbd{C-c C-c} keys to ship off your latest
12335 (extremely intelligent, of course) article, where does it go?
12336
12337 Thank you for asking.  I hate you.
12338
12339 It can be quite complicated.
12340
12341 @vindex gnus-post-method
12342 When posting news, Message usually invokes @code{message-send-news}
12343 (@pxref{News Variables, , News Variables, message, Message Manual}).
12344 Normally, Gnus will post using the same select method as you're
12345 reading from (which might be convenient if you're reading lots of
12346 groups from different private servers).  However.  If the server
12347 you're reading from doesn't allow posting, just reading, you probably
12348 want to use some other server to post your (extremely intelligent and
12349 fabulously interesting) articles.  You can then set the
12350 @code{gnus-post-method} to some other method:
12351
12352 @lisp
12353 (setq gnus-post-method '(nnspool ""))
12354 @end lisp
12355
12356 Now, if you've done this, and then this server rejects your article, or
12357 this server is down, what do you do then?  To override this variable you
12358 can use a non-zero prefix to the @kbd{C-c C-c} command to force using
12359 the ``current'' server, to get back the default behavior, for posting.
12360
12361 If you give a zero prefix (i.e., @kbd{C-u 0 C-c C-c}) to that command,
12362 Gnus will prompt you for what method to use for posting.
12363
12364 You can also set @code{gnus-post-method} to a list of select methods.
12365 If that's the case, Gnus will always prompt you for what method to use
12366 for posting.
12367
12368 Finally, if you want to always post using the native select method,
12369 you can set this variable to @code{native}.
12370
12371 @vindex message-send-mail-function
12372 When sending mail, Message invokes the function specified by the
12373 variable @code{message-send-mail-function}.  Gnus tries to set it to a
12374 value suitable for your system.
12375 @xref{Mail Variables, ,Mail Variables,message,Message manual}, for more
12376 information.
12377
12378 @node POP before SMTP
12379 @section POP before SMTP
12380 @cindex pop before smtp
12381 @findex message-smtpmail-send-it
12382 @findex mail-source-touch-pop
12383
12384 Does your @acronym{ISP} require the @acronym{POP}-before-@acronym{SMTP}
12385 authentication?  It is whether you need to connect to the @acronym{POP}
12386 mail server within a certain time before sending mails.  If so, there is
12387 a convenient way.  To do that, put the following lines in your
12388 @file{~/.gnus.el} file:
12389
12390 @lisp
12391 (setq message-send-mail-function 'message-smtpmail-send-it)
12392 (add-hook 'message-send-mail-hook 'mail-source-touch-pop)
12393 @end lisp
12394
12395 @noindent
12396 It means to let Gnus connect to the @acronym{POP} mail server in advance
12397 whenever you send a mail.  The @code{mail-source-touch-pop} function
12398 does only a @acronym{POP} authentication according to the value of
12399 @code{mail-sources} without fetching mails, just before sending a mail.
12400 Note that you have to use @code{message-smtpmail-send-it} which runs
12401 @code{message-send-mail-hook} rather than @code{smtpmail-send-it} and
12402 set the value of @code{mail-sources} for a @acronym{POP} connection
12403 correctly.  @xref{Mail Sources}.
12404
12405 If you have two or more @acronym{POP} mail servers set in
12406 @code{mail-sources}, you may want to specify one of them to
12407 @code{mail-source-primary-source} as the @acronym{POP} mail server to be
12408 used for the @acronym{POP}-before-@acronym{SMTP} authentication.  If it
12409 is your primary @acronym{POP} mail server (i.e., you are fetching mails
12410 mainly from that server), you can set it permanently as follows:
12411
12412 @lisp
12413 (setq mail-source-primary-source
12414       '(pop :server "pop3.mail.server"
12415             :password "secret"))
12416 @end lisp
12417
12418 @noindent
12419 Otherwise, bind it dynamically only when performing the
12420 @acronym{POP}-before-@acronym{SMTP} authentication as follows:
12421
12422 @lisp
12423 (add-hook 'message-send-mail-hook
12424           (lambda ()
12425             (let ((mail-source-primary-source
12426                    '(pop :server "pop3.mail.server"
12427                          :password "secret")))
12428               (mail-source-touch-pop))))
12429 @end lisp
12430
12431 @node Mail and Post
12432 @section Mail and Post
12433
12434 Here's a list of variables relevant to both mailing and
12435 posting:
12436
12437 @table @code
12438 @item gnus-mailing-list-groups
12439 @findex gnus-mailing-list-groups
12440 @cindex mailing lists
12441
12442 If your news server offers groups that are really mailing lists
12443 gatewayed to the @acronym{NNTP} server, you can read those groups without
12444 problems, but you can't post/followup to them without some difficulty.
12445 One solution is to add a @code{to-address} to the group parameters
12446 (@pxref{Group Parameters}).  An easier thing to do is set the
12447 @code{gnus-mailing-list-groups} to a regexp that matches the groups that
12448 really are mailing lists.  Then, at least, followups to the mailing
12449 lists will work most of the time.  Posting to these groups (@kbd{a}) is
12450 still a pain, though.
12451
12452 @item gnus-user-agent
12453 @vindex gnus-user-agent
12454 @cindex User-Agent
12455
12456 This variable controls which information should be exposed in the
12457 User-Agent header.  It can be a list of symbols or a string.  Valid
12458 symbols are @code{gnus} (show Gnus version) and @code{emacs} (show Emacs
12459 version).  In addition to the Emacs version, you can add @code{codename}
12460 (show (S)XEmacs codename) or either @code{config} (show system
12461 configuration) or @code{type} (show system type).  If you set it to a
12462 string, be sure to use a valid format, see RFC 2616.
12463
12464 @end table
12465
12466 You may want to do spell-checking on messages that you send out.  Or, if
12467 you don't want to spell-check by hand, you could add automatic
12468 spell-checking via the @code{ispell} package:
12469
12470 @cindex ispell
12471 @findex ispell-message
12472 @lisp
12473 (add-hook 'message-send-hook 'ispell-message)
12474 @end lisp
12475
12476 If you want to change the @code{ispell} dictionary based on what group
12477 you're in, you could say something like the following:
12478
12479 @lisp
12480 (add-hook 'gnus-select-group-hook
12481           (lambda ()
12482             (cond
12483              ((string-match
12484                "^de\\." (gnus-group-real-name gnus-newsgroup-name))
12485               (ispell-change-dictionary "deutsch"))
12486              (t
12487               (ispell-change-dictionary "english")))))
12488 @end lisp
12489
12490 Modify to suit your needs.
12491
12492 @vindex gnus-message-highlight-citation
12493 If @code{gnus-message-highlight-citation} is t, different levels of
12494 citations are highlighted like in Gnus article buffers also in message
12495 mode buffers.
12496
12497 @node Archived Messages
12498 @section Archived Messages
12499 @cindex archived messages
12500 @cindex sent messages
12501
12502 Gnus provides a few different methods for storing the mail and news you
12503 send.  The default method is to use the @dfn{archive virtual server} to
12504 store the messages.  If you want to disable this completely, the
12505 @code{gnus-message-archive-group} variable should be @code{nil}, which
12506 is the default.
12507
12508 For archiving interesting messages in a group you read, see the
12509 @kbd{B c} (@code{gnus-summary-copy-article}) command (@pxref{Mail
12510 Group Commands}).
12511
12512 @vindex gnus-message-archive-method
12513 @code{gnus-message-archive-method} says what virtual server Gnus is to
12514 use to store sent messages.  The default is @code{"archive"}, and when
12515 actually being used it is expanded into:
12516
12517 @lisp
12518 (nnfolder "archive"
12519           (nnfolder-directory   "~/Mail/archive")
12520           (nnfolder-active-file "~/Mail/archive/active")
12521           (nnfolder-get-new-mail nil)
12522           (nnfolder-inhibit-expiry t))
12523 @end lisp
12524
12525 @quotation
12526 @vindex gnus-update-message-archive-method
12527 Note: a server like this is saved in the @file{~/.newsrc.eld} file first
12528 so that it may be used as a real method of the server which is named
12529 @code{"archive"} (that is, for the case where
12530 @code{gnus-message-archive-method} is set to @code{"archive"}) ever
12531 since.  If it once has been saved, it will never be updated by default
12532 even if you change the value of @code{gnus-message-archive-method}
12533 afterward.  Therefore, the server @code{"archive"} doesn't necessarily
12534 mean the @code{nnfolder} server like this at all times.  If you want the
12535 saved method to reflect always the value of
12536 @code{gnus-message-archive-method}, set the
12537 @code{gnus-update-message-archive-method} variable to a non-@code{nil}
12538 value.  The default value of this variable is @code{nil}.
12539 @end quotation
12540
12541 You can, however, use any mail select method (@code{nnml},
12542 @code{nnmbox}, etc.).  @code{nnfolder} is a quite likable select method
12543 for doing this sort of thing, though.  If you don't like the default
12544 directory chosen, you could say something like:
12545
12546 @lisp
12547 (setq gnus-message-archive-method
12548       '(nnfolder "archive"
12549                  (nnfolder-inhibit-expiry t)
12550                  (nnfolder-active-file "~/News/sent-mail/active")
12551                  (nnfolder-directory "~/News/sent-mail/")))
12552 @end lisp
12553
12554 @vindex gnus-message-archive-group
12555 @cindex Gcc
12556 Gnus will insert @code{Gcc} headers in all outgoing messages that point
12557 to one or more group(s) on that server.  Which group to use is
12558 determined by the @code{gnus-message-archive-group} variable.
12559
12560 This variable can be used to do the following:
12561
12562 @table @asis
12563 @item a string
12564 Messages will be saved in that group.
12565
12566 Note that you can include a select method in the group name, then the
12567 message will not be stored in the select method given by
12568 @code{gnus-message-archive-method}, but in the select method specified
12569 by the group name, instead.  Suppose @code{gnus-message-archive-method}
12570 has the default value shown above.  Then setting
12571 @code{gnus-message-archive-group} to @code{"foo"} means that outgoing
12572 messages are stored in @samp{nnfolder+archive:foo}, but if you use the
12573 value @code{"nnml:foo"}, then outgoing messages will be stored in
12574 @samp{nnml:foo}.
12575
12576 @item a list of strings
12577 Messages will be saved in all those groups.
12578
12579 @item an alist of regexps, functions and forms
12580 When a key ``matches'', the result is used.
12581
12582 @item @code{nil}
12583 No message archiving will take place.  This is the default.
12584 @end table
12585
12586 Let's illustrate:
12587
12588 Just saving to a single group called @samp{MisK}:
12589 @lisp
12590 (setq gnus-message-archive-group "MisK")
12591 @end lisp
12592
12593 Saving to two groups, @samp{MisK} and @samp{safe}:
12594 @lisp
12595 (setq gnus-message-archive-group '("MisK" "safe"))
12596 @end lisp
12597
12598 Save to different groups based on what group you are in:
12599 @lisp
12600 (setq gnus-message-archive-group
12601       '(("^alt" "sent-to-alt")
12602         ("mail" "sent-to-mail")
12603         (".*" "sent-to-misc")))
12604 @end lisp
12605
12606 More complex stuff:
12607 @lisp
12608 (setq gnus-message-archive-group
12609       '((if (message-news-p)
12610             "misc-news"
12611           "misc-mail")))
12612 @end lisp
12613
12614 How about storing all news messages in one file, but storing all mail
12615 messages in one file per month:
12616
12617 @lisp
12618 (setq gnus-message-archive-group
12619       '((if (message-news-p)
12620             "misc-news"
12621           (concat "mail." (format-time-string "%Y-%m")))))
12622 @end lisp
12623
12624 Now, when you send a message off, it will be stored in the appropriate
12625 group.  (If you want to disable storing for just one particular message,
12626 you can just remove the @code{Gcc} header that has been inserted.)  The
12627 archive group will appear in the group buffer the next time you start
12628 Gnus, or the next time you press @kbd{F} in the group buffer.  You can
12629 enter it and read the articles in it just like you'd read any other
12630 group.  If the group gets really big and annoying, you can simply rename
12631 if (using @kbd{G r} in the group buffer) to something
12632 nice---@samp{misc-mail-september-1995}, or whatever.  New messages will
12633 continue to be stored in the old (now empty) group.
12634
12635 @table @code
12636 @item gnus-gcc-mark-as-read
12637 @vindex gnus-gcc-mark-as-read
12638 If non-@code{nil}, automatically mark @code{Gcc} articles as read.
12639
12640 @item gnus-gcc-externalize-attachments
12641 @vindex gnus-gcc-externalize-attachments
12642 If @code{nil}, attach files as normal parts in Gcc copies; if a regexp
12643 and matches the Gcc group name, attach files as external parts; if it is
12644 @code{all}, attach local files as external parts; if it is other
12645 non-@code{nil}, the behavior is the same as @code{all}, but it may be
12646 changed in the future.
12647
12648 @end table
12649
12650
12651 @node Posting Styles
12652 @section Posting Styles
12653 @cindex posting styles
12654 @cindex styles
12655
12656 All them variables, they make my head swim.
12657
12658 So what if you want a different @code{Organization} and signature based
12659 on what groups you post to?  And you post both from your home machine
12660 and your work machine, and you want different @code{From} lines, and so
12661 on?
12662
12663 @vindex gnus-posting-styles
12664 One way to do stuff like that is to write clever hooks that change the
12665 variables you need to have changed.  That's a bit boring, so somebody
12666 came up with the bright idea of letting the user specify these things in
12667 a handy alist.  Here's an example of a @code{gnus-posting-styles}
12668 variable:
12669
12670 @lisp
12671 ((".*"
12672   (signature "Peace and happiness")
12673   (organization "What me?"))
12674  ("^comp"
12675   (signature "Death to everybody"))
12676  ("comp.emacs.i-love-it"
12677   (organization "Emacs is it")))
12678 @end lisp
12679
12680 As you might surmise from this example, this alist consists of several
12681 @dfn{styles}.  Each style will be applicable if the first element
12682 ``matches'', in some form or other.  The entire alist will be iterated
12683 over, from the beginning towards the end, and each match will be
12684 applied, which means that attributes in later styles that match override
12685 the same attributes in earlier matching styles.  So
12686 @samp{comp.programming.literate} will have the @samp{Death to everybody}
12687 signature and the @samp{What me?} @code{Organization} header.
12688
12689 The first element in each style is called the @code{match}.  If it's a
12690 string, then Gnus will try to regexp match it against the group name.
12691 If it is the form @code{(header @var{match} @var{regexp})}, then Gnus
12692 will look in the original article for a header whose name is
12693 @var{match} and compare that @var{regexp}.  @var{match} and
12694 @var{regexp} are strings.  (The original article is the one you are
12695 replying or following up to.  If you are not composing a reply or a
12696 followup, then there is nothing to match against.)  If the
12697 @code{match} is a function symbol, that function will be called with
12698 no arguments.  If it's a variable symbol, then the variable will be
12699 referenced.  If it's a list, then that list will be @code{eval}ed.  In
12700 any case, if this returns a non-@code{nil} value, then the style is
12701 said to @dfn{match}.
12702
12703 Each style may contain an arbitrary amount of @dfn{attributes}.  Each
12704 attribute consists of a @code{(@var{name} @var{value})} pair.  In
12705 addition, you can also use the @code{(@var{name} :file @var{value})}
12706 form or the @code{(@var{name} :value @var{value})} form.  Where
12707 @code{:file} signifies @var{value} represents a file name and its
12708 contents should be used as the attribute value, @code{:value} signifies
12709 @var{value} does not represent a file name explicitly.  The attribute
12710 name can be one of:
12711
12712 @itemize @bullet
12713 @item @code{signature}
12714 @item @code{signature-file}
12715 @item @code{x-face-file}
12716 @item @code{address}, overriding @code{user-mail-address}
12717 @item @code{name}, overriding @code{(user-full-name)}
12718 @item @code{body}
12719 @end itemize
12720
12721 Note that the @code{signature-file} attribute honors the variable
12722 @code{message-signature-directory}.
12723
12724 The attribute name can also be a string or a symbol.  In that case,
12725 this will be used as a header name, and the value will be inserted in
12726 the headers of the article; if the value is @code{nil}, the header
12727 name will be removed.  If the attribute name is @code{eval}, the form
12728 is evaluated, and the result is thrown away.
12729
12730 The attribute value can be a string, a function with zero arguments
12731 (the return value will be used), a variable (its value will be used)
12732 or a list (it will be @code{eval}ed and the return value will be
12733 used).  The functions and sexps are called/@code{eval}ed in the
12734 message buffer that is being set up.  The headers of the current
12735 article are available through the @code{message-reply-headers}
12736 variable, which is a vector of the following headers: number subject
12737 from date id references chars lines xref extra.
12738
12739 In the case of a string value, if the @code{match} is a regular
12740 expression, a @samp{gnus-match-substitute-replacement} is proceed on
12741 the value to replace the positional parameters @samp{\@var{n}} by the
12742 corresponding parenthetical matches (see @xref{Replacing the Text that
12743 Matched, , Text Replacement, elisp, The Emacs Lisp Reference Manual}.)
12744
12745 @vindex message-reply-headers
12746
12747 If you wish to check whether the message you are about to compose is
12748 meant to be a news article or a mail message, you can check the values
12749 of the @code{message-news-p} and @code{message-mail-p} functions.
12750
12751 @findex message-mail-p
12752 @findex message-news-p
12753
12754 So here's a new example:
12755
12756 @lisp
12757 (setq gnus-posting-styles
12758       '((".*"
12759          (signature-file "~/.signature")
12760          (name "User Name")
12761          (x-face-file "~/.xface")
12762          (x-url (getenv "WWW_HOME"))
12763          (organization "People's Front Against MWM"))
12764         ("^rec.humor"
12765          (signature my-funny-signature-randomizer))
12766         ((equal (system-name) "gnarly")  ;; @r{A form}
12767          (signature my-quote-randomizer))
12768         (message-news-p        ;; @r{A function symbol}
12769          (signature my-news-signature))
12770         (window-system         ;; @r{A value symbol}
12771          ("X-Window-System" (format "%s" window-system)))
12772         ;; @r{If I'm replying to Larsi, set the Organization header.}
12773         ((header "from" "larsi.*org")
12774          (Organization "Somewhere, Inc."))
12775         ((posting-from-work-p) ;; @r{A user defined function}
12776          (signature-file "~/.work-signature")
12777          (address "user@@bar.foo")
12778          (body "You are fired.\n\nSincerely, your boss.")
12779          (organization "Important Work, Inc"))
12780         ("nnml:.*"
12781          (From (with-current-buffer gnus-article-buffer
12782                  (message-fetch-field "to"))))
12783         ("^nn.+:"
12784          (signature-file "~/.mail-signature"))))
12785 @end lisp
12786
12787 The @samp{nnml:.*} rule means that you use the @code{To} address as the
12788 @code{From} address in all your outgoing replies, which might be handy
12789 if you fill many roles.
12790 You may also use @code{message-alternative-emails} instead.
12791 @xref{Message Headers, ,Message Headers, message, Message Manual}.
12792
12793 @node Drafts
12794 @section Drafts
12795 @cindex drafts
12796
12797 If you are writing a message (mail or news) and suddenly remember that
12798 you have a steak in the oven (or some pesto in the food processor, you
12799 craaazy vegetarians), you'll probably wish there was a method to save
12800 the message you are writing so that you can continue editing it some
12801 other day, and send it when you feel its finished.
12802
12803 Well, don't worry about it.  Whenever you start composing a message of
12804 some sort using the Gnus mail and post commands, the buffer you get will
12805 automatically associate to an article in a special @dfn{draft} group.
12806 If you save the buffer the normal way (@kbd{C-x C-s}, for instance), the
12807 article will be saved there.  (Auto-save files also go to the draft
12808 group.)
12809
12810 @cindex nndraft
12811 @vindex nndraft-directory
12812 The draft group is a special group (which is implemented as an
12813 @code{nndraft} group, if you absolutely have to know) called
12814 @samp{nndraft:drafts}.  The variable @code{nndraft-directory} says where
12815 @code{nndraft} is to store its files.  What makes this group special is
12816 that you can't tick any articles in it or mark any articles as
12817 read---all articles in the group are permanently unread.
12818
12819 If the group doesn't exist, it will be created and you'll be subscribed
12820 to it.  The only way to make it disappear from the Group buffer is to
12821 unsubscribe it.  The special properties of the draft group comes from
12822 a group property (@pxref{Group Parameters}), and if lost the group
12823 behaves like any other group.  This means the commands below will not
12824 be available.  To restore the special properties of the group, the
12825 simplest way is to kill the group, using @kbd{C-k}, and restart
12826 Gnus.  The group is automatically created again with the
12827 correct parameters.  The content of the group is not lost.
12828
12829 @c @findex gnus-dissociate-buffer-from-draft
12830 @c @kindex C-c M-d (Mail)
12831 @c @kindex C-c M-d (Post)
12832 @c @findex gnus-associate-buffer-with-draft
12833 @c @kindex C-c C-d (Mail)
12834 @c @kindex C-c C-d (Post)
12835 @c If you're writing some super-secret message that you later want to
12836 @c encode with PGP before sending, you may wish to turn the auto-saving
12837 @c (and association with the draft group) off.  You never know who might be
12838 @c interested in reading all your extremely valuable and terribly horrible
12839 @c and interesting secrets.  The @kbd{C-c M-d}
12840 @c (@code{gnus-dissociate-buffer-from-draft}) command does that for you.
12841 @c If you change your mind and want to turn the auto-saving back on again,
12842 @c @kbd{C-c C-d} (@code{gnus-associate-buffer-with-draft} does that.
12843 @c
12844 @c @vindex gnus-use-draft
12845 @c To leave association with the draft group off by default, set
12846 @c @code{gnus-use-draft} to @code{nil}.  It is @code{t} by default.
12847
12848 @findex gnus-draft-edit-message
12849 @kindex D e (Draft)
12850 When you want to continue editing the article, you simply enter the
12851 draft group and push @kbd{D e} (@code{gnus-draft-edit-message}) to do
12852 that.  You will be placed in a buffer where you left off.
12853
12854 Rejected articles will also be put in this draft group (@pxref{Rejected
12855 Articles}).
12856
12857 @findex gnus-draft-send-all-messages
12858 @kindex D s (Draft)
12859 @findex gnus-draft-send-message
12860 @kindex D S (Draft)
12861 If you have lots of rejected messages you want to post (or mail) without
12862 doing further editing, you can use the @kbd{D s} command
12863 (@code{gnus-draft-send-message}).  This command understands the
12864 process/prefix convention (@pxref{Process/Prefix}).  The @kbd{D S}
12865 command (@code{gnus-draft-send-all-messages}) will ship off all messages
12866 in the buffer.
12867
12868 @findex gnus-draft-toggle-sending
12869 @kindex D t (Draft)
12870 If you have some messages that you wish not to send, you can use the
12871 @kbd{D t} (@code{gnus-draft-toggle-sending}) command to mark the message
12872 as unsendable.  This is a toggling command.
12873
12874 Finally, if you want to delete a draft, use the normal @kbd{B DEL}
12875 command (@pxref{Mail Group Commands}).
12876
12877
12878 @node Rejected Articles
12879 @section Rejected Articles
12880 @cindex rejected articles
12881
12882 Sometimes a news server will reject an article.  Perhaps the server
12883 doesn't like your face.  Perhaps it just feels miserable.  Perhaps
12884 @emph{there be demons}.  Perhaps you have included too much cited text.
12885 Perhaps the disk is full.  Perhaps the server is down.
12886
12887 These situations are, of course, totally beyond the control of Gnus.
12888 (Gnus, of course, loves the way you look, always feels great, has angels
12889 fluttering around inside of it, doesn't care about how much cited text
12890 you include, never runs full and never goes down.)  So Gnus saves these
12891 articles until some later time when the server feels better.
12892
12893 The rejected articles will automatically be put in a special draft group
12894 (@pxref{Drafts}).  When the server comes back up again, you'd then
12895 typically enter that group and send all the articles off.
12896
12897 @node Signing and encrypting
12898 @section Signing and encrypting
12899 @cindex using gpg
12900 @cindex using s/mime
12901 @cindex using smime
12902
12903 Gnus can digitally sign and encrypt your messages, using vanilla
12904 @acronym{PGP} format or @acronym{PGP/MIME} or @acronym{S/MIME}.  For
12905 decoding such messages, see the @code{mm-verify-option} and
12906 @code{mm-decrypt-option} options (@pxref{Security}).
12907
12908 @vindex gnus-message-replysign
12909 @vindex gnus-message-replyencrypt
12910 @vindex gnus-message-replysignencrypted
12911 Often, you would like to sign replies to people who send you signed
12912 messages.  Even more often, you might want to encrypt messages which
12913 are in reply to encrypted messages.  Gnus offers
12914 @code{gnus-message-replysign} to enable the former, and
12915 @code{gnus-message-replyencrypt} for the latter.  In addition, setting
12916 @code{gnus-message-replysignencrypted} (on by default) will sign
12917 automatically encrypted messages.
12918
12919 Instructing @acronym{MML} to perform security operations on a
12920 @acronym{MIME} part is done using the @kbd{C-c C-m s} key map for
12921 signing and the @kbd{C-c C-m c} key map for encryption, as follows.
12922
12923 @table @kbd
12924
12925 @item C-c C-m s s
12926 @kindex C-c C-m s s (Message)
12927 @findex mml-secure-message-sign-smime
12928
12929 Digitally sign current message using @acronym{S/MIME}.
12930
12931 @item C-c C-m s o
12932 @kindex C-c C-m s o (Message)
12933 @findex mml-secure-message-sign-pgp
12934
12935 Digitally sign current message using @acronym{PGP}.
12936
12937 @item C-c C-m s p
12938 @kindex C-c C-m s p (Message)
12939 @findex mml-secure-message-sign-pgp
12940
12941 Digitally sign current message using @acronym{PGP/MIME}.
12942
12943 @item C-c C-m c s
12944 @kindex C-c C-m c s (Message)
12945 @findex mml-secure-message-encrypt-smime
12946
12947 Digitally encrypt current message using @acronym{S/MIME}.
12948
12949 @item C-c C-m c o
12950 @kindex C-c C-m c o (Message)
12951 @findex mml-secure-message-encrypt-pgp
12952
12953 Digitally encrypt current message using @acronym{PGP}.
12954
12955 @item C-c C-m c p
12956 @kindex C-c C-m c p (Message)
12957 @findex mml-secure-message-encrypt-pgpmime
12958
12959 Digitally encrypt current message using @acronym{PGP/MIME}.
12960
12961 @item C-c C-m C-n
12962 @kindex C-c C-m C-n (Message)
12963 @findex mml-unsecure-message
12964 Remove security related @acronym{MML} tags from message.
12965
12966 @end table
12967
12968 @xref{Security, ,Security, message, Message Manual}, for more information.
12969
12970 @node Select Methods
12971 @chapter Select Methods
12972 @cindex foreign groups
12973 @cindex select methods
12974
12975 A @dfn{foreign group} is a group not read by the usual (or
12976 default) means.  It could be, for instance, a group from a different
12977 @acronym{NNTP} server, it could be a virtual group, or it could be your own
12978 personal mail group.
12979
12980 A foreign group (or any group, really) is specified by a @dfn{name} and
12981 a @dfn{select method}.  To take the latter first, a select method is a
12982 list where the first element says what back end to use (e.g. @code{nntp},
12983 @code{nnspool}, @code{nnml}) and the second element is the @dfn{server
12984 name}.  There may be additional elements in the select method, where the
12985 value may have special meaning for the back end in question.
12986
12987 One could say that a select method defines a @dfn{virtual server}---so
12988 we do just that (@pxref{Server Buffer}).
12989
12990 The @dfn{name} of the group is the name the back end will recognize the
12991 group as.
12992
12993 For instance, the group @samp{soc.motss} on the @acronym{NNTP} server
12994 @samp{some.where.edu} will have the name @samp{soc.motss} and select
12995 method @code{(nntp "some.where.edu")}.  Gnus will call this group
12996 @samp{nntp+some.where.edu:soc.motss}, even though the @code{nntp}
12997 back end just knows this group as @samp{soc.motss}.
12998
12999 The different methods all have their peculiarities, of course.
13000
13001 @menu
13002 * Server Buffer::               Making and editing virtual servers.
13003 * Getting News::                Reading USENET news with Gnus.
13004 * Using IMAP::                  Reading mail from @acronym{IMAP}.
13005 * Getting Mail::                Reading your personal mail with Gnus.
13006 * Browsing the Web::            Getting messages from a plethora of Web sources.
13007 * Other Sources::               Reading directories, files.
13008 * Combined Groups::             Combining groups into one group.
13009 * Email Based Diary::           Using mails to manage diary events in Gnus.
13010 * Gnus Unplugged::              Reading news and mail offline.
13011 @end menu
13012
13013
13014 @node Server Buffer
13015 @section Server Buffer
13016
13017 Traditionally, a @dfn{server} is a machine or a piece of software that
13018 one connects to, and then requests information from.  Gnus does not
13019 connect directly to any real servers, but does all transactions through
13020 one back end or other.  But that's just putting one layer more between
13021 the actual media and Gnus, so we might just as well say that each
13022 back end represents a virtual server.
13023
13024 For instance, the @code{nntp} back end may be used to connect to several
13025 different actual @acronym{NNTP} servers, or, perhaps, to many different ports
13026 on the same actual @acronym{NNTP} server.  You tell Gnus which back end to
13027 use, and what parameters to set by specifying a @dfn{select method}.
13028
13029 These select method specifications can sometimes become quite
13030 complicated---say, for instance, that you want to read from the
13031 @acronym{NNTP} server @samp{news.funet.fi} on port number 13, which
13032 hangs if queried for @acronym{NOV} headers and has a buggy select.  Ahem.
13033 Anyway, if you had to specify that for each group that used this
13034 server, that would be too much work, so Gnus offers a way of naming
13035 select methods, which is what you do in the server buffer.
13036
13037 To enter the server buffer, use the @kbd{^}
13038 (@code{gnus-group-enter-server-mode}) command in the group buffer.
13039
13040 @menu
13041 * Server Buffer Format::        You can customize the look of this buffer.
13042 * Server Commands::             Commands to manipulate servers.
13043 * Example Methods::             Examples server specifications.
13044 * Creating a Virtual Server::   An example session.
13045 * Server Variables::            Which variables to set.
13046 * Servers and Methods::         You can use server names as select methods.
13047 * Unavailable Servers::         Some servers you try to contact may be down.
13048 @end menu
13049
13050 @vindex gnus-server-mode-hook
13051 @code{gnus-server-mode-hook} is run when creating the server buffer.
13052
13053
13054 @node Server Buffer Format
13055 @subsection Server Buffer Format
13056 @cindex server buffer format
13057
13058 @vindex gnus-server-line-format
13059 You can change the look of the server buffer lines by changing the
13060 @code{gnus-server-line-format} variable.  This is a @code{format}-like
13061 variable, with some simple extensions:
13062
13063 @table @samp
13064
13065 @item h
13066 How the news is fetched---the back end name.
13067
13068 @item n
13069 The name of this server.
13070
13071 @item w
13072 Where the news is to be fetched from---the address.
13073
13074 @item s
13075 The opened/closed/denied status of the server.
13076
13077 @item a
13078 Whether this server is agentized.
13079 @end table
13080
13081 @vindex gnus-server-mode-line-format
13082 The mode line can also be customized by using the
13083 @code{gnus-server-mode-line-format} variable (@pxref{Mode Line
13084 Formatting}).  The following specs are understood:
13085
13086 @table @samp
13087 @item S
13088 Server name.
13089
13090 @item M
13091 Server method.
13092 @end table
13093
13094 Also @pxref{Formatting Variables}.
13095
13096
13097 @node Server Commands
13098 @subsection Server Commands
13099 @cindex server commands
13100
13101 @table @kbd
13102
13103 @item v
13104 @kindex v (Server)
13105 @cindex keys, reserved for users (Server)
13106 The key @kbd{v} is reserved for users.  You can bind it to some
13107 command or better use it as a prefix key.
13108
13109 @item a
13110 @kindex a (Server)
13111 @findex gnus-server-add-server
13112 Add a new server (@code{gnus-server-add-server}).
13113
13114 @item e
13115 @kindex e (Server)
13116 @findex gnus-server-edit-server
13117 Edit a server (@code{gnus-server-edit-server}).
13118
13119 @item S
13120 @kindex S (Server)
13121 @findex gnus-server-show-server
13122 Show the definition of a server (@code{gnus-server-show-server}).
13123
13124 @item SPACE
13125 @kindex SPACE (Server)
13126 @findex gnus-server-read-server
13127 Browse the current server (@code{gnus-server-read-server}).
13128
13129 @item q
13130 @kindex q (Server)
13131 @findex gnus-server-exit
13132 Return to the group buffer (@code{gnus-server-exit}).
13133
13134 @item k
13135 @kindex k (Server)
13136 @findex gnus-server-kill-server
13137 Kill the current server (@code{gnus-server-kill-server}).
13138
13139 @item y
13140 @kindex y (Server)
13141 @findex gnus-server-yank-server
13142 Yank the previously killed server (@code{gnus-server-yank-server}).
13143
13144 @item c
13145 @kindex c (Server)
13146 @findex gnus-server-copy-server
13147 Copy the current server (@code{gnus-server-copy-server}).
13148
13149 @item l
13150 @kindex l (Server)
13151 @findex gnus-server-list-servers
13152 List all servers (@code{gnus-server-list-servers}).
13153
13154 @item s
13155 @kindex s (Server)
13156 @findex gnus-server-scan-server
13157 Request that the server scan its sources for new articles
13158 (@code{gnus-server-scan-server}).  This is mainly sensible with mail
13159 servers.
13160
13161 @item g
13162 @kindex g (Server)
13163 @findex gnus-server-regenerate-server
13164 Request that the server regenerate all its data structures
13165 (@code{gnus-server-regenerate-server}).  This can be useful if you have
13166 a mail back end that has gotten out of sync.
13167
13168 @item z
13169 @kindex z (Server)
13170 @findex gnus-server-compact-server
13171
13172 Compact all groups in the server under point
13173 (@code{gnus-server-compact-server}).  Currently implemented only in
13174 nnml (@pxref{Mail Spool}).  This removes gaps between article numbers,
13175 hence getting a correct total article count.
13176
13177 @end table
13178
13179 Some more commands for closing, disabling, and re-opening servers are
13180 listed in @ref{Unavailable Servers}.
13181
13182
13183 @node Example Methods
13184 @subsection Example Methods
13185
13186 Most select methods are pretty simple and self-explanatory:
13187
13188 @lisp
13189 (nntp "news.funet.fi")
13190 @end lisp
13191
13192 Reading directly from the spool is even simpler:
13193
13194 @lisp
13195 (nnspool "")
13196 @end lisp
13197
13198 As you can see, the first element in a select method is the name of the
13199 back end, and the second is the @dfn{address}, or @dfn{name}, if you
13200 will.
13201
13202 After these two elements, there may be an arbitrary number of
13203 @code{(@var{variable} @var{form})} pairs.
13204
13205 To go back to the first example---imagine that you want to read from
13206 port 15 on that machine.  This is what the select method should
13207 look like then:
13208
13209 @lisp
13210 (nntp "news.funet.fi" (nntp-port-number 15))
13211 @end lisp
13212
13213 You should read the documentation to each back end to find out what
13214 variables are relevant, but here's an @code{nnmh} example:
13215
13216 @code{nnmh} is a mail back end that reads a spool-like structure.  Say
13217 you have two structures that you wish to access: One is your private
13218 mail spool, and the other is a public one.  Here's the possible spec for
13219 your private mail:
13220
13221 @lisp
13222 (nnmh "private" (nnmh-directory "~/private/mail/"))
13223 @end lisp
13224
13225 (This server is then called @samp{private}, but you may have guessed
13226 that.)
13227
13228 Here's the method for a public spool:
13229
13230 @lisp
13231 (nnmh "public"
13232       (nnmh-directory "/usr/information/spool/")
13233       (nnmh-get-new-mail nil))
13234 @end lisp
13235
13236 @cindex proxy
13237 @cindex firewall
13238
13239 If you are behind a firewall and only have access to the @acronym{NNTP}
13240 server from the firewall machine, you can instruct Gnus to @code{rlogin}
13241 on the firewall machine and connect with
13242 @uref{http://netcat.sourceforge.net/, netcat} from there to the
13243 @acronym{NNTP} server.
13244 Doing this can be rather fiddly, but your virtual server definition
13245 should probably look something like this:
13246
13247 @lisp
13248 (nntp "firewall"
13249       (nntp-open-connection-function nntp-open-via-rlogin-and-netcat)
13250       (nntp-via-address "the.firewall.machine")
13251       (nntp-address "the.real.nntp.host"))
13252 @end lisp
13253
13254 If you want to use the wonderful @code{ssh} program to provide a
13255 compressed connection over the modem line, you could add the following
13256 configuration to the example above:
13257
13258 @lisp
13259       (nntp-via-rlogin-command "ssh")
13260 @end lisp
13261
13262 See also @code{nntp-via-rlogin-command-switches}.  Here's an example for
13263 an indirect connection:
13264
13265 @lisp
13266 (setq gnus-select-method
13267       '(nntp "indirect"
13268              (nntp-address "news.server.example")
13269              (nntp-via-user-name "intermediate_user_name")
13270              (nntp-via-address "intermediate.host.example")
13271              (nntp-via-rlogin-command "ssh")
13272              (nntp-via-rlogin-command-switches ("-C"))
13273              (nntp-open-connection-function nntp-open-via-rlogin-and-netcat)))
13274 @end lisp
13275
13276 This means that you have to have set up @code{ssh-agent} correctly to
13277 provide automatic authorization, of course.
13278
13279 If you're behind a firewall, but have direct access to the outside world
13280 through a wrapper command like "runsocks", you could open a socksified
13281 netcat connection to the news server as follows:
13282
13283 @lisp
13284 (nntp "outside"
13285       (nntp-pre-command "runsocks")
13286       (nntp-open-connection-function nntp-open-netcat-stream)
13287       (nntp-address "the.news.server"))
13288 @end lisp
13289
13290
13291 @node Creating a Virtual Server
13292 @subsection Creating a Virtual Server
13293
13294 If you're saving lots of articles in the cache by using persistent
13295 articles, you may want to create a virtual server to read the cache.
13296
13297 First you need to add a new server.  The @kbd{a} command does that.  It
13298 would probably be best to use @code{nnml} to read the cache.  You
13299 could also use @code{nnspool} or @code{nnmh}, though.
13300
13301 Type @kbd{a nnml RET cache RET}.
13302
13303 You should now have a brand new @code{nnml} virtual server called
13304 @samp{cache}.  You now need to edit it to have the right definitions.
13305 Type @kbd{e} to edit the server.  You'll be entered into a buffer that
13306 will contain the following:
13307
13308 @lisp
13309 (nnml "cache")
13310 @end lisp
13311
13312 Change that to:
13313
13314 @lisp
13315 (nnml "cache"
13316          (nnml-directory "~/News/cache/")
13317          (nnml-active-file "~/News/cache/active"))
13318 @end lisp
13319
13320 Type @kbd{C-c C-c} to return to the server buffer.  If you now press
13321 @kbd{RET} over this virtual server, you should be entered into a browse
13322 buffer, and you should be able to enter any of the groups displayed.
13323
13324
13325 @node Server Variables
13326 @subsection Server Variables
13327 @cindex server variables
13328 @cindex server parameters
13329
13330 One sticky point when defining variables (both on back ends and in Emacs
13331 in general) is that some variables are typically initialized from other
13332 variables when the definition of the variables is being loaded.  If you
13333 change the ``base'' variable after the variables have been loaded, you
13334 won't change the ``derived'' variables.
13335
13336 This typically affects directory and file variables.  For instance,
13337 @code{nnml-directory} is @file{~/Mail/} by default, and all @code{nnml}
13338 directory variables are initialized from that variable, so
13339 @code{nnml-active-file} will be @file{~/Mail/active}.  If you define a
13340 new virtual @code{nnml} server, it will @emph{not} suffice to set just
13341 @code{nnml-directory}---you have to explicitly set all the file
13342 variables to be what you want them to be.  For a complete list of
13343 variables for each back end, see each back end's section later in this
13344 manual, but here's an example @code{nnml} definition:
13345
13346 @lisp
13347 (nnml "public"
13348       (nnml-directory "~/my-mail/")
13349       (nnml-active-file "~/my-mail/active")
13350       (nnml-newsgroups-file "~/my-mail/newsgroups"))
13351 @end lisp
13352
13353 Server variables are often called @dfn{server parameters}.
13354
13355 @node Servers and Methods
13356 @subsection Servers and Methods
13357
13358 Wherever you would normally use a select method
13359 (e.g. @code{gnus-secondary-select-method}, in the group select method,
13360 when browsing a foreign server) you can use a virtual server name
13361 instead.  This could potentially save lots of typing.  And it's nice all
13362 over.
13363
13364
13365 @node Unavailable Servers
13366 @subsection Unavailable Servers
13367
13368 If a server seems to be unreachable, Gnus will mark that server as
13369 @code{denied}.  That means that any subsequent attempt to make contact
13370 with that server will just be ignored.  ``It can't be opened,'' Gnus
13371 will tell you, without making the least effort to see whether that is
13372 actually the case or not.
13373
13374 That might seem quite naughty, but it does make sense most of the time.
13375 Let's say you have 10 groups subscribed to on server
13376 @samp{nephelococcygia.com}.  This server is located somewhere quite far
13377 away from you and the machine is quite slow, so it takes 1 minute just
13378 to find out that it refuses connection to you today.  If Gnus were to
13379 attempt to do that 10 times, you'd be quite annoyed, so Gnus won't
13380 attempt to do that.  Once it has gotten a single ``connection refused'',
13381 it will regard that server as ``down''.
13382
13383 So, what happens if the machine was only feeling unwell temporarily?
13384 How do you test to see whether the machine has come up again?
13385
13386 You jump to the server buffer (@pxref{Server Buffer}) and poke it
13387 with the following commands:
13388
13389 @table @kbd
13390
13391 @item O
13392 @kindex O (Server)
13393 @findex gnus-server-open-server
13394 Try to establish connection to the server on the current line
13395 (@code{gnus-server-open-server}).
13396
13397 @item C
13398 @kindex C (Server)
13399 @findex gnus-server-close-server
13400 Close the connection (if any) to the server
13401 (@code{gnus-server-close-server}).
13402
13403 @item D
13404 @kindex D (Server)
13405 @findex gnus-server-deny-server
13406 Mark the current server as unreachable
13407 (@code{gnus-server-deny-server}).
13408
13409 @item M-o
13410 @kindex M-o (Server)
13411 @findex gnus-server-open-all-servers
13412 Open the connections to all servers in the buffer
13413 (@code{gnus-server-open-all-servers}).
13414
13415 @item M-c
13416 @kindex M-c (Server)
13417 @findex gnus-server-close-all-servers
13418 Close the connections to all servers in the buffer
13419 (@code{gnus-server-close-all-servers}).
13420
13421 @item R
13422 @kindex R (Server)
13423 @findex gnus-server-remove-denials
13424 Remove all marks to whether Gnus was denied connection from any servers
13425 (@code{gnus-server-remove-denials}).
13426
13427 @item c
13428 @kindex c (Server)
13429 @findex gnus-server-copy-server
13430 Copy a server and give it a new name
13431 (@code{gnus-server-copy-server}).  This can be useful if you have a
13432 complex method definition, and want to use the same definition towards
13433 a different (physical) server.
13434
13435 @item L
13436 @kindex L (Server)
13437 @findex gnus-server-offline-server
13438 Set server status to offline (@code{gnus-server-offline-server}).
13439
13440 @end table
13441
13442
13443 @node Getting News
13444 @section Getting News
13445 @cindex reading news
13446 @cindex news back ends
13447
13448 A newsreader is normally used for reading news.  Gnus currently provides
13449 only two methods of getting news---it can read from an @acronym{NNTP} server,
13450 or it can read from a local spool.
13451
13452 @menu
13453 * NNTP::                        Reading news from an @acronym{NNTP} server.
13454 * News Spool::                  Reading news from the local spool.
13455 @end menu
13456
13457
13458 @node NNTP
13459 @subsection NNTP
13460 @cindex nntp
13461
13462 Subscribing to a foreign group from an @acronym{NNTP} server is rather easy.
13463 You just specify @code{nntp} as method and the address of the @acronym{NNTP}
13464 server as the, uhm, address.
13465
13466 If the @acronym{NNTP} server is located at a non-standard port, setting the
13467 third element of the select method to this port number should allow you
13468 to connect to the right port.  You'll have to edit the group info for
13469 that (@pxref{Foreign Groups}).
13470
13471 The name of the foreign group can be the same as a native group.  In
13472 fact, you can subscribe to the same group from as many different servers
13473 you feel like.  There will be no name collisions.
13474
13475 The following variables can be used to create a virtual @code{nntp}
13476 server:
13477
13478 @table @code
13479
13480 @item nntp-server-opened-hook
13481 @vindex nntp-server-opened-hook
13482 @cindex @sc{mode reader}
13483 @cindex authinfo
13484 @cindex authentication
13485 @cindex nntp authentication
13486 @findex nntp-send-authinfo
13487 @findex nntp-send-mode-reader
13488 is run after a connection has been made.  It can be used to send
13489 commands to the @acronym{NNTP} server after it has been contacted.  By
13490 default it sends the command @code{MODE READER} to the server with the
13491 @code{nntp-send-mode-reader} function.  This function should always be
13492 present in this hook.
13493
13494 @item nntp-authinfo-function
13495 @vindex nntp-authinfo-function
13496 @findex nntp-send-authinfo
13497 @vindex nntp-authinfo-file
13498 This function will be used to send @samp{AUTHINFO} to the @acronym{NNTP}
13499 server.  The default function is @code{nntp-send-authinfo}, which looks
13500 through your @file{~/.authinfo} (or whatever you've set the
13501 @code{nntp-authinfo-file} variable to) for applicable entries.  If none
13502 are found, it will prompt you for a login name and a password.  The
13503 format of the @file{~/.authinfo} file is (almost) the same as the
13504 @code{ftp} @file{~/.netrc} file, which is defined in the @code{ftp}
13505 manual page, but here are the salient facts:
13506
13507 @enumerate
13508 @item
13509 The file contains one or more line, each of which define one server.
13510
13511 @item
13512 Each line may contain an arbitrary number of token/value pairs.
13513
13514 The valid tokens include @samp{machine}, @samp{login}, @samp{password},
13515 @samp{default}.  In addition Gnus introduces two new tokens, not present
13516 in the original @file{.netrc}/@code{ftp} syntax, namely @samp{port} and
13517 @samp{force}.  (This is the only way the @file{.authinfo} file format
13518 deviates from the @file{.netrc} file format.)  @samp{port} is used to
13519 indicate what port on the server the credentials apply to and
13520 @samp{force} is explained below.
13521
13522 @end enumerate
13523
13524 Here's an example file:
13525
13526 @example
13527 machine news.uio.no login larsi password geheimnis
13528 machine nntp.ifi.uio.no login larsi force yes
13529 @end example
13530
13531 The token/value pairs may appear in any order; @samp{machine} doesn't
13532 have to be first, for instance.
13533
13534 In this example, both login name and password have been supplied for the
13535 former server, while the latter has only the login name listed, and the
13536 user will be prompted for the password.  The latter also has the
13537 @samp{force} tag, which means that the authinfo will be sent to the
13538 @var{nntp} server upon connection; the default (i.e., when there is not
13539 @samp{force} tag) is to not send authinfo to the @var{nntp} server
13540 until the @var{nntp} server asks for it.
13541
13542 You can also add @samp{default} lines that will apply to all servers
13543 that don't have matching @samp{machine} lines.
13544
13545 @example
13546 default force yes
13547 @end example
13548
13549 This will force sending @samp{AUTHINFO} commands to all servers not
13550 previously mentioned.
13551
13552 Remember to not leave the @file{~/.authinfo} file world-readable.
13553
13554 @item nntp-server-action-alist
13555 @vindex nntp-server-action-alist
13556 This is a list of regexps to match on server types and actions to be
13557 taken when matches are made.  For instance, if you want Gnus to beep
13558 every time you connect to innd, you could say something like:
13559
13560 @lisp
13561 (setq nntp-server-action-alist
13562       '(("innd" (ding))))
13563 @end lisp
13564
13565 You probably don't want to do that, though.
13566
13567 The default value is
13568
13569 @lisp
13570 '(("nntpd 1\\.5\\.11t"
13571    (remove-hook 'nntp-server-opened-hook
13572                 'nntp-send-mode-reader)))
13573 @end lisp
13574
13575 This ensures that Gnus doesn't send the @code{MODE READER} command to
13576 nntpd 1.5.11t, since that command chokes that server, I've been told.
13577
13578 @item nntp-maximum-request
13579 @vindex nntp-maximum-request
13580 If the @acronym{NNTP} server doesn't support @acronym{NOV} headers, this back end
13581 will collect headers by sending a series of @code{head} commands.  To
13582 speed things up, the back end sends lots of these commands without
13583 waiting for reply, and then reads all the replies.  This is controlled
13584 by the @code{nntp-maximum-request} variable, and is 400 by default.  If
13585 your network is buggy, you should set this to 1.
13586
13587 @item nntp-connection-timeout
13588 @vindex nntp-connection-timeout
13589 If you have lots of foreign @code{nntp} groups that you connect to
13590 regularly, you're sure to have problems with @acronym{NNTP} servers not
13591 responding properly, or being too loaded to reply within reasonable
13592 time.  This is can lead to awkward problems, which can be helped
13593 somewhat by setting @code{nntp-connection-timeout}.  This is an integer
13594 that says how many seconds the @code{nntp} back end should wait for a
13595 connection before giving up.  If it is @code{nil}, which is the default,
13596 no timeouts are done.
13597
13598 @item nntp-nov-is-evil
13599 @vindex nntp-nov-is-evil
13600 If the @acronym{NNTP} server does not support @acronym{NOV}, you could set this
13601 variable to @code{t}, but @code{nntp} usually checks automatically whether @acronym{NOV}
13602 can be used.
13603
13604 @item nntp-xover-commands
13605 @vindex nntp-xover-commands
13606 @cindex @acronym{NOV}
13607 @cindex XOVER
13608 List of strings used as commands to fetch @acronym{NOV} lines from a
13609 server.  The default value of this variable is @code{("XOVER"
13610 "XOVERVIEW")}.
13611
13612 @item nntp-nov-gap
13613 @vindex nntp-nov-gap
13614 @code{nntp} normally sends just one big request for @acronym{NOV} lines to
13615 the server.  The server responds with one huge list of lines.  However,
13616 if you have read articles 2-5000 in the group, and only want to read
13617 article 1 and 5001, that means that @code{nntp} will fetch 4999 @acronym{NOV}
13618 lines that you will not need.  This variable says how
13619 big a gap between two consecutive articles is allowed to be before the
13620 @code{XOVER} request is split into several request.  Note that if your
13621 network is fast, setting this variable to a really small number means
13622 that fetching will probably be slower.  If this variable is @code{nil},
13623 @code{nntp} will never split requests.  The default is 5.
13624
13625 @item nntp-xref-number-is-evil
13626 @vindex nntp-xref-number-is-evil
13627 When Gnus refers to an article having the @code{Message-ID} that a user
13628 specifies or having the @code{Message-ID} of the parent article of the
13629 current one (@pxref{Finding the Parent}), Gnus sends a @code{HEAD}
13630 command to the @acronym{NNTP} server to know where it is, and the server
13631 returns the data containing the pairs of a group and an article number
13632 in the @code{Xref} header.  Gnus normally uses the article number to
13633 refer to the article if the data shows that that article is in the
13634 current group, while it uses the @code{Message-ID} otherwise.  However,
13635 some news servers, e.g., ones running Diablo, run multiple engines
13636 having the same articles but article numbers are not kept synchronized
13637 between them.  In that case, the article number that appears in the
13638 @code{Xref} header varies by which engine is chosen, so you cannot refer
13639 to the parent article that is in the current group, for instance.  If
13640 you connect to such a server, set this variable to a non-@code{nil}
13641 value, and Gnus never uses article numbers.  For example:
13642
13643 @lisp
13644 (setq gnus-select-method
13645       '(nntp "newszilla"
13646              (nntp-address "newszilla.example.com")
13647              (nntp-xref-number-is-evil t)
13648              @dots{}))
13649 @end lisp
13650
13651 The default value of this server variable is @code{nil}.
13652
13653 @item nntp-prepare-server-hook
13654 @vindex nntp-prepare-server-hook
13655 A hook run before attempting to connect to an @acronym{NNTP} server.
13656
13657 @item nntp-record-commands
13658 @vindex nntp-record-commands
13659 If non-@code{nil}, @code{nntp} will log all commands it sends to the
13660 @acronym{NNTP} server (along with a timestamp) in the @samp{*nntp-log*}
13661 buffer.  This is useful if you are debugging a Gnus/@acronym{NNTP} connection
13662 that doesn't seem to work.
13663
13664 @item nntp-open-connection-function
13665 @vindex nntp-open-connection-function
13666 It is possible to customize how the connection to the nntp server will
13667 be opened.  If you specify an @code{nntp-open-connection-function}
13668 parameter, Gnus will use that function to establish the connection.
13669 Seven pre-made functions are supplied.  These functions can be grouped
13670 in two categories: direct connection functions (four pre-made), and
13671 indirect ones (three pre-made).
13672
13673 @item nntp-never-echoes-commands
13674 @vindex nntp-never-echoes-commands
13675 Non-@code{nil} means the nntp server never echoes commands.  It is
13676 reported that some nntps server doesn't echo commands.  So, you may want
13677 to set this to non-@code{nil} in the method for such a server setting
13678 @code{nntp-open-connection-function} to @code{nntp-open-ssl-stream} for
13679 example.  The default value is @code{nil}.  Note that the
13680 @code{nntp-open-connection-functions-never-echo-commands} variable
13681 overrides the @code{nil} value of this variable.
13682
13683 @item nntp-open-connection-functions-never-echo-commands
13684 @vindex nntp-open-connection-functions-never-echo-commands
13685 List of functions that never echo commands.  Add or set a function which
13686 you set to @code{nntp-open-connection-function} to this list if it does
13687 not echo commands.  Note that a non-@code{nil} value of the
13688 @code{nntp-never-echoes-commands} variable overrides this variable.  The
13689 default value is @code{(nntp-open-network-stream)}.
13690
13691 @item nntp-prepare-post-hook
13692 @vindex nntp-prepare-post-hook
13693 A hook run just before posting an article.  If there is no
13694 @code{Message-ID} header in the article and the news server provides the
13695 recommended ID, it will be added to the article before running this
13696 hook.  It is useful to make @code{Cancel-Lock} headers even if you
13697 inhibit Gnus to add a @code{Message-ID} header, you could say:
13698
13699 @lisp
13700 (add-hook 'nntp-prepare-post-hook 'canlock-insert-header)
13701 @end lisp
13702
13703 Note that not all servers support the recommended ID.  This works for
13704 INN versions 2.3.0 and later, for instance.
13705
13706 @item nntp-server-list-active-group
13707 If @code{nil}, then always use @samp{GROUP} instead of @samp{LIST
13708 ACTIVE}.  This is usually slower, but on misconfigured servers that
13709 don't update their active files often, this can help.
13710
13711
13712 @end table
13713
13714 @menu
13715 * Direct Functions::            Connecting directly to the server.
13716 * Indirect Functions::          Connecting indirectly to the server.
13717 * Common Variables::            Understood by several connection functions.
13718 * NNTP marks::                  Storing marks for @acronym{NNTP} servers.
13719 @end menu
13720
13721
13722 @node Direct Functions
13723 @subsubsection Direct Functions
13724 @cindex direct connection functions
13725
13726 These functions are called direct because they open a direct connection
13727 between your machine and the @acronym{NNTP} server.  The behavior of these
13728 functions is also affected by commonly understood variables
13729 (@pxref{Common Variables}).
13730
13731 @table @code
13732 @findex nntp-open-network-stream
13733 @item nntp-open-network-stream
13734 This is the default, and simply connects to some port or other on the
13735 remote system.  If both Emacs and the server supports it, the
13736 connection will be upgraded to an encrypted @acronym{STARTTLS}
13737 connection automatically.
13738
13739 @item network-only
13740 The same as the above, but don't do automatic @acronym{STARTTLS} upgrades.
13741
13742 @findex nntp-open-tls-stream
13743 @item nntp-open-tls-stream
13744 Opens a connection to a server over a @dfn{secure} channel.  To use
13745 this you must have @uref{http://www.gnu.org/software/gnutls/, GNUTLS}
13746 installed.  You then define a server as follows:
13747
13748 @lisp
13749 ;; @r{"nntps" is port 563 and is predefined in our @file{/etc/services}}
13750 ;; @r{however, @samp{gnutls-cli -p} doesn't like named ports.}
13751 ;;
13752 (nntp "snews.bar.com"
13753       (nntp-open-connection-function nntp-open-tls-stream)
13754       (nntp-port-number 563)
13755       (nntp-address "snews.bar.com"))
13756 @end lisp
13757
13758 @findex nntp-open-ssl-stream
13759 @item nntp-open-ssl-stream
13760 Opens a connection to a server over a @dfn{secure} channel.  To use
13761 this you must have @uref{http://www.openssl.org, OpenSSL} or
13762 @uref{ftp://ftp.psy.uq.oz.au/pub/Crypto/SSL, SSLeay} installed.  You
13763 then define a server as follows:
13764
13765 @lisp
13766 ;; @r{"snews" is port 563 and is predefined in our @file{/etc/services}}
13767 ;; @r{however, @samp{openssl s_client -port} doesn't like named ports.}
13768 ;;
13769 (nntp "snews.bar.com"
13770       (nntp-open-connection-function nntp-open-ssl-stream)
13771       (nntp-port-number 563)
13772       (nntp-address "snews.bar.com"))
13773 @end lisp
13774
13775 @findex nntp-open-netcat-stream
13776 @item nntp-open-netcat-stream
13777 Opens a connection to an @acronym{NNTP} server using the @code{netcat}
13778 program.  You might wonder why this function exists, since we have
13779 the default @code{nntp-open-network-stream} which would do the job.  (One
13780 of) the reason(s) is that if you are behind a firewall but have direct
13781 connections to the outside world thanks to a command wrapper like
13782 @code{runsocks}, you can use it like this:
13783
13784 @lisp
13785 (nntp "socksified"
13786       (nntp-pre-command "runsocks")
13787       (nntp-open-connection-function nntp-open-netcat-stream)
13788       (nntp-address "the.news.server"))
13789 @end lisp
13790
13791 With the default method, you would need to wrap your whole Emacs
13792 session, which is not a good idea.
13793
13794 @findex nntp-open-telnet-stream
13795 @item nntp-open-telnet-stream
13796 Like @code{nntp-open-netcat-stream}, but uses @code{telnet} rather than
13797 @code{netcat}.  @code{telnet} is a bit less robust because of things
13798 like line-end-conversion, but sometimes netcat is simply
13799 not available.  The previous example would turn into:
13800
13801 @lisp
13802 (nntp "socksified"
13803       (nntp-pre-command "runsocks")
13804       (nntp-open-connection-function nntp-open-telnet-stream)
13805       (nntp-address "the.news.server")
13806       (nntp-end-of-line "\n"))
13807 @end lisp
13808 @end table
13809
13810
13811 @node Indirect Functions
13812 @subsubsection Indirect Functions
13813 @cindex indirect connection functions
13814
13815 These functions are called indirect because they connect to an
13816 intermediate host before actually connecting to the @acronym{NNTP} server.
13817 All of these functions and related variables are also said to belong to
13818 the ``via'' family of connection: they're all prefixed with ``via'' to make
13819 things cleaner.  The behavior of these functions is also affected by
13820 commonly understood variables (@pxref{Common Variables}).
13821
13822 @table @code
13823 @item nntp-open-via-rlogin-and-netcat
13824 @findex nntp-open-via-rlogin-and-netcat
13825 Does an @samp{rlogin} on a remote system, and then uses @code{netcat} to connect
13826 to the real @acronym{NNTP} server from there.  This is useful for instance if
13827 you need to connect to a firewall machine first.
13828
13829 @code{nntp-open-via-rlogin-and-netcat}-specific variables:
13830
13831 @table @code
13832 @item nntp-via-rlogin-command
13833 @vindex nntp-via-rlogin-command
13834 Command used to log in on the intermediate host.  The default is
13835 @samp{rsh}, but @samp{ssh} is a popular alternative.
13836
13837 @item nntp-via-rlogin-command-switches
13838 @vindex nntp-via-rlogin-command-switches
13839 List of strings to be used as the switches to
13840 @code{nntp-via-rlogin-command}.  The default is @code{nil}.  If you use
13841 @samp{ssh} for @code{nntp-via-rlogin-command}, you may set this to
13842 @samp{("-C")} in order to compress all data connections.
13843 @end table
13844
13845 @item nntp-open-via-rlogin-and-telnet
13846 @findex nntp-open-via-rlogin-and-telnet
13847 Does essentially the same, but uses @code{telnet} instead of @samp{netcat}
13848 to connect to the real @acronym{NNTP} server from the intermediate host.
13849 @code{telnet} is a bit less robust because of things like
13850 line-end-conversion, but sometimes @code{netcat} is simply not available.
13851
13852 @code{nntp-open-via-rlogin-and-telnet}-specific variables:
13853
13854 @table @code
13855 @item nntp-telnet-command
13856 @vindex nntp-telnet-command
13857 Command used to connect to the real @acronym{NNTP} server from the
13858 intermediate host.  The default is @samp{telnet}.
13859
13860 @item nntp-telnet-switches
13861 @vindex nntp-telnet-switches
13862 List of strings to be used as the switches to the
13863 @code{nntp-telnet-command} command.  The default is @code{("-8")}.
13864
13865 @item nntp-via-rlogin-command
13866 @vindex nntp-via-rlogin-command
13867 Command used to log in on the intermediate host.  The default is
13868 @samp{rsh}, but @samp{ssh} is a popular alternative.
13869
13870 @item nntp-via-rlogin-command-switches
13871 @vindex nntp-via-rlogin-command-switches
13872 List of strings to be used as the switches to
13873 @code{nntp-via-rlogin-command}.  If you use @samp{ssh},  you may need to set
13874 this to @samp{("-t" "-e" "none")} or @samp{("-C" "-t" "-e" "none")} if
13875 the telnet command requires a pseudo-tty allocation on an intermediate
13876 host.  The default is @code{nil}.
13877 @end table
13878
13879 Note that you may want to change the value for @code{nntp-end-of-line}
13880 to @samp{\n} (@pxref{Common Variables}).
13881
13882 @item nntp-open-via-telnet-and-telnet
13883 @findex nntp-open-via-telnet-and-telnet
13884 Does essentially the same, but uses @samp{telnet} instead of
13885 @samp{rlogin} to connect to the intermediate host.
13886
13887 @code{nntp-open-via-telnet-and-telnet}-specific variables:
13888
13889 @table @code
13890 @item nntp-via-telnet-command
13891 @vindex nntp-via-telnet-command
13892 Command used to @code{telnet} the intermediate host.  The default is
13893 @samp{telnet}.
13894
13895 @item nntp-via-telnet-switches
13896 @vindex nntp-via-telnet-switches
13897 List of strings to be used as the switches to the
13898 @code{nntp-via-telnet-command} command.  The default is @samp{("-8")}.
13899
13900 @item nntp-via-user-password
13901 @vindex nntp-via-user-password
13902 Password to use when logging in on the intermediate host.
13903
13904 @item nntp-via-envuser
13905 @vindex nntp-via-envuser
13906 If non-@code{nil}, the intermediate @code{telnet} session (client and
13907 server both) will support the @code{ENVIRON} option and not prompt for
13908 login name.  This works for Solaris @code{telnet}, for instance.
13909
13910 @item nntp-via-shell-prompt
13911 @vindex nntp-via-shell-prompt
13912 Regexp matching the shell prompt on the intermediate host.  The default
13913 is @samp{bash\\|\$ *\r?$\\|> *\r?}.
13914
13915 @end table
13916
13917 Note that you may want to change the value for @code{nntp-end-of-line}
13918 to @samp{\n} (@pxref{Common Variables}).
13919 @end table
13920
13921
13922 Here are some additional variables that are understood by all the above
13923 functions:
13924
13925 @table @code
13926
13927 @item nntp-via-user-name
13928 @vindex nntp-via-user-name
13929 User name to use when connecting to the intermediate host.
13930
13931 @item nntp-via-address
13932 @vindex nntp-via-address
13933 Address of the intermediate host to connect to.
13934
13935 @end table
13936
13937
13938 @node Common Variables
13939 @subsubsection Common Variables
13940
13941 The following variables affect the behavior of all, or several of the
13942 pre-made connection functions.  When not specified, all functions are
13943 affected (the values of the following variables will be used as the
13944 default if each virtual @code{nntp} server doesn't specify those server
13945 variables individually).
13946
13947 @table @code
13948
13949 @item nntp-pre-command
13950 @vindex nntp-pre-command
13951 A command wrapper to use when connecting through a non native
13952 connection function (all except @code{nntp-open-network-stream},
13953 @code{nntp-open-tls-stream}, and @code{nntp-open-ssl-stream}).  This is
13954 where you would put a @samp{SOCKS} wrapper for instance.
13955
13956 @item nntp-address
13957 @vindex nntp-address
13958 The address of the @acronym{NNTP} server.
13959
13960 @item nntp-port-number
13961 @vindex nntp-port-number
13962 Port number to connect to the @acronym{NNTP} server.  The default is
13963 @samp{nntp}.  If you use @acronym{NNTP} over
13964 @acronym{TLS}/@acronym{SSL}, you may want to use integer ports rather
13965 than named ports (i.e, use @samp{563} instead of @samp{snews} or
13966 @samp{nntps}), because external @acronym{TLS}/@acronym{SSL} tools may
13967 not work with named ports.
13968
13969 @item nntp-end-of-line
13970 @vindex nntp-end-of-line
13971 String to use as end-of-line marker when talking to the @acronym{NNTP}
13972 server.  This is @samp{\r\n} by default, but should be @samp{\n} when
13973 using a non native telnet connection function.
13974
13975 @item nntp-netcat-command
13976 @vindex nntp-netcat-command
13977 Command to use when connecting to the @acronym{NNTP} server through
13978 @samp{netcat}.  This is @emph{not} for an intermediate host.  This is
13979 just for the real @acronym{NNTP} server.  The default is
13980 @samp{nc}.
13981
13982 @item nntp-netcat-switches
13983 @vindex nntp-netcat-switches
13984 A list of switches to pass to @code{nntp-netcat-command}.  The default
13985 is @samp{()}.
13986
13987 @end table
13988
13989 @node NNTP marks
13990 @subsubsection NNTP marks
13991 @cindex storing NNTP marks
13992
13993 Gnus stores marks (@pxref{Marking Articles}) for @acronym{NNTP}
13994 servers in marks files.  A marks file records what marks you have set
13995 in a group and each file is specific to the corresponding server.
13996 Marks files are stored in @file{~/News/marks}
13997 (@code{nntp-marks-directory}) under a classic hierarchy resembling
13998 that of a news server, for example marks for the group
13999 @samp{gmane.discuss} on the news.gmane.org server will be stored in
14000 the file @file{~/News/marks/news.gmane.org/gmane/discuss/.marks}.
14001
14002 Marks files are useful because you can copy the @file{~/News/marks}
14003 directory (using rsync, scp or whatever) to another Gnus installation,
14004 and it will realize what articles you have read and marked.  The data
14005 in @file{~/News/marks} has priority over the same data in
14006 @file{~/.newsrc.eld}.
14007
14008 Note that marks files are very much server-specific: Gnus remembers
14009 the article numbers so if you don't use the same servers on both
14010 installations things are most likely to break (most @acronym{NNTP}
14011 servers do not use the same article numbers as any other server).
14012 However, if you use servers A, B, C on one installation and servers A,
14013 D, E on the other, you can sync the marks files for A and then you'll
14014 get synchronization for that server between the two installations.
14015
14016 Using @acronym{NNTP} marks can possibly incur a performance penalty so
14017 if Gnus feels sluggish, try setting the @code{nntp-marks-is-evil}
14018 variable to @code{t}.  Marks will then be stored in @file{~/.newsrc.eld}.
14019
14020 Related variables:
14021
14022 @table @code
14023
14024 @item nntp-marks-is-evil
14025 @vindex nntp-marks-is-evil
14026 If non-@code{nil}, this back end will ignore any marks files.  The
14027 default is @code{nil}.
14028
14029 @item nntp-marks-directory
14030 @vindex nntp-marks-directory
14031 The directory where marks for nntp groups will be stored.
14032
14033 @end table
14034
14035
14036 @node News Spool
14037 @subsection News Spool
14038 @cindex nnspool
14039 @cindex news spool
14040
14041 Subscribing to a foreign group from the local spool is extremely easy,
14042 and might be useful, for instance, to speed up reading groups that
14043 contain very big articles---@samp{alt.binaries.pictures.furniture}, for
14044 instance.
14045
14046 Anyway, you just specify @code{nnspool} as the method and @code{""} (or
14047 anything else) as the address.
14048
14049 If you have access to a local spool, you should probably use that as the
14050 native select method (@pxref{Finding the News}).  It is normally faster
14051 than using an @code{nntp} select method, but might not be.  It depends.
14052 You just have to try to find out what's best at your site.
14053
14054 @table @code
14055
14056 @item nnspool-inews-program
14057 @vindex nnspool-inews-program
14058 Program used to post an article.
14059
14060 @item nnspool-inews-switches
14061 @vindex nnspool-inews-switches
14062 Parameters given to the inews program when posting an article.
14063
14064 @item nnspool-spool-directory
14065 @vindex nnspool-spool-directory
14066 Where @code{nnspool} looks for the articles.  This is normally
14067 @file{/usr/spool/news/}.
14068
14069 @item nnspool-nov-directory
14070 @vindex nnspool-nov-directory
14071 Where @code{nnspool} will look for @acronym{NOV} files.  This is normally@*
14072 @file{/usr/spool/news/over.view/}.
14073
14074 @item nnspool-lib-dir
14075 @vindex nnspool-lib-dir
14076 Where the news lib dir is (@file{/usr/lib/news/} by default).
14077
14078 @item nnspool-active-file
14079 @vindex nnspool-active-file
14080 The name of the active file.
14081
14082 @item nnspool-newsgroups-file
14083 @vindex nnspool-newsgroups-file
14084 The name of the group descriptions file.
14085
14086 @item nnspool-history-file
14087 @vindex nnspool-history-file
14088 The name of the news history file.
14089
14090 @item nnspool-active-times-file
14091 @vindex nnspool-active-times-file
14092 The name of the active date file.
14093
14094 @item nnspool-nov-is-evil
14095 @vindex nnspool-nov-is-evil
14096 If non-@code{nil}, @code{nnspool} won't try to use any @acronym{NOV} files
14097 that it finds.
14098
14099 @item nnspool-sift-nov-with-sed
14100 @vindex nnspool-sift-nov-with-sed
14101 @cindex sed
14102 If non-@code{nil}, which is the default, use @code{sed} to get the
14103 relevant portion from the overview file.  If @code{nil},
14104 @code{nnspool} will load the entire file into a buffer and process it
14105 there.
14106
14107 @end table
14108
14109
14110 @node Using IMAP
14111 @section Using IMAP
14112 @cindex imap
14113
14114 The most popular mail backend is probably @code{nnimap}, which
14115 provides access to @acronym{IMAP} servers.  @acronym{IMAP} servers
14116 store mail remotely, so the client doesn't store anything locally.
14117 This means that it's a convenient choice when you're reading your mail
14118 from different locations, or with different user agents.
14119
14120 @menu
14121 * Connecting to an IMAP Server::     Getting started with @acronym{IMAP}.
14122 * Customizing the IMAP Connection::  Variables for @acronym{IMAP} connection.
14123 * Client-Side IMAP Splitting::       Put mail in the correct mail box.
14124 @end menu
14125
14126
14127 @node Connecting to an IMAP Server
14128 @subsection Connecting to an IMAP Server
14129
14130 Connecting to an @acronym{IMAP} can be very easy.  Type @kbd{B} in the
14131 group buffer, or (if your primary interest is reading email), say
14132 something like:
14133
14134 @example
14135 (setq gnus-select-method
14136       '(nnimap "imap.gmail.com"))
14137 @end example
14138
14139 You'll be prompted for a user name and password.  If you grow tired of
14140 that, then add the following to your @file{~/.authinfo} file:
14141
14142 @example
14143 machine imap.gmail.com login <username> password <password> port imap
14144 @end example
14145
14146 That should basically be it for most users.
14147
14148
14149 @node Customizing the IMAP Connection
14150 @subsection Customizing the IMAP Connection
14151
14152 Here's an example method that's more complex:
14153
14154 @example
14155 (nnimap "imap.gmail.com"
14156         (nnimap-inbox "INBOX")
14157         (nnimap-split-methods default)
14158         (nnimap-expunge t)
14159         (nnimap-stream ssl))
14160 @end example
14161
14162 @table @code
14163 @item nnimap-address
14164 The address of the server, like @samp{imap.gmail.com}.
14165
14166 @item nnimap-server-port
14167 If the server uses a non-standard port, that can be specified here.  A
14168 typical port would be @code{"imap"} or @code{"imaps"}.
14169
14170 @item nnimap-stream
14171 How @code{nnimap} should connect to the server.  Possible values are:
14172
14173 @table @code
14174 @item undecided
14175 This is the default, and this first tries the @code{ssl} setting, and
14176 then tries the @code{network} setting.
14177
14178 @item ssl
14179 This uses standard @acronym{TLS}/@acronym{SSL} connections.
14180
14181 @item network
14182 Non-encrypted and unsafe straight socket connection, but will upgrade
14183 to encrypted @acronym{STARTTLS} if both Emacs and the server
14184 supports it.
14185
14186 @item starttls
14187 Encrypted @acronym{STARTTLS} over the normal @acronym{IMAP} port.
14188
14189 @item shell
14190 If you need to tunnel via other systems to connect to the server, you
14191 can use this option, and customize @code{nnimap-shell-program} to be
14192 what you need.
14193
14194 @end table
14195
14196 @item nnimap-authenticator
14197 Some @acronym{IMAP} servers allow anonymous logins.  In that case,
14198 this should be set to @code{anonymous}.
14199
14200 @item nnimap-expunge
14201 If non-@code{nil}, expunge articles after deleting them.  This is always done
14202 if the server supports UID EXPUNGE, but it's not done by default on
14203 servers that doesn't support that command.
14204
14205 @item nnimap-streaming
14206 Virtually all @code{IMAP} server support fast streaming of data.  If
14207 you have problems connecting to the server, try setting this to @code{nil}.
14208
14209 @item nnimap-fetch-partial-articles
14210 If non-@code{nil}, fetch partial articles from the server.  If set to
14211 a string, then it's interpreted as a regexp, and parts that have
14212 matching types will be fetched.  For instance, @samp{"text/"} will
14213 fetch all textual parts, while leaving the rest on the server.
14214
14215 @end table
14216
14217
14218 @node Client-Side IMAP Splitting
14219 @subsection Client-Side IMAP Splitting
14220
14221 Many people prefer to do the sorting/splitting of mail into their mail
14222 boxes on the @acronym{IMAP} server.  That way they don't have to
14223 download the mail they're not all that interested in.
14224
14225 If you do want to do client-side mail splitting, then the following
14226 variables are relevant:
14227
14228 @table @code
14229 @item nnimap-inbox
14230 This is the @acronym{IMAP} mail box that will be scanned for new mail.
14231
14232 @item nnimap-split-methods
14233 Uses the same syntax as @code{nnmail-split-methods} (@pxref{Splitting
14234 Mail}), except the symbol @code{default}, which means that it should
14235 use the value of the @code{nnmail-split-methods} variable.
14236
14237 @item nnimap-split-fancy
14238 Uses the same syntax as @code{nnmail-split-fancy}.
14239
14240 @item nnimap-unsplittable-articles
14241 List of flag symbols to ignore when doing splitting.  That is,
14242 articles that have these flags won't be considered when splitting.
14243 The default is @samp{(%Deleted %Seen)}.
14244
14245 @end table
14246
14247 Here's a complete example @code{nnimap} backend with a client-side
14248 ``fancy'' splitting method:
14249
14250 @example
14251 (nnimap "imap.example.com"
14252         (nnimap-inbox "INBOX")
14253         (nnimap-split-methods
14254          (| ("MailScanner-SpamCheck" "spam" "spam.detected")
14255             (to "foo@@bar.com" "foo")
14256             "undecided")))
14257 @end example
14258
14259
14260 @node Getting Mail
14261 @section Getting Mail
14262 @cindex reading mail
14263 @cindex mail
14264
14265 Reading mail with a newsreader---isn't that just plain WeIrD? But of
14266 course.
14267
14268 @menu
14269 * Mail in a Newsreader::        Important introductory notes.
14270 * Getting Started Reading Mail::  A simple cookbook example.
14271 * Splitting Mail::              How to create mail groups.
14272 * Mail Sources::                How to tell Gnus where to get mail from.
14273 * Mail Back End Variables::     Variables for customizing mail handling.
14274 * Fancy Mail Splitting::        Gnus can do hairy splitting of incoming mail.
14275 * Group Mail Splitting::        Use group customize to drive mail splitting.
14276 * Incorporating Old Mail::      What about the old mail you have?
14277 * Expiring Mail::               Getting rid of unwanted mail.
14278 * Washing Mail::                Removing cruft from the mail you get.
14279 * Duplicates::                  Dealing with duplicated mail.
14280 * Not Reading Mail::            Using mail back ends for reading other files.
14281 * Choosing a Mail Back End::    Gnus can read a variety of mail formats.
14282 @end menu
14283
14284
14285 @node Mail in a Newsreader
14286 @subsection Mail in a Newsreader
14287
14288 If you are used to traditional mail readers, but have decided to switch
14289 to reading mail with Gnus, you may find yourself experiencing something
14290 of a culture shock.
14291
14292 Gnus does not behave like traditional mail readers.  If you want to make
14293 it behave that way, you can, but it's an uphill battle.
14294
14295 Gnus, by default, handles all its groups using the same approach.  This
14296 approach is very newsreaderly---you enter a group, see the new/unread
14297 messages, and when you read the messages, they get marked as read, and
14298 you don't see them any more.  (Unless you explicitly ask for them.)
14299
14300 In particular, you do not do anything explicitly to delete messages.
14301
14302 Does this mean that all the messages that have been marked as read are
14303 deleted?  How awful!
14304
14305 But, no, it means that old messages are @dfn{expired} according to some
14306 scheme or other.  For news messages, the expire process is controlled by
14307 the news administrator; for mail, the expire process is controlled by
14308 you.  The expire process for mail is covered in depth in @ref{Expiring
14309 Mail}.
14310
14311 What many Gnus users find, after using it a while for both news and
14312 mail, is that the transport mechanism has very little to do with how
14313 they want to treat a message.
14314
14315 Many people subscribe to several mailing lists.  These are transported
14316 via @acronym{SMTP}, and are therefore mail.  But we might go for weeks without
14317 answering, or even reading these messages very carefully.  We may not
14318 need to save them because if we should need to read one again, they are
14319 archived somewhere else.
14320
14321 Some people have local news groups which have only a handful of readers.
14322 These are transported via @acronym{NNTP}, and are therefore news.  But we may need
14323 to read and answer a large fraction of the messages very carefully in
14324 order to do our work.  And there may not be an archive, so we may need
14325 to save the interesting messages the same way we would personal mail.
14326
14327 The important distinction turns out to be not the transport mechanism,
14328 but other factors such as how interested we are in the subject matter,
14329 or how easy it is to retrieve the message if we need to read it again.
14330
14331 Gnus provides many options for sorting mail into ``groups'' which behave
14332 like newsgroups, and for treating each group (whether mail or news)
14333 differently.
14334
14335 Some users never get comfortable using the Gnus (ahem) paradigm and wish
14336 that Gnus should grow up and be a male, er, mail reader.  It is possible
14337 to whip Gnus into a more mailreaderly being, but, as said before, it's
14338 not easy.  People who prefer proper mail readers should try @sc{vm}
14339 instead, which is an excellent, and proper, mail reader.
14340
14341 I don't mean to scare anybody off, but I want to make it clear that you
14342 may be required to learn a new way of thinking about messages.  After
14343 you've been subjected to The Gnus Way, you will come to love it.  I can
14344 guarantee it.  (At least the guy who sold me the Emacs Subliminal
14345 Brain-Washing Functions that I've put into Gnus did guarantee it.  You
14346 Will Be Assimilated.  You Love Gnus.  You Love The Gnus Mail Way.
14347 You Do.)
14348
14349
14350 @node Getting Started Reading Mail
14351 @subsection Getting Started Reading Mail
14352
14353 It's quite easy to use Gnus to read your new mail.  You just plonk the
14354 mail back end of your choice into @code{gnus-secondary-select-methods},
14355 and things will happen automatically.
14356
14357 For instance, if you want to use @code{nnml} (which is a ``one file per
14358 mail'' back end), you could put the following in your @file{~/.gnus.el} file:
14359
14360 @lisp
14361 (setq gnus-secondary-select-methods '((nnml "")))
14362 @end lisp
14363
14364 Now, the next time you start Gnus, this back end will be queried for new
14365 articles, and it will move all the messages in your spool file to its
14366 directory, which is @file{~/Mail/} by default.  The new group that will
14367 be created (@samp{mail.misc}) will be subscribed, and you can read it
14368 like any other group.
14369
14370 You will probably want to split the mail into several groups, though:
14371
14372 @lisp
14373 (setq nnmail-split-methods
14374       '(("junk" "^From:.*Lars Ingebrigtsen")
14375         ("crazy" "^Subject:.*die\\|^Organization:.*flabby")
14376         ("other" "")))
14377 @end lisp
14378
14379 This will result in three new @code{nnml} mail groups being created:
14380 @samp{nnml:junk}, @samp{nnml:crazy}, and @samp{nnml:other}.  All the
14381 mail that doesn't fit into the first two groups will be placed in the
14382 last group.
14383
14384 This should be sufficient for reading mail with Gnus.  You might want to
14385 give the other sections in this part of the manual a perusal, though.
14386 Especially @pxref{Choosing a Mail Back End} and @pxref{Expiring Mail}.
14387
14388
14389 @node Splitting Mail
14390 @subsection Splitting Mail
14391 @cindex splitting mail
14392 @cindex mail splitting
14393 @cindex mail filtering (splitting)
14394
14395 @vindex nnmail-split-methods
14396 The @code{nnmail-split-methods} variable says how the incoming mail is
14397 to be split into groups.
14398
14399 @lisp
14400 (setq nnmail-split-methods
14401   '(("mail.junk" "^From:.*Lars Ingebrigtsen")
14402     ("mail.crazy" "^Subject:.*die\\|^Organization:.*flabby")
14403     ("mail.other" "")))
14404 @end lisp
14405
14406 This variable is a list of lists, where the first element of each of
14407 these lists is the name of the mail group (they do not have to be called
14408 something beginning with @samp{mail}, by the way), and the second
14409 element is a regular expression used on the header of each mail to
14410 determine if it belongs in this mail group.  The first string may
14411 contain @samp{\\1} forms, like the ones used by @code{replace-match} to
14412 insert sub-expressions from the matched text.  For instance:
14413
14414 @lisp
14415 ("list.\\1" "From:.* \\(.*\\)-list@@majordomo.com")
14416 @end lisp
14417
14418 @noindent
14419 In that case, @code{nnmail-split-lowercase-expanded} controls whether
14420 the inserted text should be made lowercase.  @xref{Fancy Mail Splitting}.
14421
14422 The second element can also be a function.  In that case, it will be
14423 called narrowed to the headers with the first element of the rule as the
14424 argument.  It should return a non-@code{nil} value if it thinks that the
14425 mail belongs in that group.
14426
14427 @cindex @samp{bogus} group
14428 The last of these groups should always be a general one, and the regular
14429 expression should @emph{always} be @samp{""} so that it matches any mails
14430 that haven't been matched by any of the other regexps.  (These rules are
14431 processed from the beginning of the alist toward the end.  The first rule
14432 to make a match will ``win'', unless you have crossposting enabled.  In
14433 that case, all matching rules will ``win''.)  If no rule matched, the mail
14434 will end up in the @samp{bogus} group.  When new groups are created by
14435 splitting mail, you may want to run @code{gnus-group-find-new-groups} to
14436 see the new groups.  This also applies to the @samp{bogus} group.
14437
14438 If you like to tinker with this yourself, you can set this variable to a
14439 function of your choice.  This function will be called without any
14440 arguments in a buffer narrowed to the headers of an incoming mail
14441 message.  The function should return a list of group names that it
14442 thinks should carry this mail message.
14443
14444 This variable can also be a fancy split method.  For the syntax,
14445 see @ref{Fancy Mail Splitting}.
14446
14447 Note that the mail back ends are free to maul the poor, innocent,
14448 incoming headers all they want to.  They all add @code{Lines} headers;
14449 some add @code{X-Gnus-Group} headers; most rename the Unix mbox
14450 @code{From<SPACE>} line to something else.
14451
14452 @vindex nnmail-crosspost
14453 The mail back ends all support cross-posting.  If several regexps match,
14454 the mail will be ``cross-posted'' to all those groups.
14455 @code{nnmail-crosspost} says whether to use this mechanism or not.  Note
14456 that no articles are crossposted to the general (@samp{""}) group.
14457
14458 @vindex nnmail-crosspost-link-function
14459 @cindex crosspost
14460 @cindex links
14461 @code{nnmh} and @code{nnml} makes crossposts by creating hard links to
14462 the crossposted articles.  However, not all file systems support hard
14463 links.  If that's the case for you, set
14464 @code{nnmail-crosspost-link-function} to @code{copy-file}.  (This
14465 variable is @code{add-name-to-file} by default.)
14466
14467 @kindex M-x nnmail-split-history
14468 @findex nnmail-split-history
14469 If you wish to see where the previous mail split put the messages, you
14470 can use the @kbd{M-x nnmail-split-history} command.  If you wish to see
14471 where re-spooling messages would put the messages, you can use
14472 @code{gnus-summary-respool-trace} and related commands (@pxref{Mail
14473 Group Commands}).
14474
14475 @vindex nnmail-split-header-length-limit
14476 Header lines longer than the value of
14477 @code{nnmail-split-header-length-limit} are excluded from the split
14478 function.
14479
14480 @vindex nnmail-mail-splitting-decodes
14481 @vindex nnmail-mail-splitting-charset
14482 By default, splitting does not decode headers, so you can not match on
14483 non-@acronym{ASCII} strings.  But it is useful if you want to match
14484 articles based on the raw header data.  To enable it, set the
14485 @code{nnmail-mail-splitting-decodes} variable to a non-@code{nil} value.
14486 In addition, the value of the @code{nnmail-mail-splitting-charset}
14487 variable is used for decoding non-@acronym{MIME} encoded string when
14488 @code{nnmail-mail-splitting-decodes} is non-@code{nil}.  The default
14489 value is @code{nil} which means not to decode non-@acronym{MIME} encoded
14490 string.  A suitable value for you will be @code{undecided} or be the
14491 charset used normally in mails you are interested in.
14492
14493 @vindex nnmail-resplit-incoming
14494 By default, splitting is performed on all incoming messages.  If you
14495 specify a @code{directory} entry for the variable @code{mail-sources}
14496 (@pxref{Mail Source Specifiers}), however, then splitting does
14497 @emph{not} happen by default.  You can set the variable
14498 @code{nnmail-resplit-incoming} to a non-@code{nil} value to make
14499 splitting happen even in this case.  (This variable has no effect on
14500 other kinds of entries.)
14501
14502 Gnus gives you all the opportunity you could possibly want for shooting
14503 yourself in the foot.  Let's say you create a group that will contain
14504 all the mail you get from your boss.  And then you accidentally
14505 unsubscribe from the group.  Gnus will still put all the mail from your
14506 boss in the unsubscribed group, and so, when your boss mails you ``Have
14507 that report ready by Monday or you're fired!'', you'll never see it and,
14508 come Tuesday, you'll still believe that you're gainfully employed while
14509 you really should be out collecting empty bottles to save up for next
14510 month's rent money.
14511
14512
14513 @node Mail Sources
14514 @subsection Mail Sources
14515
14516 Mail can be gotten from many different sources---the mail spool, from
14517 a @acronym{POP} mail server, from a procmail directory, or from a
14518 maildir, for instance.
14519
14520 @menu
14521 * Mail Source Specifiers::      How to specify what a mail source is.
14522 * Mail Source Customization::   Some variables that influence things.
14523 * Fetching Mail::               Using the mail source specifiers.
14524 @end menu
14525
14526
14527 @node Mail Source Specifiers
14528 @subsubsection Mail Source Specifiers
14529 @cindex POP
14530 @cindex mail server
14531 @cindex procmail
14532 @cindex mail spool
14533 @cindex mail source
14534
14535 You tell Gnus how to fetch mail by setting @code{mail-sources}
14536 (@pxref{Fetching Mail}) to a @dfn{mail source specifier}.
14537
14538 Here's an example:
14539
14540 @lisp
14541 (pop :server "pop3.mailserver.com" :user "myname")
14542 @end lisp
14543
14544 As can be observed, a mail source specifier is a list where the first
14545 element is a @dfn{mail source type}, followed by an arbitrary number of
14546 @dfn{keywords}.  Keywords that are not explicitly specified are given
14547 default values.
14548
14549 The @code{mail-sources} is global for all mail groups.  You can specify
14550 an additional mail source for a particular group by including the
14551 @code{group} mail specifier in @code{mail-sources}, and setting a
14552 @code{mail-source} group parameter (@pxref{Group Parameters}) specifying
14553 a single mail source.  When this is used, @code{mail-sources} is
14554 typically just @code{(group)}; the @code{mail-source} parameter for a
14555 group might look like this:
14556
14557 @lisp
14558 (mail-source . (file :path "home/user/spools/foo.spool"))
14559 @end lisp
14560
14561 This means that the group's (and only this group's) messages will be
14562 fetched from the spool file @samp{/user/spools/foo.spool}.
14563
14564 The following mail source types are available:
14565
14566 @table @code
14567 @item file
14568 Get mail from a single file; typically from the mail spool.
14569
14570 Keywords:
14571
14572 @table @code
14573 @item :path
14574 The file name.  Defaults to the value of the @env{MAIL}
14575 environment variable or the value of @code{rmail-spool-directory}
14576 (usually something like @file{/usr/mail/spool/user-name}).
14577
14578 @item :prescript
14579 @itemx :postscript
14580 Script run before/after fetching mail.
14581 @end table
14582
14583 An example file mail source:
14584
14585 @lisp
14586 (file :path "/usr/spool/mail/user-name")
14587 @end lisp
14588
14589 Or using the default file name:
14590
14591 @lisp
14592 (file)
14593 @end lisp
14594
14595 If the mail spool file is not located on the local machine, it's best
14596 to use @acronym{POP} or @acronym{IMAP} or the like to fetch the mail.
14597 You can not use ange-ftp file names here---it has no way to lock the
14598 mail spool while moving the mail.
14599
14600 If it's impossible to set up a proper server, you can use ssh instead.
14601
14602 @lisp
14603 (setq mail-sources
14604       '((file :prescript "ssh host bin/getmail >%t")))
14605 @end lisp
14606
14607 The @samp{getmail} script would look something like the following:
14608
14609 @example
14610 #!/bin/sh
14611 #  getmail - move mail from spool to stdout
14612 #  flu@@iki.fi
14613
14614 MOVEMAIL=/usr/lib/emacs/20.3/i386-redhat-linux/movemail
14615 TMP=$HOME/Mail/tmp
14616 rm -f $TMP; $MOVEMAIL $MAIL $TMP >/dev/null && cat $TMP
14617 @end example
14618
14619 Alter this script to fit the @samp{movemail} and temporary
14620 file you want to use.
14621
14622
14623 @item directory
14624 @vindex nnmail-scan-directory-mail-source-once
14625 Get mail from several files in a directory.  This is typically used
14626 when you have procmail split the incoming mail into several files.
14627 That is, there is a one-to-one correspondence between files in that
14628 directory and groups, so that mail from the file @file{foo.bar.spool}
14629 will be put in the group @code{foo.bar}.  (You can change the suffix
14630 to be used instead of @code{.spool}.)  Setting
14631 @code{nnmail-scan-directory-mail-source-once} to non-@code{nil} forces
14632 Gnus to scan the mail source only once.  This is particularly useful
14633 if you want to scan mail groups at a specified level.
14634
14635 @vindex nnmail-resplit-incoming
14636 There is also the variable @code{nnmail-resplit-incoming}, if you set
14637 that to a non-@code{nil} value, then the normal splitting process is
14638 applied to all the files from the directory, @ref{Splitting Mail}.
14639
14640 Keywords:
14641
14642 @table @code
14643 @item :path
14644 The name of the directory where the files are.  There is no default
14645 value.
14646
14647 @item :suffix
14648 Only files ending with this suffix are used.  The default is
14649 @samp{.spool}.
14650
14651 @item :predicate
14652 Only files that have this predicate return non-@code{nil} are returned.
14653 The default is @code{identity}.  This is used as an additional
14654 filter---only files that have the right suffix @emph{and} satisfy this
14655 predicate are considered.
14656
14657 @item :prescript
14658 @itemx :postscript
14659 Script run before/after fetching mail.
14660
14661 @end table
14662
14663 An example directory mail source:
14664
14665 @lisp
14666 (directory :path "/home/user-name/procmail-dir/"
14667            :suffix ".prcml")
14668 @end lisp
14669
14670 @item pop
14671 Get mail from a @acronym{POP} server.
14672
14673 Keywords:
14674
14675 @table @code
14676 @item :server
14677 The name of the @acronym{POP} server.  The default is taken from the
14678 @env{MAILHOST} environment variable.
14679
14680 @item :port
14681 The port number of the @acronym{POP} server.  This can be a number (eg,
14682 @samp{:port 1234}) or a string (eg, @samp{:port "pop3"}).  If it is a
14683 string, it should be a service name as listed in @file{/etc/services} on
14684 Unix systems.  The default is @samp{"pop3"}.  On some systems you might
14685 need to specify it as @samp{"pop-3"} instead.
14686
14687 @item :user
14688 The user name to give to the @acronym{POP} server.  The default is the login
14689 name.
14690
14691 @item :password
14692 The password to give to the @acronym{POP} server.  If not specified,
14693 the user is prompted.
14694
14695 @item :program
14696 The program to use to fetch mail from the @acronym{POP} server.  This
14697 should be a @code{format}-like string.  Here's an example:
14698
14699 @example
14700 fetchmail %u@@%s -P %p %t
14701 @end example
14702
14703 The valid format specifier characters are:
14704
14705 @table @samp
14706 @item t
14707 The name of the file the mail is to be moved to.  This must always be
14708 included in this string.
14709
14710 @item s
14711 The name of the server.
14712
14713 @item P
14714 The port number of the server.
14715
14716 @item u
14717 The user name to use.
14718
14719 @item p
14720 The password to use.
14721 @end table
14722
14723 The values used for these specs are taken from the values you give the
14724 corresponding keywords.
14725
14726 @item :prescript
14727 A script to be run before fetching the mail.  The syntax is the same as
14728 the @code{:program} keyword.  This can also be a function to be run.
14729
14730 @item :postscript
14731 A script to be run after fetching the mail.  The syntax is the same as
14732 the @code{:program} keyword.  This can also be a function to be run.
14733
14734 @item :function
14735 The function to use to fetch mail from the @acronym{POP} server.  The
14736 function is called with one parameter---the name of the file where the
14737 mail should be moved to.
14738
14739 @item :authentication
14740 This can be either the symbol @code{password} or the symbol @code{apop}
14741 and says what authentication scheme to use.  The default is
14742 @code{password}.
14743
14744 @end table
14745
14746 @vindex pop3-movemail
14747 @vindex pop3-leave-mail-on-server
14748 If the @code{:program} and @code{:function} keywords aren't specified,
14749 @code{pop3-movemail} will be used.  If @code{pop3-leave-mail-on-server}
14750 is non-@code{nil} the mail is to be left on the @acronym{POP} server
14751 after fetching when using @code{pop3-movemail}.  Note that POP servers
14752 maintain no state information between sessions, so what the client
14753 believes is there and what is actually there may not match up.  If they
14754 do not, then you may get duplicate mails or the whole thing can fall
14755 apart and leave you with a corrupt mailbox.
14756
14757 Here are some examples for getting mail from a @acronym{POP} server.
14758 Fetch from the default @acronym{POP} server, using the default user
14759 name, and default fetcher:
14760
14761 @lisp
14762 (pop)
14763 @end lisp
14764
14765 Fetch from a named server with a named user and password:
14766
14767 @lisp
14768 (pop :server "my.pop.server"
14769      :user "user-name" :password "secret")
14770 @end lisp
14771
14772 Use @samp{movemail} to move the mail:
14773
14774 @lisp
14775 (pop :program "movemail po:%u %t %p")
14776 @end lisp
14777
14778 @item maildir
14779 Get mail from a maildir.  This is a type of mailbox that is supported by
14780 at least qmail and postfix, where each file in a special directory
14781 contains exactly one mail.
14782
14783 Keywords:
14784
14785 @table @code
14786 @item :path
14787 The name of the directory where the mails are stored.  The default is
14788 taken from the @env{MAILDIR} environment variable or
14789 @file{~/Maildir/}.
14790 @item :subdirs
14791 The subdirectories of the Maildir.  The default is
14792 @samp{("new" "cur")}.
14793
14794 @c If you sometimes look at your mail through a pop3 daemon before fetching
14795 @c them with Gnus, you may also have to fetch your mails from the
14796 @c @code{cur} directory inside the maildir, like in the first example
14797 @c below.
14798
14799 You can also get mails from remote hosts (because maildirs don't suffer
14800 from locking problems).
14801
14802 @end table
14803
14804 Two example maildir mail sources:
14805
14806 @lisp
14807 (maildir :path "/home/user-name/Maildir/"
14808          :subdirs ("cur" "new"))
14809 @end lisp
14810
14811 @lisp
14812 (maildir :path "/user@@remotehost.org:~/Maildir/"
14813          :subdirs ("new"))
14814 @end lisp
14815
14816 @item imap
14817 Get mail from a @acronym{IMAP} server.  If you don't want to use
14818 @acronym{IMAP} as intended, as a network mail reading protocol (ie
14819 with nnimap), for some reason or other, Gnus let you treat it similar
14820 to a @acronym{POP} server and fetches articles from a given
14821 @acronym{IMAP} mailbox.  @xref{Using IMAP}, for more information.
14822
14823 Keywords:
14824
14825 @table @code
14826 @item :server
14827 The name of the @acronym{IMAP} server.  The default is taken from the
14828 @env{MAILHOST} environment variable.
14829
14830 @item :port
14831 The port number of the @acronym{IMAP} server.  The default is @samp{143}, or
14832 @samp{993} for @acronym{TLS}/@acronym{SSL} connections.
14833
14834 @item :user
14835 The user name to give to the @acronym{IMAP} server.  The default is the login
14836 name.
14837
14838 @item :password
14839 The password to give to the @acronym{IMAP} server.  If not specified, the user is
14840 prompted.
14841
14842 @item :stream
14843 What stream to use for connecting to the server, this is one of the
14844 symbols in @code{imap-stream-alist}.  Right now, this means
14845 @samp{gssapi}, @samp{kerberos4}, @samp{starttls}, @samp{tls},
14846 @samp{ssl}, @samp{shell} or the default @samp{network}.
14847
14848 @item :authentication
14849 Which authenticator to use for authenticating to the server, this is
14850 one of the symbols in @code{imap-authenticator-alist}.  Right now,
14851 this means @samp{gssapi}, @samp{kerberos4}, @samp{digest-md5},
14852 @samp{cram-md5}, @samp{anonymous} or the default @samp{login}.
14853
14854 @item :program
14855 When using the `shell' :stream, the contents of this variable is
14856 mapped into the @code{imap-shell-program} variable.  This should be a
14857 @code{format}-like string (or list of strings).  Here's an example:
14858
14859 @example
14860 ssh %s imapd
14861 @end example
14862
14863 Make sure nothing is interfering with the output of the program, e.g.,
14864 don't forget to redirect the error output to the void.  The valid format
14865 specifier characters are:
14866
14867 @table @samp
14868 @item s
14869 The name of the server.
14870
14871 @item l
14872 User name from @code{imap-default-user}.
14873
14874 @item p
14875 The port number of the server.
14876 @end table
14877
14878 The values used for these specs are taken from the values you give the
14879 corresponding keywords.
14880
14881 @item :mailbox
14882 The name of the mailbox to get mail from.  The default is @samp{INBOX}
14883 which normally is the mailbox which receives incoming mail.
14884
14885 @item :predicate
14886 The predicate used to find articles to fetch.  The default, @samp{UNSEEN
14887 UNDELETED}, is probably the best choice for most people, but if you
14888 sometimes peek in your mailbox with a @acronym{IMAP} client and mark some
14889 articles as read (or; SEEN) you might want to set this to @samp{1:*}.
14890 Then all articles in the mailbox is fetched, no matter what.  For a
14891 complete list of predicates, see RFC 2060 section 6.4.4.
14892
14893 @item :fetchflag
14894 How to flag fetched articles on the server, the default @samp{\Deleted}
14895 will mark them as deleted, an alternative would be @samp{\Seen} which
14896 would simply mark them as read.  These are the two most likely choices,
14897 but more flags are defined in RFC 2060 section 2.3.2.
14898
14899 @item :dontexpunge
14900 If non-@code{nil}, don't remove all articles marked as deleted in the
14901 mailbox after finishing the fetch.
14902
14903 @end table
14904
14905 An example @acronym{IMAP} mail source:
14906
14907 @lisp
14908 (imap :server "mail.mycorp.com"
14909       :stream kerberos4
14910       :fetchflag "\\Seen")
14911 @end lisp
14912
14913 @item group
14914 Get the actual mail source from the @code{mail-source} group parameter,
14915 @xref{Group Parameters}.
14916
14917 @end table
14918
14919 @table @dfn
14920 @item Common Keywords
14921 Common keywords can be used in any type of mail source.
14922
14923 Keywords:
14924
14925 @table @code
14926 @item :plugged
14927 If non-@code{nil}, fetch the mail even when Gnus is unplugged.  If you
14928 use directory source to get mail, you can specify it as in this
14929 example:
14930
14931 @lisp
14932 (setq mail-sources
14933       '((directory :path "/home/pavel/.Spool/"
14934                    :suffix ""
14935                    :plugged t)))
14936 @end lisp
14937
14938 Gnus will then fetch your mail even when you are unplugged.  This is
14939 useful when you use local mail and news.
14940
14941 @end table
14942 @end table
14943
14944 @subsubsection Function Interface
14945
14946 Some of the above keywords specify a Lisp function to be executed.
14947 For each keyword @code{:foo}, the Lisp variable @code{foo} is bound to
14948 the value of the keyword while the function is executing.  For example,
14949 consider the following mail-source setting:
14950
14951 @lisp
14952 (setq mail-sources '((pop :user "jrl"
14953                           :server "pophost" :function fetchfunc)))
14954 @end lisp
14955
14956 While the function @code{fetchfunc} is executing, the symbol @code{user}
14957 is bound to @code{"jrl"}, and the symbol @code{server} is bound to
14958 @code{"pophost"}.  The symbols @code{port}, @code{password},
14959 @code{program}, @code{prescript}, @code{postscript}, @code{function},
14960 and @code{authentication} are also bound (to their default values).
14961
14962 See above for a list of keywords for each type of mail source.
14963
14964
14965 @node Mail Source Customization
14966 @subsubsection Mail Source Customization
14967
14968 The following is a list of variables that influence how the mail is
14969 fetched.  You would normally not need to set or change any of these
14970 variables.
14971
14972 @table @code
14973 @item mail-source-crash-box
14974 @vindex mail-source-crash-box
14975 File where mail will be stored while processing it.  The default is@*
14976 @file{~/.emacs-mail-crash-box}.
14977
14978 @cindex Incoming*
14979 @item mail-source-delete-incoming
14980 @vindex mail-source-delete-incoming
14981 If non-@code{nil}, delete incoming files after handling them.  If
14982 @code{t}, delete the files immediately, if @code{nil}, never delete any
14983 files.  If a positive number, delete files older than number of days
14984 (the deletion will only happen when receiving new mail).  You may also
14985 set @code{mail-source-delete-incoming} to @code{nil} and call
14986 @code{mail-source-delete-old-incoming} from a hook or interactively.
14987 @code{mail-source-delete-incoming} defaults to @code{10} in alpha Gnusae
14988 and @code{2} in released Gnusae.  @xref{Gnus Development}.
14989
14990 @item mail-source-delete-old-incoming-confirm
14991 @vindex mail-source-delete-old-incoming-confirm
14992 If non-@code{nil}, ask for confirmation before deleting old incoming
14993 files.  This variable only applies when
14994 @code{mail-source-delete-incoming} is a positive number.
14995
14996 @item mail-source-ignore-errors
14997 @vindex mail-source-ignore-errors
14998 If non-@code{nil}, ignore errors when reading mail from a mail source.
14999
15000 @item mail-source-directory
15001 @vindex mail-source-directory
15002 Directory where incoming mail source files (if any) will be stored.  The
15003 default is @file{~/Mail/}.  At present, the only thing this is used for
15004 is to say where the incoming files will be stored if the variable
15005 @code{mail-source-delete-incoming} is @code{nil} or a number.
15006
15007 @item mail-source-incoming-file-prefix
15008 @vindex mail-source-incoming-file-prefix
15009 Prefix for file name for storing incoming mail.  The default is
15010 @file{Incoming}, in which case files will end up with names like
15011 @file{Incoming30630D_} or @file{Incoming298602ZD}.  This is really only
15012 relevant if @code{mail-source-delete-incoming} is @code{nil} or a
15013 number.
15014
15015 @item mail-source-default-file-modes
15016 @vindex mail-source-default-file-modes
15017 All new mail files will get this file mode.  The default is 384.
15018
15019 @item mail-source-movemail-program
15020 @vindex mail-source-movemail-program
15021 If non-@code{nil}, name of program for fetching new mail.  If
15022 @code{nil}, @code{movemail} in @var{exec-directory}.
15023
15024 @end table
15025
15026
15027 @node Fetching Mail
15028 @subsubsection Fetching Mail
15029
15030 @vindex mail-sources
15031 The way to actually tell Gnus where to get new mail from is to set
15032 @code{mail-sources} to a list of mail source specifiers
15033 (@pxref{Mail Source Specifiers}).
15034
15035 If this variable is @code{nil}, the mail back ends will never attempt to
15036 fetch mail by themselves.
15037
15038 If you want to fetch mail both from your local spool as well as a
15039 @acronym{POP} mail server, you'd say something like:
15040
15041 @lisp
15042 (setq mail-sources
15043       '((file)
15044         (pop :server "pop3.mail.server"
15045              :password "secret")))
15046 @end lisp
15047
15048 Or, if you don't want to use any of the keyword defaults:
15049
15050 @lisp
15051 (setq mail-sources
15052       '((file :path "/var/spool/mail/user-name")
15053         (pop :server "pop3.mail.server"
15054              :user "user-name"
15055              :port "pop3"
15056              :password "secret")))
15057 @end lisp
15058
15059
15060 When you use a mail back end, Gnus will slurp all your mail from your
15061 inbox and plonk it down in your home directory.  Gnus doesn't move any
15062 mail if you're not using a mail back end---you have to do a lot of magic
15063 invocations first.  At the time when you have finished drawing the
15064 pentagram, lightened the candles, and sacrificed the goat, you really
15065 shouldn't be too surprised when Gnus moves your mail.
15066
15067
15068
15069 @node Mail Back End Variables
15070 @subsection Mail Back End Variables
15071
15072 These variables are (for the most part) pertinent to all the various
15073 mail back ends.
15074
15075 @table @code
15076 @vindex nnmail-read-incoming-hook
15077 @item nnmail-read-incoming-hook
15078 The mail back ends all call this hook after reading new mail.  You can
15079 use this hook to notify any mail watch programs, if you want to.
15080
15081 @vindex nnmail-split-hook
15082 @item nnmail-split-hook
15083 @findex gnus-article-decode-encoded-words
15084 @cindex RFC 1522 decoding
15085 @cindex RFC 2047 decoding
15086 Hook run in the buffer where the mail headers of each message is kept
15087 just before the splitting based on these headers is done.  The hook is
15088 free to modify the buffer contents in any way it sees fit---the buffer
15089 is discarded after the splitting has been done, and no changes performed
15090 in the buffer will show up in any files.
15091 @code{gnus-article-decode-encoded-words} is one likely function to add
15092 to this hook.
15093
15094 @vindex nnmail-pre-get-new-mail-hook
15095 @vindex nnmail-post-get-new-mail-hook
15096 @item nnmail-pre-get-new-mail-hook
15097 @itemx nnmail-post-get-new-mail-hook
15098 These are two useful hooks executed when treating new incoming
15099 mail---@code{nnmail-pre-get-new-mail-hook} (is called just before
15100 starting to handle the new mail) and
15101 @code{nnmail-post-get-new-mail-hook} (is called when the mail handling
15102 is done).  Here's and example of using these two hooks to change the
15103 default file modes the new mail files get:
15104
15105 @lisp
15106 (add-hook 'nnmail-pre-get-new-mail-hook
15107           (lambda () (set-default-file-modes 511)))
15108
15109 (add-hook 'nnmail-post-get-new-mail-hook
15110           (lambda () (set-default-file-modes 551)))
15111 @end lisp
15112
15113 @item nnmail-use-long-file-names
15114 @vindex nnmail-use-long-file-names
15115 If non-@code{nil}, the mail back ends will use long file and directory
15116 names.  Groups like @samp{mail.misc} will end up in directories
15117 (assuming use of @code{nnml} back end) or files (assuming use of
15118 @code{nnfolder} back end) like @file{mail.misc}.  If it is @code{nil},
15119 the same group will end up in @file{mail/misc}.
15120
15121 @item nnmail-delete-file-function
15122 @vindex nnmail-delete-file-function
15123 @findex delete-file
15124 Function called to delete files.  It is @code{delete-file} by default.
15125
15126 @item nnmail-cache-accepted-message-ids
15127 @vindex nnmail-cache-accepted-message-ids
15128 If non-@code{nil}, put the @code{Message-ID}s of articles imported into
15129 the back end (via @code{Gcc}, for instance) into the mail duplication
15130 discovery cache.  The default is @code{nil}.
15131
15132 @item nnmail-cache-ignore-groups
15133 @vindex nnmail-cache-ignore-groups
15134 This can be a regular expression or a list of regular expressions.
15135 Group names that match any of the regular expressions will never be
15136 recorded in the @code{Message-ID} cache.
15137
15138 This can be useful, for example, when using Fancy Splitting
15139 (@pxref{Fancy Mail Splitting}) together with the function
15140 @code{nnmail-split-fancy-with-parent}.
15141
15142 @end table
15143
15144
15145 @node Fancy Mail Splitting
15146 @subsection Fancy Mail Splitting
15147 @cindex mail splitting
15148 @cindex fancy mail splitting
15149
15150 @vindex nnmail-split-fancy
15151 @findex nnmail-split-fancy
15152 If the rather simple, standard method for specifying how to split mail
15153 doesn't allow you to do what you want, you can set
15154 @code{nnmail-split-methods} to @code{nnmail-split-fancy}.  Then you can
15155 play with the @code{nnmail-split-fancy} variable.
15156
15157 Let's look at an example value of this variable first:
15158
15159 @lisp
15160 ;; @r{Messages from the mailer daemon are not crossposted to any of}
15161 ;; @r{the ordinary groups.  Warnings are put in a separate group}
15162 ;; @r{from real errors.}
15163 (| ("from" mail (| ("subject" "warn.*" "mail.warning")
15164                    "mail.misc"))
15165    ;; @r{Non-error messages are crossposted to all relevant}
15166    ;; @r{groups, but we don't crosspost between the group for the}
15167    ;; @r{(ding) list and the group for other (ding) related mail.}
15168    (& (| (any "ding@@ifi\\.uio\\.no" "ding.list")
15169          ("subject" "ding" "ding.misc"))
15170       ;; @r{Other mailing lists@dots{}}
15171       (any "procmail@@informatik\\.rwth-aachen\\.de" "procmail.list")
15172       (any "SmartList@@informatik\\.rwth-aachen\\.de" "SmartList.list")
15173       ;; @r{Both lists below have the same suffix, so prevent}
15174       ;; @r{cross-posting to mkpkg.list of messages posted only to}
15175       ;; @r{the bugs- list, but allow cross-posting when the}
15176       ;; @r{message was really cross-posted.}
15177       (any "bugs-mypackage@@somewhere" "mypkg.bugs")
15178       (any "mypackage@@somewhere" - "bugs-mypackage" "mypkg.list")
15179       ;; @r{People@dots{}}
15180       (any "larsi@@ifi\\.uio\\.no" "people.Lars_Magne_Ingebrigtsen"))
15181    ;; @r{Unmatched mail goes to the catch all group.}
15182    "misc.misc")
15183 @end lisp
15184
15185 This variable has the format of a @dfn{split}.  A split is a
15186 (possibly) recursive structure where each split may contain other
15187 splits.  Here are the possible split syntaxes:
15188
15189 @table @code
15190
15191 @item group
15192 If the split is a string, that will be taken as a group name.  Normal
15193 regexp match expansion will be done.  See below for examples.
15194
15195 @c Don't fold this line.
15196 @item (@var{field} @var{value} [- @var{restrict} [@dots{}] ] @var{split} [@var{invert-partial}])
15197 The split can be a list containing at least three elements.  If the
15198 first element @var{field} (a regexp matching a header) contains
15199 @var{value} (also a regexp) then store the message as specified by
15200 @var{split}.
15201
15202 If @var{restrict} (yet another regexp) matches some string after
15203 @var{field} and before the end of the matched @var{value}, the
15204 @var{split} is ignored.  If none of the @var{restrict} clauses match,
15205 @var{split} is processed.
15206
15207 The last element @var{invert-partial} is optional.  If it is
15208 non-@code{nil}, the match-partial-words behavior controlled by the
15209 variable @code{nnmail-split-fancy-match-partial-words} (see below) is
15210 be inverted.  (New in Gnus 5.10.7)
15211
15212 @item (| @var{split} @dots{})
15213 If the split is a list, and the first element is @code{|} (vertical
15214 bar), then process each @var{split} until one of them matches.  A
15215 @var{split} is said to match if it will cause the mail message to be
15216 stored in one or more groups.
15217
15218 @item (& @var{split} @dots{})
15219 If the split is a list, and the first element is @code{&}, then
15220 process all @var{split}s in the list.
15221
15222 @item junk
15223 If the split is the symbol @code{junk}, then don't save (i.e., delete)
15224 this message.  Use with extreme caution.
15225
15226 @item (: @var{function} @var{arg1} @var{arg2} @dots{})
15227 If the split is a list, and the first element is @samp{:}, then the
15228 second element will be called as a function with @var{args} given as
15229 arguments.  The function should return a @var{split}.
15230
15231 @cindex body split
15232 For instance, the following function could be used to split based on the
15233 body of the messages:
15234
15235 @lisp
15236 (defun split-on-body ()
15237   (save-excursion
15238     (save-restriction
15239       (widen)
15240       (goto-char (point-min))
15241       (when (re-search-forward "Some.*string" nil t)
15242         "string.group"))))
15243 @end lisp
15244
15245 The buffer is narrowed to the header of the message in question when
15246 @var{function} is run.  That's why @code{(widen)} needs to be called
15247 after @code{save-excursion} and @code{save-restriction} in the example
15248 above.  Also note that with the nnimap backend, message bodies will
15249 not be downloaded by default.  You need to set
15250 @code{nnimap-split-download-body} to @code{t} to do that
15251 (@pxref{Client-Side IMAP Splitting}).
15252
15253 @item (! @var{func} @var{split})
15254 If the split is a list, and the first element is @code{!}, then
15255 @var{split} will be processed, and @var{func} will be called as a
15256 function with the result of @var{split} as argument.  @var{func}
15257 should return a split.
15258
15259 @item nil
15260 If the split is @code{nil}, it is ignored.
15261
15262 @end table
15263
15264 In these splits, @var{field} must match a complete field name.
15265
15266 Normally, @var{value} in these splits must match a complete @emph{word}
15267 according to the fundamental mode syntax table.  In other words, all
15268 @var{value}'s will be implicitly surrounded by @code{\<...\>} markers,
15269 which are word delimiters.  Therefore, if you use the following split,
15270 for example,
15271
15272 @example
15273 (any "joe" "joemail")
15274 @end example
15275
15276 @noindent
15277 messages sent from @samp{joedavis@@foo.org} will normally not be filed
15278 in @samp{joemail}.  If you want to alter this behavior, you can use any
15279 of the following three ways:
15280
15281 @enumerate
15282 @item
15283 @vindex nnmail-split-fancy-match-partial-words
15284 You can set the @code{nnmail-split-fancy-match-partial-words} variable
15285 to non-@code{nil} in order to ignore word boundaries and instead the
15286 match becomes more like a grep.  This variable controls whether partial
15287 words are matched during fancy splitting.  The default value is
15288 @code{nil}.
15289
15290 Note that it influences all @var{value}'s in your split rules.
15291
15292 @item
15293 @var{value} beginning with @code{.*} ignores word boundaries in front of
15294 a word.  Similarly, if @var{value} ends with @code{.*}, word boundaries
15295 in the rear of a word will be ignored.  For example, the @var{value}
15296 @code{"@@example\\.com"} does not match @samp{foo@@example.com} but
15297 @code{".*@@example\\.com"} does.
15298
15299 @item
15300 You can set the @var{invert-partial} flag in your split rules of the
15301 @samp{(@var{field} @var{value} @dots{})} types, aforementioned in this
15302 section.  If the flag is set, word boundaries on both sides of a word
15303 are ignored even if @code{nnmail-split-fancy-match-partial-words} is
15304 @code{nil}.  Contrarily, if the flag is set, word boundaries are not
15305 ignored even if @code{nnmail-split-fancy-match-partial-words} is
15306 non-@code{nil}.  (New in Gnus 5.10.7)
15307 @end enumerate
15308
15309 @vindex nnmail-split-abbrev-alist
15310 @var{field} and @var{value} can also be Lisp symbols, in that case
15311 they are expanded as specified by the variable
15312 @code{nnmail-split-abbrev-alist}.  This is an alist of cons cells,
15313 where the @sc{car} of a cell contains the key, and the @sc{cdr}
15314 contains the associated value.  Predefined entries in
15315 @code{nnmail-split-abbrev-alist} include:
15316
15317 @table @code
15318 @item from
15319 Matches the @samp{From}, @samp{Sender} and @samp{Resent-From} fields.
15320 @item to
15321 Matches the @samp{To}, @samp{Cc}, @samp{Apparently-To},
15322 @samp{Resent-To} and @samp{Resent-Cc} fields.
15323 @item any
15324 Is the union of the @code{from} and @code{to} entries.
15325 @end table
15326
15327 @vindex nnmail-split-fancy-syntax-table
15328 @code{nnmail-split-fancy-syntax-table} is the syntax table in effect
15329 when all this splitting is performed.
15330
15331 If you want to have Gnus create groups dynamically based on some
15332 information in the headers (i.e., do @code{replace-match}-like
15333 substitutions in the group names), you can say things like:
15334
15335 @example
15336 (any "debian-\\b\\(\\w+\\)@@lists.debian.org" "mail.debian.\\1")
15337 @end example
15338
15339 In this example, messages sent to @samp{debian-foo@@lists.debian.org}
15340 will be filed in @samp{mail.debian.foo}.
15341
15342 If the string contains the element @samp{\&}, then the previously
15343 matched string will be substituted.  Similarly, the elements @samp{\\1}
15344 up to @samp{\\9} will be substituted with the text matched by the
15345 groupings 1 through 9.
15346
15347 @vindex nnmail-split-lowercase-expanded
15348 Where @code{nnmail-split-lowercase-expanded} controls whether the
15349 lowercase of the matched string should be used for the substitution.
15350 Setting it as non-@code{nil} is useful to avoid the creation of multiple
15351 groups when users send to an address using different case
15352 (i.e. mailing-list@@domain vs Mailing-List@@Domain).  The default value
15353 is @code{t}.
15354
15355 @findex nnmail-split-fancy-with-parent
15356 @code{nnmail-split-fancy-with-parent} is a function which allows you to
15357 split followups into the same groups their parents are in.  Sometimes
15358 you can't make splitting rules for all your mail.  For example, your
15359 boss might send you personal mail regarding different projects you are
15360 working on, and as you can't tell your boss to put a distinguishing
15361 string into the subject line, you have to resort to manually moving the
15362 messages into the right group.  With this function, you only have to do
15363 it once per thread.
15364
15365 To use this feature, you have to set @code{nnmail-treat-duplicates}
15366 and @code{nnmail-cache-accepted-message-ids} to a non-@code{nil}
15367 value.  And then you can include @code{nnmail-split-fancy-with-parent}
15368 using the colon feature, like so:
15369 @lisp
15370 (setq nnmail-treat-duplicates 'warn     ; @r{or @code{delete}}
15371       nnmail-cache-accepted-message-ids t
15372       nnmail-split-fancy
15373       '(| (: nnmail-split-fancy-with-parent)
15374           ;; @r{other splits go here}
15375         ))
15376 @end lisp
15377
15378 This feature works as follows: when @code{nnmail-treat-duplicates} is
15379 non-@code{nil}, Gnus records the message id of every message it sees
15380 in the file specified by the variable
15381 @code{nnmail-message-id-cache-file}, together with the group it is in
15382 (the group is omitted for non-mail messages).  When mail splitting is
15383 invoked, the function @code{nnmail-split-fancy-with-parent} then looks
15384 at the References (and In-Reply-To) header of each message to split
15385 and searches the file specified by @code{nnmail-message-id-cache-file}
15386 for the message ids.  When it has found a parent, it returns the
15387 corresponding group name unless the group name matches the regexp
15388 @code{nnmail-split-fancy-with-parent-ignore-groups}.  It is
15389 recommended that you set @code{nnmail-message-id-cache-length} to a
15390 somewhat higher number than the default so that the message ids are
15391 still in the cache.  (A value of 5000 appears to create a file some
15392 300 kBytes in size.)
15393 @vindex nnmail-cache-accepted-message-ids
15394 When @code{nnmail-cache-accepted-message-ids} is non-@code{nil}, Gnus
15395 also records the message ids of moved articles, so that the followup
15396 messages goes into the new group.
15397
15398 Also see the variable @code{nnmail-cache-ignore-groups} if you don't
15399 want certain groups to be recorded in the cache.  For example, if all
15400 outgoing messages are written to an ``outgoing'' group, you could set
15401 @code{nnmail-cache-ignore-groups} to match that group name.
15402 Otherwise, answers to all your messages would end up in the
15403 ``outgoing'' group.
15404
15405
15406 @node Group Mail Splitting
15407 @subsection Group Mail Splitting
15408 @cindex mail splitting
15409 @cindex group mail splitting
15410
15411 @findex gnus-group-split
15412 If you subscribe to dozens of mailing lists but you don't want to
15413 maintain mail splitting rules manually, group mail splitting is for you.
15414 You just have to set @code{to-list} and/or @code{to-address} in group
15415 parameters or group customization and set @code{nnmail-split-methods} to
15416 @code{gnus-group-split}.  This splitting function will scan all groups
15417 for those parameters and split mail accordingly, i.e., messages posted
15418 from or to the addresses specified in the parameters @code{to-list} or
15419 @code{to-address} of a mail group will be stored in that group.
15420
15421 Sometimes, mailing lists have multiple addresses, and you may want mail
15422 splitting to recognize them all: just set the @code{extra-aliases} group
15423 parameter to the list of additional addresses and it's done.  If you'd
15424 rather use a regular expression, set @code{split-regexp}.
15425
15426 All these parameters in a group will be used to create an
15427 @code{nnmail-split-fancy} split, in which the @var{field} is @samp{any},
15428 the @var{value} is a single regular expression that matches
15429 @code{to-list}, @code{to-address}, all of @code{extra-aliases} and all
15430 matches of @code{split-regexp}, and the @var{split} is the name of the
15431 group.  @var{restrict}s are also supported: just set the
15432 @code{split-exclude} parameter to a list of regular expressions.
15433
15434 If you can't get the right split to be generated using all these
15435 parameters, or you just need something fancier, you can set the
15436 parameter @code{split-spec} to an @code{nnmail-split-fancy} split.  In
15437 this case, all other aforementioned parameters will be ignored by
15438 @code{gnus-group-split}.  In particular, @code{split-spec} may be set to
15439 @code{nil}, in which case the group will be ignored by
15440 @code{gnus-group-split}.
15441
15442 @vindex gnus-group-split-default-catch-all-group
15443 @code{gnus-group-split} will do cross-posting on all groups that match,
15444 by defining a single @code{&} fancy split containing one split for each
15445 group.  If a message doesn't match any split, it will be stored in the
15446 group named in @code{gnus-group-split-default-catch-all-group}, unless
15447 some group has @code{split-spec} set to @code{catch-all}, in which case
15448 that group is used as the catch-all group.  Even though this variable is
15449 often used just to name a group, it may also be set to an arbitrarily
15450 complex fancy split (after all, a group name is a fancy split), and this
15451 may be useful to split mail that doesn't go to any mailing list to
15452 personal mail folders.  Note that this fancy split is added as the last
15453 element of a @code{|} split list that also contains a @code{&} split
15454 with the rules extracted from group parameters.
15455
15456 It's time for an example.  Assume the following group parameters have
15457 been defined:
15458
15459 @example
15460 nnml:mail.bar:
15461 ((to-address . "bar@@femail.com")
15462  (split-regexp . ".*@@femail\\.com"))
15463 nnml:mail.foo:
15464 ((to-list . "foo@@nowhere.gov")
15465  (extra-aliases "foo@@localhost" "foo-redist@@home")
15466  (split-exclude "bugs-foo" "rambling-foo")
15467  (admin-address . "foo-request@@nowhere.gov"))
15468 nnml:mail.others:
15469 ((split-spec . catch-all))
15470 @end example
15471
15472 Setting @code{nnmail-split-methods} to @code{gnus-group-split} will
15473 behave as if @code{nnmail-split-fancy} had been selected and variable
15474 @code{nnmail-split-fancy} had been set as follows:
15475
15476 @lisp
15477 (| (& (any "\\(bar@@femail\\.com\\|.*@@femail\\.com\\)" "mail.bar")
15478       (any "\\(foo@@nowhere\\.gov\\|foo@@localhost\\|foo-redist@@home\\)"
15479            - "bugs-foo" - "rambling-foo" "mail.foo"))
15480    "mail.others")
15481 @end lisp
15482
15483 @findex gnus-group-split-fancy
15484 If you'd rather not use group splitting for all your mail groups, you
15485 may use it for only some of them, by using @code{nnmail-split-fancy}
15486 splits like this:
15487
15488 @lisp
15489 (: gnus-group-split-fancy @var{groups} @var{no-crosspost} @var{catch-all})
15490 @end lisp
15491
15492 @var{groups} may be a regular expression or a list of group names whose
15493 parameters will be scanned to generate the output split.
15494 @var{no-crosspost} can be used to disable cross-posting; in this case, a
15495 single @code{|} split will be output.  @var{catch-all} is the fall back
15496 fancy split, used like @code{gnus-group-split-default-catch-all-group}.
15497 If @var{catch-all} is @code{nil}, or if @code{split-regexp} matches the
15498 empty string in any selected group, no catch-all split will be issued.
15499 Otherwise, if some group has @code{split-spec} set to @code{catch-all},
15500 this group will override the value of the @var{catch-all} argument.
15501
15502 @findex gnus-group-split-setup
15503 Unfortunately, scanning all groups and their parameters can be quite
15504 slow, especially considering that it has to be done for every message.
15505 But don't despair!  The function @code{gnus-group-split-setup} can be
15506 used to enable @code{gnus-group-split} in a much more efficient way.  It
15507 sets @code{nnmail-split-methods} to @code{nnmail-split-fancy} and sets
15508 @code{nnmail-split-fancy} to the split produced by
15509 @code{gnus-group-split-fancy}.  Thus, the group parameters are only
15510 scanned once, no matter how many messages are split.
15511
15512 @findex gnus-group-split-update
15513 However, if you change group parameters, you'd have to update
15514 @code{nnmail-split-fancy} manually.  You can do it by running
15515 @code{gnus-group-split-update}.  If you'd rather have it updated
15516 automatically, just tell @code{gnus-group-split-setup} to do it for
15517 you.  For example, add to your @file{~/.gnus.el}:
15518
15519 @lisp
15520 (gnus-group-split-setup @var{auto-update} @var{catch-all})
15521 @end lisp
15522
15523 If @var{auto-update} is non-@code{nil}, @code{gnus-group-split-update}
15524 will be added to @code{nnmail-pre-get-new-mail-hook}, so you won't ever
15525 have to worry about updating @code{nnmail-split-fancy} again.  If you
15526 don't omit @var{catch-all} (it's optional, equivalent to @code{nil}),
15527 @code{gnus-group-split-default-catch-all-group} will be set to its
15528 value.
15529
15530 @vindex gnus-group-split-updated-hook
15531 Because you may want to change @code{nnmail-split-fancy} after it is set
15532 by @code{gnus-group-split-update}, this function will run
15533 @code{gnus-group-split-updated-hook} just before finishing.
15534
15535 @node Incorporating Old Mail
15536 @subsection Incorporating Old Mail
15537 @cindex incorporating old mail
15538 @cindex import old mail
15539
15540 Most people have lots of old mail stored in various file formats.  If
15541 you have set up Gnus to read mail using one of the spiffy Gnus mail
15542 back ends, you'll probably wish to have that old mail incorporated into
15543 your mail groups.
15544
15545 Doing so can be quite easy.
15546
15547 To take an example: You're reading mail using @code{nnml}
15548 (@pxref{Mail Spool}), and have set @code{nnmail-split-methods} to a
15549 satisfactory value (@pxref{Splitting Mail}).  You have an old Unix mbox
15550 file filled with important, but old, mail.  You want to move it into
15551 your @code{nnml} groups.
15552
15553 Here's how:
15554
15555 @enumerate
15556 @item
15557 Go to the group buffer.
15558
15559 @item
15560 Type @kbd{G f} and give the file name to the mbox file when prompted to create an
15561 @code{nndoc} group from the mbox file (@pxref{Foreign Groups}).
15562
15563 @item
15564 Type @kbd{SPACE} to enter the newly created group.
15565
15566 @item
15567 Type @kbd{M P b} to process-mark all articles in this group's buffer
15568 (@pxref{Setting Process Marks}).
15569
15570 @item
15571 Type @kbd{B r} to respool all the process-marked articles, and answer
15572 @samp{nnml} when prompted (@pxref{Mail Group Commands}).
15573 @end enumerate
15574
15575 All the mail messages in the mbox file will now also be spread out over
15576 all your @code{nnml} groups.  Try entering them and check whether things
15577 have gone without a glitch.  If things look ok, you may consider
15578 deleting the mbox file, but I wouldn't do that unless I was absolutely
15579 sure that all the mail has ended up where it should be.
15580
15581 Respooling is also a handy thing to do if you're switching from one mail
15582 back end to another.  Just respool all the mail in the old mail groups
15583 using the new mail back end.
15584
15585
15586 @node Expiring Mail
15587 @subsection Expiring Mail
15588 @cindex article expiry
15589 @cindex expiring mail
15590
15591 Traditional mail readers have a tendency to remove mail articles when
15592 you mark them as read, in some way.  Gnus takes a fundamentally
15593 different approach to mail reading.
15594
15595 Gnus basically considers mail just to be news that has been received in
15596 a rather peculiar manner.  It does not think that it has the power to
15597 actually change the mail, or delete any mail messages.  If you enter a
15598 mail group, and mark articles as ``read'', or kill them in some other
15599 fashion, the mail articles will still exist on the system.  I repeat:
15600 Gnus will not delete your old, read mail.  Unless you ask it to, of
15601 course.
15602
15603 To make Gnus get rid of your unwanted mail, you have to mark the
15604 articles as @dfn{expirable}.  (With the default key bindings, this means
15605 that you have to type @kbd{E}.)  This does not mean that the articles
15606 will disappear right away, however.  In general, a mail article will be
15607 deleted from your system if, 1) it is marked as expirable, AND 2) it is
15608 more than one week old.  If you do not mark an article as expirable, it
15609 will remain on your system until hell freezes over.  This bears
15610 repeating one more time, with some spurious capitalizations: IF you do
15611 NOT mark articles as EXPIRABLE, Gnus will NEVER delete those ARTICLES.
15612
15613 You do not have to mark articles as expirable by hand.  Gnus provides
15614 two features, called ``auto-expire'' and ``total-expire'', that can help you
15615 with this.  In a nutshell, ``auto-expire'' means that Gnus hits @kbd{E}
15616 for you when you select an article.  And ``total-expire'' means that Gnus
15617 considers all articles as expirable that are read.  So, in addition to
15618 the articles marked @samp{E}, also the articles marked @samp{r},
15619 @samp{R}, @samp{O}, @samp{K}, @samp{Y} and so on are considered
15620 expirable.
15621
15622 When should either auto-expire or total-expire be used?  Most people
15623 who are subscribed to mailing lists split each list into its own group
15624 and then turn on auto-expire or total-expire for those groups.
15625 (@xref{Splitting Mail}, for more information on splitting each list
15626 into its own group.)
15627
15628 Which one is better, auto-expire or total-expire?  It's not easy to
15629 answer.  Generally speaking, auto-expire is probably faster.  Another
15630 advantage of auto-expire is that you get more marks to work with: for
15631 the articles that are supposed to stick around, you can still choose
15632 between tick and dormant and read marks.  But with total-expire, you
15633 only have dormant and ticked to choose from.  The advantage of
15634 total-expire is that it works well with adaptive scoring (@pxref{Adaptive
15635 Scoring}).  Auto-expire works with normal scoring but not with adaptive
15636 scoring.
15637
15638 @vindex gnus-auto-expirable-newsgroups
15639 Groups that match the regular expression
15640 @code{gnus-auto-expirable-newsgroups} will have all articles that you
15641 read marked as expirable automatically.  All articles marked as
15642 expirable have an @samp{E} in the first column in the summary buffer.
15643
15644 By default, if you have auto expiry switched on, Gnus will mark all the
15645 articles you read as expirable, no matter if they were read or unread
15646 before.  To avoid having articles marked as read marked as expirable
15647 automatically, you can put something like the following in your
15648 @file{~/.gnus.el} file:
15649
15650 @vindex gnus-mark-article-hook
15651 @lisp
15652 (remove-hook 'gnus-mark-article-hook
15653              'gnus-summary-mark-read-and-unread-as-read)
15654 (add-hook 'gnus-mark-article-hook 'gnus-summary-mark-unread-as-read)
15655 @end lisp
15656
15657 Note that making a group auto-expirable doesn't mean that all read
15658 articles are expired---only the articles marked as expirable
15659 will be expired.  Also note that using the @kbd{d} command won't make
15660 articles expirable---only semi-automatic marking of articles as read will
15661 mark the articles as expirable in auto-expirable groups.
15662
15663 Let's say you subscribe to a couple of mailing lists, and you want the
15664 articles you have read to disappear after a while:
15665
15666 @lisp
15667 (setq gnus-auto-expirable-newsgroups
15668       "mail.nonsense-list\\|mail.nice-list")
15669 @end lisp
15670
15671 Another way to have auto-expiry happen is to have the element
15672 @code{auto-expire} in the group parameters of the group.
15673
15674 If you use adaptive scoring (@pxref{Adaptive Scoring}) and
15675 auto-expiring, you'll have problems.  Auto-expiring and adaptive scoring
15676 don't really mix very well.
15677
15678 @vindex nnmail-expiry-wait
15679 The @code{nnmail-expiry-wait} variable supplies the default time an
15680 expirable article has to live.  Gnus starts counting days from when the
15681 message @emph{arrived}, not from when it was sent.  The default is seven
15682 days.
15683
15684 Gnus also supplies a function that lets you fine-tune how long articles
15685 are to live, based on what group they are in.  Let's say you want to
15686 have one month expiry period in the @samp{mail.private} group, a one day
15687 expiry period in the @samp{mail.junk} group, and a six day expiry period
15688 everywhere else:
15689
15690 @vindex nnmail-expiry-wait-function
15691 @lisp
15692 (setq nnmail-expiry-wait-function
15693       (lambda (group)
15694        (cond ((string= group "mail.private")
15695                31)
15696              ((string= group "mail.junk")
15697                1)
15698              ((string= group "important")
15699                'never)
15700              (t
15701                6))))
15702 @end lisp
15703
15704 The group names this function is fed are ``unadorned'' group
15705 names---no @samp{nnml:} prefixes and the like.
15706
15707 The @code{nnmail-expiry-wait} variable and
15708 @code{nnmail-expiry-wait-function} function can either be a number (not
15709 necessarily an integer) or one of the symbols @code{immediate} or
15710 @code{never}.
15711
15712 You can also use the @code{expiry-wait} group parameter to selectively
15713 change the expiry period (@pxref{Group Parameters}).
15714
15715 @vindex nnmail-expiry-target
15716 The normal action taken when expiring articles is to delete them.
15717 However, in some circumstances it might make more sense to move them
15718 to other groups instead of deleting them.  The variable
15719 @code{nnmail-expiry-target} (and the @code{expiry-target} group
15720 parameter) controls this.  The variable supplies a default value for
15721 all groups, which can be overridden for specific groups by the group
15722 parameter.  default value is @code{delete}, but this can also be a
15723 string (which should be the name of the group the message should be
15724 moved to), or a function (which will be called in a buffer narrowed to
15725 the message in question, and with the name of the group being moved
15726 from as its parameter) which should return a target---either a group
15727 name or @code{delete}.
15728
15729 Here's an example for specifying a group name:
15730 @lisp
15731 (setq nnmail-expiry-target "nnml:expired")
15732 @end lisp
15733
15734 @findex nnmail-fancy-expiry-target
15735 @vindex nnmail-fancy-expiry-targets
15736 Gnus provides a function @code{nnmail-fancy-expiry-target} which will
15737 expire mail to groups according to the variable
15738 @code{nnmail-fancy-expiry-targets}.  Here's an example:
15739
15740 @lisp
15741  (setq nnmail-expiry-target 'nnmail-fancy-expiry-target
15742        nnmail-fancy-expiry-targets
15743        '((to-from "boss" "nnfolder:Work")
15744          ("subject" "IMPORTANT" "nnfolder:IMPORTANT.%Y.%b")
15745          ("from" ".*" "nnfolder:Archive-%Y")))
15746 @end lisp
15747
15748 With this setup, any mail that has @code{IMPORTANT} in its Subject
15749 header and was sent in the year @code{YYYY} and month @code{MMM}, will
15750 get expired to the group @code{nnfolder:IMPORTANT.YYYY.MMM}.  If its
15751 From or To header contains the string @code{boss}, it will get expired
15752 to @code{nnfolder:Work}.  All other mail will get expired to
15753 @code{nnfolder:Archive-YYYY}.
15754
15755 @vindex nnmail-keep-last-article
15756 If @code{nnmail-keep-last-article} is non-@code{nil}, Gnus will never
15757 expire the final article in a mail newsgroup.  This is to make life
15758 easier for procmail users.
15759
15760 @vindex gnus-total-expirable-newsgroups
15761 By the way: That line up there, about Gnus never expiring non-expirable
15762 articles, is a lie.  If you put @code{total-expire} in the group
15763 parameters, articles will not be marked as expirable, but all read
15764 articles will be put through the expiry process.  Use with extreme
15765 caution.  Even more dangerous is the
15766 @code{gnus-total-expirable-newsgroups} variable.  All groups that match
15767 this regexp will have all read articles put through the expiry process,
15768 which means that @emph{all} old mail articles in the groups in question
15769 will be deleted after a while.  Use with extreme caution, and don't come
15770 crying to me when you discover that the regexp you used matched the
15771 wrong group and all your important mail has disappeared.  Be a
15772 @emph{man}!  Or a @emph{woman}!  Whatever you feel more comfortable
15773 with!  So there!
15774
15775 Most people make most of their mail groups total-expirable, though.
15776
15777 @vindex gnus-inhibit-user-auto-expire
15778 If @code{gnus-inhibit-user-auto-expire} is non-@code{nil}, user marking
15779 commands will not mark an article as expirable, even if the group has
15780 auto-expire turned on.
15781
15782 @vindex gnus-mark-copied-or-moved-articles-as-expirable
15783 The expirable marks of articles will be removed when copying or moving
15784 them to a group in which auto-expire is not turned on.  This is for
15785 preventing articles from being expired unintentionally.  On the other
15786 hand, to a group that has turned auto-expire on, the expirable marks of
15787 articles that are copied or moved will not be changed by default.  I.e.,
15788 when copying or moving to such a group, articles that were expirable
15789 will be left expirable and ones that were not expirable will not be
15790 marked as expirable.  So, even though in auto-expire groups, some
15791 articles will never get expired (unless you read them again).  If you
15792 don't side with that behavior that unexpirable articles may be mixed
15793 into auto-expire groups, you can set
15794 @code{gnus-mark-copied-or-moved-articles-as-expirable} to a
15795 non-@code{nil} value.  In that case, articles that have been read will
15796 be marked as expirable automatically when being copied or moved to a
15797 group that has auto-expire turned on.  The default value is @code{nil}.
15798
15799
15800 @node Washing Mail
15801 @subsection Washing Mail
15802 @cindex mail washing
15803 @cindex list server brain damage
15804 @cindex incoming mail treatment
15805
15806 Mailers and list servers are notorious for doing all sorts of really,
15807 really stupid things with mail.  ``Hey, RFC 822 doesn't explicitly
15808 prohibit us from adding the string @code{wE aRe ElItE!!!!!1!!} to the
15809 end of all lines passing through our server, so let's do that!!!!1!''
15810 Yes, but RFC 822 wasn't designed to be read by morons.  Things that were
15811 considered to be self-evident were not discussed.  So.  Here we are.
15812
15813 Case in point:  The German version of Microsoft Exchange adds @samp{AW:
15814 } to the subjects of replies instead of @samp{Re: }.  I could pretend to
15815 be shocked and dismayed by this, but I haven't got the energy.  It is to
15816 laugh.
15817
15818 Gnus provides a plethora of functions for washing articles while
15819 displaying them, but it might be nicer to do the filtering before
15820 storing the mail to disk.  For that purpose, we have three hooks and
15821 various functions that can be put in these hooks.
15822
15823 @table @code
15824 @item nnmail-prepare-incoming-hook
15825 @vindex nnmail-prepare-incoming-hook
15826 This hook is called before doing anything with the mail and is meant for
15827 grand, sweeping gestures.  It is called in a buffer that contains all
15828 the new, incoming mail.  Functions to be used include:
15829
15830 @table @code
15831 @item nnheader-ms-strip-cr
15832 @findex nnheader-ms-strip-cr
15833 Remove trailing carriage returns from each line.  This is default on
15834 Emacs running on MS machines.
15835
15836 @end table
15837
15838 @item nnmail-prepare-incoming-header-hook
15839 @vindex nnmail-prepare-incoming-header-hook
15840 This hook is called narrowed to each header.  It can be used when
15841 cleaning up the headers.  Functions that can be used include:
15842
15843 @table @code
15844 @item nnmail-remove-leading-whitespace
15845 @findex nnmail-remove-leading-whitespace
15846 Clear leading white space that ``helpful'' listservs have added to the
15847 headers to make them look nice.  Aaah.
15848
15849 (Note that this function works on both the header on the body of all
15850 messages, so it is a potentially dangerous function to use (if a body
15851 of a message contains something that looks like a header line).  So
15852 rather than fix the bug, it is of course the right solution to make it
15853 into a feature by documenting it.)
15854
15855 @item nnmail-remove-list-identifiers
15856 @findex nnmail-remove-list-identifiers
15857 Some list servers add an identifier---for example, @samp{(idm)}---to the
15858 beginning of all @code{Subject} headers.  I'm sure that's nice for
15859 people who use stone age mail readers.  This function will remove
15860 strings that match the @code{nnmail-list-identifiers} regexp, which can
15861 also be a list of regexp.  @code{nnmail-list-identifiers} may not contain
15862 @code{\\(..\\)}.
15863
15864 For instance, if you want to remove the @samp{(idm)} and the
15865 @samp{nagnagnag} identifiers:
15866
15867 @lisp
15868 (setq nnmail-list-identifiers
15869       '("(idm)" "nagnagnag"))
15870 @end lisp
15871
15872 This can also be done non-destructively with
15873 @code{gnus-list-identifiers}, @xref{Article Hiding}.
15874
15875 @item nnmail-remove-tabs
15876 @findex nnmail-remove-tabs
15877 Translate all @samp{TAB} characters into @samp{SPACE} characters.
15878
15879 @item nnmail-ignore-broken-references
15880 @findex nnmail-ignore-broken-references
15881 @c @findex nnmail-fix-eudora-headers
15882 @cindex Eudora
15883 @cindex Pegasus
15884 Some mail user agents (e.g. Eudora and Pegasus) produce broken
15885 @code{References} headers, but correct @code{In-Reply-To} headers.  This
15886 function will get rid of the @code{References} header if the headers
15887 contain a line matching the regular expression
15888 @code{nnmail-broken-references-mailers}.
15889
15890 @end table
15891
15892 @item nnmail-prepare-incoming-message-hook
15893 @vindex nnmail-prepare-incoming-message-hook
15894 This hook is called narrowed to each message.  Functions to be used
15895 include:
15896
15897 @table @code
15898 @item article-de-quoted-unreadable
15899 @findex article-de-quoted-unreadable
15900 Decode Quoted Readable encoding.
15901
15902 @end table
15903 @end table
15904
15905
15906 @node Duplicates
15907 @subsection Duplicates
15908
15909 @vindex nnmail-treat-duplicates
15910 @vindex nnmail-message-id-cache-length
15911 @vindex nnmail-message-id-cache-file
15912 @cindex duplicate mails
15913 If you are a member of a couple of mailing lists, you will sometimes
15914 receive two copies of the same mail.  This can be quite annoying, so
15915 @code{nnmail} checks for and treats any duplicates it might find.  To do
15916 this, it keeps a cache of old @code{Message-ID}s---
15917 @code{nnmail-message-id-cache-file}, which is @file{~/.nnmail-cache} by
15918 default.  The approximate maximum number of @code{Message-ID}s stored
15919 there is controlled by the @code{nnmail-message-id-cache-length}
15920 variable, which is 1000 by default.  (So 1000 @code{Message-ID}s will be
15921 stored.) If all this sounds scary to you, you can set
15922 @code{nnmail-treat-duplicates} to @code{warn} (which is what it is by
15923 default), and @code{nnmail} won't delete duplicate mails.  Instead it
15924 will insert a warning into the head of the mail saying that it thinks
15925 that this is a duplicate of a different message.
15926
15927 This variable can also be a function.  If that's the case, the function
15928 will be called from a buffer narrowed to the message in question with
15929 the @code{Message-ID} as a parameter.  The function must return either
15930 @code{nil}, @code{warn}, or @code{delete}.
15931
15932 You can turn this feature off completely by setting the variable to
15933 @code{nil}.
15934
15935 If you want all the duplicate mails to be put into a special
15936 @dfn{duplicates} group, you could do that using the normal mail split
15937 methods:
15938
15939 @lisp
15940 (setq nnmail-split-fancy
15941       '(| ;; @r{Messages duplicates go to a separate group.}
15942         ("gnus-warning" "duplicat\\(e\\|ion\\) of message" "duplicate")
15943         ;; @r{Message from daemons, postmaster, and the like to another.}
15944         (any mail "mail.misc")
15945         ;; @r{Other rules.}
15946         [...] ))
15947 @end lisp
15948 @noindent
15949 Or something like:
15950 @lisp
15951 (setq nnmail-split-methods
15952       '(("duplicates" "^Gnus-Warning:.*duplicate")
15953         ;; @r{Other rules.}
15954         [...]))
15955 @end lisp
15956
15957 Here's a neat feature: If you know that the recipient reads her mail
15958 with Gnus, and that she has @code{nnmail-treat-duplicates} set to
15959 @code{delete}, you can send her as many insults as you like, just by
15960 using a @code{Message-ID} of a mail that you know that she's already
15961 received.  Think of all the fun!  She'll never see any of it!  Whee!
15962
15963
15964 @node Not Reading Mail
15965 @subsection Not Reading Mail
15966
15967 If you start using any of the mail back ends, they have the annoying
15968 habit of assuming that you want to read mail with them.  This might not
15969 be unreasonable, but it might not be what you want.
15970
15971 If you set @code{mail-sources} and @code{nnmail-spool-file} to
15972 @code{nil}, none of the back ends will ever attempt to read incoming
15973 mail, which should help.
15974
15975 @vindex nnbabyl-get-new-mail
15976 @vindex nnmbox-get-new-mail
15977 @vindex nnml-get-new-mail
15978 @vindex nnmh-get-new-mail
15979 @vindex nnfolder-get-new-mail
15980 This might be too much, if, for instance, you are reading mail quite
15981 happily with @code{nnml} and just want to peek at some old (pre-Emacs
15982 23) Rmail file you have stashed away with @code{nnbabyl}.  All back ends have
15983 variables called back-end-@code{get-new-mail}.  If you want to disable
15984 the @code{nnbabyl} mail reading, you edit the virtual server for the
15985 group to have a setting where @code{nnbabyl-get-new-mail} to @code{nil}.
15986
15987 All the mail back ends will call @code{nn}*@code{-prepare-save-mail-hook}
15988 narrowed to the article to be saved before saving it when reading
15989 incoming mail.
15990
15991
15992 @node Choosing a Mail Back End
15993 @subsection Choosing a Mail Back End
15994
15995 Gnus will read the mail spool when you activate a mail group.  The mail
15996 file is first copied to your home directory.  What happens after that
15997 depends on what format you want to store your mail in.
15998
15999 There are six different mail back ends in the standard Gnus, and more
16000 back ends are available separately.  The mail back end most people use
16001 (because it is possibly the fastest) is @code{nnml} (@pxref{Mail
16002 Spool}).
16003
16004 @menu
16005 * Unix Mail Box::               Using the (quite) standard Un*x mbox.
16006 * Babyl::                       Babyl was used by older versions of Rmail.
16007 * Mail Spool::                  Store your mail in a private spool?
16008 * MH Spool::                    An mhspool-like back end.
16009 * Maildir::                     Another one-file-per-message format.
16010 * Mail Folders::                Having one file for each group.
16011 * Comparing Mail Back Ends::    An in-depth looks at pros and cons.
16012 @end menu
16013
16014
16015
16016 @node Unix Mail Box
16017 @subsubsection Unix Mail Box
16018 @cindex nnmbox
16019 @cindex unix mail box
16020
16021 @vindex nnmbox-active-file
16022 @vindex nnmbox-mbox-file
16023 The @dfn{nnmbox} back end will use the standard Un*x mbox file to store
16024 mail.  @code{nnmbox} will add extra headers to each mail article to say
16025 which group it belongs in.
16026
16027 Virtual server settings:
16028
16029 @table @code
16030 @item nnmbox-mbox-file
16031 @vindex nnmbox-mbox-file
16032 The name of the mail box in the user's home directory.  Default is
16033 @file{~/mbox}.
16034
16035 @item nnmbox-active-file
16036 @vindex nnmbox-active-file
16037 The name of the active file for the mail box.  Default is
16038 @file{~/.mbox-active}.
16039
16040 @item nnmbox-get-new-mail
16041 @vindex nnmbox-get-new-mail
16042 If non-@code{nil}, @code{nnmbox} will read incoming mail and split it
16043 into groups.  Default is @code{t}.
16044 @end table
16045
16046
16047 @node Babyl
16048 @subsubsection Babyl
16049 @cindex nnbabyl
16050
16051 @vindex nnbabyl-active-file
16052 @vindex nnbabyl-mbox-file
16053 The @dfn{nnbabyl} back end will use a Babyl mail box to store mail.
16054 @code{nnbabyl} will add extra headers to each mail article to say which
16055 group it belongs in.
16056
16057 Virtual server settings:
16058
16059 @table @code
16060 @item nnbabyl-mbox-file
16061 @vindex nnbabyl-mbox-file
16062 The name of the Babyl file.  The default is @file{~/RMAIL}
16063
16064 @item nnbabyl-active-file
16065 @vindex nnbabyl-active-file
16066 The name of the active file for the Babyl file.  The default is
16067 @file{~/.rmail-active}
16068
16069 @item nnbabyl-get-new-mail
16070 @vindex nnbabyl-get-new-mail
16071 If non-@code{nil}, @code{nnbabyl} will read incoming mail.  Default is
16072 @code{t}
16073 @end table
16074
16075
16076 @node Mail Spool
16077 @subsubsection Mail Spool
16078 @cindex nnml
16079 @cindex mail @acronym{NOV} spool
16080
16081 The @dfn{nnml} spool mail format isn't compatible with any other known
16082 format.  It should be used with some caution.
16083
16084 @vindex nnml-directory
16085 If you use this back end, Gnus will split all incoming mail into files,
16086 one file for each mail, and put the articles into the corresponding
16087 directories under the directory specified by the @code{nnml-directory}
16088 variable.  The default value is @file{~/Mail/}.
16089
16090 You do not have to create any directories beforehand; Gnus will take
16091 care of all that.
16092
16093 If you have a strict limit as to how many files you are allowed to store
16094 in your account, you should not use this back end.  As each mail gets its
16095 own file, you might very well occupy thousands of inodes within a few
16096 weeks.  If this is no problem for you, and it isn't a problem for you
16097 having your friendly systems administrator walking around, madly,
16098 shouting ``Who is eating all my inodes?! Who? Who!?!'', then you should
16099 know that this is probably the fastest format to use.  You do not have
16100 to trudge through a big mbox file just to read your new mail.
16101
16102 @code{nnml} is probably the slowest back end when it comes to article
16103 splitting.  It has to create lots of files, and it also generates
16104 @acronym{NOV} databases for the incoming mails.  This makes it possibly the
16105 fastest back end when it comes to reading mail.
16106
16107 @cindex self contained nnml servers
16108 @cindex marks
16109 When the marks file is used (which it is by default), @code{nnml}
16110 servers have the property that you may backup them using @code{tar} or
16111 similar, and later be able to restore them into Gnus (by adding the
16112 proper @code{nnml} server) and have all your marks be preserved.  Marks
16113 for a group are usually stored in the @code{.marks} file (but see
16114 @code{nnml-marks-file-name}) within each @code{nnml} group's directory.
16115 Individual @code{nnml} groups are also possible to backup, use @kbd{G m}
16116 to restore the group (after restoring the backup into the nnml
16117 directory).
16118
16119 If for some reason you believe your @file{.marks} files are screwed
16120 up, you can just delete them all.  Gnus will then correctly regenerate
16121 them next time it starts.
16122
16123 Virtual server settings:
16124
16125 @table @code
16126 @item nnml-directory
16127 @vindex nnml-directory
16128 All @code{nnml} directories will be placed under this directory.  The
16129 default is the value of @code{message-directory} (whose default value
16130 is @file{~/Mail}).
16131
16132 @item nnml-active-file
16133 @vindex nnml-active-file
16134 The active file for the @code{nnml} server.  The default is
16135 @file{~/Mail/active}.
16136
16137 @item nnml-newsgroups-file
16138 @vindex nnml-newsgroups-file
16139 The @code{nnml} group descriptions file.  @xref{Newsgroups File
16140 Format}.  The default is @file{~/Mail/newsgroups}.
16141
16142 @item nnml-get-new-mail
16143 @vindex nnml-get-new-mail
16144 If non-@code{nil}, @code{nnml} will read incoming mail.  The default is
16145 @code{t}.
16146
16147 @item nnml-nov-is-evil
16148 @vindex nnml-nov-is-evil
16149 If non-@code{nil}, this back end will ignore any @acronym{NOV} files.  The
16150 default is @code{nil}.
16151
16152 @item nnml-nov-file-name
16153 @vindex nnml-nov-file-name
16154 The name of the @acronym{NOV} files.  The default is @file{.overview}.
16155
16156 @item nnml-prepare-save-mail-hook
16157 @vindex nnml-prepare-save-mail-hook
16158 Hook run narrowed to an article before saving.
16159
16160 @item nnml-marks-is-evil
16161 @vindex nnml-marks-is-evil
16162 If non-@code{nil}, this back end will ignore any @sc{marks} files.  The
16163 default is @code{nil}.
16164
16165 @item nnml-marks-file-name
16166 @vindex nnml-marks-file-name
16167 The name of the @dfn{marks} files.  The default is @file{.marks}.
16168
16169 @item nnml-use-compressed-files
16170 @vindex nnml-use-compressed-files
16171 If non-@code{nil}, @code{nnml} will allow using compressed message
16172 files.  This requires @code{auto-compression-mode} to be enabled
16173 (@pxref{Compressed Files, ,Compressed Files, emacs, The Emacs Manual}).
16174 If the value of @code{nnml-use-compressed-files} is a string, it is used
16175 as the file extension specifying the compression program.  You can set it
16176 to @samp{.bz2} if your Emacs supports it.  A value of @code{t} is
16177 equivalent to @samp{.gz}.
16178
16179 @item nnml-compressed-files-size-threshold
16180 @vindex nnml-compressed-files-size-threshold
16181 Default size threshold for compressed message files.  Message files with
16182 bodies larger than that many characters will be automatically compressed
16183 if @code{nnml-use-compressed-files} is non-@code{nil}.
16184
16185 @end table
16186
16187 @findex nnml-generate-nov-databases
16188 If your @code{nnml} groups and @acronym{NOV} files get totally out of
16189 whack, you can do a complete update by typing @kbd{M-x
16190 nnml-generate-nov-databases}.  This command will trawl through the
16191 entire @code{nnml} hierarchy, looking at each and every article, so it
16192 might take a while to complete.  A better interface to this
16193 functionality can be found in the server buffer (@pxref{Server
16194 Commands}).
16195
16196
16197 @node MH Spool
16198 @subsubsection MH Spool
16199 @cindex nnmh
16200 @cindex mh-e mail spool
16201
16202 @code{nnmh} is just like @code{nnml}, except that is doesn't generate
16203 @acronym{NOV} databases and it doesn't keep an active file or marks
16204 file.  This makes @code{nnmh} a @emph{much} slower back end than
16205 @code{nnml}, but it also makes it easier to write procmail scripts
16206 for.
16207
16208 Virtual server settings:
16209
16210 @table @code
16211 @item nnmh-directory
16212 @vindex nnmh-directory
16213 All @code{nnmh} directories will be located under this directory.  The
16214 default is the value of @code{message-directory} (whose default is
16215 @file{~/Mail})
16216
16217 @item nnmh-get-new-mail
16218 @vindex nnmh-get-new-mail
16219 If non-@code{nil}, @code{nnmh} will read incoming mail.  The default is
16220 @code{t}.
16221
16222 @item nnmh-be-safe
16223 @vindex nnmh-be-safe
16224 If non-@code{nil}, @code{nnmh} will go to ridiculous lengths to make
16225 sure that the articles in the folder are actually what Gnus thinks
16226 they are.  It will check date stamps and stat everything in sight, so
16227 setting this to @code{t} will mean a serious slow-down.  If you never
16228 use anything but Gnus to read the @code{nnmh} articles, you do not
16229 have to set this variable to @code{t}.  The default is @code{nil}.
16230 @end table
16231
16232
16233 @node Maildir
16234 @subsubsection Maildir
16235 @cindex nnmaildir
16236 @cindex maildir
16237
16238 @code{nnmaildir} stores mail in the maildir format, with each maildir
16239 corresponding to a group in Gnus.  This format is documented here:
16240 @uref{http://cr.yp.to/proto/maildir.html} and here:
16241 @uref{http://www.qmail.org/man/man5/maildir.html}.  @code{nnmaildir}
16242 also stores extra information in the @file{.nnmaildir/} directory
16243 within a maildir.
16244
16245 Maildir format was designed to allow concurrent deliveries and
16246 reading, without needing locks.  With other back ends, you would have
16247 your mail delivered to a spool of some kind, and then you would
16248 configure Gnus to split mail from that spool into your groups.  You
16249 can still do that with @code{nnmaildir}, but the more common
16250 configuration is to have your mail delivered directly to the maildirs
16251 that appear as group in Gnus.
16252
16253 @code{nnmaildir} is designed to be perfectly reliable: @kbd{C-g} will
16254 never corrupt its data in memory, and @code{SIGKILL} will never
16255 corrupt its data in the filesystem.
16256
16257 @code{nnmaildir} stores article marks and @acronym{NOV} data in each
16258 maildir.  So you can copy a whole maildir from one Gnus setup to
16259 another, and you will keep your marks.
16260
16261 Virtual server settings:
16262
16263 @table @code
16264 @item directory
16265 For each of your @code{nnmaildir} servers (it's very unlikely that
16266 you'd need more than one), you need to create a directory and populate
16267 it with maildirs or symlinks to maildirs (and nothing else; do not
16268 choose a directory already used for other purposes).  Each maildir
16269 will be represented in Gnus as a newsgroup on that server; the
16270 filename of the symlink will be the name of the group.  Any filenames
16271 in the directory starting with @samp{.} are ignored.  The directory is
16272 scanned when you first start Gnus, and each time you type @kbd{g} in
16273 the group buffer; if any maildirs have been removed or added,
16274 @code{nnmaildir} notices at these times.
16275
16276 The value of the @code{directory} parameter should be a Lisp form
16277 which is processed by @code{eval} and @code{expand-file-name} to get
16278 the path of the directory for this server.  The form is @code{eval}ed
16279 only when the server is opened; the resulting string is used until the
16280 server is closed.  (If you don't know about forms and @code{eval},
16281 don't worry---a simple string will work.)  This parameter is not
16282 optional; you must specify it.  I don't recommend using
16283 @code{"~/Mail"} or a subdirectory of it; several other parts of Gnus
16284 use that directory by default for various things, and may get confused
16285 if @code{nnmaildir} uses it too.  @code{"~/.nnmaildir"} is a typical
16286 value.
16287
16288 @item target-prefix
16289 This should be a Lisp form which is processed by @code{eval} and
16290 @code{expand-file-name}.  The form is @code{eval}ed only when the
16291 server is opened; the resulting string is used until the server is
16292 closed.
16293
16294 When you create a group on an @code{nnmaildir} server, the maildir is
16295 created with @code{target-prefix} prepended to its name, and a symlink
16296 pointing to that maildir is created, named with the plain group name.
16297 So if @code{directory} is @code{"~/.nnmaildir"} and
16298 @code{target-prefix} is @code{"../maildirs/"}, then when you create
16299 the group @code{foo}, @code{nnmaildir} will create
16300 @file{~/.nnmaildir/../maildirs/foo} as a maildir, and will create
16301 @file{~/.nnmaildir/foo} as a symlink pointing to
16302 @file{../maildirs/foo}.
16303
16304 You can set @code{target-prefix} to a string without any slashes to
16305 create both maildirs and symlinks in the same @code{directory}; in
16306 this case, any maildirs found in @code{directory} whose names start
16307 with @code{target-prefix} will not be listed as groups (but the
16308 symlinks pointing to them will be).
16309
16310 As a special case, if @code{target-prefix} is @code{""} (the default),
16311 then when you create a group, the maildir will be created in
16312 @code{directory} without a corresponding symlink.  Beware that you
16313 cannot use @code{gnus-group-delete-group} on such groups without the
16314 @code{force} argument.
16315
16316 @item directory-files
16317 This should be a function with the same interface as
16318 @code{directory-files} (such as @code{directory-files} itself).  It is
16319 used to scan the server's @code{directory} for maildirs.  This
16320 parameter is optional; the default is
16321 @code{nnheader-directory-files-safe} if
16322 @code{nnheader-directory-files-is-safe} is @code{nil}, and
16323 @code{directory-files} otherwise.
16324 (@code{nnheader-directory-files-is-safe} is checked only once when the
16325 server is opened; if you want to check it each time the directory is
16326 scanned, you'll have to provide your own function that does that.)
16327
16328 @item get-new-mail
16329 If non-@code{nil}, then after scanning for new mail in the group
16330 maildirs themselves as usual, this server will also incorporate mail
16331 the conventional Gnus way, from @code{mail-sources} according to
16332 @code{nnmail-split-methods} or @code{nnmail-split-fancy}.  The default
16333 value is @code{nil}.
16334
16335 Do @emph{not} use the same maildir both in @code{mail-sources} and as
16336 an @code{nnmaildir} group.  The results might happen to be useful, but
16337 that would be by chance, not by design, and the results might be
16338 different in the future.  If your split rules create new groups,
16339 remember to supply a @code{create-directory} server parameter.
16340 @end table
16341
16342 @subsubsection Group parameters
16343
16344 @code{nnmaildir} uses several group parameters.  It's safe to ignore
16345 all this; the default behavior for @code{nnmaildir} is the same as the
16346 default behavior for other mail back ends: articles are deleted after
16347 one week, etc.  Except for the expiry parameters, all this
16348 functionality is unique to @code{nnmaildir}, so you can ignore it if
16349 you're just trying to duplicate the behavior you already have with
16350 another back end.
16351
16352 If the value of any of these parameters is a vector, the first element
16353 is evaluated as a Lisp form and the result is used, rather than the
16354 original value.  If the value is not a vector, the value itself is
16355 evaluated as a Lisp form.  (This is why these parameters use names
16356 different from those of other, similar parameters supported by other
16357 back ends: they have different, though similar, meanings.)  (For
16358 numbers, strings, @code{nil}, and @code{t}, you can ignore the
16359 @code{eval} business again; for other values, remember to use an extra
16360 quote and wrap the value in a vector when appropriate.)
16361
16362 @table @code
16363 @item expire-age
16364 An integer specifying the minimum age, in seconds, of an article
16365 before it will be expired, or the symbol @code{never} to specify that
16366 articles should never be expired.  If this parameter is not set,
16367 @code{nnmaildir} falls back to the usual
16368 @code{nnmail-expiry-wait}(@code{-function}) variables (the
16369 @code{expiry-wait} group parameter overrides @code{nnmail-expiry-wait}
16370 and makes @code{nnmail-expiry-wait-function} ineffective).  If you
16371 wanted a value of 3 days, you could use something like @code{[(* 3 24
16372 60 60)]}; @code{nnmaildir} will evaluate the form and use the result.
16373 An article's age is measured starting from the article file's
16374 modification time.  Normally, this is the same as the article's
16375 delivery time, but editing an article makes it younger.  Moving an
16376 article (other than via expiry) may also make an article younger.
16377
16378 @item expire-group
16379 If this is set to a string such as a full Gnus group name, like
16380 @example
16381 "backend+server.address.string:group.name"
16382 @end example
16383 and if it is not the name of the same group that the parameter belongs
16384 to, then articles will be moved to the specified group during expiry
16385 before being deleted.  @emph{If this is set to an @code{nnmaildir}
16386 group, the article will be just as old in the destination group as it
16387 was in the source group.}  So be careful with @code{expire-age} in the
16388 destination group.  If this is set to the name of the same group that
16389 the parameter belongs to, then the article is not expired at all.  If
16390 you use the vector form, the first element is evaluated once for each
16391 article.  So that form can refer to
16392 @code{nnmaildir-article-file-name}, etc., to decide where to put the
16393 article.  @emph{Even if this parameter is not set, @code{nnmaildir}
16394 does not fall back to the @code{expiry-target} group parameter or the
16395 @code{nnmail-expiry-target} variable.}
16396
16397 @item read-only
16398 If this is set to @code{t}, @code{nnmaildir} will treat the articles
16399 in this maildir as read-only.  This means: articles are not renamed
16400 from @file{new/} into @file{cur/}; articles are only found in
16401 @file{new/}, not @file{cur/}; articles are never deleted; articles
16402 cannot be edited.  @file{new/} is expected to be a symlink to the
16403 @file{new/} directory of another maildir---e.g., a system-wide mailbox
16404 containing a mailing list of common interest.  Everything in the
16405 maildir outside @file{new/} is @emph{not} treated as read-only, so for
16406 a shared mailbox, you do still need to set up your own maildir (or
16407 have write permission to the shared mailbox); your maildir just won't
16408 contain extra copies of the articles.
16409
16410 @item directory-files
16411 A function with the same interface as @code{directory-files}.  It is
16412 used to scan the directories in the maildir corresponding to this
16413 group to find articles.  The default is the function specified by the
16414 server's @code{directory-files} parameter.
16415
16416 @item distrust-Lines:
16417 If non-@code{nil}, @code{nnmaildir} will always count the lines of an
16418 article, rather than use the @code{Lines:} header field.  If
16419 @code{nil}, the header field will be used if present.
16420
16421 @item always-marks
16422 A list of mark symbols, such as @code{['(read expire)]}.  Whenever
16423 Gnus asks @code{nnmaildir} for article marks, @code{nnmaildir} will
16424 say that all articles have these marks, regardless of whether the
16425 marks stored in the filesystem say so.  This is a proof-of-concept
16426 feature that will probably be removed eventually; it ought to be done
16427 in Gnus proper, or abandoned if it's not worthwhile.
16428
16429 @item never-marks
16430 A list of mark symbols, such as @code{['(tick expire)]}.  Whenever
16431 Gnus asks @code{nnmaildir} for article marks, @code{nnmaildir} will
16432 say that no articles have these marks, regardless of whether the marks
16433 stored in the filesystem say so.  @code{never-marks} overrides
16434 @code{always-marks}.  This is a proof-of-concept feature that will
16435 probably be removed eventually; it ought to be done in Gnus proper, or
16436 abandoned if it's not worthwhile.
16437
16438 @item nov-cache-size
16439 An integer specifying the size of the @acronym{NOV} memory cache.  To
16440 speed things up, @code{nnmaildir} keeps @acronym{NOV} data in memory
16441 for a limited number of articles in each group.  (This is probably not
16442 worthwhile, and will probably be removed in the future.)  This
16443 parameter's value is noticed only the first time a group is seen after
16444 the server is opened---i.e., when you first start Gnus, typically.
16445 The @acronym{NOV} cache is never resized until the server is closed
16446 and reopened.  The default is an estimate of the number of articles
16447 that would be displayed in the summary buffer: a count of articles
16448 that are either marked with @code{tick} or not marked with
16449 @code{read}, plus a little extra.
16450 @end table
16451
16452 @subsubsection Article identification
16453 Articles are stored in the @file{cur/} subdirectory of each maildir.
16454 Each article file is named like @code{uniq:info}, where @code{uniq}
16455 contains no colons.  @code{nnmaildir} ignores, but preserves, the
16456 @code{:info} part.  (Other maildir readers typically use this part of
16457 the filename to store marks.)  The @code{uniq} part uniquely
16458 identifies the article, and is used in various places in the
16459 @file{.nnmaildir/} subdirectory of the maildir to store information
16460 about the corresponding article.  The full pathname of an article is
16461 available in the variable @code{nnmaildir-article-file-name} after you
16462 request the article in the summary buffer.
16463
16464 @subsubsection NOV data
16465 An article identified by @code{uniq} has its @acronym{NOV} data (used
16466 to generate lines in the summary buffer) stored in
16467 @code{.nnmaildir/nov/uniq}.  There is no
16468 @code{nnmaildir-generate-nov-databases} function.  (There isn't much
16469 need for it---an article's @acronym{NOV} data is updated automatically
16470 when the article or @code{nnmail-extra-headers} has changed.)  You can
16471 force @code{nnmaildir} to regenerate the @acronym{NOV} data for a
16472 single article simply by deleting the corresponding @acronym{NOV}
16473 file, but @emph{beware}: this will also cause @code{nnmaildir} to
16474 assign a new article number for this article, which may cause trouble
16475 with @code{seen} marks, the Agent, and the cache.
16476
16477 @subsubsection Article marks
16478 An article identified by @code{uniq} is considered to have the mark
16479 @code{flag} when the file @file{.nnmaildir/marks/flag/uniq} exists.
16480 When Gnus asks @code{nnmaildir} for a group's marks, @code{nnmaildir}
16481 looks for such files and reports the set of marks it finds.  When Gnus
16482 asks @code{nnmaildir} to store a new set of marks, @code{nnmaildir}
16483 creates and deletes the corresponding files as needed.  (Actually,
16484 rather than create a new file for each mark, it just creates hard
16485 links to @file{.nnmaildir/markfile}, to save inodes.)
16486
16487 You can invent new marks by creating a new directory in
16488 @file{.nnmaildir/marks/}.  You can tar up a maildir and remove it from
16489 your server, untar it later, and keep your marks.  You can add and
16490 remove marks yourself by creating and deleting mark files.  If you do
16491 this while Gnus is running and your @code{nnmaildir} server is open,
16492 it's best to exit all summary buffers for @code{nnmaildir} groups and
16493 type @kbd{s} in the group buffer first, and to type @kbd{g} or
16494 @kbd{M-g} in the group buffer afterwards.  Otherwise, Gnus might not
16495 pick up the changes, and might undo them.
16496
16497
16498 @node Mail Folders
16499 @subsubsection Mail Folders
16500 @cindex nnfolder
16501 @cindex mbox folders
16502 @cindex mail folders
16503
16504 @code{nnfolder} is a back end for storing each mail group in a
16505 separate file.  Each file is in the standard Un*x mbox format.
16506 @code{nnfolder} will add extra headers to keep track of article
16507 numbers and arrival dates.
16508
16509 @cindex self contained nnfolder servers
16510 @cindex marks
16511 When the marks file is used (which it is by default), @code{nnfolder}
16512 servers have the property that you may backup them using @code{tar} or
16513 similar, and later be able to restore them into Gnus (by adding the
16514 proper @code{nnfolder} server) and have all your marks be preserved.
16515 Marks for a group are usually stored in a file named as the mbox file
16516 with @code{.mrk} concatenated to it (but see
16517 @code{nnfolder-marks-file-suffix}) within the @code{nnfolder}
16518 directory.  Individual @code{nnfolder} groups are also possible to
16519 backup, use @kbd{G m} to restore the group (after restoring the backup
16520 into the @code{nnfolder} directory).
16521
16522 Virtual server settings:
16523
16524 @table @code
16525 @item nnfolder-directory
16526 @vindex nnfolder-directory
16527 All the @code{nnfolder} mail boxes will be stored under this
16528 directory.  The default is the value of @code{message-directory}
16529 (whose default is @file{~/Mail})
16530
16531 @item nnfolder-active-file
16532 @vindex nnfolder-active-file
16533 The name of the active file.  The default is @file{~/Mail/active}.
16534
16535 @item nnfolder-newsgroups-file
16536 @vindex nnfolder-newsgroups-file
16537 The name of the group descriptions file.  @xref{Newsgroups File
16538 Format}.  The default is @file{~/Mail/newsgroups}
16539
16540 @item nnfolder-get-new-mail
16541 @vindex nnfolder-get-new-mail
16542 If non-@code{nil}, @code{nnfolder} will read incoming mail.  The
16543 default is @code{t}
16544
16545 @item nnfolder-save-buffer-hook
16546 @vindex nnfolder-save-buffer-hook
16547 @cindex backup files
16548 Hook run before saving the folders.  Note that Emacs does the normal
16549 backup renaming of files even with the @code{nnfolder} buffers.  If
16550 you wish to switch this off, you could say something like the
16551 following in your @file{.emacs} file:
16552
16553 @lisp
16554 (defun turn-off-backup ()
16555   (set (make-local-variable 'backup-inhibited) t))
16556
16557 (add-hook 'nnfolder-save-buffer-hook 'turn-off-backup)
16558 @end lisp
16559
16560 @item nnfolder-delete-mail-hook
16561 @vindex nnfolder-delete-mail-hook
16562 Hook run in a buffer narrowed to the message that is to be deleted.
16563 This function can be used to copy the message to somewhere else, or to
16564 extract some information from it before removing it.
16565
16566 @item nnfolder-nov-is-evil
16567 @vindex nnfolder-nov-is-evil
16568 If non-@code{nil}, this back end will ignore any @acronym{NOV} files.  The
16569 default is @code{nil}.
16570
16571 @item nnfolder-nov-file-suffix
16572 @vindex nnfolder-nov-file-suffix
16573 The extension for @acronym{NOV} files.  The default is @file{.nov}.
16574
16575 @item nnfolder-nov-directory
16576 @vindex nnfolder-nov-directory
16577 The directory where the @acronym{NOV} files should be stored.  If
16578 @code{nil}, @code{nnfolder-directory} is used.
16579
16580 @item nnfolder-marks-is-evil
16581 @vindex nnfolder-marks-is-evil
16582 If non-@code{nil}, this back end will ignore any @sc{marks} files.  The
16583 default is @code{nil}.
16584
16585 @item nnfolder-marks-file-suffix
16586 @vindex nnfolder-marks-file-suffix
16587 The extension for @sc{marks} files.  The default is @file{.mrk}.
16588
16589 @item nnfolder-marks-directory
16590 @vindex nnfolder-marks-directory
16591 The directory where the @sc{marks} files should be stored.  If
16592 @code{nil}, @code{nnfolder-directory} is used.
16593
16594 @end table
16595
16596
16597 @findex nnfolder-generate-active-file
16598 @kindex M-x nnfolder-generate-active-file
16599 If you have lots of @code{nnfolder}-like files you'd like to read with
16600 @code{nnfolder}, you can use the @kbd{M-x nnfolder-generate-active-file}
16601 command to make @code{nnfolder} aware of all likely files in
16602 @code{nnfolder-directory}.  This only works if you use long file names,
16603 though.
16604
16605 @node Comparing Mail Back Ends
16606 @subsubsection Comparing Mail Back Ends
16607
16608 First, just for terminology, the @dfn{back end} is the common word for a
16609 low-level access method---a transport, if you will, by which something
16610 is acquired.  The sense is that one's mail has to come from somewhere,
16611 and so selection of a suitable back end is required in order to get that
16612 mail within spitting distance of Gnus.
16613
16614 The same concept exists for Usenet itself: Though access to articles is
16615 typically done by @acronym{NNTP} these days, once upon a midnight dreary, everyone
16616 in the world got at Usenet by running a reader on the machine where the
16617 articles lay (the machine which today we call an @acronym{NNTP} server), and
16618 access was by the reader stepping into the articles' directory spool
16619 area directly.  One can still select between either the @code{nntp} or
16620 @code{nnspool} back ends, to select between these methods, if one happens
16621 actually to live on the server (or can see its spool directly, anyway,
16622 via NFS).
16623
16624 The goal in selecting a mail back end is to pick one which
16625 simultaneously represents a suitable way of dealing with the original
16626 format plus leaving mail in a form that is convenient to use in the
16627 future.  Here are some high and low points on each:
16628
16629 @table @code
16630 @item nnmbox
16631
16632 UNIX systems have historically had a single, very common, and well-
16633 defined format.  All messages arrive in a single @dfn{spool file}, and
16634 they are delineated by a line whose regular expression matches
16635 @samp{^From_}.  (My notational use of @samp{_} is to indicate a space,
16636 to make it clear in this instance that this is not the RFC-specified
16637 @samp{From:} header.)  Because Emacs and therefore Gnus emanate
16638 historically from the Unix environment, it is simplest if one does not
16639 mess a great deal with the original mailbox format, so if one chooses
16640 this back end, Gnus' primary activity in getting mail from the real spool
16641 area to Gnus' preferred directory is simply to copy it, with no
16642 (appreciable) format change in the process.  It is the ``dumbest'' way
16643 to move mail into availability in the Gnus environment.  This makes it
16644 fast to move into place, but slow to parse, when Gnus has to look at
16645 what's where.
16646
16647 @item nnbabyl
16648
16649 Once upon a time, there was the DEC-10 and DEC-20, running operating
16650 systems called TOPS and related things, and the usual (only?) mail
16651 reading environment was a thing called Babyl.  I don't know what format
16652 was used for mail landing on the system, but Babyl had its own internal
16653 format to which mail was converted, primarily involving creating a
16654 spool-file-like entity with a scheme for inserting Babyl-specific
16655 headers and status bits above the top of each message in the file.
16656 Rmail was Emacs' first mail reader, it was written by Richard Stallman,
16657 and Stallman came out of that TOPS/Babyl environment, so he wrote Rmail
16658 to understand the mail files folks already had in existence.  Gnus (and
16659 VM, for that matter) continue to support this format because it's
16660 perceived as having some good qualities in those mailer-specific
16661 headers/status bits stuff.  Rmail itself still exists as well, of
16662 course, and is still maintained within Emacs.  Since Emacs 23, it
16663 uses standard mbox format rather than Babyl.
16664
16665 Both of the above forms leave your mail in a single file on your
16666 file system, and they must parse that entire file each time you take a
16667 look at your mail.
16668
16669 @item nnml
16670
16671 @code{nnml} is the back end which smells the most as though you were
16672 actually operating with an @code{nnspool}-accessed Usenet system.  (In
16673 fact, I believe @code{nnml} actually derived from @code{nnspool} code,
16674 lo these years ago.)  One's mail is taken from the original spool file,
16675 and is then cut up into individual message files, 1:1.  It maintains a
16676 Usenet-style active file (analogous to what one finds in an INN- or
16677 CNews-based news system in (for instance) @file{/var/lib/news/active},
16678 or what is returned via the @samp{NNTP LIST} verb) and also creates
16679 @dfn{overview} files for efficient group entry, as has been defined for
16680 @acronym{NNTP} servers for some years now.  It is slower in mail-splitting,
16681 due to the creation of lots of files, updates to the @code{nnml} active
16682 file, and additions to overview files on a per-message basis, but it is
16683 extremely fast on access because of what amounts to the indexing support
16684 provided by the active file and overviews.
16685
16686 @code{nnml} costs @dfn{inodes} in a big way; that is, it soaks up the
16687 resource which defines available places in the file system to put new
16688 files.  Sysadmins take a dim view of heavy inode occupation within
16689 tight, shared file systems.  But if you live on a personal machine where
16690 the file system is your own and space is not at a premium, @code{nnml}
16691 wins big.
16692
16693 It is also problematic using this back end if you are living in a
16694 FAT16-based Windows world, since much space will be wasted on all these
16695 tiny files.
16696
16697 @item nnmh
16698
16699 The Rand MH mail-reading system has been around UNIX systems for a very
16700 long time; it operates by splitting one's spool file of messages into
16701 individual files, but with little or no indexing support---@code{nnmh}
16702 is considered to be semantically equivalent to ``@code{nnml} without
16703 active file or overviews''.  This is arguably the worst choice, because
16704 one gets the slowness of individual file creation married to the
16705 slowness of access parsing when learning what's new in one's groups.
16706
16707 @item nnfolder
16708
16709 Basically the effect of @code{nnfolder} is @code{nnmbox} (the first
16710 method described above) on a per-group basis.  That is, @code{nnmbox}
16711 itself puts @emph{all} one's mail in one file; @code{nnfolder} provides a
16712 little bit of optimization to this so that each of one's mail groups has
16713 a Unix mail box file.  It's faster than @code{nnmbox} because each group
16714 can be parsed separately, and still provides the simple Unix mail box
16715 format requiring minimal effort in moving the mail around.  In addition,
16716 it maintains an ``active'' file making it much faster for Gnus to figure
16717 out how many messages there are in each separate group.
16718
16719 If you have groups that are expected to have a massive amount of
16720 messages, @code{nnfolder} is not the best choice, but if you receive
16721 only a moderate amount of mail, @code{nnfolder} is probably the most
16722 friendly mail back end all over.
16723
16724 @item nnmaildir
16725
16726 For configuring expiry and other things, @code{nnmaildir} uses
16727 incompatible group parameters, slightly different from those of other
16728 mail back ends.
16729
16730 @code{nnmaildir} is largely similar to @code{nnml}, with some notable
16731 differences. Each message is stored in a separate file, but the
16732 filename is unrelated to the article number in Gnus. @code{nnmaildir}
16733 also stores the equivalent of @code{nnml}'s overview files in one file
16734 per article, so it uses about twice as many inodes as @code{nnml}.
16735 (Use @code{df -i} to see how plentiful your inode supply is.) If this
16736 slows you down or takes up very much space, a non-block-structured
16737 file system.
16738
16739 Since maildirs don't require locking for delivery, the maildirs you use
16740 as groups can also be the maildirs your mail is directly delivered to.
16741 This means you can skip Gnus' mail splitting if your mail is already
16742 organized into different mailboxes during delivery.  A @code{directory}
16743 entry in @code{mail-sources} would have a similar effect, but would
16744 require one set of mailboxes for spooling deliveries (in mbox format,
16745 thus damaging message bodies), and another set to be used as groups (in
16746 whatever format you like).  A maildir has a built-in spool, in the
16747 @code{new/} subdirectory.  Beware that currently, mail moved from
16748 @code{new/} to @code{cur/} instead of via mail splitting will not
16749 undergo treatment such as duplicate checking.
16750
16751 @code{nnmaildir} stores article marks for a given group in the
16752 corresponding maildir, in a way designed so that it's easy to manipulate
16753 them from outside Gnus.  You can tar up a maildir, unpack it somewhere
16754 else, and still have your marks.  @code{nnml} also stores marks, but
16755 it's not as easy to work with them from outside Gnus as with
16756 @code{nnmaildir}.
16757
16758 @code{nnmaildir} uses a significant amount of memory to speed things up.
16759 (It keeps in memory some of the things that @code{nnml} stores in files
16760 and that @code{nnmh} repeatedly parses out of message files.)  If this
16761 is a problem for you, you can set the @code{nov-cache-size} group
16762 parameter to something small (0 would probably not work, but 1 probably
16763 would) to make it use less memory.  This caching will probably be
16764 removed in the future.
16765
16766 Startup is likely to be slower with @code{nnmaildir} than with other
16767 back ends.  Everything else is likely to be faster, depending in part
16768 on your file system.
16769
16770 @code{nnmaildir} does not use @code{nnoo}, so you cannot use @code{nnoo}
16771 to write an @code{nnmaildir}-derived back end.
16772
16773 @end table
16774
16775
16776 @node Browsing the Web
16777 @section Browsing the Web
16778 @cindex web
16779 @cindex browsing the web
16780 @cindex www
16781 @cindex http
16782
16783 Web-based discussion forums are getting more and more popular.  On many
16784 subjects, the web-based forums have become the most important forums,
16785 eclipsing the importance of mailing lists and news groups.  The reason
16786 is easy to understand---they are friendly to new users; you just point
16787 and click, and there's the discussion.  With mailing lists, you have to
16788 go through a cumbersome subscription procedure, and most people don't
16789 even know what a news group is.
16790
16791 The problem with this scenario is that web browsers are not very good at
16792 being newsreaders.  They do not keep track of what articles you've read;
16793 they do not allow you to score on subjects you're interested in; they do
16794 not allow off-line browsing; they require you to click around and drive
16795 you mad in the end.
16796
16797 So---if web browsers suck at reading discussion forums, why not use Gnus
16798 to do it instead?
16799
16800 Gnus has been getting a bit of a collection of back ends for providing
16801 interfaces to these sources.
16802
16803 @menu
16804 * Archiving Mail::
16805 * Web Searches::                Creating groups from articles that match a string.
16806 * RSS::                         Reading RDF site summary.
16807 * Customizing W3::              Doing stuff to Emacs/W3 from Gnus.
16808 @end menu
16809
16810 All the web sources require Emacs/W3 and the url library or those
16811 alternatives to work.
16812
16813 The main caveat with all these web sources is that they probably won't
16814 work for a very long time.  Gleaning information from the @acronym{HTML} data
16815 is guesswork at best, and when the layout is altered, the Gnus back end
16816 will fail.  If you have reasonably new versions of these back ends,
16817 though, you should be ok.
16818
16819 One thing all these Web methods have in common is that the Web sources
16820 are often down, unavailable or just plain too slow to be fun.  In those
16821 cases, it makes a lot of sense to let the Gnus Agent (@pxref{Gnus
16822 Unplugged}) handle downloading articles, and then you can read them at
16823 leisure from your local disk.  No more World Wide Wait for you.
16824
16825 @node Archiving Mail
16826 @subsection Archiving Mail
16827 @cindex archiving mail
16828 @cindex backup of mail
16829
16830 Some of the back ends, notably @code{nnml}, @code{nnfolder}, and
16831 @code{nnmaildir}, now actually store the article marks with each group.
16832 For these servers, archiving and restoring a group while preserving
16833 marks is fairly simple.
16834
16835 (Preserving the group level and group parameters as well still
16836 requires ritual dancing and sacrifices to the @file{.newsrc.eld} deity
16837 though.)
16838
16839 To archive an entire @code{nnml}, @code{nnfolder}, or @code{nnmaildir}
16840 server, take a recursive copy of the server directory.  There is no need
16841 to shut down Gnus, so archiving may be invoked by @code{cron} or
16842 similar.  You restore the data by restoring the directory tree, and
16843 adding a server definition pointing to that directory in Gnus.  The
16844 @ref{Article Backlog}, @ref{Asynchronous Fetching} and other things
16845 might interfere with overwriting data, so you may want to shut down Gnus
16846 before you restore the data.
16847
16848 It is also possible to archive individual @code{nnml},
16849 @code{nnfolder}, or @code{nnmaildir} groups, while preserving marks.
16850 For @code{nnml} or @code{nnmaildir}, you copy all files in the group's
16851 directory.  For @code{nnfolder} you need to copy both the base folder
16852 file itself (@file{FOO}, say), and the marks file (@file{FOO.mrk} in
16853 this example).  Restoring the group is done with @kbd{G m} from the Group
16854 buffer.  The last step makes Gnus notice the new directory.
16855 @code{nnmaildir} notices the new directory automatically, so @kbd{G m}
16856 is unnecessary in that case.
16857
16858 @node Web Searches
16859 @subsection Web Searches
16860 @cindex nnweb
16861 @cindex Google
16862 @cindex dejanews
16863 @cindex gmane
16864 @cindex Usenet searches
16865 @cindex searching the Usenet
16866
16867 It's, like, too neat to search the Usenet for articles that match a
16868 string, but it, like, totally @emph{sucks}, like, totally, to use one of
16869 those, like, Web browsers, and you, like, have to, rilly, like, look at
16870 the commercials, so, like, with Gnus you can do @emph{rad}, rilly,
16871 searches without having to use a browser.
16872
16873 The @code{nnweb} back end allows an easy interface to the mighty search
16874 engine.  You create an @code{nnweb} group, enter a search pattern, and
16875 then enter the group and read the articles like you would any normal
16876 group.  The @kbd{G w} command in the group buffer (@pxref{Foreign
16877 Groups}) will do this in an easy-to-use fashion.
16878
16879 @code{nnweb} groups don't really lend themselves to being solid
16880 groups---they have a very fleeting idea of article numbers.  In fact,
16881 each time you enter an @code{nnweb} group (not even changing the search
16882 pattern), you are likely to get the articles ordered in a different
16883 manner.  Not even using duplicate suppression (@pxref{Duplicate
16884 Suppression}) will help, since @code{nnweb} doesn't even know the
16885 @code{Message-ID} of the articles before reading them using some search
16886 engines (Google, for instance).  The only possible way to keep track
16887 of which articles you've read is by scoring on the @code{Date}
16888 header---mark all articles posted before the last date you read the
16889 group as read.
16890
16891 If the search engine changes its output substantially, @code{nnweb}
16892 won't be able to parse it and will fail.  One could hardly fault the Web
16893 providers if they were to do this---their @emph{raison d'@^etre} is to
16894 make money off of advertisements, not to provide services to the
16895 community.  Since @code{nnweb} washes the ads off all the articles, one
16896 might think that the providers might be somewhat miffed.  We'll see.
16897
16898 You must have the @code{url} and @code{W3} package or those alternatives
16899 (try @code{customize-group} on the @samp{mm-url} variable group)
16900 installed to be able to use @code{nnweb}.
16901
16902 Virtual server variables:
16903
16904 @table @code
16905 @item nnweb-type
16906 @vindex nnweb-type
16907 What search engine type is being used.  The currently supported types
16908 are @code{google}, @code{dejanews}, and @code{gmane}.  Note that
16909 @code{dejanews} is an alias to @code{google}.
16910
16911 @item nnweb-search
16912 @vindex nnweb-search
16913 The search string to feed to the search engine.
16914
16915 @item nnweb-max-hits
16916 @vindex nnweb-max-hits
16917 Advisory maximum number of hits per search to display.  The default is
16918 999.
16919
16920 @item nnweb-type-definition
16921 @vindex nnweb-type-definition
16922 Type-to-definition alist.  This alist says what @code{nnweb} should do
16923 with the various search engine types.  The following elements must be
16924 present:
16925
16926 @table @code
16927 @item article
16928 Function to decode the article and provide something that Gnus
16929 understands.
16930
16931 @item map
16932 Function to create an article number to message header and URL alist.
16933
16934 @item search
16935 Function to send the search string to the search engine.
16936
16937 @item address
16938 The address the aforementioned function should send the search string
16939 to.
16940
16941 @item id
16942 Format string URL to fetch an article by @code{Message-ID}.
16943 @end table
16944
16945 @end table
16946
16947
16948 @node RSS
16949 @subsection RSS
16950 @cindex nnrss
16951 @cindex RSS
16952
16953 Some web sites have an RDF Site Summary (@acronym{RSS}).
16954 @acronym{RSS} is a format for summarizing headlines from news related
16955 sites (such as BBC or CNN).  But basically anything list-like can be
16956 presented as an @acronym{RSS} feed: weblogs, changelogs or recent
16957 changes to a wiki (e.g. @url{http://cliki.net/recent-changes.rdf}).
16958
16959 @acronym{RSS} has a quite regular and nice interface, and it's
16960 possible to get the information Gnus needs to keep groups updated.
16961
16962 Note: you had better use Emacs which supports the @code{utf-8} coding
16963 system because @acronym{RSS} uses UTF-8 for encoding non-@acronym{ASCII}
16964 text by default.  It is also used by default for non-@acronym{ASCII}
16965 group names.
16966
16967 @kindex G R (Group)
16968 Use @kbd{G R} from the group buffer to subscribe to a feed---you will be
16969 prompted for the location, the title and the description of the feed.
16970 The title, which allows any characters, will be used for the group name
16971 and the name of the group data file.  The description can be omitted.
16972
16973 An easy way to get started with @code{nnrss} is to say something like
16974 the following in the group buffer: @kbd{B nnrss RET RET y}, then
16975 subscribe to groups.
16976
16977 The @code{nnrss} back end saves the group data file in
16978 @code{nnrss-directory} (see below) for each @code{nnrss} group.  File
16979 names containing non-@acronym{ASCII} characters will be encoded by the
16980 coding system specified with the @code{nnmail-pathname-coding-system}
16981 variable or other.  Also @xref{Non-ASCII Group Names}, for more
16982 information.
16983
16984 The @code{nnrss} back end generates @samp{multipart/alternative}
16985 @acronym{MIME} articles in which each contains a @samp{text/plain} part
16986 and a @samp{text/html} part.
16987
16988 @cindex OPML
16989 You can also use the following commands to import and export your
16990 subscriptions from a file in @acronym{OPML} format (Outline Processor
16991 Markup Language).
16992
16993 @defun nnrss-opml-import file
16994 Prompt for an @acronym{OPML} file, and subscribe to each feed in the
16995 file.
16996 @end defun
16997
16998 @defun nnrss-opml-export
16999 Write your current @acronym{RSS} subscriptions to a buffer in
17000 @acronym{OPML} format.
17001 @end defun
17002
17003 The following @code{nnrss} variables can be altered:
17004
17005 @table @code
17006 @item nnrss-directory
17007 @vindex nnrss-directory
17008 The directory where @code{nnrss} stores its files.  The default is
17009 @file{~/News/rss/}.
17010
17011 @item nnrss-file-coding-system
17012 @vindex nnrss-file-coding-system
17013 The coding system used when reading and writing the @code{nnrss} groups
17014 data files.  The default is the value of
17015 @code{mm-universal-coding-system} (which defaults to @code{emacs-mule}
17016 in Emacs or @code{escape-quoted} in XEmacs).
17017
17018 @item nnrss-ignore-article-fields
17019 @vindex nnrss-ignore-article-fields
17020 Some feeds update constantly article fields during their publications,
17021 e.g. to indicate the number of comments.  However, if there is
17022 a difference between the local article and the distant one, the latter
17023 is considered to be new.  To avoid this and discard some fields, set this
17024 variable to the list of fields to be ignored.  The default is
17025 @code{'(slash:comments)}.
17026
17027 @item nnrss-use-local
17028 @vindex nnrss-use-local
17029 @findex nnrss-generate-download-script
17030 If you set @code{nnrss-use-local} to @code{t}, @code{nnrss} will read
17031 the feeds from local files in @code{nnrss-directory}.  You can use
17032 the command @code{nnrss-generate-download-script} to generate a
17033 download script using @command{wget}.
17034 @end table
17035
17036 The following code may be helpful, if you want to show the description in
17037 the summary buffer.
17038
17039 @lisp
17040 (add-to-list 'nnmail-extra-headers nnrss-description-field)
17041 (setq gnus-summary-line-format "%U%R%z%I%(%[%4L: %-15,15f%]%) %s%uX\n")
17042
17043 (defun gnus-user-format-function-X (header)
17044   (let ((descr
17045          (assq nnrss-description-field (mail-header-extra header))))
17046     (if descr (concat "\n\t" (cdr descr)) "")))
17047 @end lisp
17048
17049 The following code may be useful to open an nnrss url directly from the
17050 summary buffer.
17051
17052 @lisp
17053 (require 'browse-url)
17054
17055 (defun browse-nnrss-url (arg)
17056   (interactive "p")
17057   (let ((url (assq nnrss-url-field
17058                    (mail-header-extra
17059                     (gnus-data-header
17060                      (assq (gnus-summary-article-number)
17061                            gnus-newsgroup-data))))))
17062     (if url
17063         (progn
17064           (browse-url (cdr url))
17065           (gnus-summary-mark-as-read-forward 1))
17066       (gnus-summary-scroll-up arg))))
17067
17068 (eval-after-load "gnus"
17069   #'(define-key gnus-summary-mode-map
17070       (kbd "<RET>") 'browse-nnrss-url))
17071 (add-to-list 'nnmail-extra-headers nnrss-url-field)
17072 @end lisp
17073
17074 Even if you have added @samp{text/html} to the
17075 @code{mm-discouraged-alternatives} variable (@pxref{Display
17076 Customization, ,Display Customization, emacs-mime, The Emacs MIME
17077 Manual}) since you don't want to see @acronym{HTML} parts, it might be
17078 more useful especially in @code{nnrss} groups to display
17079 @samp{text/html} parts.  Here's an example of setting
17080 @code{mm-discouraged-alternatives} as a group parameter (@pxref{Group
17081 Parameters}) in order to display @samp{text/html} parts only in
17082 @code{nnrss} groups:
17083
17084 @lisp
17085 ;; @r{Set the default value of @code{mm-discouraged-alternatives}.}
17086 (eval-after-load "gnus-sum"
17087   '(add-to-list
17088     'gnus-newsgroup-variables
17089     '(mm-discouraged-alternatives
17090       . '("text/html" "image/.*"))))
17091
17092 ;; @r{Display @samp{text/html} parts in @code{nnrss} groups.}
17093 (add-to-list
17094  'gnus-parameters
17095  '("\\`nnrss:" (mm-discouraged-alternatives nil)))
17096 @end lisp
17097
17098
17099 @node Customizing W3
17100 @subsection Customizing W3
17101 @cindex W3
17102 @cindex html
17103 @cindex url
17104 @cindex Netscape
17105
17106 Gnus uses the url library to fetch web pages and Emacs/W3 (or those
17107 alternatives) to display web pages.  Emacs/W3 is documented in its own
17108 manual, but there are some things that may be more relevant for Gnus
17109 users.
17110
17111 For instance, a common question is how to make Emacs/W3 follow links
17112 using the @code{browse-url} functions (which will call some external web
17113 browser like Netscape).  Here's one way:
17114
17115 @lisp
17116 (eval-after-load "w3"
17117   '(progn
17118     (fset 'w3-fetch-orig (symbol-function 'w3-fetch))
17119     (defun w3-fetch (&optional url target)
17120       (interactive (list (w3-read-url-with-default)))
17121       (if (eq major-mode 'gnus-article-mode)
17122           (browse-url url)
17123         (w3-fetch-orig url target)))))
17124 @end lisp
17125
17126 Put that in your @file{.emacs} file, and hitting links in W3-rendered
17127 @acronym{HTML} in the Gnus article buffers will use @code{browse-url} to
17128 follow the link.
17129
17130
17131 @node Other Sources
17132 @section Other Sources
17133
17134 Gnus can do more than just read news or mail.  The methods described
17135 below allow Gnus to view directories and files as if they were
17136 newsgroups.
17137
17138 @menu
17139 * Directory Groups::            You can read a directory as if it was a newsgroup.
17140 * Anything Groups::             Dired?  Who needs dired?
17141 * Document Groups::             Single files can be the basis of a group.
17142 * Mail-To-News Gateways::       Posting articles via mail-to-news gateways.
17143 * The Empty Backend::           The backend that never has any news.
17144 @end menu
17145
17146
17147 @node Directory Groups
17148 @subsection Directory Groups
17149 @cindex nndir
17150 @cindex directory groups
17151
17152 If you have a directory that has lots of articles in separate files in
17153 it, you might treat it as a newsgroup.  The files have to have numerical
17154 names, of course.
17155
17156 This might be an opportune moment to mention @code{ange-ftp} (and its
17157 successor @code{efs}), that most wonderful of all wonderful Emacs
17158 packages.  When I wrote @code{nndir}, I didn't think much about it---a
17159 back end to read directories.  Big deal.
17160
17161 @code{ange-ftp} changes that picture dramatically.  For instance, if you
17162 enter the @code{ange-ftp} file name
17163 @file{/ftp.hpc.uh.edu:/pub/emacs/ding-list/} as the directory name,
17164 @code{ange-ftp} or @code{efs} will actually allow you to read this
17165 directory over at @samp{sina} as a newsgroup.  Distributed news ahoy!
17166
17167 @code{nndir} will use @acronym{NOV} files if they are present.
17168
17169 @code{nndir} is a ``read-only'' back end---you can't delete or expire
17170 articles with this method.  You can use @code{nnmh} or @code{nnml} for
17171 whatever you use @code{nndir} for, so you could switch to any of those
17172 methods if you feel the need to have a non-read-only @code{nndir}.
17173
17174
17175 @node Anything Groups
17176 @subsection Anything Groups
17177 @cindex nneething
17178
17179 From the @code{nndir} back end (which reads a single spool-like
17180 directory), it's just a hop and a skip to @code{nneething}, which
17181 pretends that any arbitrary directory is a newsgroup.  Strange, but
17182 true.
17183
17184 When @code{nneething} is presented with a directory, it will scan this
17185 directory and assign article numbers to each file.  When you enter such
17186 a group, @code{nneething} must create ``headers'' that Gnus can use.
17187 After all, Gnus is a newsreader, in case you're forgetting.
17188 @code{nneething} does this in a two-step process.  First, it snoops each
17189 file in question.  If the file looks like an article (i.e., the first
17190 few lines look like headers), it will use this as the head.  If this is
17191 just some arbitrary file without a head (e.g. a C source file),
17192 @code{nneething} will cobble up a header out of thin air.  It will use
17193 file ownership, name and date and do whatever it can with these
17194 elements.
17195
17196 All this should happen automatically for you, and you will be presented
17197 with something that looks very much like a newsgroup.  Totally like a
17198 newsgroup, to be precise.  If you select an article, it will be displayed
17199 in the article buffer, just as usual.
17200
17201 If you select a line that represents a directory, Gnus will pop you into
17202 a new summary buffer for this @code{nneething} group.  And so on.  You can
17203 traverse the entire disk this way, if you feel like, but remember that
17204 Gnus is not dired, really, and does not intend to be, either.
17205
17206 There are two overall modes to this action---ephemeral or solid.  When
17207 doing the ephemeral thing (i.e., @kbd{G D} from the group buffer), Gnus
17208 will not store information on what files you have read, and what files
17209 are new, and so on.  If you create a solid @code{nneething} group the
17210 normal way with @kbd{G m}, Gnus will store a mapping table between
17211 article numbers and file names, and you can treat this group like any
17212 other groups.  When you activate a solid @code{nneething} group, you will
17213 be told how many unread articles it contains, etc., etc.
17214
17215 Some variables:
17216
17217 @table @code
17218 @item nneething-map-file-directory
17219 @vindex nneething-map-file-directory
17220 All the mapping files for solid @code{nneething} groups will be stored
17221 in this directory, which defaults to @file{~/.nneething/}.
17222
17223 @item nneething-exclude-files
17224 @vindex nneething-exclude-files
17225 All files that match this regexp will be ignored.  Nice to use to exclude
17226 auto-save files and the like, which is what it does by default.
17227
17228 @item nneething-include-files
17229 @vindex nneething-include-files
17230 Regexp saying what files to include in the group.  If this variable is
17231 non-@code{nil}, only files matching this regexp will be included.
17232
17233 @item nneething-map-file
17234 @vindex nneething-map-file
17235 Name of the map files.
17236 @end table
17237
17238
17239 @node Document Groups
17240 @subsection Document Groups
17241 @cindex nndoc
17242 @cindex documentation group
17243 @cindex help group
17244
17245 @code{nndoc} is a cute little thing that will let you read a single file
17246 as a newsgroup.  Several files types are supported:
17247
17248 @table @code
17249 @cindex Babyl
17250 @item babyl
17251 The Babyl format.
17252
17253 @cindex mbox
17254 @cindex Unix mbox
17255 @item mbox
17256 The standard Unix mbox file.
17257
17258 @cindex MMDF mail box
17259 @item mmdf
17260 The MMDF mail box format.
17261
17262 @item news
17263 Several news articles appended into a file.
17264
17265 @cindex rnews batch files
17266 @item rnews
17267 The rnews batch transport format.
17268
17269 @item nsmail
17270 Netscape mail boxes.
17271
17272 @item mime-parts
17273 @acronym{MIME} multipart messages.
17274
17275 @item standard-digest
17276 The standard (RFC 1153) digest format.
17277
17278 @item mime-digest
17279 A @acronym{MIME} digest of messages.
17280
17281 @item lanl-gov-announce
17282 Announcement messages from LANL Gov Announce.
17283
17284 @cindex git commit messages
17285 @item git
17286 @code{git} commit messages.
17287
17288 @cindex forwarded messages
17289 @item rfc822-forward
17290 A message forwarded according to RFC822.
17291
17292 @item outlook
17293 The Outlook mail box.
17294
17295 @item oe-dbx
17296 The Outlook Express dbx mail box.
17297
17298 @item exim-bounce
17299 A bounce message from the Exim MTA.
17300
17301 @item forward
17302 A message forwarded according to informal rules.
17303
17304 @item rfc934
17305 An RFC934-forwarded message.
17306
17307 @item mailman
17308 A mailman digest.
17309
17310 @item clari-briefs
17311 A digest of Clarinet brief news items.
17312
17313 @item slack-digest
17314 Non-standard digest format---matches most things, but does it badly.
17315
17316 @item mail-in-mail
17317 The last resort.
17318 @end table
17319
17320 You can also use the special ``file type'' @code{guess}, which means
17321 that @code{nndoc} will try to guess what file type it is looking at.
17322 @code{digest} means that @code{nndoc} should guess what digest type the
17323 file is.
17324
17325 @code{nndoc} will not try to change the file or insert any extra headers into
17326 it---it will simply, like, let you use the file as the basis for a
17327 group.  And that's it.
17328
17329 If you have some old archived articles that you want to insert into your
17330 new & spiffy Gnus mail back end, @code{nndoc} can probably help you with
17331 that.  Say you have an old @file{RMAIL} file with mail that you now want
17332 to split into your new @code{nnml} groups.  You look at that file using
17333 @code{nndoc} (using the @kbd{G f} command in the group buffer
17334 (@pxref{Foreign Groups})), set the process mark on all the articles in
17335 the buffer (@kbd{M P b}, for instance), and then re-spool (@kbd{B r})
17336 using @code{nnml}.  If all goes well, all the mail in the @file{RMAIL}
17337 file is now also stored in lots of @code{nnml} directories, and you can
17338 delete that pesky @file{RMAIL} file.  If you have the guts!
17339
17340 Virtual server variables:
17341
17342 @table @code
17343 @item nndoc-article-type
17344 @vindex nndoc-article-type
17345 This should be one of @code{mbox}, @code{babyl}, @code{digest},
17346 @code{news}, @code{rnews}, @code{mmdf}, @code{forward}, @code{rfc934},
17347 @code{rfc822-forward}, @code{mime-parts}, @code{standard-digest},
17348 @code{slack-digest}, @code{clari-briefs}, @code{nsmail}, @code{outlook},
17349 @code{oe-dbx}, @code{mailman}, and @code{mail-in-mail} or @code{guess}.
17350
17351 @item nndoc-post-type
17352 @vindex nndoc-post-type
17353 This variable says whether Gnus is to consider the group a news group or
17354 a mail group.  There are two valid values:  @code{mail} (the default)
17355 and @code{news}.
17356 @end table
17357
17358 @menu
17359 * Document Server Internals::   How to add your own document types.
17360 @end menu
17361
17362
17363 @node Document Server Internals
17364 @subsubsection Document Server Internals
17365
17366 Adding new document types to be recognized by @code{nndoc} isn't
17367 difficult.  You just have to whip up a definition of what the document
17368 looks like, write a predicate function to recognize that document type,
17369 and then hook into @code{nndoc}.
17370
17371 First, here's an example document type definition:
17372
17373 @example
17374 (mmdf
17375  (article-begin .  "^\^A\^A\^A\^A\n")
17376  (body-end .  "^\^A\^A\^A\^A\n"))
17377 @end example
17378
17379 The definition is simply a unique @dfn{name} followed by a series of
17380 regexp pseudo-variable settings.  Below are the possible
17381 variables---don't be daunted by the number of variables; most document
17382 types can be defined with very few settings:
17383
17384 @table @code
17385 @item first-article
17386 If present, @code{nndoc} will skip past all text until it finds
17387 something that match this regexp.  All text before this will be
17388 totally ignored.
17389
17390 @item article-begin
17391 This setting has to be present in all document type definitions.  It
17392 says what the beginning of each article looks like.  To do more
17393 complicated things that cannot be dealt with a simple regexp, you can
17394 use @code{article-begin-function} instead of this.
17395
17396 @item article-begin-function
17397 If present, this should be a function that moves point to the beginning
17398 of each article.  This setting overrides @code{article-begin}.
17399
17400 @item head-begin
17401 If present, this should be a regexp that matches the head of the
17402 article.  To do more complicated things that cannot be dealt with a
17403 simple regexp, you can use @code{head-begin-function} instead of this.
17404
17405 @item head-begin-function
17406 If present, this should be a function that moves point to the head of
17407 the article.  This setting overrides @code{head-begin}.
17408
17409 @item head-end
17410 This should match the end of the head of the article.  It defaults to
17411 @samp{^$}---the empty line.
17412
17413 @item body-begin
17414 This should match the beginning of the body of the article.  It defaults
17415 to @samp{^\n}.  To do more complicated things that cannot be dealt with
17416 a simple regexp, you can use @code{body-begin-function} instead of this.
17417
17418 @item body-begin-function
17419 If present, this function should move point to the beginning of the body
17420 of the article.  This setting overrides @code{body-begin}.
17421
17422 @item body-end
17423 If present, this should match the end of the body of the article.  To do
17424 more complicated things that cannot be dealt with a simple regexp, you
17425 can use @code{body-end-function} instead of this.
17426
17427 @item body-end-function
17428 If present, this function should move point to the end of the body of
17429 the article.  This setting overrides @code{body-end}.
17430
17431 @item file-begin
17432 If present, this should match the beginning of the file.  All text
17433 before this regexp will be totally ignored.
17434
17435 @item file-end
17436 If present, this should match the end of the file.  All text after this
17437 regexp will be totally ignored.
17438
17439 @end table
17440
17441 So, using these variables @code{nndoc} is able to dissect a document
17442 file into a series of articles, each with a head and a body.  However, a
17443 few more variables are needed since not all document types are all that
17444 news-like---variables needed to transform the head or the body into
17445 something that's palatable for Gnus:
17446
17447 @table @code
17448 @item prepare-body-function
17449 If present, this function will be called when requesting an article.  It
17450 will be called with point at the start of the body, and is useful if the
17451 document has encoded some parts of its contents.
17452
17453 @item article-transform-function
17454 If present, this function is called when requesting an article.  It's
17455 meant to be used for more wide-ranging transformation of both head and
17456 body of the article.
17457
17458 @item generate-head-function
17459 If present, this function is called to generate a head that Gnus can
17460 understand.  It is called with the article number as a parameter, and is
17461 expected to generate a nice head for the article in question.  It is
17462 called when requesting the headers of all articles.
17463
17464 @item generate-article-function
17465 If present, this function is called to generate an entire article that
17466 Gnus can understand.  It is called with the article number as a
17467 parameter when requesting all articles.
17468
17469 @item dissection-function
17470 If present, this function is called to dissect a document by itself,
17471 overriding @code{first-article}, @code{article-begin},
17472 @code{article-begin-function}, @code{head-begin},
17473 @code{head-begin-function}, @code{head-end}, @code{body-begin},
17474 @code{body-begin-function}, @code{body-end}, @code{body-end-function},
17475 @code{file-begin}, and @code{file-end}.
17476
17477 @end table
17478
17479 Let's look at the most complicated example I can come up with---standard
17480 digests:
17481
17482 @example
17483 (standard-digest
17484  (first-article . ,(concat "^" (make-string 70 ?-) "\n\n+"))
17485  (article-begin . ,(concat "\n\n" (make-string 30 ?-) "\n\n+"))
17486  (prepare-body-function . nndoc-unquote-dashes)
17487  (body-end-function . nndoc-digest-body-end)
17488  (head-end . "^ ?$")
17489  (body-begin . "^ ?\n")
17490  (file-end . "^End of .*digest.*[0-9].*\n\\*\\*\\|^End of.*Digest *$")
17491  (subtype digest guess))
17492 @end example
17493
17494 We see that all text before a 70-width line of dashes is ignored; all
17495 text after a line that starts with that @samp{^End of} is also ignored;
17496 each article begins with a 30-width line of dashes; the line separating
17497 the head from the body may contain a single space; and that the body is
17498 run through @code{nndoc-unquote-dashes} before being delivered.
17499
17500 To hook your own document definition into @code{nndoc}, use the
17501 @code{nndoc-add-type} function.  It takes two parameters---the first
17502 is the definition itself and the second (optional) parameter says
17503 where in the document type definition alist to put this definition.
17504 The alist is traversed sequentially, and
17505 @code{nndoc-@var{type}-type-p} is called for a given type @var{type}.
17506 So @code{nndoc-mmdf-type-p} is called to see whether a document is of
17507 @code{mmdf} type, and so on.  These type predicates should return
17508 @code{nil} if the document is not of the correct type; @code{t} if it
17509 is of the correct type; and a number if the document might be of the
17510 correct type.  A high number means high probability; a low number
17511 means low probability with @samp{0} being the lowest valid number.
17512
17513
17514 @node Mail-To-News Gateways
17515 @subsection Mail-To-News Gateways
17516 @cindex mail-to-news gateways
17517 @cindex gateways
17518
17519 If your local @code{nntp} server doesn't allow posting, for some reason
17520 or other, you can post using one of the numerous mail-to-news gateways.
17521 The @code{nngateway} back end provides the interface.
17522
17523 Note that you can't read anything from this back end---it can only be
17524 used to post with.
17525
17526 Server variables:
17527
17528 @table @code
17529 @item nngateway-address
17530 @vindex nngateway-address
17531 This is the address of the mail-to-news gateway.
17532
17533 @item nngateway-header-transformation
17534 @vindex nngateway-header-transformation
17535 News headers often have to be transformed in some odd way or other
17536 for the mail-to-news gateway to accept it.  This variable says what
17537 transformation should be called, and defaults to
17538 @code{nngateway-simple-header-transformation}.  The function is called
17539 narrowed to the headers to be transformed and with one parameter---the
17540 gateway address.
17541
17542 This default function just inserts a new @code{To} header based on the
17543 @code{Newsgroups} header and the gateway address.
17544 For instance, an article with this @code{Newsgroups} header:
17545
17546 @example
17547 Newsgroups: alt.religion.emacs
17548 @end example
17549
17550 will get this @code{To} header inserted:
17551
17552 @example
17553 To: alt-religion-emacs@@GATEWAY
17554 @end example
17555
17556 The following pre-defined functions exist:
17557
17558 @findex nngateway-simple-header-transformation
17559 @table @code
17560
17561 @item nngateway-simple-header-transformation
17562 Creates a @code{To} header that looks like
17563 @var{newsgroup}@@@code{nngateway-address}.
17564
17565 @findex nngateway-mail2news-header-transformation
17566
17567 @item nngateway-mail2news-header-transformation
17568 Creates a @code{To} header that looks like
17569 @code{nngateway-address}.
17570 @end table
17571
17572 @end table
17573
17574 Here's an example:
17575
17576 @lisp
17577 (setq gnus-post-method
17578       '(nngateway
17579         "mail2news@@replay.com"
17580         (nngateway-header-transformation
17581          nngateway-mail2news-header-transformation)))
17582 @end lisp
17583
17584 So, to use this, simply say something like:
17585
17586 @lisp
17587 (setq gnus-post-method '(nngateway "GATEWAY.ADDRESS"))
17588 @end lisp
17589
17590
17591 @node The Empty Backend
17592 @subsection The Empty Backend
17593 @cindex nnnil
17594
17595 @code{nnnil} is a backend that can be used as a placeholder if you
17596 have to specify a backend somewhere, but don't really want to.  The
17597 classical example is if you don't want to have a primary select
17598 methods, but want to only use secondary ones:
17599
17600 @lisp
17601 (setq gnus-select-method '(nnnil ""))
17602 (setq gnus-secondary-select-methods
17603       '((nnimap "foo")
17604         (nnml "")))
17605 @end lisp
17606
17607
17608 @node Combined Groups
17609 @section Combined Groups
17610
17611 Gnus allows combining a mixture of all the other group types into bigger
17612 groups.
17613
17614 @menu
17615 * Virtual Groups::              Combining articles from many groups.
17616 @end menu
17617
17618
17619 @node Virtual Groups
17620 @subsection Virtual Groups
17621 @cindex nnvirtual
17622 @cindex virtual groups
17623 @cindex merging groups
17624
17625 An @dfn{nnvirtual group} is really nothing more than a collection of
17626 other groups.
17627
17628 For instance, if you are tired of reading many small groups, you can
17629 put them all in one big group, and then grow tired of reading one
17630 big, unwieldy group.  The joys of computing!
17631
17632 You specify @code{nnvirtual} as the method.  The address should be a
17633 regexp to match component groups.
17634
17635 All marks in the virtual group will stick to the articles in the
17636 component groups.  So if you tick an article in a virtual group, the
17637 article will also be ticked in the component group from whence it
17638 came.  (And vice versa---marks from the component groups will also be
17639 shown in the virtual group.).  To create an empty virtual group, run
17640 @kbd{G V} (@code{gnus-group-make-empty-virtual}) in the group buffer
17641 and edit the method regexp with @kbd{M-e}
17642 (@code{gnus-group-edit-group-method})
17643
17644 Here's an example @code{nnvirtual} method that collects all Andrea Dworkin
17645 newsgroups into one, big, happy newsgroup:
17646
17647 @lisp
17648 (nnvirtual "^alt\\.fan\\.andrea-dworkin$\\|^rec\\.dworkin.*")
17649 @end lisp
17650
17651 The component groups can be native or foreign; everything should work
17652 smoothly, but if your computer explodes, it was probably my fault.
17653
17654 Collecting the same group from several servers might actually be a good
17655 idea if users have set the Distribution header to limit distribution.
17656 If you would like to read @samp{soc.motss} both from a server in Japan
17657 and a server in Norway, you could use the following as the group regexp:
17658
17659 @example
17660 "^nntp\\+server\\.jp:soc\\.motss$\\|^nntp\\+server\\.no:soc\\.motss$"
17661 @end example
17662
17663 (Remember, though, that if you're creating the group with @kbd{G m}, you
17664 shouldn't double the backslashes, and you should leave off the quote
17665 characters at the beginning and the end of the string.)
17666
17667 This should work kinda smoothly---all articles from both groups should
17668 end up in this one, and there should be no duplicates.  Threading (and
17669 the rest) will still work as usual, but there might be problems with the
17670 sequence of articles.  Sorting on date might be an option here
17671 (@pxref{Selecting a Group}).
17672
17673 One limitation, however---all groups included in a virtual
17674 group have to be alive (i.e., subscribed or unsubscribed).  Killed or
17675 zombie groups can't be component groups for @code{nnvirtual} groups.
17676
17677 @vindex nnvirtual-always-rescan
17678 If the @code{nnvirtual-always-rescan} variable is non-@code{nil} (which
17679 is the default), @code{nnvirtual} will always scan groups for unread
17680 articles when entering a virtual group.  If this variable is @code{nil}
17681 and you read articles in a component group after the virtual group has
17682 been activated, the read articles from the component group will show up
17683 when you enter the virtual group.  You'll also see this effect if you
17684 have two virtual groups that have a component group in common.  If
17685 that's the case, you should set this variable to @code{t}.  Or you can
17686 just tap @code{M-g} on the virtual group every time before you enter
17687 it---it'll have much the same effect.
17688
17689 @code{nnvirtual} can have both mail and news groups as component groups.
17690 When responding to articles in @code{nnvirtual} groups, @code{nnvirtual}
17691 has to ask the back end of the component group the article comes from
17692 whether it is a news or mail back end.  However, when you do a @kbd{^},
17693 there is typically no sure way for the component back end to know this,
17694 and in that case @code{nnvirtual} tells Gnus that the article came from a
17695 not-news back end.  (Just to be on the safe side.)
17696
17697 @kbd{C-c C-n} in the message buffer will insert the @code{Newsgroups}
17698 line from the article you respond to in these cases.
17699
17700 @code{nnvirtual} groups do not inherit anything but articles and marks
17701 from component groups---group parameters, for instance, are not
17702 inherited.
17703
17704
17705 @node Email Based Diary
17706 @section Email Based Diary
17707 @cindex diary
17708 @cindex email based diary
17709 @cindex calendar
17710
17711 This section describes a special mail back end called @code{nndiary},
17712 and its companion library @code{gnus-diary}.  It is ``special'' in the
17713 sense that it is not meant to be one of the standard alternatives for
17714 reading mail with Gnus.  See @ref{Choosing a Mail Back End} for that.
17715 Instead, it is used to treat @emph{some} of your mails in a special way,
17716 namely, as event reminders.
17717
17718 Here is a typical scenario:
17719
17720 @itemize @bullet
17721 @item
17722 You've got a date with Andy Mc Dowell or Bruce Willis (select according
17723 to your sexual preference) in one month.  You don't want to forget it.
17724 @item
17725 So you send a ``reminder'' message (actually, a diary one) to yourself.
17726 @item
17727 You forget all about it and keep on getting and reading new mail, as usual.
17728 @item
17729 From time to time, as you type `g' in the group buffer and as the date
17730 is getting closer, the message will pop up again to remind you of your
17731 appointment, just as if it were new and unread.
17732 @item
17733 Read your ``new'' messages, this one included, and start dreaming again
17734 of the night you're gonna have.
17735 @item
17736 Once the date is over (you actually fell asleep just after dinner), the
17737 message will be automatically deleted if it is marked as expirable.
17738 @end itemize
17739
17740 The Gnus Diary back end has the ability to handle regular appointments
17741 (that wouldn't ever be deleted) as well as punctual ones, operates as a
17742 real mail back end and is configurable in many ways.  All of this is
17743 explained in the sections below.
17744
17745 @menu
17746 * The NNDiary Back End::        Basic setup and usage.
17747 * The Gnus Diary Library::      Utility toolkit on top of nndiary.
17748 * Sending or Not Sending::      A final note on sending diary messages.
17749 @end menu
17750
17751
17752 @node The NNDiary Back End
17753 @subsection The NNDiary Back End
17754 @cindex nndiary
17755 @cindex the nndiary back end
17756
17757 @code{nndiary} is a back end very similar to @code{nnml} (@pxref{Mail
17758 Spool}).  Actually, it could appear as a mix of @code{nnml} and
17759 @code{nndraft}.  If you know @code{nnml}, you're already familiar with
17760 the message storing scheme of @code{nndiary}: one file per message, one
17761 directory per group.
17762
17763   Before anything, there is one requirement to be able to run
17764 @code{nndiary} properly: you @emph{must} use the group timestamp feature
17765 of Gnus.  This adds a timestamp to each group's parameters.  @ref{Group
17766 Timestamp} to see how it's done.
17767
17768 @menu
17769 * Diary Messages::              What makes a message valid for nndiary.
17770 * Running NNDiary::             NNDiary has two modes of operation.
17771 * Customizing NNDiary::         Bells and whistles.
17772 @end menu
17773
17774 @node Diary Messages
17775 @subsubsection Diary Messages
17776 @cindex nndiary messages
17777 @cindex nndiary mails
17778
17779 @code{nndiary} messages are just normal ones, except for the mandatory
17780 presence of 7 special headers.  These headers are of the form
17781 @code{X-Diary-<something>}, @code{<something>} being one of
17782 @code{Minute}, @code{Hour}, @code{Dom}, @code{Month}, @code{Year},
17783 @code{Time-Zone} and @code{Dow}.  @code{Dom} means ``Day of Month'', and
17784 @code{dow} means ``Day of Week''.  These headers actually behave like
17785 crontab specifications and define the event date(s):
17786
17787 @itemize @bullet
17788 @item
17789 For all headers except the @code{Time-Zone} one, a header value is
17790 either a star (meaning all possible values), or a list of fields
17791 (separated by a comma).
17792 @item
17793 A field is either an integer, or a range.
17794 @item
17795 A range is two integers separated by a dash.
17796 @item
17797 Possible integer values are 0--59 for @code{Minute}, 0--23 for
17798 @code{Hour}, 1--31 for @code{Dom}, 1--12 for @code{Month}, above 1971
17799 for @code{Year} and 0--6 for @code{Dow} (0 meaning Sunday).
17800 @item
17801 As a special case, a star in either @code{Dom} or @code{Dow} doesn't
17802 mean ``all possible values'', but ``use only the other field''.  Note
17803 that if both are star'ed, the use of either one gives the same result.
17804 @item
17805 The @code{Time-Zone} header is special in that it can only have one
17806 value (@code{GMT}, for instance).  A star doesn't mean ``all possible
17807 values'' (because it makes no sense), but ``the current local time
17808 zone''.  Most of the time, you'll be using a star here.  However, for a
17809 list of available time zone values, see the variable
17810 @code{nndiary-headers}.
17811 @end itemize
17812
17813 As a concrete example, here are the diary headers to add to your message
17814 for specifying ``Each Monday and each 1st of month, at 12:00, 20:00,
17815 21:00, 22:00, 23:00 and 24:00, from 1999 to 2010'' (I'll let you find
17816 what to do then):
17817
17818 @example
17819 X-Diary-Minute: 0
17820 X-Diary-Hour: 12, 20-24
17821 X-Diary-Dom: 1
17822 X-Diary-Month: *
17823 X-Diary-Year: 1999-2010
17824 X-Diary-Dow: 1
17825 X-Diary-Time-Zone: *
17826 @end example
17827
17828 @node Running NNDiary
17829 @subsubsection Running NNDiary
17830 @cindex running nndiary
17831 @cindex nndiary operation modes
17832
17833 @code{nndiary} has two modes of operation: ``traditional'' (the default)
17834 and ``autonomous''.  In traditional mode, @code{nndiary} does not get new
17835 mail by itself.  You have to move (@kbd{B m}) or copy (@kbd{B c}) mails
17836 from your primary mail back end to nndiary groups in order to handle them
17837 as diary messages.  In autonomous mode, @code{nndiary} retrieves its own
17838 mail and handles it independently from your primary mail back end.
17839
17840 One should note that Gnus is not inherently designed to allow several
17841 ``master'' mail back ends at the same time.  However, this does make
17842 sense with @code{nndiary}: you really want to send and receive diary
17843 messages to your diary groups directly.  So, @code{nndiary} supports
17844 being sort of a ``second primary mail back end'' (to my knowledge, it is
17845 the only back end offering this feature).  However, there is a limitation
17846 (which I hope to fix some day): respooling doesn't work in autonomous
17847 mode.
17848
17849 In order to use @code{nndiary} in autonomous mode, you have several
17850 things to do:
17851
17852 @itemize @bullet
17853 @item
17854 Allow @code{nndiary} to retrieve new mail by itself.  Put the following
17855 line in your @file{~/.gnus.el} file:
17856
17857 @lisp
17858 (setq nndiary-get-new-mail t)
17859 @end lisp
17860 @item
17861 You must arrange for diary messages (those containing @code{X-Diary-*}
17862 headers) to be split in a private folder @emph{before} Gnus treat them.
17863 Again, this is needed because Gnus cannot (yet ?) properly handle
17864 multiple primary mail back ends.  Getting those messages from a separate
17865 source will compensate this misfeature to some extent.
17866
17867 As an example, here's my procmailrc entry to store diary files in
17868 @file{~/.nndiary} (the default @code{nndiary} mail source file):
17869
17870 @example
17871 :0 HD :
17872 * ^X-Diary
17873 .nndiary
17874 @end example
17875 @end itemize
17876
17877 Once this is done, you might want to customize the following two options
17878 that affect the diary mail retrieval and splitting processes:
17879
17880 @defvar nndiary-mail-sources
17881 This is the diary-specific replacement for the standard
17882 @code{mail-sources} variable.  It obeys the same syntax, and defaults to
17883 @code{(file :path "~/.nndiary")}.
17884 @end defvar
17885
17886 @defvar nndiary-split-methods
17887 This is the diary-specific replacement for the standard
17888 @code{nnmail-split-methods} variable.  It obeys the same syntax.
17889 @end defvar
17890
17891   Finally, you may add a permanent @code{nndiary} virtual server
17892 (something like @code{(nndiary "diary")} should do) to your
17893 @code{gnus-secondary-select-methods}.
17894
17895   Hopefully, almost everything (see the TODO section in
17896 @file{nndiary.el}) will work as expected when you restart Gnus: in
17897 autonomous mode, typing @kbd{g} and @kbd{M-g} in the group buffer, will
17898 also get your new diary mails and split them according to your
17899 diary-specific rules, @kbd{F} will find your new diary groups etc.
17900
17901 @node Customizing NNDiary
17902 @subsubsection Customizing NNDiary
17903 @cindex customizing nndiary
17904 @cindex nndiary customization
17905
17906 Now that @code{nndiary} is up and running, it's time to customize it.
17907 The custom group is called @code{nndiary} (no, really ?!).  You should
17908 browse it to figure out which options you'd like to tweak.  The following
17909 two variables are probably the only ones you will want to change:
17910
17911 @defvar nndiary-reminders
17912 This is the list of times when you want to be reminded of your
17913 appointments (e.g. 3 weeks before, then 2 days before, then 1 hour
17914 before and that's it).  Remember that ``being reminded'' means that the
17915 diary message will pop up as brand new and unread again when you get new
17916 mail.
17917 @end defvar
17918
17919 @defvar nndiary-week-starts-on-monday
17920 Rather self-explanatory.  Otherwise, Sunday is assumed (this is the
17921 default).
17922 @end defvar
17923
17924
17925 @node The Gnus Diary Library
17926 @subsection The Gnus Diary Library
17927 @cindex gnus-diary
17928 @cindex the gnus diary library
17929
17930 Using @code{nndiary} manually (I mean, writing the headers by hand and
17931 so on) would be rather boring.  Fortunately, there is a library called
17932 @code{gnus-diary} written on top of @code{nndiary}, that does many
17933 useful things for you.
17934
17935   In order to use it, add the following line to your @file{~/.gnus.el} file:
17936
17937 @lisp
17938 (require 'gnus-diary)
17939 @end lisp
17940
17941   Also, you shouldn't use any @code{gnus-user-format-function-[d|D]}
17942 (@pxref{Summary Buffer Lines}).  @code{gnus-diary} provides both of these
17943 (sorry if you used them before).
17944
17945
17946 @menu
17947 * Diary Summary Line Format::           A nicer summary buffer line format.
17948 * Diary Articles Sorting::              A nicer way to sort messages.
17949 * Diary Headers Generation::            Not doing it manually.
17950 * Diary Group Parameters::              Not handling them manually.
17951 @end menu
17952
17953 @node Diary Summary Line Format
17954 @subsubsection Diary Summary Line Format
17955 @cindex diary summary buffer line
17956 @cindex diary summary line format
17957
17958 Displaying diary messages in standard summary line format (usually
17959 something like @samp{From Joe: Subject}) is pretty useless.  Most of
17960 the time, you're the one who wrote the message, and you mostly want to
17961 see the event's date.
17962
17963   @code{gnus-diary} provides two supplemental user formats to be used in
17964 summary line formats.  @code{D} corresponds to a formatted time string
17965 for the next occurrence of the event (e.g. ``Sat, Sep 22 01, 12:00''),
17966 while @code{d} corresponds to an approximative remaining time until the
17967 next occurrence of the event (e.g. ``in 6 months, 1 week'').
17968
17969   For example, here's how Joe's birthday is displayed in my
17970 @code{nndiary+diary:birthdays} summary buffer (note that the message is
17971 expirable, but will never be deleted, as it specifies a periodic event):
17972
17973 @example
17974    E  Sat, Sep 22 01, 12:00: Joe's birthday (in 6 months, 1 week)
17975 @end example
17976
17977 In order to get something like the above, you would normally add the
17978 following line to your diary groups'parameters:
17979
17980 @lisp
17981 (gnus-summary-line-format "%U%R%z %uD: %(%s%) (%ud)\n")
17982 @end lisp
17983
17984 However, @code{gnus-diary} does it automatically (@pxref{Diary Group
17985 Parameters}).  You can however customize the provided summary line format
17986 with the following user options:
17987
17988 @defvar gnus-diary-summary-line-format
17989 Defines the summary line format used for diary groups (@pxref{Summary
17990 Buffer Lines}).  @code{gnus-diary} uses it to automatically update the
17991 diary groups'parameters.
17992 @end defvar
17993
17994 @defvar gnus-diary-time-format
17995 Defines the format to display dates in diary summary buffers.  This is
17996 used by the @code{D} user format.  See the docstring for details.
17997 @end defvar
17998
17999 @defvar gnus-diary-delay-format-function
18000 Defines the format function to use for displaying delays (remaining
18001 times) in diary summary buffers.  This is used by the @code{d} user
18002 format.  There are currently built-in functions for English and French;
18003 you can also define your own.  See the docstring for details.
18004 @end defvar
18005
18006 @node Diary Articles Sorting
18007 @subsubsection Diary Articles Sorting
18008 @cindex diary articles sorting
18009 @cindex diary summary lines sorting
18010 @findex gnus-summary-sort-by-schedule
18011 @findex gnus-thread-sort-by-schedule
18012 @findex gnus-article-sort-by-schedule
18013
18014 @code{gnus-diary} provides new sorting functions (@pxref{Sorting the
18015 Summary Buffer} ) called @code{gnus-summary-sort-by-schedule},
18016 @code{gnus-thread-sort-by-schedule} and
18017 @code{gnus-article-sort-by-schedule}.  These functions let you organize
18018 your diary summary buffers from the closest event to the farthest one.
18019
18020 @code{gnus-diary} automatically installs
18021 @code{gnus-summary-sort-by-schedule} as a menu item in the summary
18022 buffer's ``sort'' menu, and the two others as the primary (hence
18023 default) sorting functions in the group parameters (@pxref{Diary Group
18024 Parameters}).
18025
18026 @node Diary Headers Generation
18027 @subsubsection Diary Headers Generation
18028 @cindex diary headers generation
18029 @findex gnus-diary-check-message
18030
18031 @code{gnus-diary} provides a function called
18032 @code{gnus-diary-check-message} to help you handle the @code{X-Diary-*}
18033 headers.  This function ensures that the current message contains all the
18034 required diary headers, and prompts you for values or corrections if
18035 needed.
18036
18037   This function is hooked into the @code{nndiary} back end, so that
18038 moving or copying an article to a diary group will trigger it
18039 automatically.  It is also bound to @kbd{C-c C-f d} in
18040 @code{message-mode} and @code{article-edit-mode} in order to ease the
18041 process of converting a usual mail to a diary one.
18042
18043   This function takes a prefix argument which will force prompting of
18044 all diary headers, regardless of their presence or validity.  That way,
18045 you can very easily reschedule an already valid diary message, for
18046 instance.
18047
18048 @node Diary Group Parameters
18049 @subsubsection Diary Group Parameters
18050 @cindex diary group parameters
18051
18052 When you create a new diary group, or visit one, @code{gnus-diary}
18053 automatically checks your group parameters and if needed, sets the
18054 summary line format to the diary-specific value, installs the
18055 diary-specific sorting functions, and also adds the different
18056 @code{X-Diary-*} headers to the group's posting-style.  It is then easier
18057 to send a diary message, because if you use @kbd{C-u a} or @kbd{C-u m}
18058 on a diary group to prepare a message, these headers will be inserted
18059 automatically (although not filled with proper values yet).
18060
18061 @node Sending or Not Sending
18062 @subsection Sending or Not Sending
18063
18064 Well, assuming you've read all of the above, here are two final notes on
18065 mail sending with @code{nndiary}:
18066
18067 @itemize @bullet
18068 @item
18069 @code{nndiary} is a @emph{real} mail back end.  You really send real diary
18070 messsages for real.  This means for instance that you can give
18071 appointments to anybody (provided they use Gnus and @code{nndiary}) by
18072 sending the diary message to them as well.
18073 @item
18074 However, since @code{nndiary} also has a @code{request-post} method, you
18075 can also use @kbd{C-u a} instead of @kbd{C-u m} on a diary group and the
18076 message won't actually be sent; just stored locally in the group. This
18077 comes in very handy for private appointments.
18078 @end itemize
18079
18080 @node Gnus Unplugged
18081 @section Gnus Unplugged
18082 @cindex offline
18083 @cindex unplugged
18084 @cindex agent
18085 @cindex Gnus agent
18086 @cindex Gnus unplugged
18087
18088 In olden times (ca. February '88), people used to run their newsreaders
18089 on big machines with permanent connections to the net.  News transport
18090 was dealt with by news servers, and all the newsreaders had to do was to
18091 read news.  Believe it or not.
18092
18093 Nowadays most people read news and mail at home, and use some sort of
18094 modem to connect to the net.  To avoid running up huge phone bills, it
18095 would be nice to have a way to slurp down all the news and mail, hang up
18096 the phone, read for several hours, and then upload any responses you
18097 have to make.  And then you repeat the procedure.
18098
18099 Of course, you can use news servers for doing this as well.  I've used
18100 @code{inn} together with @code{slurp}, @code{pop} and @code{sendmail}
18101 for some years, but doing that's a bore.  Moving the news server
18102 functionality up to the newsreader makes sense if you're the only person
18103 reading news on a machine.
18104
18105 Setting up Gnus as an ``offline'' newsreader is quite simple.  In
18106 fact, you don't have to configure anything as the agent is now enabled
18107 by default (@pxref{Agent Variables, gnus-agent}).
18108
18109 Of course, to use it as such, you have to learn a few new commands.
18110
18111 @menu
18112 * Agent Basics::                How it all is supposed to work.
18113 * Agent Categories::            How to tell the Gnus Agent what to download.
18114 * Agent Commands::              New commands for all the buffers.
18115 * Agent Visuals::               Ways that the agent may effect your summary buffer.
18116 * Agent as Cache::              The Agent is a big cache too.
18117 * Agent Expiry::                How to make old articles go away.
18118 * Agent Regeneration::          How to recover from lost connections and other accidents.
18119 * Agent and flags::             How the Agent maintains flags.
18120 * Agent and IMAP::              How to use the Agent with @acronym{IMAP}.
18121 * Outgoing Messages::           What happens when you post/mail something?
18122 * Agent Variables::             Customizing is fun.
18123 * Example Setup::               An example @file{~/.gnus.el} file for offline people.
18124 * Batching Agents::             How to fetch news from a @code{cron} job.
18125 * Agent Caveats::               What you think it'll do and what it does.
18126 @end menu
18127
18128
18129 @node Agent Basics
18130 @subsection Agent Basics
18131
18132 First, let's get some terminology out of the way.
18133
18134 The Gnus Agent is said to be @dfn{unplugged} when you have severed the
18135 connection to the net (and notified the Agent that this is the case).
18136 When the connection to the net is up again (and Gnus knows this), the
18137 Agent is @dfn{plugged}.
18138
18139 The @dfn{local} machine is the one you're running on, and which isn't
18140 connected to the net continuously.
18141
18142 @dfn{Downloading} means fetching things from the net to your local
18143 machine.  @dfn{Uploading} is doing the opposite.
18144
18145 You know that Gnus gives you all the opportunity you'd ever want for
18146 shooting yourself in the foot.  Some people call it flexibility.  Gnus
18147 is also customizable to a great extent, which means that the user has a
18148 say on how Gnus behaves.  Other newsreaders might unconditionally shoot
18149 you in your foot, but with Gnus, you have a choice!
18150
18151 Gnus is never really in plugged or unplugged state.  Rather, it applies
18152 that state to each server individually.  This means that some servers
18153 can be plugged while others can be unplugged.  Additionally, some
18154 servers can be ignored by the Agent altogether (which means that
18155 they're kinda like plugged always).
18156
18157 So when you unplug the Agent and then wonder why is Gnus opening a
18158 connection to the Net, the next step to do is to look whether all
18159 servers are agentized.  If there is an unagentized server, you found
18160 the culprit.
18161
18162 Another thing is the @dfn{offline} state.  Sometimes, servers aren't
18163 reachable.  When Gnus notices this, it asks you whether you want the
18164 server to be switched to offline state.  If you say yes, then the
18165 server will behave somewhat as if it was unplugged, except that Gnus
18166 will ask you whether you want to switch it back online again.
18167
18168 Let's take a typical Gnus session using the Agent.
18169
18170 @itemize @bullet
18171
18172 @item
18173 @findex gnus-unplugged
18174 You start Gnus with @code{gnus-unplugged}.  This brings up the Gnus
18175 Agent in a disconnected state.  You can read all the news that you have
18176 already fetched while in this mode.
18177
18178 @item
18179 You then decide to see whether any new news has arrived.  You connect
18180 your machine to the net (using PPP or whatever), and then hit @kbd{J j}
18181 to make Gnus become @dfn{plugged} and use @kbd{g} to check for new mail
18182 as usual.  To check for new mail in unplugged mode (@pxref{Mail
18183 Source Specifiers}).
18184
18185 @item
18186 You can then read the new news immediately, or you can download the
18187 news onto your local machine.  If you want to do the latter, you press
18188 @kbd{g} to check if there are any new news and then @kbd{J s} to fetch
18189 all the eligible articles in all the groups.  (To let Gnus know which
18190 articles you want to download, @pxref{Agent Categories}).
18191
18192 @item
18193 After fetching the articles, you press @kbd{J j} to make Gnus become
18194 unplugged again, and you shut down the PPP thing (or whatever).  And
18195 then you read the news offline.
18196
18197 @item
18198 And then you go to step 2.
18199 @end itemize
18200
18201 Here are some things you should do the first time (or so) that you use
18202 the Agent.
18203
18204 @itemize @bullet
18205
18206 @item
18207 Decide which servers should be covered by the Agent.  If you have a mail
18208 back end, it would probably be nonsensical to have it covered by the
18209 Agent.  Go to the server buffer (@kbd{^} in the group buffer) and press
18210 @kbd{J a} on the server (or servers) that you wish to have covered by the
18211 Agent (@pxref{Server Agent Commands}), or @kbd{J r} on automatically
18212 added servers you do not wish to have covered by the Agent.  By default,
18213 all @code{nntp} and @code{nnimap} servers in @code{gnus-select-method} and
18214 @code{gnus-secondary-select-methods} are agentized.
18215
18216 @item
18217 Decide on download policy.  It's fairly simple once you decide whether
18218 you are going to use agent categories, topic parameters, and/or group
18219 parameters to implement your policy.  If you're new to gnus, it
18220 is probably best to start with a category, @xref{Agent Categories}.
18221
18222 Both topic parameters (@pxref{Topic Parameters}) and agent categories
18223 (@pxref{Agent Categories}) provide for setting a policy that applies
18224 to multiple groups.  Which you use is entirely up to you.  Topic
18225 parameters do override categories so, if you mix the two, you'll have
18226 to take that into account.  If you have a few groups that deviate from
18227 your policy, you can use group parameters (@pxref{Group Parameters}) to
18228 configure them.
18229
18230 @item
18231 Uhm@dots{} that's it.
18232 @end itemize
18233
18234
18235 @node Agent Categories
18236 @subsection Agent Categories
18237
18238 One of the main reasons to integrate the news transport layer into the
18239 newsreader is to allow greater control over what articles to download.
18240 There's not much point in downloading huge amounts of articles, just to
18241 find out that you're not interested in reading any of them.  It's better
18242 to be somewhat more conservative in choosing what to download, and then
18243 mark the articles for downloading manually if it should turn out that
18244 you're interested in the articles anyway.
18245
18246 One of the more effective methods for controlling what is to be
18247 downloaded is to create a @dfn{category} and then assign some (or all)
18248 groups to this category.  Groups that do not belong in any other
18249 category belong to the @code{default} category.  Gnus has its own
18250 buffer for creating and managing categories.
18251
18252 If you prefer, you can also use group parameters (@pxref{Group
18253 Parameters}) and topic parameters (@pxref{Topic Parameters}) for an
18254 alternative approach to controlling the agent.  The only real
18255 difference is that categories are specific to the agent (so there is
18256 less to learn) while group and topic parameters include the kitchen
18257 sink.
18258
18259 Since you can set agent parameters in several different places we have
18260 a rule to decide which source to believe.  This rule specifies that
18261 the parameter sources are checked in the following order: group
18262 parameters, topic parameters, agent category, and finally customizable
18263 variables.  So you can mix all of these sources to produce a wide range
18264 of behavior, just don't blame me if you don't remember where you put
18265 your settings.
18266
18267 @menu
18268 * Category Syntax::             What a category looks like.
18269 * Category Buffer::             A buffer for maintaining categories.
18270 * Category Variables::          Customize'r'Us.
18271 @end menu
18272
18273
18274 @node Category Syntax
18275 @subsubsection Category Syntax
18276
18277 A category consists of a name, the list of groups belonging to the
18278 category, and a number of optional parameters that override the
18279 customizable variables.  The complete list of agent parameters are
18280 listed below.
18281
18282 @cindex Agent Parameters
18283 @table @code
18284 @item agent-groups
18285 The list of groups that are in this category.
18286
18287 @item agent-predicate
18288 A predicate which (generally) gives a rough outline of which articles
18289 are eligible for downloading; and
18290
18291 @item agent-score
18292 a score rule which (generally) gives you a finer granularity when
18293 deciding what articles to download.  (Note that this @dfn{download
18294 score} is not necessarily related to normal scores.)
18295
18296 @item agent-enable-expiration
18297 a boolean indicating whether the agent should expire old articles in
18298 this group.  Most groups should be expired to conserve disk space.  In
18299 fact, its probably safe to say that the gnus.* hierarchy contains the
18300 only groups that should not be expired.
18301
18302 @item agent-days-until-old
18303 an integer indicating the number of days that the agent should wait
18304 before deciding that a read article is safe to expire.
18305
18306 @item agent-low-score
18307 an integer that overrides the value of @code{gnus-agent-low-score}.
18308
18309 @item agent-high-score
18310 an integer that overrides the value of @code{gnus-agent-high-score}.
18311
18312 @item agent-short-article
18313 an integer that overrides the value of
18314 @code{gnus-agent-short-article}.
18315
18316 @item agent-long-article
18317 an integer that overrides the value of @code{gnus-agent-long-article}.
18318
18319 @item agent-enable-undownloaded-faces
18320 a symbol indicating whether the summary buffer should display
18321 undownloaded articles using the @code{gnus-summary-*-undownloaded-face}
18322 faces.  Any symbol other than @code{nil} will enable the use of
18323 undownloaded faces.
18324 @end table
18325
18326 The name of a category can not be changed once the category has been
18327 created.
18328
18329 Each category maintains a list of groups that are exclusive members of
18330 that category.  The exclusivity rule is automatically enforced, add a
18331 group to a new category and it is automatically removed from its old
18332 category.
18333
18334 A predicate in its simplest form can be a single predicate such as
18335 @code{true} or @code{false}.  These two will download every available
18336 article or nothing respectively.  In the case of these two special
18337 predicates an additional score rule is superfluous.
18338
18339 Predicates of @code{high} or @code{low} download articles in respect of
18340 their scores in relationship to @code{gnus-agent-high-score} and
18341 @code{gnus-agent-low-score} as described below.
18342
18343 To gain even finer control of what is to be regarded eligible for
18344 download a predicate can consist of a number of predicates with logical
18345 operators sprinkled in between.
18346
18347 Perhaps some examples are in order.
18348
18349 Here's a simple predicate.  (It's the default predicate, in fact, used
18350 for all groups that don't belong to any other category.)
18351
18352 @lisp
18353 short
18354 @end lisp
18355
18356 Quite simple, eh?  This predicate is true if and only if the article is
18357 short (for some value of ``short'').
18358
18359 Here's a more complex predicate:
18360
18361 @lisp
18362 (or high
18363     (and
18364      (not low)
18365      (not long)))
18366 @end lisp
18367
18368 This means that an article should be downloaded if it has a high score,
18369 or if the score is not low and the article is not long.  You get the
18370 drift.
18371
18372 The available logical operators are @code{or}, @code{and} and
18373 @code{not}.  (If you prefer, you can use the more ``C''-ish operators
18374 @samp{|}, @code{&} and @code{!} instead.)
18375
18376 The following predicates are pre-defined, but if none of these fit what
18377 you want to do, you can write your own.
18378
18379 When evaluating each of these predicates, the named constant will be
18380 bound to the value determined by calling
18381 @code{gnus-agent-find-parameter} on the appropriate parameter.  For
18382 example, gnus-agent-short-article will be bound to
18383 @code{(gnus-agent-find-parameter group 'agent-short-article)}.  This
18384 means that you can specify a predicate in your category then tune that
18385 predicate to individual groups.
18386
18387 @table @code
18388 @item short
18389 True if the article is shorter than @code{gnus-agent-short-article}
18390 lines; default 100.
18391
18392 @item long
18393 True if the article is longer than @code{gnus-agent-long-article}
18394 lines; default 200.
18395
18396 @item low
18397 True if the article has a download score less than
18398 @code{gnus-agent-low-score}; default 0.
18399
18400 @item high
18401 True if the article has a download score greater than
18402 @code{gnus-agent-high-score}; default 0.
18403
18404 @item spam
18405 True if the Gnus Agent guesses that the article is spam.  The
18406 heuristics may change over time, but at present it just computes a
18407 checksum and sees whether articles match.
18408
18409 @item true
18410 Always true.
18411
18412 @item false
18413 Always false.
18414 @end table
18415
18416 If you want to create your own predicate function, here's what you have
18417 to know:  The functions are called with no parameters, but the
18418 @code{gnus-headers} and @code{gnus-score} dynamic variables are bound to
18419 useful values.
18420
18421 For example, you could decide that you don't want to download articles
18422 that were posted more than a certain number of days ago (e.g. posted
18423 more than @code{gnus-agent-expire-days} ago) you might write a function
18424 something along the lines of the following:
18425
18426 @lisp
18427 (defun my-article-old-p ()
18428   "Say whether an article is old."
18429   (< (time-to-days (date-to-time (mail-header-date gnus-headers)))
18430      (- (time-to-days (current-time)) gnus-agent-expire-days)))
18431 @end lisp
18432
18433 with the predicate then defined as:
18434
18435 @lisp
18436 (not my-article-old-p)
18437 @end lisp
18438
18439 or you could append your predicate to the predefined
18440 @code{gnus-category-predicate-alist} in your @file{~/.gnus.el} or
18441 wherever.
18442
18443 @lisp
18444 (require 'gnus-agent)
18445 (setq  gnus-category-predicate-alist
18446   (append gnus-category-predicate-alist
18447          '((old . my-article-old-p))))
18448 @end lisp
18449
18450 and simply specify your predicate as:
18451
18452 @lisp
18453 (not old)
18454 @end lisp
18455
18456 If/when using something like the above, be aware that there are many
18457 misconfigured systems/mailers out there and so an article's date is not
18458 always a reliable indication of when it was posted.  Hell, some people
18459 just don't give a damn.
18460
18461 The above predicates apply to @emph{all} the groups which belong to the
18462 category.  However, if you wish to have a specific predicate for an
18463 individual group within a category, or you're just too lazy to set up a
18464 new category, you can enter a group's individual predicate in its group
18465 parameters like so:
18466
18467 @lisp
18468 (agent-predicate . short)
18469 @end lisp
18470
18471 This is the group/topic parameter equivalent of the agent category default.
18472 Note that when specifying a single word predicate like this, the
18473 @code{agent-predicate} specification must be in dotted pair notation.
18474
18475 The equivalent of the longer example from above would be:
18476
18477 @lisp
18478 (agent-predicate or high (and (not low) (not long)))
18479 @end lisp
18480
18481 The outer parenthesis required in the category specification are not
18482 entered here as, not being in dotted pair notation, the value of the
18483 predicate is assumed to be a list.
18484
18485
18486 Now, the syntax of the download score is the same as the syntax of
18487 normal score files, except that all elements that require actually
18488 seeing the article itself are verboten.  This means that only the
18489 following headers can be scored on: @code{Subject}, @code{From},
18490 @code{Date}, @code{Message-ID}, @code{References}, @code{Chars},
18491 @code{Lines}, and @code{Xref}.
18492
18493 As with predicates, the specification of the @code{download score rule}
18494 to use in respect of a group can be in either the category definition if
18495 it's to be applicable to all groups in therein, or a group's parameters
18496 if it's to be specific to that group.
18497
18498 In both of these places the @code{download score rule} can take one of
18499 three forms:
18500
18501 @enumerate
18502 @item
18503 Score rule
18504
18505 This has the same syntax as a normal Gnus score file except only a
18506 subset of scoring keywords are available as mentioned above.
18507
18508 example:
18509
18510 @itemize @bullet
18511 @item
18512 Category specification
18513
18514 @lisp
18515 (("from"
18516        ("Lars Ingebrigtsen" 1000000 nil s))
18517 ("lines"
18518        (500 -100 nil <)))
18519 @end lisp
18520
18521 @item
18522 Group/Topic Parameter specification
18523
18524 @lisp
18525 (agent-score ("from"
18526                    ("Lars Ingebrigtsen" 1000000 nil s))
18527              ("lines"
18528                    (500 -100 nil <)))
18529 @end lisp
18530
18531 Again, note the omission of the outermost parenthesis here.
18532 @end itemize
18533
18534 @item
18535 Agent score file
18536
18537 These score files must @emph{only} contain the permitted scoring
18538 keywords stated above.
18539
18540 example:
18541
18542 @itemize @bullet
18543 @item
18544 Category specification
18545
18546 @lisp
18547 ("~/News/agent.SCORE")
18548 @end lisp
18549
18550 or perhaps
18551
18552 @lisp
18553 ("~/News/agent.SCORE" "~/News/agent.group.SCORE")
18554 @end lisp
18555
18556 @item
18557 Group Parameter specification
18558
18559 @lisp
18560 (agent-score "~/News/agent.SCORE")
18561 @end lisp
18562
18563 Additional score files can be specified as above.  Need I say anything
18564 about parenthesis?
18565 @end itemize
18566
18567 @item
18568 Use @code{normal} score files
18569
18570 If you don't want to maintain two sets of scoring rules for a group, and
18571 your desired @code{downloading} criteria for a group are the same as your
18572 @code{reading} criteria then you can tell the agent to refer to your
18573 @code{normal} score files when deciding what to download.
18574
18575 These directives in either the category definition or a group's
18576 parameters will cause the agent to read in all the applicable score
18577 files for a group, @emph{filtering out} those sections that do not
18578 relate to one of the permitted subset of scoring keywords.
18579
18580 @itemize @bullet
18581 @item
18582 Category Specification
18583
18584 @lisp
18585 file
18586 @end lisp
18587
18588 @item
18589 Group Parameter specification
18590
18591 @lisp
18592 (agent-score . file)
18593 @end lisp
18594 @end itemize
18595 @end enumerate
18596
18597 @node Category Buffer
18598 @subsubsection Category Buffer
18599
18600 You'd normally do all category maintenance from the category buffer.
18601 When you enter it for the first time (with the @kbd{J c} command from
18602 the group buffer), you'll only see the @code{default} category.
18603
18604 The following commands are available in this buffer:
18605
18606 @table @kbd
18607 @item q
18608 @kindex q (Category)
18609 @findex gnus-category-exit
18610 Return to the group buffer (@code{gnus-category-exit}).
18611
18612 @item e
18613 @kindex e (Category)
18614 @findex gnus-category-customize-category
18615 Use a customization buffer to set all of the selected category's
18616 parameters at one time (@code{gnus-category-customize-category}).
18617
18618 @item k
18619 @kindex k (Category)
18620 @findex gnus-category-kill
18621 Kill the current category (@code{gnus-category-kill}).
18622
18623 @item c
18624 @kindex c (Category)
18625 @findex gnus-category-copy
18626 Copy the current category (@code{gnus-category-copy}).
18627
18628 @item a
18629 @kindex a (Category)
18630 @findex gnus-category-add
18631 Add a new category (@code{gnus-category-add}).
18632
18633 @item p
18634 @kindex p (Category)
18635 @findex gnus-category-edit-predicate
18636 Edit the predicate of the current category
18637 (@code{gnus-category-edit-predicate}).
18638
18639 @item g
18640 @kindex g (Category)
18641 @findex gnus-category-edit-groups
18642 Edit the list of groups belonging to the current category
18643 (@code{gnus-category-edit-groups}).
18644
18645 @item s
18646 @kindex s (Category)
18647 @findex gnus-category-edit-score
18648 Edit the download score rule of the current category
18649 (@code{gnus-category-edit-score}).
18650
18651 @item l
18652 @kindex l (Category)
18653 @findex gnus-category-list
18654 List all the categories (@code{gnus-category-list}).
18655 @end table
18656
18657
18658 @node Category Variables
18659 @subsubsection Category Variables
18660
18661 @table @code
18662 @item gnus-category-mode-hook
18663 @vindex gnus-category-mode-hook
18664 Hook run in category buffers.
18665
18666 @item gnus-category-line-format
18667 @vindex gnus-category-line-format
18668 Format of the lines in the category buffer (@pxref{Formatting
18669 Variables}).  Valid elements are:
18670
18671 @table @samp
18672 @item c
18673 The name of the category.
18674
18675 @item g
18676 The number of groups in the category.
18677 @end table
18678
18679 @item gnus-category-mode-line-format
18680 @vindex gnus-category-mode-line-format
18681 Format of the category mode line (@pxref{Mode Line Formatting}).
18682
18683 @item gnus-agent-short-article
18684 @vindex gnus-agent-short-article
18685 Articles that have fewer lines than this are short.  Default 100.
18686
18687 @item gnus-agent-long-article
18688 @vindex gnus-agent-long-article
18689 Articles that have more lines than this are long.  Default 200.
18690
18691 @item gnus-agent-low-score
18692 @vindex gnus-agent-low-score
18693 Articles that have a score lower than this have a low score.  Default
18694 0.
18695
18696 @item gnus-agent-high-score
18697 @vindex gnus-agent-high-score
18698 Articles that have a score higher than this have a high score.  Default
18699 0.
18700
18701 @item gnus-agent-expire-days
18702 @vindex gnus-agent-expire-days
18703 The number of days that a @samp{read} article must stay in the agent's
18704 local disk before becoming eligible for expiration (While the name is
18705 the same, this doesn't mean expiring the article on the server.  It
18706 just means deleting the local copy of the article).  What is also
18707 important to understand is that the counter starts with the time the
18708 article was written to the local disk and not the time the article was
18709 read.
18710 Default 7.
18711
18712 @item gnus-agent-enable-expiration
18713 @vindex gnus-agent-enable-expiration
18714 Determines whether articles in a group are, by default, expired or
18715 retained indefinitely.  The default is @code{ENABLE} which means that
18716 you'll have to disable expiration when desired.  On the other hand,
18717 you could set this to @code{DISABLE}.  In that case, you would then
18718 have to enable expiration in selected groups.
18719
18720 @end table
18721
18722
18723 @node Agent Commands
18724 @subsection Agent Commands
18725 @findex gnus-agent-toggle-plugged
18726 @kindex J j (Agent)
18727
18728 All the Gnus Agent commands are on the @kbd{J} submap.  The @kbd{J j}
18729 (@code{gnus-agent-toggle-plugged}) command works in all modes, and
18730 toggles the plugged/unplugged state of the Gnus Agent.
18731
18732
18733 @menu
18734 * Group Agent Commands::        Configure groups and fetch their contents.
18735 * Summary Agent Commands::      Manually select then fetch specific articles.
18736 * Server Agent Commands::       Select the servers that are supported by the agent.
18737 @end menu
18738
18739
18740
18741
18742 @node Group Agent Commands
18743 @subsubsection Group Agent Commands
18744
18745 @table @kbd
18746 @item J u
18747 @kindex J u (Agent Group)
18748 @findex gnus-agent-fetch-groups
18749 Fetch all eligible articles in the current group
18750 (@code{gnus-agent-fetch-groups}).
18751
18752 @item J c
18753 @kindex J c (Agent Group)
18754 @findex gnus-enter-category-buffer
18755 Enter the Agent category buffer (@code{gnus-enter-category-buffer}).
18756
18757 @item J s
18758 @kindex J s (Agent Group)
18759 @findex gnus-agent-fetch-session
18760 Fetch all eligible articles in all groups
18761 (@code{gnus-agent-fetch-session}).
18762
18763 @item J S
18764 @kindex J S (Agent Group)
18765 @findex gnus-group-send-queue
18766 Send all sendable messages in the queue group
18767 (@code{gnus-group-send-queue}).  @xref{Drafts}.
18768
18769 @item J a
18770 @kindex J a (Agent Group)
18771 @findex gnus-agent-add-group
18772 Add the current group to an Agent category
18773 (@code{gnus-agent-add-group}).  This command understands the
18774 process/prefix convention (@pxref{Process/Prefix}).
18775
18776 @item J r
18777 @kindex J r (Agent Group)
18778 @findex gnus-agent-remove-group
18779 Remove the current group from its category, if any
18780 (@code{gnus-agent-remove-group}).  This command understands the
18781 process/prefix convention (@pxref{Process/Prefix}).
18782
18783 @item J Y
18784 @kindex J Y (Agent Group)
18785 @findex gnus-agent-synchronize-flags
18786 Synchronize flags changed while unplugged with remote server, if any.
18787
18788
18789 @end table
18790
18791
18792 @node Summary Agent Commands
18793 @subsubsection Summary Agent Commands
18794
18795 @table @kbd
18796 @item J #
18797 @kindex J # (Agent Summary)
18798 @findex gnus-agent-mark-article
18799 Mark the article for downloading (@code{gnus-agent-mark-article}).
18800
18801 @item J M-#
18802 @kindex J M-# (Agent Summary)
18803 @findex gnus-agent-unmark-article
18804 Remove the downloading mark from the article
18805 (@code{gnus-agent-unmark-article}).
18806
18807 @cindex %
18808 @item @@
18809 @kindex @@ (Agent Summary)
18810 @findex gnus-agent-toggle-mark
18811 Toggle whether to download the article
18812 (@code{gnus-agent-toggle-mark}).  The download mark is @samp{%} by
18813 default.
18814
18815 @item J c
18816 @kindex J c (Agent Summary)
18817 @findex gnus-agent-catchup
18818 Mark all articles as read (@code{gnus-agent-catchup}) that are neither cached, downloaded, nor downloadable.
18819
18820 @item J S
18821 @kindex J S (Agent Summary)
18822 @findex gnus-agent-fetch-group
18823 Download all eligible (@pxref{Agent Categories}) articles in this group.
18824 (@code{gnus-agent-fetch-group}).
18825
18826 @item J s
18827 @kindex J s (Agent Summary)
18828 @findex gnus-agent-summary-fetch-series
18829 Download all processable articles in this group.
18830 (@code{gnus-agent-summary-fetch-series}).
18831
18832 @item J u
18833 @kindex J u (Agent Summary)
18834 @findex gnus-agent-summary-fetch-group
18835 Download all downloadable articles in the current group
18836 (@code{gnus-agent-summary-fetch-group}).
18837
18838 @end table
18839
18840
18841 @node Server Agent Commands
18842 @subsubsection Server Agent Commands
18843
18844 @table @kbd
18845 @item J a
18846 @kindex J a (Agent Server)
18847 @findex gnus-agent-add-server
18848 Add the current server to the list of servers covered by the Gnus Agent
18849 (@code{gnus-agent-add-server}).
18850
18851 @item J r
18852 @kindex J r (Agent Server)
18853 @findex gnus-agent-remove-server
18854 Remove the current server from the list of servers covered by the Gnus
18855 Agent (@code{gnus-agent-remove-server}).
18856
18857 @end table
18858
18859
18860 @node Agent Visuals
18861 @subsection Agent Visuals
18862
18863 If you open a summary while unplugged and, Gnus knows from the group's
18864 active range that there are more articles than the headers currently
18865 stored in the Agent, you may see some articles whose subject looks
18866 something like @samp{[Undownloaded article #####]}.  These are
18867 placeholders for the missing headers.  Aside from setting a mark,
18868 there is not much that can be done with one of these placeholders.
18869 When Gnus finally gets a chance to fetch the group's headers, the
18870 placeholders will automatically be replaced by the actual headers.
18871 You can configure the summary buffer's maneuvering to skip over the
18872 placeholders if you care (See @code{gnus-auto-goto-ignores}).
18873
18874 While it may be obvious to all, the only headers and articles
18875 available while unplugged are those headers and articles that were
18876 fetched into the Agent while previously plugged.  To put it another
18877 way, ``If you forget to fetch something while plugged, you might have a
18878 less than satisfying unplugged session''.  For this reason, the Agent
18879 adds two visual effects to your summary buffer.  These effects display
18880 the download status of each article so that you always know which
18881 articles will be available when unplugged.
18882
18883 The first visual effect is the @samp{%O} spec.  If you customize
18884 @code{gnus-summary-line-format} to include this specifier, you will add
18885 a single character field that indicates an article's download status.
18886 Articles that have been fetched into either the Agent or the Cache,
18887 will display @code{gnus-downloaded-mark} (defaults to @samp{+}).  All
18888 other articles will display @code{gnus-undownloaded-mark} (defaults to
18889 @samp{-}).  If you open a group that has not been agentized, a space
18890 (@samp{ }) will be displayed.
18891
18892 The second visual effect are the undownloaded faces.  The faces, there
18893 are three indicating the article's score (low, normal, high), seem to
18894 result in a love/hate response from many Gnus users.  The problem is
18895 that the face selection is controlled by a list of condition tests and
18896 face names (See @code{gnus-summary-highlight}).  Each condition is
18897 tested in the order in which it appears in the list so early
18898 conditions have precedence over later conditions.  All of this means
18899 that, if you tick an undownloaded article, the article will continue
18900 to be displayed in the undownloaded face rather than the ticked face.
18901
18902 If you use the Agent as a cache (to avoid downloading the same article
18903 each time you visit it or to minimize your connection time), the
18904 undownloaded face will probably seem like a good idea.  The reason
18905 being that you do all of our work (marking, reading, deleting) with
18906 downloaded articles so the normal faces always appear.  For those
18907 users using the agent to improve online performance by caching the NOV
18908 database (most users since 5.10.2), the undownloaded faces may appear
18909 to be an absolutely horrible idea.  The issue being that, since none
18910 of their articles have been fetched into the Agent, all of the
18911 normal faces will be obscured by the undownloaded faces.
18912
18913 If you would like to use the undownloaded faces, you must enable the
18914 undownloaded faces by setting the @code{agent-enable-undownloaded-faces}
18915 group parameter to @code{t}.  This parameter, like all other agent
18916 parameters, may be set on an Agent Category (@pxref{Agent Categories}),
18917 a Group Topic (@pxref{Topic Parameters}), or an individual group
18918 (@pxref{Group Parameters}).
18919
18920 The one problem common to all users using the agent is how quickly it
18921 can consume disk space.  If you using the agent on many groups, it is
18922 even more difficult to effectively recover disk space.  One solution
18923 is the @samp{%F} format available in @code{gnus-group-line-format}.
18924 This format will display the actual disk space used by articles
18925 fetched into both the agent and cache.  By knowing which groups use
18926 the most space, users know where to focus their efforts when ``agent
18927 expiring'' articles.
18928
18929 @node Agent as Cache
18930 @subsection Agent as Cache
18931
18932 When Gnus is plugged, it is not efficient to download headers or
18933 articles from the server again, if they are already stored in the
18934 Agent.  So, Gnus normally only downloads headers once, and stores them
18935 in the Agent.  These headers are later used when generating the summary
18936 buffer, regardless of whether you are plugged or unplugged.  Articles
18937 are not cached in the Agent by default though (that would potentially
18938 consume lots of disk space), but if you have already downloaded an
18939 article into the Agent, Gnus will not download the article from the
18940 server again but use the locally stored copy instead.
18941
18942 If you so desire, you can configure the agent (see @code{gnus-agent-cache}
18943 @pxref{Agent Variables}) to always download headers and articles while
18944 plugged.  Gnus will almost certainly be slower, but it will be kept
18945 synchronized with the server.  That last point probably won't make any
18946 sense if you are using a nntp or nnimap back end.
18947
18948 @node Agent Expiry
18949 @subsection Agent Expiry
18950
18951 @vindex gnus-agent-expire-days
18952 @findex gnus-agent-expire
18953 @kindex M-x gnus-agent-expire
18954 @kindex M-x gnus-agent-expire-group
18955 @findex gnus-agent-expire-group
18956 @cindex agent expiry
18957 @cindex Gnus agent expiry
18958 @cindex expiry, in Gnus agent
18959
18960 The Agent back end, @code{nnagent}, doesn't handle expiry.  Well, at
18961 least it doesn't handle it like other back ends.  Instead, there are
18962 special @code{gnus-agent-expire} and @code{gnus-agent-expire-group}
18963 commands that will expire all read articles that are older than
18964 @code{gnus-agent-expire-days} days.  They can be run whenever you feel
18965 that you're running out of space.  Neither are particularly fast or
18966 efficient, and it's not a particularly good idea to interrupt them (with
18967 @kbd{C-g} or anything else) once you've started one of them.
18968
18969 Note that other functions, e.g. @code{gnus-request-expire-articles},
18970 might run @code{gnus-agent-expire} for you to keep the agent
18971 synchronized with the group.
18972
18973 The agent parameter @code{agent-enable-expiration} may be used to
18974 prevent expiration in selected groups.
18975
18976 @vindex gnus-agent-expire-all
18977 If @code{gnus-agent-expire-all} is non-@code{nil}, the agent
18978 expiration commands will expire all articles---unread, read, ticked
18979 and dormant.  If @code{nil} (which is the default), only read articles
18980 are eligible for expiry, and unread, ticked and dormant articles will
18981 be kept indefinitely.
18982
18983 If you find that some articles eligible for expiry are never expired,
18984 perhaps some Gnus Agent files are corrupted.  There's are special
18985 commands, @code{gnus-agent-regenerate} and
18986 @code{gnus-agent-regenerate-group}, to fix possible problems.
18987
18988 @node Agent Regeneration
18989 @subsection Agent Regeneration
18990
18991 @cindex agent regeneration
18992 @cindex Gnus agent regeneration
18993 @cindex regeneration
18994
18995 The local data structures used by @code{nnagent} may become corrupted
18996 due to certain exceptional conditions.  When this happens,
18997 @code{nnagent} functionality may degrade or even fail.  The solution
18998 to this problem is to repair the local data structures by removing all
18999 internal inconsistencies.
19000
19001 For example, if your connection to your server is lost while
19002 downloaded articles into the agent, the local data structures will not
19003 know about articles successfully downloaded prior to the connection
19004 failure.  Running @code{gnus-agent-regenerate} or
19005 @code{gnus-agent-regenerate-group} will update the data structures
19006 such that you don't need to download these articles a second time.
19007
19008 @findex gnus-agent-regenerate
19009 @kindex M-x gnus-agent-regenerate
19010 The command @code{gnus-agent-regenerate} will perform
19011 @code{gnus-agent-regenerate-group} on every agentized group.  While
19012 you can run @code{gnus-agent-regenerate} in any buffer, it is strongly
19013 recommended that you first close all summary buffers.
19014
19015 @findex gnus-agent-regenerate-group
19016 @kindex M-x gnus-agent-regenerate-group
19017 The command @code{gnus-agent-regenerate-group} uses the local copies
19018 of individual articles to repair the local @acronym{NOV}(header) database.  It
19019 then updates the internal data structures that document which articles
19020 are stored locally.  An optional argument will mark articles in the
19021 agent as unread.
19022
19023 @node Agent and flags
19024 @subsection Agent and flags
19025
19026 The Agent works with any Gnus back end including those, such as
19027 nnimap, that store flags (read, ticked, etc) on the server.  Sadly,
19028 the Agent does not actually know which backends keep their flags in
19029 the backend server rather than in @file{.newsrc}.  This means that the
19030 Agent, while unplugged or disconnected, will always record all changes
19031 to the flags in its own files.
19032
19033 When you plug back in, Gnus will then check to see if you have any
19034 changed any flags and ask if you wish to synchronize these with the
19035 server.  This behavior is customizable by @code{gnus-agent-synchronize-flags}.
19036
19037 @vindex gnus-agent-synchronize-flags
19038 If @code{gnus-agent-synchronize-flags} is @code{nil}, the Agent will
19039 never automatically synchronize flags.  If it is @code{ask}, which is
19040 the default, the Agent will check if you made any changes and if so
19041 ask if you wish to synchronize these when you re-connect.  If it has
19042 any other value, all flags will be synchronized automatically.
19043
19044 If you do not wish to synchronize flags automatically when you
19045 re-connect, you can do it manually with the
19046 @code{gnus-agent-synchronize-flags} command that is bound to @kbd{J Y}
19047 in the group buffer.
19048
19049 Technical note: the synchronization algorithm does not work by ``pushing''
19050 all local flags to the server, but rather by incrementally updated the
19051 server view of flags by changing only those flags that were changed by
19052 the user.  Thus, if you set one flag on an article, quit the group then
19053 re-select the group and remove the flag; the flag will be set and
19054 removed from the server when you ``synchronize''.  The queued flag
19055 operations can be found in the per-server @code{flags} file in the Agent
19056 directory.  It's emptied when you synchronize flags.
19057
19058 @node Agent and IMAP
19059 @subsection Agent and IMAP
19060
19061 The Agent works with any Gnus back end, including nnimap.  However,
19062 since there are some conceptual differences between @acronym{NNTP} and
19063 @acronym{IMAP}, this section (should) provide you with some information to
19064 make Gnus Agent work smoother as a @acronym{IMAP} Disconnected Mode client.
19065
19066 Some things are currently not implemented in the Agent that you'd might
19067 expect from a disconnected @acronym{IMAP} client, including:
19068
19069 @itemize @bullet
19070
19071 @item
19072 Copying/moving articles into nnimap groups when unplugged.
19073
19074 @item
19075 Creating/deleting nnimap groups when unplugged.
19076
19077 @end itemize
19078
19079 @node Outgoing Messages
19080 @subsection Outgoing Messages
19081
19082 By default, when Gnus is unplugged, all outgoing messages (both mail
19083 and news) are stored in the draft group ``queue'' (@pxref{Drafts}).
19084 You can view them there after posting, and edit them at will.
19085
19086 You can control the circumstances under which outgoing mail is queued
19087 (see @code{gnus-agent-queue-mail}, @pxref{Agent Variables}).  Outgoing
19088 news is always queued when Gnus is unplugged, and never otherwise.
19089
19090 You can send the messages either from the draft group with the special
19091 commands available there, or you can use the @kbd{J S} command in the
19092 group buffer to send all the sendable messages in the draft group.
19093 Posting news will only work when Gnus is plugged, but you can send
19094 mail at any time.
19095
19096 If sending mail while unplugged does not work for you and you worry
19097 about hitting @kbd{J S} by accident when unplugged, you can have Gnus
19098 ask you to confirm your action (see
19099 @code{gnus-agent-prompt-send-queue}, @pxref{Agent Variables}).
19100
19101 @node Agent Variables
19102 @subsection Agent Variables
19103
19104 @table @code
19105 @item gnus-agent
19106 @vindex gnus-agent
19107 Is the agent enabled?  The default is @code{t}.  When first enabled,
19108 the agent will use @code{gnus-agent-auto-agentize-methods} to
19109 automatically mark some back ends as agentized.  You may change which
19110 back ends are agentized using the agent commands in the server buffer.
19111
19112 To enter the server buffer, use the @kbd{^}
19113 (@code{gnus-group-enter-server-mode}) command in the group buffer.
19114
19115
19116 @item gnus-agent-directory
19117 @vindex gnus-agent-directory
19118 Where the Gnus Agent will store its files.  The default is
19119 @file{~/News/agent/}.
19120
19121 @item gnus-agent-handle-level
19122 @vindex gnus-agent-handle-level
19123 Groups on levels (@pxref{Group Levels}) higher than this variable will
19124 be ignored by the Agent.  The default is @code{gnus-level-subscribed},
19125 which means that only subscribed group will be considered by the Agent
19126 by default.
19127
19128 @item gnus-agent-plugged-hook
19129 @vindex gnus-agent-plugged-hook
19130 Hook run when connecting to the network.
19131
19132 @item gnus-agent-unplugged-hook
19133 @vindex gnus-agent-unplugged-hook
19134 Hook run when disconnecting from the network.
19135
19136 @item gnus-agent-fetched-hook
19137 @vindex gnus-agent-fetched-hook
19138 Hook run when finished fetching articles.
19139
19140 @item gnus-agent-cache
19141 @vindex gnus-agent-cache
19142 Variable to control whether use the locally stored @acronym{NOV} and
19143 articles when plugged, e.g. essentially using the Agent as a cache.
19144 The default is non-@code{nil}, which means to use the Agent as a cache.
19145
19146 @item gnus-agent-go-online
19147 @vindex gnus-agent-go-online
19148 If @code{gnus-agent-go-online} is @code{nil}, the Agent will never
19149 automatically switch offline servers into online status.  If it is
19150 @code{ask}, the default, the Agent will ask if you wish to switch
19151 offline servers into online status when you re-connect.  If it has any
19152 other value, all offline servers will be automatically switched into
19153 online status.
19154
19155 @item gnus-agent-mark-unread-after-downloaded
19156 @vindex gnus-agent-mark-unread-after-downloaded
19157 If @code{gnus-agent-mark-unread-after-downloaded} is non-@code{nil},
19158 mark articles as unread after downloading.  This is usually a safe
19159 thing to do as the newly downloaded article has obviously not been
19160 read.  The default is @code{t}.
19161
19162 @item gnus-agent-synchronize-flags
19163 @vindex gnus-agent-synchronize-flags
19164 If @code{gnus-agent-synchronize-flags} is @code{nil}, the Agent will
19165 never automatically synchronize flags.  If it is @code{ask}, which is
19166 the default, the Agent will check if you made any changes and if so
19167 ask if you wish to synchronize these when you re-connect.  If it has
19168 any other value, all flags will be synchronized automatically.
19169
19170 @item gnus-agent-consider-all-articles
19171 @vindex gnus-agent-consider-all-articles
19172 If @code{gnus-agent-consider-all-articles} is non-@code{nil}, the
19173 agent will let the agent predicate decide whether articles need to be
19174 downloaded or not, for all articles.  When @code{nil}, the default,
19175 the agent will only let the predicate decide whether unread articles
19176 are downloaded or not.  If you enable this, you may also want to look
19177 into the agent expiry settings (@pxref{Category Variables}), so that
19178 the agent doesn't download articles which the agent will later expire,
19179 over and over again.
19180
19181 @item gnus-agent-max-fetch-size
19182 @vindex gnus-agent-max-fetch-size
19183 The agent fetches articles into a temporary buffer prior to parsing
19184 them into individual files.  To avoid exceeding the max. buffer size,
19185 the agent alternates between fetching and parsing until all articles
19186 have been fetched.  @code{gnus-agent-max-fetch-size} provides a size
19187 limit to control how often the cycling occurs.  A large value improves
19188 performance.  A small value minimizes the time lost should the
19189 connection be lost while fetching (You may need to run
19190 @code{gnus-agent-regenerate-group} to update the group's state.
19191 However, all articles parsed prior to losing the connection will be
19192 available while unplugged).  The default is 10M so it is unusual to
19193 see any cycling.
19194
19195 @item gnus-server-unopen-status
19196 @vindex gnus-server-unopen-status
19197 Perhaps not an Agent variable, but closely related to the Agent, this
19198 variable says what will happen if Gnus cannot open a server.  If the
19199 Agent is enabled, the default, @code{nil}, makes Gnus ask the user
19200 whether to deny the server or whether to unplug the agent.  If the
19201 Agent is disabled, Gnus always simply deny the server.  Other choices
19202 for this variable include @code{denied} and @code{offline} the latter
19203 is only valid if the Agent is used.
19204
19205 @item gnus-auto-goto-ignores
19206 @vindex gnus-auto-goto-ignores
19207 Another variable that isn't an Agent variable, yet so closely related
19208 that most will look for it here, this variable tells the summary
19209 buffer how to maneuver around undownloaded (only headers stored in the
19210 agent) and unfetched (neither article nor headers stored) articles.
19211
19212 The valid values are @code{nil} (maneuver to any article),
19213 @code{undownloaded} (maneuvering while unplugged ignores articles that
19214 have not been fetched), @code{always-undownloaded} (maneuvering always
19215 ignores articles that have not been fetched), @code{unfetched}
19216 (maneuvering ignores articles whose headers have not been fetched).
19217
19218 @item gnus-agent-queue-mail
19219 @vindex gnus-agent-queue-mail
19220 When @code{gnus-agent-queue-mail} is @code{always}, Gnus will always
19221 queue mail rather than sending it straight away.  When @code{t}, Gnus
19222 will queue mail when unplugged only.  When @code{nil}, never queue
19223 mail.  The default is @code{t}.
19224
19225 @item gnus-agent-prompt-send-queue
19226 @vindex gnus-agent-prompt-send-queue
19227 When @code{gnus-agent-prompt-send-queue} is non-@code{nil} Gnus will
19228 prompt you to confirm that you really wish to proceed if you hit
19229 @kbd{J S} while unplugged.  The default is @code{nil}.
19230
19231 @item gnus-agent-auto-agentize-methods
19232 @vindex gnus-agent-auto-agentize-methods
19233 If you have never used the Agent before (or more technically, if
19234 @file{~/News/agent/lib/servers} does not exist), Gnus will
19235 automatically agentize a few servers for you.  This variable control
19236 which back ends should be auto-agentized.  It is typically only useful
19237 to agentize remote back ends.  The auto-agentizing has the same effect
19238 as running @kbd{J a} on the servers (@pxref{Server Agent Commands}).
19239 If the file exist, you must manage the servers manually by adding or
19240 removing them, this variable is only applicable the first time you
19241 start Gnus.  The default is @samp{(nntp nnimap)}.
19242
19243 @end table
19244
19245
19246 @node Example Setup
19247 @subsection Example Setup
19248
19249 If you don't want to read this manual, and you have a fairly standard
19250 setup, you may be able to use something like the following as your
19251 @file{~/.gnus.el} file to get started.
19252
19253 @lisp
19254 ;; @r{Define how Gnus is to fetch news.  We do this over @acronym{NNTP}}
19255 ;; @r{from your ISP's server.}
19256 (setq gnus-select-method '(nntp "news.your-isp.com"))
19257
19258 ;; @r{Define how Gnus is to read your mail.  We read mail from}
19259 ;; @r{your ISP's @acronym{POP} server.}
19260 (setq mail-sources '((pop :server "pop.your-isp.com")))
19261
19262 ;; @r{Say how Gnus is to store the mail.  We use nnml groups.}
19263 (setq gnus-secondary-select-methods '((nnml "")))
19264
19265 ;; @r{Make Gnus into an offline newsreader.}
19266 ;; (gnus-agentize) ; @r{The obsolete setting.}
19267 ;; (setq gnus-agent t) ; @r{Now the default.}
19268 @end lisp
19269
19270 That should be it, basically.  Put that in your @file{~/.gnus.el} file,
19271 edit to suit your needs, start up PPP (or whatever), and type @kbd{M-x
19272 gnus}.
19273
19274 If this is the first time you've run Gnus, you will be subscribed
19275 automatically to a few default newsgroups.  You'll probably want to
19276 subscribe to more groups, and to do that, you have to query the
19277 @acronym{NNTP} server for a complete list of groups with the @kbd{A A}
19278 command.  This usually takes quite a while, but you only have to do it
19279 once.
19280
19281 After reading and parsing a while, you'll be presented with a list of
19282 groups.  Subscribe to the ones you want to read with the @kbd{u}
19283 command.  @kbd{l} to make all the killed groups disappear after you've
19284 subscribe to all the groups you want to read.  (@kbd{A k} will bring
19285 back all the killed groups.)
19286
19287 You can now read the groups at once, or you can download the articles
19288 with the @kbd{J s} command.  And then read the rest of this manual to
19289 find out which of the other gazillion things you want to customize.
19290
19291
19292 @node Batching Agents
19293 @subsection Batching Agents
19294 @findex gnus-agent-batch
19295
19296 Having the Gnus Agent fetch articles (and post whatever messages you've
19297 written) is quite easy once you've gotten things set up properly.  The
19298 following shell script will do everything that is necessary:
19299
19300 You can run a complete batch command from the command line with the
19301 following incantation:
19302
19303 @example
19304 #!/bin/sh
19305 emacs -batch -l ~/.emacs -l ~/.gnus.el -f gnus-agent-batch >/dev/null 2>&1
19306 @end example
19307
19308
19309 @node Agent Caveats
19310 @subsection Agent Caveats
19311
19312 The Gnus Agent doesn't seem to work like most other offline
19313 newsreaders.  Here are some common questions that some imaginary people
19314 may ask:
19315
19316 @table @dfn
19317 @item If I read an article while plugged, do they get entered into the Agent?
19318
19319 @strong{No}.  If you want this behavior, add
19320 @code{gnus-agent-fetch-selected-article} to
19321 @code{gnus-select-article-hook}.
19322
19323 @item If I read an article while plugged, and the article already exists in
19324 the Agent, will it get downloaded once more?
19325
19326 @strong{No}, unless @code{gnus-agent-cache} is @code{nil}.
19327
19328 @end table
19329
19330 In short, when Gnus is unplugged, it only looks into the locally stored
19331 articles; when it's plugged, it talks to your ISP and may also use the
19332 locally stored articles.
19333
19334
19335 @node Scoring
19336 @chapter Scoring
19337 @cindex scoring
19338
19339 Other people use @dfn{kill files}, but we here at Gnus Towers like
19340 scoring better than killing, so we'd rather switch than fight.  They do
19341 something completely different as well, so sit up straight and pay
19342 attention!
19343
19344 @vindex gnus-summary-mark-below
19345 All articles have a default score (@code{gnus-summary-default-score}),
19346 which is 0 by default.  This score may be raised or lowered either
19347 interactively or by score files.  Articles that have a score lower than
19348 @code{gnus-summary-mark-below} are marked as read.
19349
19350 Gnus will read any @dfn{score files} that apply to the current group
19351 before generating the summary buffer.
19352
19353 There are several commands in the summary buffer that insert score
19354 entries based on the current article.  You can, for instance, ask Gnus to
19355 lower or increase the score of all articles with a certain subject.
19356
19357 There are two sorts of scoring entries: Permanent and temporary.
19358 Temporary score entries are self-expiring entries.  Any entries that are
19359 temporary and have not been used for, say, a week, will be removed
19360 silently to help keep the sizes of the score files down.
19361
19362 @menu
19363 * Summary Score Commands::      Adding score entries for the current group.
19364 * Group Score Commands::        General score commands.
19365 * Score Variables::             Customize your scoring.  (My, what terminology).
19366 * Score File Format::           What a score file may contain.
19367 * Score File Editing::          You can edit score files by hand as well.
19368 * Adaptive Scoring::            Big Sister Gnus knows what you read.
19369 * Home Score File::             How to say where new score entries are to go.
19370 * Followups To Yourself::       Having Gnus notice when people answer you.
19371 * Scoring On Other Headers::    Scoring on non-standard headers.
19372 * Scoring Tips::                How to score effectively.
19373 * Reverse Scoring::             That problem child of old is not problem.
19374 * Global Score Files::          Earth-spanning, ear-splitting score files.
19375 * Kill Files::                  They are still here, but they can be ignored.
19376 * Converting Kill Files::       Translating kill files to score files.
19377 * Advanced Scoring::            Using logical expressions to build score rules.
19378 * Score Decays::                It can be useful to let scores wither away.
19379 @end menu
19380
19381
19382 @node Summary Score Commands
19383 @section Summary Score Commands
19384 @cindex score commands
19385
19386 The score commands that alter score entries do not actually modify real
19387 score files.  That would be too inefficient.  Gnus maintains a cache of
19388 previously loaded score files, one of which is considered the
19389 @dfn{current score file alist}.  The score commands simply insert
19390 entries into this list, and upon group exit, this list is saved.
19391
19392 The current score file is by default the group's local score file, even
19393 if no such score file actually exists.  To insert score commands into
19394 some other score file (e.g. @file{all.SCORE}), you must first make this
19395 score file the current one.
19396
19397 General score commands that don't actually change the score file:
19398
19399 @table @kbd
19400
19401 @item V s
19402 @kindex V s (Summary)
19403 @findex gnus-summary-set-score
19404 Set the score of the current article (@code{gnus-summary-set-score}).
19405
19406 @item V S
19407 @kindex V S (Summary)
19408 @findex gnus-summary-current-score
19409 Display the score of the current article
19410 (@code{gnus-summary-current-score}).
19411
19412 @item V t
19413 @kindex V t (Summary)
19414 @findex gnus-score-find-trace
19415 Display all score rules that have been used on the current article
19416 (@code{gnus-score-find-trace}).  In the @code{*Score Trace*} buffer, you
19417 may type @kbd{e} to edit score file corresponding to the score rule on
19418 current line and @kbd{f} to format (@code{gnus-score-pretty-print}) the
19419 score file and edit it.
19420
19421 @item V w
19422 @kindex V w (Summary)
19423 @findex gnus-score-find-favourite-words
19424 List words used in scoring (@code{gnus-score-find-favourite-words}).
19425
19426 @item V R
19427 @kindex V R (Summary)
19428 @findex gnus-summary-rescore
19429 Run the current summary through the scoring process
19430 (@code{gnus-summary-rescore}).  This might be useful if you're playing
19431 around with your score files behind Gnus' back and want to see the
19432 effect you're having.
19433
19434 @item V c
19435 @kindex V c (Summary)
19436 @findex gnus-score-change-score-file
19437 Make a different score file the current
19438 (@code{gnus-score-change-score-file}).
19439
19440 @item V e
19441 @kindex V e (Summary)
19442 @findex gnus-score-edit-current-scores
19443 Edit the current score file (@code{gnus-score-edit-current-scores}).
19444 You will be popped into a @code{gnus-score-mode} buffer (@pxref{Score
19445 File Editing}).
19446
19447 @item V f
19448 @kindex V f (Summary)
19449 @findex gnus-score-edit-file
19450 Edit a score file and make this score file the current one
19451 (@code{gnus-score-edit-file}).
19452
19453 @item V F
19454 @kindex V F (Summary)
19455 @findex gnus-score-flush-cache
19456 Flush the score cache (@code{gnus-score-flush-cache}).  This is useful
19457 after editing score files.
19458
19459 @item V C
19460 @kindex V C (Summary)
19461 @findex gnus-score-customize
19462 Customize a score file in a visually pleasing manner
19463 (@code{gnus-score-customize}).
19464
19465 @end table
19466
19467 The rest of these commands modify the local score file.
19468
19469 @table @kbd
19470
19471 @item V m
19472 @kindex V m (Summary)
19473 @findex gnus-score-set-mark-below
19474 Prompt for a score, and mark all articles with a score below this as
19475 read (@code{gnus-score-set-mark-below}).
19476
19477 @item V x
19478 @kindex V x (Summary)
19479 @findex gnus-score-set-expunge-below
19480 Prompt for a score, and add a score rule to the current score file to
19481 expunge all articles below this score
19482 (@code{gnus-score-set-expunge-below}).
19483 @end table
19484
19485 The keystrokes for actually making score entries follow a very regular
19486 pattern, so there's no need to list all the commands.  (Hundreds of
19487 them.)
19488
19489 @findex gnus-summary-increase-score
19490 @findex gnus-summary-lower-score
19491
19492 @enumerate
19493 @item
19494 The first key is either @kbd{I} (upper case i) for increasing the score
19495 or @kbd{L} for lowering the score.
19496 @item
19497 The second key says what header you want to score on.  The following
19498 keys are available:
19499 @table @kbd
19500
19501 @item a
19502 Score on the author name.
19503
19504 @item s
19505 Score on the subject line.
19506
19507 @item x
19508 Score on the @code{Xref} line---i.e., the cross-posting line.
19509
19510 @item r
19511 Score on the @code{References} line.
19512
19513 @item d
19514 Score on the date.
19515
19516 @item l
19517 Score on the number of lines.
19518
19519 @item i
19520 Score on the @code{Message-ID} header.
19521
19522 @item e
19523 Score on an ``extra'' header, that is, one of those in gnus-extra-headers,
19524 if your @acronym{NNTP} server tracks additional header data in overviews.
19525
19526 @item f
19527 Score on followups---this matches the author name, and adds scores to
19528 the followups to this author.  (Using this key leads to the creation of
19529 @file{ADAPT} files.)
19530
19531 @item b
19532 Score on the body.
19533
19534 @item h
19535 Score on the head.
19536
19537 @item t
19538 Score on thread.  (Using this key leads to the creation of @file{ADAPT}
19539 files.)
19540
19541 @end table
19542
19543 @item
19544 The third key is the match type.  Which match types are valid depends on
19545 what headers you are scoring on.
19546
19547 @table @code
19548
19549 @item strings
19550
19551 @table @kbd
19552
19553 @item e
19554 Exact matching.
19555
19556 @item s
19557 Substring matching.
19558
19559 @item f
19560 Fuzzy matching (@pxref{Fuzzy Matching}).
19561
19562 @item r
19563 Regexp matching
19564 @end table
19565
19566 @item date
19567 @table @kbd
19568
19569 @item b
19570 Before date.
19571
19572 @item a
19573 After date.
19574
19575 @item n
19576 This date.
19577 @end table
19578
19579 @item number
19580 @table @kbd
19581
19582 @item <
19583 Less than number.
19584
19585 @item =
19586 Equal to number.
19587
19588 @item >
19589 Greater than number.
19590 @end table
19591 @end table
19592
19593 @item
19594 The fourth and usually final key says whether this is a temporary (i.e.,
19595 expiring) score entry, or a permanent (i.e., non-expiring) score entry,
19596 or whether it is to be done immediately, without adding to the score
19597 file.
19598 @table @kbd
19599
19600 @item t
19601 Temporary score entry.
19602
19603 @item p
19604 Permanent score entry.
19605
19606 @item i
19607 Immediately scoring.
19608 @end table
19609
19610 @item
19611 If you are scoring on `e' (extra) headers, you will then be prompted for
19612 the header name on which you wish to score.  This must be a header named
19613 in gnus-extra-headers, and @samp{TAB} completion is available.
19614
19615 @end enumerate
19616
19617 So, let's say you want to increase the score on the current author with
19618 exact matching permanently: @kbd{I a e p}.  If you want to lower the
19619 score based on the subject line, using substring matching, and make a
19620 temporary score entry: @kbd{L s s t}.  Pretty easy.
19621
19622 To make things a bit more complicated, there are shortcuts.  If you use
19623 a capital letter on either the second or third keys, Gnus will use
19624 defaults for the remaining one or two keystrokes.  The defaults are
19625 ``substring'' and ``temporary''.  So @kbd{I A} is the same as @kbd{I a s
19626 t}, and @kbd{I a R} is the same as @kbd{I a r t}.
19627
19628 These functions take both the numerical prefix and the symbolic prefix
19629 (@pxref{Symbolic Prefixes}).  A numerical prefix says how much to lower
19630 (or increase) the score of the article.  A symbolic prefix of @code{a}
19631 says to use the @file{all.SCORE} file for the command instead of the
19632 current score file.
19633
19634 @vindex gnus-score-mimic-keymap
19635 The @code{gnus-score-mimic-keymap} says whether these commands will
19636 pretend they are keymaps or not.
19637
19638
19639 @node Group Score Commands
19640 @section Group Score Commands
19641 @cindex group score commands
19642
19643 There aren't many of these as yet, I'm afraid.
19644
19645 @table @kbd
19646
19647 @item W e
19648 @kindex W e (Group)
19649 @findex gnus-score-edit-all-score
19650 Edit the apply-to-all-groups all.SCORE file.  You will be popped into
19651 a @code{gnus-score-mode} buffer (@pxref{Score File Editing}).
19652
19653 @item W f
19654 @kindex W f (Group)
19655 @findex gnus-score-flush-cache
19656 Gnus maintains a cache of score alists to avoid having to reload them
19657 all the time.  This command will flush the cache
19658 (@code{gnus-score-flush-cache}).
19659
19660 @end table
19661
19662 You can do scoring from the command line by saying something like:
19663
19664 @findex gnus-batch-score
19665 @cindex batch scoring
19666 @example
19667 $ emacs -batch -l ~/.emacs -l ~/.gnus.el -f gnus-batch-score
19668 @end example
19669
19670
19671 @node Score Variables
19672 @section Score Variables
19673 @cindex score variables
19674
19675 @table @code
19676
19677 @item gnus-use-scoring
19678 @vindex gnus-use-scoring
19679 If @code{nil}, Gnus will not check for score files, and will not, in
19680 general, do any score-related work.  This is @code{t} by default.
19681
19682 @item gnus-kill-killed
19683 @vindex gnus-kill-killed
19684 If this variable is @code{nil}, Gnus will never apply score files to
19685 articles that have already been through the kill process.  While this
19686 may save you lots of time, it also means that if you apply a kill file
19687 to a group, and then change the kill file and want to run it over you
19688 group again to kill more articles, it won't work.  You have to set this
19689 variable to @code{t} to do that.  (It is @code{t} by default.)
19690
19691 @item gnus-kill-files-directory
19692 @vindex gnus-kill-files-directory
19693 All kill and score files will be stored in this directory, which is
19694 initialized from the @env{SAVEDIR} environment variable by default.
19695 This is @file{~/News/} by default.
19696
19697 @item gnus-score-file-suffix
19698 @vindex gnus-score-file-suffix
19699 Suffix to add to the group name to arrive at the score file name
19700 (@file{SCORE} by default.)
19701
19702 @item gnus-score-uncacheable-files
19703 @vindex gnus-score-uncacheable-files
19704 @cindex score cache
19705 All score files are normally cached to avoid excessive re-loading of
19706 score files.  However, this might make your Emacs grow big and
19707 bloated, so this regexp can be used to weed out score files unlikely
19708 to be needed again.  It would be a bad idea to deny caching of
19709 @file{all.SCORE}, while it might be a good idea to not cache
19710 @file{comp.infosystems.www.authoring.misc.ADAPT}.  In fact, this
19711 variable is @samp{ADAPT$} by default, so no adaptive score files will
19712 be cached.
19713
19714 @item gnus-save-score
19715 @vindex gnus-save-score
19716 If you have really complicated score files, and do lots of batch
19717 scoring, then you might set this variable to @code{t}.  This will make
19718 Gnus save the scores into the @file{.newsrc.eld} file.
19719
19720 If you do not set this to @code{t}, then manual scores (like those set
19721 with @kbd{V s} (@code{gnus-summary-set-score})) will not be preserved
19722 across group visits.
19723
19724 @item gnus-score-interactive-default-score
19725 @vindex gnus-score-interactive-default-score
19726 Score used by all the interactive raise/lower commands to raise/lower
19727 score with.  Default is 1000, which may seem excessive, but this is to
19728 ensure that the adaptive scoring scheme gets enough room to play with.
19729 We don't want the small changes from the adaptive scoring to overwrite
19730 manually entered data.
19731
19732 @item gnus-summary-default-score
19733 @vindex gnus-summary-default-score
19734 Default score of an article, which is 0 by default.
19735
19736 @item gnus-summary-expunge-below
19737 @vindex gnus-summary-expunge-below
19738 Don't display the summary lines of articles that have scores lower than
19739 this variable.  This is @code{nil} by default, which means that no
19740 articles will be hidden.  This variable is local to the summary buffers,
19741 and has to be set from @code{gnus-summary-mode-hook}.
19742
19743 @item gnus-score-over-mark
19744 @vindex gnus-score-over-mark
19745 Mark (in the third column) used for articles with a score over the
19746 default.  Default is @samp{+}.
19747
19748 @item gnus-score-below-mark
19749 @vindex gnus-score-below-mark
19750 Mark (in the third column) used for articles with a score below the
19751 default.  Default is @samp{-}.
19752
19753 @item gnus-score-find-score-files-function
19754 @vindex gnus-score-find-score-files-function
19755 Function used to find score files for the current group.  This function
19756 is called with the name of the group as the argument.
19757
19758 Predefined functions available are:
19759 @table @code
19760
19761 @item gnus-score-find-single
19762 @findex gnus-score-find-single
19763 Only apply the group's own score file.
19764
19765 @item gnus-score-find-bnews
19766 @findex gnus-score-find-bnews
19767 Apply all score files that match, using bnews syntax.  This is the
19768 default.  If the current group is @samp{gnu.emacs.gnus}, for instance,
19769 @file{all.emacs.all.SCORE}, @file{not.alt.all.SCORE} and
19770 @file{gnu.all.SCORE} would all apply.  In short, the instances of
19771 @samp{all} in the score file names are translated into @samp{.*}, and
19772 then a regexp match is done.
19773
19774 This means that if you have some score entries that you want to apply to
19775 all groups, then you put those entries in the @file{all.SCORE} file.
19776
19777 The score files are applied in a semi-random order, although Gnus will
19778 try to apply the more general score files before the more specific score
19779 files.  It does this by looking at the number of elements in the score
19780 file names---discarding the @samp{all} elements.
19781
19782 @item gnus-score-find-hierarchical
19783 @findex gnus-score-find-hierarchical
19784 Apply all score files from all the parent groups.  This means that you
19785 can't have score files like @file{all.SCORE}, but you can have
19786 @file{SCORE}, @file{comp.SCORE} and @file{comp.emacs.SCORE} for each
19787 server.
19788
19789 @end table
19790 This variable can also be a list of functions.  In that case, all
19791 these functions will be called with the group name as argument, and
19792 all the returned lists of score files will be applied.  These
19793 functions can also return lists of lists of score alists directly.  In
19794 that case, the functions that return these non-file score alists
19795 should probably be placed before the ``real'' score file functions, to
19796 ensure that the last score file returned is the local score file.
19797 Phu.
19798
19799 For example, to do hierarchical scoring but use a non-server-specific
19800 overall score file, you could use the value
19801 @example
19802 (list (lambda (group) ("all.SCORE"))
19803       'gnus-score-find-hierarchical)
19804 @end example
19805
19806 @item gnus-score-expiry-days
19807 @vindex gnus-score-expiry-days
19808 This variable says how many days should pass before an unused score file
19809 entry is expired.  If this variable is @code{nil}, no score file entries
19810 are expired.  It's 7 by default.
19811
19812 @item gnus-update-score-entry-dates
19813 @vindex gnus-update-score-entry-dates
19814 If this variable is non-@code{nil}, temporary score entries that have
19815 been triggered (matched) will have their dates updated.  (This is how Gnus
19816 controls expiry---all non-matched-entries will become too old while
19817 matched entries will stay fresh and young.)  However, if you set this
19818 variable to @code{nil}, even matched entries will grow old and will
19819 have to face that oh-so grim reaper.
19820
19821 @item gnus-score-after-write-file-function
19822 @vindex gnus-score-after-write-file-function
19823 Function called with the name of the score file just written.
19824
19825 @item gnus-score-thread-simplify
19826 @vindex gnus-score-thread-simplify
19827 If this variable is non-@code{nil}, article subjects will be
19828 simplified for subject scoring purposes in the same manner as with
19829 threading---according to the current value of
19830 @code{gnus-simplify-subject-functions}.  If the scoring entry uses
19831 @code{substring} or @code{exact} matching, the match will also be
19832 simplified in this manner.
19833
19834 @end table
19835
19836
19837 @node Score File Format
19838 @section Score File Format
19839 @cindex score file format
19840
19841 A score file is an @code{emacs-lisp} file that normally contains just a
19842 single form.  Casual users are not expected to edit these files;
19843 everything can be changed from the summary buffer.
19844
19845 Anyway, if you'd like to dig into it yourself, here's an example:
19846
19847 @lisp
19848 (("from"
19849   ("Lars Ingebrigtsen" -10000)
19850   ("Per Abrahamsen")
19851   ("larsi\\|lmi" -50000 nil R))
19852  ("subject"
19853   ("Ding is Badd" nil 728373))
19854  ("xref"
19855   ("alt.politics" -1000 728372 s))
19856  ("lines"
19857   (2 -100 nil <))
19858  (mark 0)
19859  (expunge -1000)
19860  (mark-and-expunge -10)
19861  (read-only nil)
19862  (orphan -10)
19863  (adapt t)
19864  (files "/hom/larsi/News/gnu.SCORE")
19865  (exclude-files "all.SCORE")
19866  (local (gnus-newsgroup-auto-expire t)
19867         (gnus-summary-make-false-root empty))
19868  (eval (ding)))
19869 @end lisp
19870
19871 This example demonstrates most score file elements.  @xref{Advanced
19872 Scoring}, for a different approach.
19873
19874 Even though this looks much like Lisp code, nothing here is actually
19875 @code{eval}ed.  The Lisp reader is used to read this form, though, so it
19876 has to be valid syntactically, if not semantically.
19877
19878 Six keys are supported by this alist:
19879
19880 @table @code
19881
19882 @item STRING
19883 If the key is a string, it is the name of the header to perform the
19884 match on.  Scoring can only be performed on these eight headers:
19885 @code{From}, @code{Subject}, @code{References}, @code{Message-ID},
19886 @code{Xref}, @code{Lines}, @code{Chars} and @code{Date}.  In addition to
19887 these headers, there are three strings to tell Gnus to fetch the entire
19888 article and do the match on larger parts of the article: @code{Body}
19889 will perform the match on the body of the article, @code{Head} will
19890 perform the match on the head of the article, and @code{All} will
19891 perform the match on the entire article.  Note that using any of these
19892 last three keys will slow down group entry @emph{considerably}.  The
19893 final ``header'' you can score on is @code{Followup}.  These score
19894 entries will result in new score entries being added for all follow-ups
19895 to articles that matches these score entries.
19896
19897 Following this key is an arbitrary number of score entries, where each
19898 score entry has one to four elements.
19899 @enumerate
19900
19901 @item
19902 The first element is the @dfn{match element}.  On most headers this will
19903 be a string, but on the Lines and Chars headers, this must be an
19904 integer.
19905
19906 @item
19907 If the second element is present, it should be a number---the @dfn{score
19908 element}.  This number should be an integer in the neginf to posinf
19909 interval.  This number is added to the score of the article if the match
19910 is successful.  If this element is not present, the
19911 @code{gnus-score-interactive-default-score} number will be used
19912 instead.  This is 1000 by default.
19913
19914 @item
19915 If the third element is present, it should be a number---the @dfn{date
19916 element}.  This date says when the last time this score entry matched,
19917 which provides a mechanism for expiring the score entries.  It this
19918 element is not present, the score entry is permanent.  The date is
19919 represented by the number of days since December 31, 1 BCE.
19920
19921 @item
19922 If the fourth element is present, it should be a symbol---the @dfn{type
19923 element}.  This element specifies what function should be used to see
19924 whether this score entry matches the article.  What match types that can
19925 be used depends on what header you wish to perform the match on.
19926 @table @dfn
19927
19928 @item From, Subject, References, Xref, Message-ID
19929 For most header types, there are the @code{r} and @code{R} (regexp), as
19930 well as @code{s} and @code{S} (substring) types, and @code{e} and
19931 @code{E} (exact match), and @code{w} (word match) types.  If this
19932 element is not present, Gnus will assume that substring matching should
19933 be used.  @code{R}, @code{S}, and @code{E} differ from the others in
19934 that the matches will be done in a case-sensitive manner.  All these
19935 one-letter types are really just abbreviations for the @code{regexp},
19936 @code{string}, @code{exact}, and @code{word} types, which you can use
19937 instead, if you feel like.
19938
19939 @item Extra
19940 Just as for the standard string overview headers, if you are using
19941 gnus-extra-headers, you can score on these headers' values.  In this
19942 case, there is a 5th element in the score entry, being the name of the
19943 header to be scored.  The following entry is useful in your
19944 @file{all.SCORE} file in case of spam attacks from a single origin
19945 host, if your @acronym{NNTP} server tracks @samp{NNTP-Posting-Host} in
19946 overviews:
19947
19948 @lisp
19949 ("111.222.333.444" -1000 nil s
19950  "NNTP-Posting-Host")
19951 @end lisp
19952
19953 @item Lines, Chars
19954 These two headers use different match types: @code{<}, @code{>},
19955 @code{=}, @code{>=} and @code{<=}.
19956
19957 These predicates are true if
19958
19959 @example
19960 (PREDICATE HEADER MATCH)
19961 @end example
19962
19963 evaluates to non-@code{nil}.  For instance, the advanced match
19964 @code{("lines" 4 <)} (@pxref{Advanced Scoring}) will result in the
19965 following form:
19966
19967 @lisp
19968 (< header-value 4)
19969 @end lisp
19970
19971 Or to put it another way: When using @code{<} on @code{Lines} with 4 as
19972 the match, we get the score added if the article has less than 4 lines.
19973 (It's easy to get confused and think it's the other way around.  But
19974 it's not.  I think.)
19975
19976 When matching on @code{Lines}, be careful because some back ends (like
19977 @code{nndir}) do not generate @code{Lines} header, so every article ends
19978 up being marked as having 0 lines.  This can lead to strange results if
19979 you happen to lower score of the articles with few lines.
19980
19981 @item Date
19982 For the Date header we have three kinda silly match types:
19983 @code{before}, @code{at} and @code{after}.  I can't really imagine this
19984 ever being useful, but, like, it would feel kinda silly not to provide
19985 this function.  Just in case.  You never know.  Better safe than sorry.
19986 Once burnt, twice shy.  Don't judge a book by its cover.  Never not have
19987 sex on a first date.  (I have been told that at least one person, and I
19988 quote, ``found this function indispensable'', however.)
19989
19990 @cindex ISO8601
19991 @cindex date
19992 A more useful match type is @code{regexp}.  With it, you can match the
19993 date string using a regular expression.  The date is normalized to
19994 ISO8601 compact format first---@var{YYYYMMDD}@code{T}@var{HHMMSS}.  If
19995 you want to match all articles that have been posted on April 1st in
19996 every year, you could use @samp{....0401.........} as a match string,
19997 for instance.  (Note that the date is kept in its original time zone, so
19998 this will match articles that were posted when it was April 1st where
19999 the article was posted from.  Time zones are such wholesome fun for the
20000 whole family, eh?)
20001
20002 @item Head, Body, All
20003 These three match keys use the same match types as the @code{From} (etc)
20004 header uses.
20005
20006 @item Followup
20007 This match key is somewhat special, in that it will match the
20008 @code{From} header, and affect the score of not only the matching
20009 articles, but also all followups to the matching articles.  This allows
20010 you e.g. increase the score of followups to your own articles, or
20011 decrease the score of followups to the articles of some known
20012 trouble-maker.  Uses the same match types as the @code{From} header
20013 uses.  (Using this match key will lead to creation of @file{ADAPT}
20014 files.)
20015
20016 @item Thread
20017 This match key works along the same lines as the @code{Followup} match
20018 key.  If you say that you want to score on a (sub-)thread started by an
20019 article with a @code{Message-ID} @var{x}, then you add a @samp{thread}
20020 match.  This will add a new @samp{thread} match for each article that
20021 has @var{x} in its @code{References} header.  (These new @samp{thread}
20022 matches will use the @code{Message-ID}s of these matching articles.)
20023 This will ensure that you can raise/lower the score of an entire thread,
20024 even though some articles in the thread may not have complete
20025 @code{References} headers.  Note that using this may lead to
20026 undeterministic scores of the articles in the thread.  (Using this match
20027 key will lead to creation of @file{ADAPT} files.)
20028 @end table
20029 @end enumerate
20030
20031 @cindex score file atoms
20032 @item mark
20033 The value of this entry should be a number.  Any articles with a score
20034 lower than this number will be marked as read.
20035
20036 @item expunge
20037 The value of this entry should be a number.  Any articles with a score
20038 lower than this number will be removed from the summary buffer.
20039
20040 @item mark-and-expunge
20041 The value of this entry should be a number.  Any articles with a score
20042 lower than this number will be marked as read and removed from the
20043 summary buffer.
20044
20045 @item thread-mark-and-expunge
20046 The value of this entry should be a number.  All articles that belong to
20047 a thread that has a total score below this number will be marked as read
20048 and removed from the summary buffer.  @code{gnus-thread-score-function}
20049 says how to compute the total score for a thread.
20050
20051 @item files
20052 The value of this entry should be any number of file names.  These files
20053 are assumed to be score files as well, and will be loaded the same way
20054 this one was.
20055
20056 @item exclude-files
20057 The clue of this entry should be any number of files.  These files will
20058 not be loaded, even though they would normally be so, for some reason or
20059 other.
20060
20061 @item eval
20062 The value of this entry will be @code{eval}ed.  This element will be
20063 ignored when handling global score files.
20064
20065 @item read-only
20066 Read-only score files will not be updated or saved.  Global score files
20067 should feature this atom (@pxref{Global Score Files}).  (Note:
20068 @dfn{Global} here really means @dfn{global}; not your personal
20069 apply-to-all-groups score files.)
20070
20071 @item orphan
20072 The value of this entry should be a number.  Articles that do not have
20073 parents will get this number added to their scores.  Imagine you follow
20074 some high-volume newsgroup, like @samp{comp.lang.c}.  Most likely you
20075 will only follow a few of the threads, also want to see any new threads.
20076
20077 You can do this with the following two score file entries:
20078
20079 @example
20080         (orphan -500)
20081         (mark-and-expunge -100)
20082 @end example
20083
20084 When you enter the group the first time, you will only see the new
20085 threads.  You then raise the score of the threads that you find
20086 interesting (with @kbd{I T} or @kbd{I S}), and ignore (@kbd{c y}) the
20087 rest.  Next time you enter the group, you will see new articles in the
20088 interesting threads, plus any new threads.
20089
20090 I.e.---the orphan score atom is for high-volume groups where a few
20091 interesting threads which can't be found automatically by ordinary
20092 scoring rules exist.
20093
20094 @item adapt
20095 This entry controls the adaptive scoring.  If it is @code{t}, the
20096 default adaptive scoring rules will be used.  If it is @code{ignore}, no
20097 adaptive scoring will be performed on this group.  If it is a list, this
20098 list will be used as the adaptive scoring rules.  If it isn't present,
20099 or is something other than @code{t} or @code{ignore}, the default
20100 adaptive scoring rules will be used.  If you want to use adaptive
20101 scoring on most groups, you'd set @code{gnus-use-adaptive-scoring} to
20102 @code{t}, and insert an @code{(adapt ignore)} in the groups where you do
20103 not want adaptive scoring.  If you only want adaptive scoring in a few
20104 groups, you'd set @code{gnus-use-adaptive-scoring} to @code{nil}, and
20105 insert @code{(adapt t)} in the score files of the groups where you want
20106 it.
20107
20108 @item adapt-file
20109 All adaptive score entries will go to the file named by this entry.  It
20110 will also be applied when entering the group.  This atom might be handy
20111 if you want to adapt on several groups at once, using the same adaptive
20112 file for a number of groups.
20113
20114 @item local
20115 @cindex local variables
20116 The value of this entry should be a list of @code{(@var{var}
20117 @var{value})} pairs.  Each @var{var} will be made buffer-local to the
20118 current summary buffer, and set to the value specified.  This is a
20119 convenient, if somewhat strange, way of setting variables in some
20120 groups if you don't like hooks much.  Note that the @var{value} won't
20121 be evaluated.
20122 @end table
20123
20124
20125 @node Score File Editing
20126 @section Score File Editing
20127
20128 You normally enter all scoring commands from the summary buffer, but you
20129 might feel the urge to edit them by hand as well, so we've supplied you
20130 with a mode for that.
20131
20132 It's simply a slightly customized @code{emacs-lisp} mode, with these
20133 additional commands:
20134
20135 @table @kbd
20136
20137 @item C-c C-c
20138 @kindex C-c C-c (Score)
20139 @findex gnus-score-edit-exit
20140 Save the changes you have made and return to the summary buffer
20141 (@code{gnus-score-edit-exit}).
20142
20143 @item C-c C-d
20144 @kindex C-c C-d (Score)
20145 @findex gnus-score-edit-insert-date
20146 Insert the current date in numerical format
20147 (@code{gnus-score-edit-insert-date}).  This is really the day number, if
20148 you were wondering.
20149
20150 @item C-c C-p
20151 @kindex C-c C-p (Score)
20152 @findex gnus-score-pretty-print
20153 The adaptive score files are saved in an unformatted fashion.  If you
20154 intend to read one of these files, you want to @dfn{pretty print} it
20155 first.  This command (@code{gnus-score-pretty-print}) does that for
20156 you.
20157
20158 @end table
20159
20160 Type @kbd{M-x gnus-score-mode} to use this mode.
20161
20162 @vindex gnus-score-mode-hook
20163 @code{gnus-score-menu-hook} is run in score mode buffers.
20164
20165 In the summary buffer you can use commands like @kbd{V f}, @kbd{V e} and
20166 @kbd{V t} to begin editing score files.
20167
20168
20169 @node Adaptive Scoring
20170 @section Adaptive Scoring
20171 @cindex adaptive scoring
20172
20173 If all this scoring is getting you down, Gnus has a way of making it all
20174 happen automatically---as if by magic.  Or rather, as if by artificial
20175 stupidity, to be precise.
20176
20177 @vindex gnus-use-adaptive-scoring
20178 When you read an article, or mark an article as read, or kill an
20179 article, you leave marks behind.  On exit from the group, Gnus can sniff
20180 these marks and add score elements depending on what marks it finds.
20181 You turn on this ability by setting @code{gnus-use-adaptive-scoring} to
20182 @code{t} or @code{(line)}.  If you want score adaptively on separate
20183 words appearing in the subjects, you should set this variable to
20184 @code{(word)}.  If you want to use both adaptive methods, set this
20185 variable to @code{(word line)}.
20186
20187 @vindex gnus-default-adaptive-score-alist
20188 To give you complete control over the scoring process, you can customize
20189 the @code{gnus-default-adaptive-score-alist} variable.  For instance, it
20190 might look something like this:
20191
20192 @lisp
20193 (setq gnus-default-adaptive-score-alist
20194   '((gnus-unread-mark)
20195     (gnus-ticked-mark (from 4))
20196     (gnus-dormant-mark (from 5))
20197     (gnus-del-mark (from -4) (subject -1))
20198     (gnus-read-mark (from 4) (subject 2))
20199     (gnus-expirable-mark (from -1) (subject -1))
20200     (gnus-killed-mark (from -1) (subject -3))
20201     (gnus-kill-file-mark)
20202     (gnus-ancient-mark)
20203     (gnus-low-score-mark)
20204     (gnus-catchup-mark (from -1) (subject -1))))
20205 @end lisp
20206
20207 As you see, each element in this alist has a mark as a key (either a
20208 variable name or a ``real'' mark---a character).  Following this key is
20209 a arbitrary number of header/score pairs.  If there are no header/score
20210 pairs following the key, no adaptive scoring will be done on articles
20211 that have that key as the article mark.  For instance, articles with
20212 @code{gnus-unread-mark} in the example above will not get adaptive score
20213 entries.
20214
20215 Each article can have only one mark, so just a single of these rules
20216 will be applied to each article.
20217
20218 To take @code{gnus-del-mark} as an example---this alist says that all
20219 articles that have that mark (i.e., are marked with @samp{e}) will have a
20220 score entry added to lower based on the @code{From} header by -4, and
20221 lowered by @code{Subject} by -1.  Change this to fit your prejudices.
20222
20223 If you have marked 10 articles with the same subject with
20224 @code{gnus-del-mark}, the rule for that mark will be applied ten times.
20225 That means that that subject will get a score of ten times -1, which
20226 should be, unless I'm much mistaken, -10.
20227
20228 If you have auto-expirable (mail) groups (@pxref{Expiring Mail}), all
20229 the read articles will be marked with the @samp{E} mark.  This'll
20230 probably make adaptive scoring slightly impossible, so auto-expiring and
20231 adaptive scoring doesn't really mix very well.
20232
20233 The headers you can score on are @code{from}, @code{subject},
20234 @code{message-id}, @code{references}, @code{xref}, @code{lines},
20235 @code{chars} and @code{date}.  In addition, you can score on
20236 @code{followup}, which will create an adaptive score entry that matches
20237 on the @code{References} header using the @code{Message-ID} of the
20238 current article, thereby matching the following thread.
20239
20240 If you use this scheme, you should set the score file atom @code{mark}
20241 to something small---like -300, perhaps, to avoid having small random
20242 changes result in articles getting marked as read.
20243
20244 After using adaptive scoring for a week or so, Gnus should start to
20245 become properly trained and enhance the authors you like best, and kill
20246 the authors you like least, without you having to say so explicitly.
20247
20248 You can control what groups the adaptive scoring is to be performed on
20249 by using the score files (@pxref{Score File Format}).  This will also
20250 let you use different rules in different groups.
20251
20252 @vindex gnus-adaptive-file-suffix
20253 The adaptive score entries will be put into a file where the name is the
20254 group name with @code{gnus-adaptive-file-suffix} appended.  The default
20255 is @file{ADAPT}.
20256
20257 @vindex gnus-adaptive-pretty-print
20258 Adaptive score files can get huge and are not meant to be edited by
20259 human hands.  If @code{gnus-adaptive-pretty-print} is @code{nil} (the
20260 default) those files will not be written in a human readable way.
20261
20262 @vindex gnus-score-exact-adapt-limit
20263 When doing adaptive scoring, substring or fuzzy matching would probably
20264 give you the best results in most cases.  However, if the header one
20265 matches is short, the possibility for false positives is great, so if
20266 the length of the match is less than
20267 @code{gnus-score-exact-adapt-limit}, exact matching will be used.  If
20268 this variable is @code{nil}, exact matching will always be used to avoid
20269 this problem.
20270
20271 @vindex gnus-default-adaptive-word-score-alist
20272 As mentioned above, you can adapt either on individual words or entire
20273 headers.  If you adapt on words, the
20274 @code{gnus-default-adaptive-word-score-alist} variable says what score
20275 each instance of a word should add given a mark.
20276
20277 @lisp
20278 (setq gnus-default-adaptive-word-score-alist
20279       `((,gnus-read-mark . 30)
20280         (,gnus-catchup-mark . -10)
20281         (,gnus-killed-mark . -20)
20282         (,gnus-del-mark . -15)))
20283 @end lisp
20284
20285 This is the default value.  If you have adaption on words enabled, every
20286 word that appears in subjects of articles marked with
20287 @code{gnus-read-mark} will result in a score rule that increase the
20288 score with 30 points.
20289
20290 @vindex gnus-default-ignored-adaptive-words
20291 @vindex gnus-ignored-adaptive-words
20292 Words that appear in the @code{gnus-default-ignored-adaptive-words} list
20293 will be ignored.  If you wish to add more words to be ignored, use the
20294 @code{gnus-ignored-adaptive-words} list instead.
20295
20296 @vindex gnus-adaptive-word-length-limit
20297 Some may feel that short words shouldn't count when doing adaptive
20298 scoring.  If so, you may set @code{gnus-adaptive-word-length-limit} to
20299 an integer.  Words shorter than this number will be ignored.  This
20300 variable defaults to @code{nil}.
20301
20302 @vindex gnus-adaptive-word-syntax-table
20303 When the scoring is done, @code{gnus-adaptive-word-syntax-table} is the
20304 syntax table in effect.  It is similar to the standard syntax table, but
20305 it considers numbers to be non-word-constituent characters.
20306
20307 @vindex gnus-adaptive-word-minimum
20308 If @code{gnus-adaptive-word-minimum} is set to a number, the adaptive
20309 word scoring process will never bring down the score of an article to
20310 below this number.  The default is @code{nil}.
20311
20312 @vindex gnus-adaptive-word-no-group-words
20313 If @code{gnus-adaptive-word-no-group-words} is set to @code{t}, gnus
20314 won't adaptively word score any of the words in the group name.  Useful
20315 for groups like @samp{comp.editors.emacs}, where most of the subject
20316 lines contain the word @samp{emacs}.
20317
20318 After using this scheme for a while, it might be nice to write a
20319 @code{gnus-psychoanalyze-user} command to go through the rules and see
20320 what words you like and what words you don't like.  Or perhaps not.
20321
20322 Note that the adaptive word scoring thing is highly experimental and is
20323 likely to change in the future.  Initial impressions seem to indicate
20324 that it's totally useless as it stands.  Some more work (involving more
20325 rigorous statistical methods) will have to be done to make this useful.
20326
20327
20328 @node Home Score File
20329 @section Home Score File
20330
20331 The score file where new score file entries will go is called the
20332 @dfn{home score file}.  This is normally (and by default) the score file
20333 for the group itself.  For instance, the home score file for
20334 @samp{gnu.emacs.gnus} is @file{gnu.emacs.gnus.SCORE}.
20335
20336 However, this may not be what you want.  It is often convenient to share
20337 a common home score file among many groups---all @samp{emacs} groups
20338 could perhaps use the same home score file.
20339
20340 @vindex gnus-home-score-file
20341 The variable that controls this is @code{gnus-home-score-file}.  It can
20342 be:
20343
20344 @enumerate
20345 @item
20346 A string.  Then this file will be used as the home score file for all
20347 groups.
20348
20349 @item
20350 A function.  The result of this function will be used as the home score
20351 file.  The function will be called with the name of the group as the
20352 parameter.
20353
20354 @item
20355 A list.  The elements in this list can be:
20356
20357 @enumerate
20358 @item
20359 @code{(@var{regexp} @var{file-name})}.  If the @var{regexp} matches the
20360 group name, the @var{file-name} will be used as the home score file.
20361
20362 @item
20363 A function.  If the function returns non-@code{nil}, the result will
20364 be used as the home score file.  The function will be called with the
20365 name of the group as the parameter.
20366
20367 @item
20368 A string.  Use the string as the home score file.
20369 @end enumerate
20370
20371 The list will be traversed from the beginning towards the end looking
20372 for matches.
20373
20374 @end enumerate
20375
20376 So, if you want to use just a single score file, you could say:
20377
20378 @lisp
20379 (setq gnus-home-score-file
20380       "my-total-score-file.SCORE")
20381 @end lisp
20382
20383 If you want to use @file{gnu.SCORE} for all @samp{gnu} groups and
20384 @file{rec.SCORE} for all @samp{rec} groups (and so on), you can say:
20385
20386 @findex gnus-hierarchial-home-score-file
20387 @lisp
20388 (setq gnus-home-score-file
20389       'gnus-hierarchial-home-score-file)
20390 @end lisp
20391
20392 This is a ready-made function provided for your convenience.
20393 Other functions include
20394
20395 @table @code
20396 @item gnus-current-home-score-file
20397 @findex gnus-current-home-score-file
20398 Return the ``current'' regular score file.  This will make scoring
20399 commands add entry to the ``innermost'' matching score file.
20400
20401 @end table
20402
20403 If you want to have one score file for the @samp{emacs} groups and
20404 another for the @samp{comp} groups, while letting all other groups use
20405 their own home score files:
20406
20407 @lisp
20408 (setq gnus-home-score-file
20409       ;; @r{All groups that match the regexp @code{"\\.emacs"}}
20410       '(("\\.emacs" "emacs.SCORE")
20411         ;; @r{All the comp groups in one score file}
20412         ("^comp" "comp.SCORE")))
20413 @end lisp
20414
20415 @vindex gnus-home-adapt-file
20416 @code{gnus-home-adapt-file} works exactly the same way as
20417 @code{gnus-home-score-file}, but says what the home adaptive score file
20418 is instead.  All new adaptive file entries will go into the file
20419 specified by this variable, and the same syntax is allowed.
20420
20421 In addition to using @code{gnus-home-score-file} and
20422 @code{gnus-home-adapt-file}, you can also use group parameters
20423 (@pxref{Group Parameters}) and topic parameters (@pxref{Topic
20424 Parameters}) to achieve much the same.  Group and topic parameters take
20425 precedence over this variable.
20426
20427
20428 @node Followups To Yourself
20429 @section Followups To Yourself
20430
20431 Gnus offers two commands for picking out the @code{Message-ID} header in
20432 the current buffer.  Gnus will then add a score rule that scores using
20433 this @code{Message-ID} on the @code{References} header of other
20434 articles.  This will, in effect, increase the score of all articles that
20435 respond to the article in the current buffer.  Quite useful if you want
20436 to easily note when people answer what you've said.
20437
20438 @table @code
20439
20440 @item gnus-score-followup-article
20441 @findex gnus-score-followup-article
20442 This will add a score to articles that directly follow up your own
20443 article.
20444
20445 @item gnus-score-followup-thread
20446 @findex gnus-score-followup-thread
20447 This will add a score to all articles that appear in a thread ``below''
20448 your own article.
20449 @end table
20450
20451 @vindex message-sent-hook
20452 These two functions are both primarily meant to be used in hooks like
20453 @code{message-sent-hook}, like this:
20454 @lisp
20455 (add-hook 'message-sent-hook 'gnus-score-followup-thread)
20456 @end lisp
20457
20458
20459 If you look closely at your own @code{Message-ID}, you'll notice that
20460 the first two or three characters are always the same.  Here's two of
20461 mine:
20462
20463 @example
20464 <x6u3u47icf.fsf@@eyesore.no>
20465 <x6sp9o7ibw.fsf@@eyesore.no>
20466 @end example
20467
20468 So ``my'' ident on this machine is @samp{x6}.  This can be
20469 exploited---the following rule will raise the score on all followups to
20470 myself:
20471
20472 @lisp
20473 ("references"
20474  ("<x6[0-9a-z]+\\.fsf\\(_-_\\)?@@.*eyesore\\.no>"
20475   1000 nil r))
20476 @end lisp
20477
20478 Whether it's the first two or first three characters that are ``yours''
20479 is system-dependent.
20480
20481
20482 @node Scoring On Other Headers
20483 @section Scoring On Other Headers
20484 @cindex scoring on other headers
20485
20486 Gnus is quite fast when scoring the ``traditional''
20487 headers---@samp{From}, @samp{Subject} and so on.  However, scoring
20488 other headers requires writing a @code{head} scoring rule, which means
20489 that Gnus has to request every single article from the back end to find
20490 matches.  This takes a long time in big groups.
20491
20492 @vindex gnus-inhibit-slow-scoring
20493 You can inhibit this slow scoring on headers or body by setting the
20494 variable @code{gnus-inhibit-slow-scoring}.  If
20495 @code{gnus-inhibit-slow-scoring} is regexp, slow scoring is inhibited if
20496 the group matches the regexp.  If it is t, slow scoring on it is
20497 inhibited for all groups.
20498
20499 Now, there's not much you can do about the slowness for news groups, but for
20500 mail groups, you have greater control.  In @ref{To From Newsgroups},
20501 it's explained in greater detail what this mechanism does, but here's
20502 a cookbook example for @code{nnml} on how to allow scoring on the
20503 @samp{To} and @samp{Cc} headers.
20504
20505 Put the following in your @file{~/.gnus.el} file.
20506
20507 @lisp
20508 (setq gnus-extra-headers '(To Cc Newsgroups Keywords)
20509       nnmail-extra-headers gnus-extra-headers)
20510 @end lisp
20511
20512 Restart Gnus and rebuild your @code{nnml} overview files with the
20513 @kbd{M-x nnml-generate-nov-databases} command.  This will take a long
20514 time if you have much mail.
20515
20516 Now you can score on @samp{To} and @samp{Cc} as ``extra headers'' like
20517 so: @kbd{I e s p To RET <your name> RET}.
20518
20519 See?  Simple.
20520
20521
20522 @node Scoring Tips
20523 @section Scoring Tips
20524 @cindex scoring tips
20525
20526 @table @dfn
20527
20528 @item Crossposts
20529 @cindex crossposts
20530 @cindex scoring crossposts
20531 If you want to lower the score of crossposts, the line to match on is
20532 the @code{Xref} header.
20533 @lisp
20534 ("xref" (" talk.politics.misc:" -1000))
20535 @end lisp
20536
20537 @item Multiple crossposts
20538 If you want to lower the score of articles that have been crossposted to
20539 more than, say, 3 groups:
20540 @lisp
20541 ("xref"
20542   ("[^:\n]+:[0-9]+ +[^:\n]+:[0-9]+ +[^:\n]+:[0-9]+"
20543    -1000 nil r))
20544 @end lisp
20545
20546 @item Matching on the body
20547 This is generally not a very good idea---it takes a very long time.
20548 Gnus actually has to fetch each individual article from the server.  But
20549 you might want to anyway, I guess.  Even though there are three match
20550 keys (@code{Head}, @code{Body} and @code{All}), you should choose one
20551 and stick with it in each score file.  If you use any two, each article
20552 will be fetched @emph{twice}.  If you want to match a bit on the
20553 @code{Head} and a bit on the @code{Body}, just use @code{All} for all
20554 the matches.
20555
20556 @item Marking as read
20557 You will probably want to mark articles that have scores below a certain
20558 number as read.  This is most easily achieved by putting the following
20559 in your @file{all.SCORE} file:
20560 @lisp
20561 ((mark -100))
20562 @end lisp
20563 You may also consider doing something similar with @code{expunge}.
20564
20565 @item Negated character classes
20566 If you say stuff like @code{[^abcd]*}, you may get unexpected results.
20567 That will match newlines, which might lead to, well, The Unknown.  Say
20568 @code{[^abcd\n]*} instead.
20569 @end table
20570
20571
20572 @node Reverse Scoring
20573 @section Reverse Scoring
20574 @cindex reverse scoring
20575
20576 If you want to keep just articles that have @samp{Sex with Emacs} in the
20577 subject header, and expunge all other articles, you could put something
20578 like this in your score file:
20579
20580 @lisp
20581 (("subject"
20582   ("Sex with Emacs" 2))
20583  (mark 1)
20584  (expunge 1))
20585 @end lisp
20586
20587 So, you raise all articles that match @samp{Sex with Emacs} and mark the
20588 rest as read, and expunge them to boot.
20589
20590
20591 @node Global Score Files
20592 @section Global Score Files
20593 @cindex global score files
20594
20595 Sure, other newsreaders have ``global kill files''.  These are usually
20596 nothing more than a single kill file that applies to all groups, stored
20597 in the user's home directory.  Bah!  Puny, weak newsreaders!
20598
20599 What I'm talking about here are Global Score Files.  Score files from
20600 all over the world, from users everywhere, uniting all nations in one
20601 big, happy score file union!  Ange-score!  New and untested!
20602
20603 @vindex gnus-global-score-files
20604 All you have to do to use other people's score files is to set the
20605 @code{gnus-global-score-files} variable.  One entry for each score file,
20606 or each score file directory.  Gnus will decide by itself what score
20607 files are applicable to which group.
20608
20609 To use the score file
20610 @file{/ftp@@ftp.gnus.org:/pub/larsi/ding/score/soc.motss.SCORE} and
20611 all score files in the @file{/ftp@@ftp.some-where:/pub/score} directory,
20612 say this:
20613
20614 @lisp
20615 (setq gnus-global-score-files
20616       '("/ftp@@ftp.gnus.org:/pub/larsi/ding/score/soc.motss.SCORE"
20617         "/ftp@@ftp.some-where:/pub/score/"))
20618 @end lisp
20619
20620 @findex gnus-score-search-global-directories
20621 @noindent
20622 Simple, eh?  Directory names must end with a @samp{/}.  These
20623 directories are typically scanned only once during each Gnus session.
20624 If you feel the need to manually re-scan the remote directories, you can
20625 use the @code{gnus-score-search-global-directories} command.
20626
20627 Note that, at present, using this option will slow down group entry
20628 somewhat.  (That is---a lot.)
20629
20630 If you want to start maintaining score files for other people to use,
20631 just put your score file up for anonymous ftp and announce it to the
20632 world.  Become a retro-moderator!  Participate in the retro-moderator
20633 wars sure to ensue, where retro-moderators battle it out for the
20634 sympathy of the people, luring them to use their score files on false
20635 premises!  Yay!  The net is saved!
20636
20637 Here are some tips for the would-be retro-moderator, off the top of my
20638 head:
20639
20640 @itemize @bullet
20641
20642 @item
20643 Articles heavily crossposted are probably junk.
20644 @item
20645 To lower a single inappropriate article, lower by @code{Message-ID}.
20646 @item
20647 Particularly brilliant authors can be raised on a permanent basis.
20648 @item
20649 Authors that repeatedly post off-charter for the group can safely be
20650 lowered out of existence.
20651 @item
20652 Set the @code{mark} and @code{expunge} atoms to obliterate the nastiest
20653 articles completely.
20654
20655 @item
20656 Use expiring score entries to keep the size of the file down.  You
20657 should probably have a long expiry period, though, as some sites keep
20658 old articles for a long time.
20659 @end itemize
20660
20661 @dots{} I wonder whether other newsreaders will support global score files
20662 in the future.  @emph{Snicker}.  Yup, any day now, newsreaders like Blue
20663 Wave, xrn and 1stReader are bound to implement scoring.  Should we start
20664 holding our breath yet?
20665
20666
20667 @node Kill Files
20668 @section Kill Files
20669 @cindex kill files
20670
20671 Gnus still supports those pesky old kill files.  In fact, the kill file
20672 entries can now be expiring, which is something I wrote before Daniel
20673 Quinlan thought of doing score files, so I've left the code in there.
20674
20675 In short, kill processing is a lot slower (and I do mean @emph{a lot})
20676 than score processing, so it might be a good idea to rewrite your kill
20677 files into score files.
20678
20679 Anyway, a kill file is a normal @code{emacs-lisp} file.  You can put any
20680 forms into this file, which means that you can use kill files as some
20681 sort of primitive hook function to be run on group entry, even though
20682 that isn't a very good idea.
20683
20684 Normal kill files look like this:
20685
20686 @lisp
20687 (gnus-kill "From" "Lars Ingebrigtsen")
20688 (gnus-kill "Subject" "ding")
20689 (gnus-expunge "X")
20690 @end lisp
20691
20692 This will mark every article written by me as read, and remove the
20693 marked articles from the summary buffer.  Very useful, you'll agree.
20694
20695 Other programs use a totally different kill file syntax.  If Gnus
20696 encounters what looks like a @code{rn} kill file, it will take a stab at
20697 interpreting it.
20698
20699 Two summary functions for editing a @sc{gnus} kill file:
20700
20701 @table @kbd
20702
20703 @item M-k
20704 @kindex M-k (Summary)
20705 @findex gnus-summary-edit-local-kill
20706 Edit this group's kill file (@code{gnus-summary-edit-local-kill}).
20707
20708 @item M-K
20709 @kindex M-K (Summary)
20710 @findex gnus-summary-edit-global-kill
20711 Edit the general kill file (@code{gnus-summary-edit-global-kill}).
20712 @end table
20713
20714 Two group mode functions for editing the kill files:
20715
20716 @table @kbd
20717
20718 @item M-k
20719 @kindex M-k (Group)
20720 @findex gnus-group-edit-local-kill
20721 Edit this group's kill file (@code{gnus-group-edit-local-kill}).
20722
20723 @item M-K
20724 @kindex M-K (Group)
20725 @findex gnus-group-edit-global-kill
20726 Edit the general kill file (@code{gnus-group-edit-global-kill}).
20727 @end table
20728
20729 Kill file variables:
20730
20731 @table @code
20732 @item gnus-kill-file-name
20733 @vindex gnus-kill-file-name
20734 A kill file for the group @samp{soc.motss} is normally called
20735 @file{soc.motss.KILL}.  The suffix appended to the group name to get
20736 this file name is detailed by the @code{gnus-kill-file-name} variable.
20737 The ``global'' kill file (not in the score file sense of ``global'', of
20738 course) is just called @file{KILL}.
20739
20740 @vindex gnus-kill-save-kill-file
20741 @item gnus-kill-save-kill-file
20742 If this variable is non-@code{nil}, Gnus will save the
20743 kill file after processing, which is necessary if you use expiring
20744 kills.
20745
20746 @item gnus-apply-kill-hook
20747 @vindex gnus-apply-kill-hook
20748 @findex gnus-apply-kill-file-unless-scored
20749 @findex gnus-apply-kill-file
20750 A hook called to apply kill files to a group.  It is
20751 @code{(gnus-apply-kill-file)} by default.  If you want to ignore the
20752 kill file if you have a score file for the same group, you can set this
20753 hook to @code{(gnus-apply-kill-file-unless-scored)}.  If you don't want
20754 kill files to be processed, you should set this variable to @code{nil}.
20755
20756 @item gnus-kill-file-mode-hook
20757 @vindex gnus-kill-file-mode-hook
20758 A hook called in kill-file mode buffers.
20759
20760 @end table
20761
20762
20763 @node Converting Kill Files
20764 @section Converting Kill Files
20765 @cindex kill files
20766 @cindex converting kill files
20767
20768 If you have loads of old kill files, you may want to convert them into
20769 score files.  If they are ``regular'', you can use
20770 the @file{gnus-kill-to-score.el} package; if not, you'll have to do it
20771 by hand.
20772
20773 The kill to score conversion package isn't included in Emacs by default.
20774 You can fetch it from the contrib directory of the Gnus distribution or
20775 from
20776 @uref{http://heim.ifi.uio.no/~larsi/ding-various/gnus-kill-to-score.el}.
20777
20778 If your old kill files are very complex---if they contain more
20779 non-@code{gnus-kill} forms than not, you'll have to convert them by
20780 hand.  Or just let them be as they are.  Gnus will still use them as
20781 before.
20782
20783
20784 @node Advanced Scoring
20785 @section Advanced Scoring
20786
20787 Scoring on Subjects and From headers is nice enough, but what if you're
20788 really interested in what a person has to say only when she's talking
20789 about a particular subject?  Or what if you really don't want to
20790 read what person A has to say when she's following up to person B, but
20791 want to read what she says when she's following up to person C?
20792
20793 By using advanced scoring rules you may create arbitrarily complex
20794 scoring patterns.
20795
20796 @menu
20797 * Advanced Scoring Syntax::     A definition.
20798 * Advanced Scoring Examples::   What they look like.
20799 * Advanced Scoring Tips::       Getting the most out of it.
20800 @end menu
20801
20802
20803 @node Advanced Scoring Syntax
20804 @subsection Advanced Scoring Syntax
20805
20806 Ordinary scoring rules have a string as the first element in the rule.
20807 Advanced scoring rules have a list as the first element.  The second
20808 element is the score to be applied if the first element evaluated to a
20809 non-@code{nil} value.
20810
20811 These lists may consist of three logical operators, one redirection
20812 operator, and various match operators.
20813
20814 Logical operators:
20815
20816 @table @code
20817 @item &
20818 @itemx and
20819 This logical operator will evaluate each of its arguments until it finds
20820 one that evaluates to @code{false}, and then it'll stop.  If all arguments
20821 evaluate to @code{true} values, then this operator will return
20822 @code{true}.
20823
20824 @item |
20825 @itemx or
20826 This logical operator will evaluate each of its arguments until it finds
20827 one that evaluates to @code{true}.  If no arguments are @code{true},
20828 then this operator will return @code{false}.
20829
20830 @item !
20831 @itemx not
20832 @itemx Â¬
20833 This logical operator only takes a single argument.  It returns the
20834 logical negation of the value of its argument.
20835
20836 @end table
20837
20838 There is an @dfn{indirection operator} that will make its arguments
20839 apply to the ancestors of the current article being scored.  For
20840 instance, @code{1-} will make score rules apply to the parent of the
20841 current article.  @code{2-} will make score rules apply to the
20842 grandparent of the current article.  Alternatively, you can write
20843 @code{^^}, where the number of @code{^}s (carets) says how far back into
20844 the ancestry you want to go.
20845
20846 Finally, we have the match operators.  These are the ones that do the
20847 real work.  Match operators are header name strings followed by a match
20848 and a match type.  A typical match operator looks like @samp{("from"
20849 "Lars Ingebrigtsen" s)}.  The header names are the same as when using
20850 simple scoring, and the match types are also the same.
20851
20852
20853 @node Advanced Scoring Examples
20854 @subsection Advanced Scoring Examples
20855
20856 Please note that the following examples are score file rules.  To
20857 make a complete score file from them, surround them with another pair
20858 of parentheses.
20859
20860 Let's say you want to increase the score of articles written by Lars
20861 when he's talking about Gnus:
20862
20863 @example
20864 @group
20865 ((&
20866   ("from" "Lars Ingebrigtsen")
20867   ("subject" "Gnus"))
20868  1000)
20869 @end group
20870 @end example
20871
20872 Quite simple, huh?
20873
20874 When he writes long articles, he sometimes has something nice to say:
20875
20876 @example
20877 ((&
20878   ("from" "Lars Ingebrigtsen")
20879   (|
20880    ("subject" "Gnus")
20881    ("lines" 100 >)))
20882  1000)
20883 @end example
20884
20885 However, when he responds to things written by Reig Eigil Logge, you
20886 really don't want to read what he's written:
20887
20888 @example
20889 ((&
20890   ("from" "Lars Ingebrigtsen")
20891   (1- ("from" "Reig Eigil Logge")))
20892  -100000)
20893 @end example
20894
20895 Everybody that follows up Redmondo when he writes about disappearing
20896 socks should have their scores raised, but only when they talk about
20897 white socks.  However, when Lars talks about socks, it's usually not
20898 very interesting:
20899
20900 @example
20901 ((&
20902   (1-
20903    (&
20904     ("from" "redmondo@@.*no" r)
20905     ("body" "disappearing.*socks" t)))
20906   (! ("from" "Lars Ingebrigtsen"))
20907   ("body" "white.*socks"))
20908  1000)
20909 @end example
20910
20911 Suppose you're reading a high volume group and you're only interested
20912 in replies. The plan is to score down all articles that don't have
20913 subject that begin with "Re:", "Fw:" or "Fwd:" and then score up all
20914 parents of articles that have subjects that begin with reply marks.
20915
20916 @example
20917 ((! ("subject" "re:\\|fwd?:" r))
20918   -200)
20919 ((1- ("subject" "re:\\|fwd?:" r))
20920   200)
20921 @end example
20922
20923 The possibilities are endless.
20924
20925 @node Advanced Scoring Tips
20926 @subsection Advanced Scoring Tips
20927
20928 The @code{&} and @code{|} logical operators do short-circuit logic.
20929 That is, they stop processing their arguments when it's clear what the
20930 result of the operation will be.  For instance, if one of the arguments
20931 of an @code{&} evaluates to @code{false}, there's no point in evaluating
20932 the rest of the arguments.  This means that you should put slow matches
20933 (@samp{body}, @samp{header}) last and quick matches (@samp{from},
20934 @samp{subject}) first.
20935
20936 The indirection arguments (@code{1-} and so on) will make their
20937 arguments work on previous generations of the thread.  If you say
20938 something like:
20939
20940 @example
20941 ...
20942 (1-
20943  (1-
20944   ("from" "lars")))
20945 ...
20946 @end example
20947
20948 Then that means ``score on the from header of the grandparent of the
20949 current article''.  An indirection is quite fast, but it's better to say:
20950
20951 @example
20952 (1-
20953  (&
20954   ("from" "Lars")
20955   ("subject" "Gnus")))
20956 @end example
20957
20958 than it is to say:
20959
20960 @example
20961 (&
20962  (1- ("from" "Lars"))
20963  (1- ("subject" "Gnus")))
20964 @end example
20965
20966
20967 @node Score Decays
20968 @section Score Decays
20969 @cindex score decays
20970 @cindex decays
20971
20972 You may find that your scores have a tendency to grow without
20973 bounds, especially if you're using adaptive scoring.  If scores get too
20974 big, they lose all meaning---they simply max out and it's difficult to
20975 use them in any sensible way.
20976
20977 @vindex gnus-decay-scores
20978 @findex gnus-decay-score
20979 @vindex gnus-decay-score-function
20980 Gnus provides a mechanism for decaying scores to help with this problem.
20981 When score files are loaded and @code{gnus-decay-scores} is
20982 non-@code{nil}, Gnus will run the score files through the decaying
20983 mechanism thereby lowering the scores of all non-permanent score rules.
20984 If @code{gnus-decay-scores} is a regexp, only score files matching this
20985 regexp are treated.  E.g. you may set it to @samp{\\.ADAPT\\'} if only
20986 @emph{adaptive} score files should be decayed.  The decay itself if
20987 performed by the @code{gnus-decay-score-function} function, which is
20988 @code{gnus-decay-score} by default.  Here's the definition of that
20989 function:
20990
20991 @lisp
20992 (defun gnus-decay-score (score)
20993   "Decay SCORE according to `gnus-score-decay-constant'
20994 and `gnus-score-decay-scale'."
20995   (let ((n (- score
20996               (* (if (< score 0) -1 1)
20997                  (min (abs score)
20998                       (max gnus-score-decay-constant
20999                            (* (abs score)
21000                               gnus-score-decay-scale)))))))
21001     (if (and (featurep 'xemacs)
21002              ;; XEmacs' floor can handle only the floating point
21003              ;; number below the half of the maximum integer.
21004              (> (abs n) (lsh -1 -2)))
21005         (string-to-number
21006          (car (split-string (number-to-string n) "\\.")))
21007       (floor n))))
21008 @end lisp
21009
21010 @vindex gnus-score-decay-scale
21011 @vindex gnus-score-decay-constant
21012 @code{gnus-score-decay-constant} is 3 by default and
21013 @code{gnus-score-decay-scale} is 0.05.  This should cause the following:
21014
21015 @enumerate
21016 @item
21017 Scores between -3 and 3 will be set to 0 when this function is called.
21018
21019 @item
21020 Scores with magnitudes between 3 and 60 will be shrunk by 3.
21021
21022 @item
21023 Scores with magnitudes greater than 60 will be shrunk by 5% of the
21024 score.
21025 @end enumerate
21026
21027 If you don't like this decay function, write your own.  It is called
21028 with the score to be decayed as its only parameter, and it should return
21029 the new score, which should be an integer.
21030
21031 Gnus will try to decay scores once a day.  If you haven't run Gnus for
21032 four days, Gnus will decay the scores four times, for instance.
21033
21034 @node Searching
21035 @chapter Searching
21036 @cindex searching
21037
21038 FIXME: Add a brief overview of Gnus search capabilities.  A brief
21039 comparison of nnir, nnmairix, contrib/gnus-namazu would be nice
21040 as well.
21041
21042 This chapter describes tools for searching groups and servers for
21043 articles matching a query and then retrieving those articles. Gnus
21044 provides a simpler mechanism for searching through articles in a summary buffer 
21045 to find those matching a pattern. @xref{Searching for Articles}. 
21046
21047 @menu
21048 * nnir::                     Searching with various engines.
21049 * nnmairix::                 Searching with Mairix.
21050 @end menu
21051
21052 @node nnir
21053 @section nnir
21054 @cindex nnir
21055
21056 This section describes how to use @code{nnir} to search for articles
21057 within gnus.
21058
21059 @menu
21060 * What is nnir?::               What does @code{nnir} do?
21061 * Basic Usage::                 How to perform simple searches.
21062 * Setting up nnir::             How to set up @code{nnir}.
21063 @end menu
21064
21065 @node What is nnir?
21066 @subsection What is nnir?
21067
21068 @code{nnir} is a Gnus interface to a number of tools for searching
21069 through mail and news repositories. Different backends (like
21070 @code{nnimap} and @code{nntp}) work with different tools (called
21071 @dfn{engines} in @code{nnir} lingo), but all use the same basic search
21072 interface.
21073
21074 The @code{nnimap} and @code{gmane} search engines should work with no
21075 configuration. Other engines require a local index that needs to be
21076 created and maintained outside of Gnus. 
21077
21078
21079 @node Basic Usage
21080 @subsection Basic Usage
21081
21082 In the group buffer typing @kbd{G G} will search the group on the
21083 current line by calling @code{gnus-group-make-nnir-group}.  This prompts
21084 for a query string, creates an ephemeral @code{nnir} group containing
21085 the articles that match this query, and takes you to a summary buffer
21086 showing these articles. Articles may then be read, moved and deleted
21087 using the usual commands.
21088
21089 The @code{nnir} group made in this way is an @code{ephemeral} group, and
21090 some changes are not permanent: aside from reading, moving, and
21091 deleting, you can't act on the original article. But there is an
21092 alternative: you can @emph{warp} to the original group for the article
21093 on the current line with @kbd{A W}, aka
21094 @code{gnus-warp-to-article}. Even better, the function
21095 @code{gnus-summary-refer-thread}, bound by default in summary buffers to
21096 @kbd{A T}, will first warp to the original group before it works its
21097 magic and includes all the articles in the thread. From here you can
21098 read, move and delete articles, but also copy them, alter article marks,
21099 whatever. Go nuts.
21100
21101 You say you want to search more than just the group on the current line?
21102 No problem: just process-mark the groups you want to search. You want
21103 even more? Calling for an nnir search with the cursor on a topic heading
21104 will search all the groups under that heading.
21105
21106 Still not enough? OK, in the server buffer
21107 @code{gnus-group-make-nnir-group} (now bound to @kbd{G}) will search all
21108 groups from the server on the current line. Too much? Want to ignore
21109 certain groups when searching, like spam groups? Just customize
21110 @code{nnir-ignored-newsgroups}.
21111
21112 One more thing: individual search engines may have special search
21113 features. You can access these special features by giving a prefix-arg
21114 to @code{gnus-group-make-nnir-group}. If you are searching multiple
21115 groups with different search engines you will be prompted for the
21116 special search features for each engine separately. 
21117
21118
21119 @node Setting up nnir
21120 @subsection Setting up nnir
21121
21122 To set up nnir you may need to do some prep work. Firstly, you may need
21123 to configure the search engines you plan to use. Some of them, like
21124 @code{imap} and @code{gmane}, need no special configuration. Others,
21125 like @code{namazu} and @code{swish}, require configuration as described
21126 below. Secondly, you need to associate a search engine with a server or
21127 a backend.
21128
21129 If you just want to use the @code{imap} engine to search @code{nnimap}
21130 servers, and the @code{gmane} engine to search @code{gmane} then you
21131 don't have to do anything. But you might want to read the details of the
21132 query language anyway.
21133
21134 @menu
21135 * Associating Engines::                 How to associate engines.
21136 * The imap Engine::                     Imap configuration and usage.
21137 * The gmane Engine::                    Gmane configuration and usage.
21138 * The swish++ Engine::                  Swish++ configuration and usage.
21139 * The swish-e Engine::                  Swish-e configuration and usage.
21140 * The namazu Engine::                   Namazu configuration and usage.
21141 * The hyrex Engine::                    Hyrex configuration and usage.
21142 * Customizations::                      User customizable settings.
21143 @end menu
21144
21145 @node Associating Engines
21146 @subsubsection Associating Engines
21147
21148
21149 When searching a group, @code{nnir} needs to know which search engine to
21150 use. You can configure a given server to use a particular engine by
21151 setting the server variable @code{nnir-search-engine} to the engine
21152 name. For example to use the @code{namazu} engine to search the server
21153 named @code{home} you can use
21154
21155 @lisp
21156 (setq gnus-secondary-select-methods
21157       '((nnml "home" 
21158          (nnimap-address "localhost")
21159          (nnir-search-engine namazu))))
21160 @end lisp
21161
21162 Alternatively you might want to use a particular engine for all servers
21163 with a given backend. For example, you might want to use the @code{imap}
21164 engine for all servers using the @code{nnimap} backend. In this case you
21165 can customize the variable @code{nnir-method-default-engines}. This is
21166 an alist of pairs of the form @code{(backend . engine)}. By default this
21167 variable is set to use the @code{imap} engine for all servers using the
21168 @code{nnimap} backend, and the @code{gmane} backend for @code{nntp}
21169 servers. (Don't worry, the @code{gmane} search engine won't actually try
21170 to search non-gmane @code{nntp} servers.) But if you wanted to use
21171 @code{namazu} for all your servers with an @code{nnimap} backend you
21172 could change this to
21173
21174 @lisp
21175 '((nnimap . namazu)
21176   (nntp . gmane))
21177 @end lisp
21178
21179 @node The imap Engine
21180 @subsubsection The imap Engine
21181
21182 The @code{imap} engine requires no configuration. 
21183
21184 Queries using the @code{imap} engine follow a simple query language. 
21185 The search is always case-insensitive and supports the following
21186 features (inspired by the Google search input language):
21187
21188 @table @samp
21189
21190 @item Boolean query operators
21191 AND, OR, and NOT are supported, and parentheses can be used to control
21192 operator precedence, e.g. (emacs OR xemacs) AND linux. Note that
21193 operators must be written with all capital letters to be
21194 recognised. Also preceding a term with a - sign is equivalent to NOT
21195 term.
21196
21197 @item Automatic AND queries 
21198 If you specify multiple words then they will be treated as an AND
21199 expression intended to match all components.
21200
21201 @item Phrase searches
21202 If you wrap your query in double-quotes then it will be treated as a
21203 literal string.
21204
21205 @end table
21206
21207 By default the whole message will be searched. The query can be limited
21208 to a specific part of a message by using a prefix-arg. After inputting
21209 the query this will prompt (with completion) for a message part.
21210 Choices include ``Whole message'', ``Subject'', ``From'', and
21211 ``To''. Any unrecognized input is interpreted as a header name. For
21212 example, typing @kbd{Message-ID} in response to this prompt will limit
21213 the query to the Message-ID header.
21214
21215 Finally selecting ``Imap'' will interpret the query as a raw
21216 @acronym{IMAP} search query. The format of such queries can be found in
21217 RFC3501.
21218
21219 If you don't like the default of searching whole messages you can
21220 customize @code{nnir-imap-default-search-key}. For example to use
21221 @acronym{IMAP} queries by default
21222
21223 @lisp
21224 (setq nnir-imap-default-search-key "Imap")
21225 @end lisp
21226
21227 @node The gmane Engine
21228 @subsubsection The gmane Engine
21229
21230 The @code{gmane} engine requires no configuration. 
21231
21232 Gmane queries follow a simple query language:
21233
21234 @table @samp
21235 @item Boolean query operators
21236 AND, OR, NOT (or AND NOT), and XOR are supported, and brackets can be
21237 used to control operator precedence, e.g. (emacs OR xemacs) AND linux.
21238 Note that operators must be written with all capital letters to be
21239 recognised.
21240
21241 @item Required and excluded terms
21242 + and - can be used to require or exclude terms, e.g. football -american
21243
21244 @item Unicode handling 
21245 The search engine converts all text to utf-8, so searching should work
21246 in any language.
21247
21248 @item Stopwords 
21249 Common English words (like 'the' and 'a') are ignored by default. You
21250 can override this by prefixing such words with a + (e.g. +the) or
21251 enclosing the word in quotes (e.g. "the").
21252
21253 @end table
21254
21255 The query can be limited to articles by a specific author using a
21256 prefix-arg. After inputting the query this will prompt for an author
21257 name (or part of a name) to match.
21258
21259 @node The swish++ Engine
21260 @subsubsection The swish++ Engine
21261
21262 FIXEM: Say something more here.
21263
21264 Documentation for swish++ may be found at the swish++ sourceforge page:
21265 @uref{http://swishplusplus.sourceforge.net}
21266
21267 @table @code
21268
21269 @item nnir-swish++-program
21270 The name of the swish++ executable. Defaults to @code{search}
21271
21272 @item nnir-swish++-additional-switches
21273 A list of strings to be given as additional arguments to
21274 swish++. @code{nil} by default.
21275
21276 @item nnir-swish++-remove-prefix
21277 The prefix to remove from each file name returned by swish++ in order
21278 to get a group name. By default this is @code{$HOME/Mail}.
21279
21280 @end table
21281
21282 @node The swish-e Engine
21283 @subsubsection The swish-e Engine
21284
21285 FIXEM: Say something more here.
21286
21287 Documentation for swish-e may be found at the swish-e homepage
21288 @uref{http://swish-e.org}
21289
21290 @table @code
21291
21292 @item nnir-swish-e-program
21293 The name of the swish-e search program. Defaults to @code{swish-e}.
21294
21295 @item nnir-swish-e-additional-switches
21296 A list of strings to be given as additional arguments to
21297 swish-e. @code{nil} by default.
21298
21299 @item nnir-swish-e-remove-prefix
21300 The prefix to remove from each file name returned by swish-e in order
21301 to get a group name. By default this is @code{$HOME/Mail}.
21302
21303 @end table
21304
21305 @node The namazu Engine
21306 @subsubsection The namazu Engine
21307
21308 Using the namazu engine requires creating and maintaining index files.
21309 One directory should contain all the index files, and nnir must be told
21310 where to find them by setting the @code{nnir-namazu-index-directory}
21311 variable.  
21312
21313 To work correctly the @code{nnir-namazu-remove-prefix} variable must
21314 also be correct. This is the prefix to remove from each file name
21315 returned by Namazu in order to get a proper group name (albeit with `/'
21316 instead of `.').
21317
21318 For example, suppose that Namazu returns file names such as
21319 @samp{/home/john/Mail/mail/misc/42}.  For this example, use the
21320 following setting: @code{(setq nnir-namazu-remove-prefix
21321 "/home/john/Mail/")} Note the trailing slash.  Removing this prefix from
21322 the directory gives @samp{mail/misc/42}.  @code{nnir} knows to remove
21323 the @samp{/42} and to replace @samp{/} with @samp{.} to arrive at the
21324 correct group name @samp{mail.misc}.
21325
21326 Extra switches may be passed to the namazu search command by setting the
21327 variable @code{nnir-namazu-additional-switches}.  It is particularly
21328 important not to pass any any switches to namazu that will change the
21329 output format.  Good switches to use include `--sort', `--ascending',
21330 `--early' and `--late'.  Refer to the Namazu documentation for further
21331 information on valid switches.
21332
21333 Mail must first be indexed  with the `mknmz' program.  Read the documentation
21334 for namazu to create a configuration file. Here is an example:
21335
21336 @cartouche
21337 @example
21338  package conf;  # Don't remove this line!
21339
21340  # Paths which will not be indexed. Don't use `^' or `$' anchors.
21341  $EXCLUDE_PATH = "spam|sent";
21342
21343  # Header fields which should be searchable. case-insensitive
21344  $REMAIN_HEADER = "from|date|message-id|subject";
21345
21346  # Searchable fields. case-insensitive
21347  $SEARCH_FIELD = "from|date|message-id|subject";
21348
21349  # The max length of a word.
21350  $WORD_LENG_MAX = 128;
21351
21352  # The max length of a field.
21353  $MAX_FIELD_LENGTH = 256;
21354 @end example
21355 @end cartouche
21356
21357 For this example, mail is stored in the directories @samp{~/Mail/mail/},
21358 @samp{~/Mail/lists/} and @samp{~/Mail/archive/}, so to index them go to
21359 the index directory set in @code{nnir-namazu-index-directory} and issue
21360 the following command:
21361
21362 @example
21363 mknmz --mailnews ~/Mail/archive/ ~/Mail/mail/ ~/Mail/lists/
21364 @end example
21365
21366 For maximum searching efficiency you might want to have a cron job run
21367 this command periodically, say every four hours.
21368
21369 @node The hyrex Engine
21370 @subsubsection The hyrex Engine
21371 This engine is obsolete.
21372
21373 @node Customizations
21374 @subsubsection Custimozations
21375
21376 @table @code
21377
21378 @item nnir-method-default-engines
21379 Alist of server backend - search engine pairs. The default associations
21380 are
21381 @example
21382 (nnimap . imap)
21383 (nntp . gmane)
21384 @end example
21385
21386 @item nnir-ignored-newsgroups
21387 A regexp to match newsgroups in the active file that should be skipped
21388 when searching all groups on a server.
21389
21390 @item nnir-summary-line-format
21391 The format specification to be used for lines in an nnir summary buffer.
21392 All the items from `gnus-summary-line-format' are available, along with
21393 three items unique to nnir summary buffers:
21394
21395 @example
21396 %Z    Search retrieval score value (integer)
21397 %G    Article original full group name (string)
21398 %g    Article original short group name (string)
21399 @end example
21400
21401 If nil (the default) this will use @code{gnus-summary-line-format}.
21402
21403 @item nnir-retrieve-headers-override-function
21404 If non-nil, a function that retrieves article headers rather than using
21405 the gnus built-in function.  This function takes an article list and
21406 group as arguments and populates the `nntp-server-buffer' with the
21407 retrieved headers. It should then return either 'nov or 'headers
21408 indicating the retrieved header format. Failure to retrieve headers
21409 should return @code{nil}
21410
21411 If this variable is nil, or if the provided function returns nil for a
21412 search result, @code{gnus-retrieve-headers} will be called instead."
21413
21414
21415 @end table
21416
21417
21418 @node nnmairix
21419 @section nnmairix
21420
21421 @cindex mairix
21422 @cindex nnmairix
21423 This paragraph describes how to set up mairix and the back end
21424 @code{nnmairix} for indexing and searching your mail from within
21425 Gnus.  Additionally, you can create permanent ``smart'' groups which are
21426 bound to mairix searches and are automatically updated.
21427
21428 @menu
21429 * About mairix::                About the mairix mail search engine
21430 * nnmairix requirements::       What you will need for using nnmairix
21431 * What nnmairix does::          What does nnmairix actually do?
21432 * Setting up mairix::           Set up your mairix installation
21433 * Configuring nnmairix::        Set up the nnmairix back end
21434 * nnmairix keyboard shortcuts:: List of available keyboard shortcuts
21435 * Propagating marks::           How to propagate marks from nnmairix groups
21436 * nnmairix tips and tricks::    Some tips, tricks and examples
21437 * nnmairix caveats::            Some more stuff you might want to know
21438 @end menu
21439
21440 @c FIXME: The markup in this section might need improvement.
21441 @c E.g. adding @samp, @var, @file, @command, etc.
21442 @c Cf. (info "(texinfo)Indicating")
21443
21444 @node About mairix
21445 @subsection About mairix
21446
21447 Mairix is a tool for indexing and searching words in locally stored
21448 mail.  It was written by Richard Curnow and is licensed under the
21449 GPL.  Mairix comes with most popular GNU/Linux distributions, but it also
21450 runs under Windows (with cygwin), Mac OS X and Solaris.  The homepage can
21451 be found at
21452 @uref{http://www.rpcurnow.force9.co.uk/mairix/index.html}
21453
21454 Though mairix might not be as flexible as other search tools like
21455 swish++ or namazu, which you can use via the @code{nnir} back end, it
21456 has the prime advantage of being incredibly fast.  On current systems, it
21457 can easily search through headers and message bodies of thousands and
21458 thousands of mails in well under a second.  Building the database
21459 necessary for searching might take a minute or two, but only has to be
21460 done once fully.  Afterwards, the updates are done incrementally and
21461 therefore are really fast, too.  Additionally, mairix is very easy to set
21462 up.
21463
21464 For maximum speed though, mairix should be used with mails stored in
21465 @code{Maildir} or @code{MH} format (this includes the @code{nnml} back
21466 end), although it also works with mbox.  Mairix presents the search
21467 results by populating a @emph{virtual} maildir/MH folder with symlinks
21468 which point to the ``real'' message files (if mbox is used, copies are
21469 made).  Since mairix already presents search results in such a virtual
21470 mail folder, it is very well suited for using it as an external program
21471 for creating @emph{smart} mail folders, which represent certain mail
21472 searches.
21473
21474 @node nnmairix requirements
21475 @subsection nnmairix requirements
21476
21477 Mairix searches local mail---that means, mairix absolutely must have
21478 direct access to your mail folders.  If your mail resides on another
21479 server (e.g. an @acronym{IMAP} server) and you happen to have shell
21480 access, @code{nnmairix} supports running mairix remotely, e.g. via ssh.
21481
21482 Additionally, @code{nnmairix} only supports the following Gnus back
21483 ends: @code{nnml}, @code{nnmaildir}, and @code{nnimap}.  You must use
21484 one of these back ends for using @code{nnmairix}.  Other back ends, like
21485 @code{nnmbox}, @code{nnfolder} or @code{nnmh}, won't work.
21486
21487 If you absolutely must use mbox and still want to use @code{nnmairix},
21488 you can set up a local @acronym{IMAP} server, which you then access via
21489 @code{nnimap}.  This is a rather massive setup for accessing some mbox
21490 files, so just change to MH or Maildir already...  However, if you're
21491 really, really passionate about using mbox, you might want to look into
21492 the package @file{mairix.el}, which comes with Emacs 23.
21493
21494 @node What nnmairix does
21495 @subsection What nnmairix does
21496
21497 The back end @code{nnmairix} enables you to call mairix from within Gnus,
21498 either to query mairix with a search term or to update the
21499 database.  While visiting a message in the summary buffer, you can use
21500 several pre-defined shortcuts for calling mairix, e.g. to quickly
21501 search for all mails from the sender of the current message or to
21502 display the whole thread associated with the message, even if the
21503 mails are in different folders.
21504
21505 Additionally, you can create permanent @code{nnmairix} groups which are bound
21506 to certain mairix searches.  This way, you can easily create a group
21507 containing mails from a certain sender, with a certain subject line or
21508 even for one specific thread based on the Message-ID.  If you check for
21509 new mail in these folders (e.g. by pressing @kbd{g} or @kbd{M-g}), they
21510 automatically update themselves by calling mairix.
21511
21512 You might ask why you need @code{nnmairix} at all, since mairix already
21513 creates the group, populates it with links to the mails so that you can
21514 then access it with Gnus, right?  Well, this @emph{might} work, but often
21515 does not---at least not without problems.  Most probably you will get
21516 strange article counts, and sometimes you might see mails which Gnus
21517 claims have already been canceled and are inaccessible.  This is due to
21518 the fact that Gnus isn't really amused when things are happening behind
21519 its back.  Another problem can be the mail back end itself, e.g. if you
21520 use mairix with an @acronym{IMAP} server (I had Dovecot complaining
21521 about corrupt index files when mairix changed the contents of the search
21522 group).  Using @code{nnmairix} should circumvent these problems.
21523
21524 @code{nnmairix} is not really a mail back end---it's actually more like
21525 a wrapper, sitting between a ``real'' mail back end where mairix stores
21526 the searches and the Gnus front end.  You can choose between three
21527 different mail back ends for the mairix folders: @code{nnml},
21528 @code{nnmaildir} or @code{nnimap}.  @code{nnmairix} will call the mairix
21529 binary so that the search results are stored in folders named
21530 @code{zz_mairix-<NAME>-<NUMBER>} on this mail back end, but it will
21531 present these folders in the Gnus front end only with @code{<NAME>}.
21532 You can use an existing mail back end where you already store your mail,
21533 but if you're uncomfortable with @code{nnmairix} creating new mail
21534 groups alongside your other mail, you can also create e.g. a new
21535 @code{nnmaildir} or @code{nnml} server exclusively for mairix, but then
21536 make sure those servers do not accidentally receive your new mail
21537 (@pxref{nnmairix caveats}).  A special case exists if you want to use
21538 mairix remotely on an IMAP server with @code{nnimap}---here the mairix
21539 folders and your other mail must be on the same @code{nnimap} back end.
21540
21541 @node Setting up mairix
21542 @subsection Setting up mairix
21543
21544 First: create a backup of your mail folders (@pxref{nnmairix caveats}).
21545
21546 Setting up mairix is easy: simply create a @file{.mairixrc} file with
21547 (at least) the following entries:
21548
21549 @example
21550 # Your Maildir/MH base folder
21551 base=~/Maildir
21552 @end example
21553
21554 This is the base folder for your mails.  All the following directories
21555 are relative to this base folder.  If you want to use @code{nnmairix}
21556 with @code{nnimap}, this base directory has to point to the mail
21557 directory where the @acronym{IMAP} server stores the mail folders!
21558
21559 @example
21560 maildir= ... your maildir folders which should be indexed ...
21561 mh= ... your nnml/mh folders which should be indexed ...
21562 mbox = ... your mbox files which should be indexed ...
21563 @end example
21564
21565 This specifies all your mail folders and mbox files (relative to the
21566 base directory!) you want to index with mairix.  Note that the
21567 @code{nnml} back end saves mails in MH format, so you have to put those
21568 directories in the @code{mh} line.  See the example at the end of this
21569 section and mairixrc's man-page for further details.
21570
21571 @example
21572 omit=zz_mairix-*
21573 @end example
21574
21575 @vindex nnmairix-group-prefix
21576 This should make sure that you don't accidentally index the mairix
21577 search results.  You can change the prefix of these folders with the
21578 variable @code{nnmairix-group-prefix}.
21579
21580 @example
21581 mformat= ... 'maildir' or 'mh' ...
21582 database= ... location of database file ...
21583 @end example
21584
21585 The @code{format} setting specifies the output format for the mairix
21586 search folder.  Set this to @code{mh} if you want to access search results
21587 with @code{nnml}.  Otherwise choose @code{maildir}.
21588
21589 To summarize, here is my shortened @file{.mairixrc} file as an example:
21590
21591 @example
21592 base=~/Maildir
21593 maildir=.personal:.work:.logcheck:.sent
21594 mh=../Mail/nnml/*...
21595 mbox=../mboxmail/mailarchive_year*
21596 mformat=maildir
21597 omit=zz_mairix-*
21598 database=~/.mairixdatabase
21599 @end example
21600
21601 In this case, the base directory is @file{~/Maildir}, where all my Maildir
21602 folders are stored.  As you can see, the folders are separated by
21603 colons.  If you wonder why every folder begins with a dot: this is
21604 because I use Dovecot as @acronym{IMAP} server, which again uses
21605 @code{Maildir++} folders.  For testing nnmairix, I also have some
21606 @code{nnml} mail, which is saved in @file{~/Mail/nnml}.  Since this has
21607 to be specified relative to the @code{base} directory, the @code{../Mail}
21608 notation is needed.  Note that the line ends in @code{*...}, which means
21609 to recursively scan all files under this directory.  Without the three
21610 dots, the wildcard @code{*} will not work recursively.  I also have some
21611 old mbox files with archived mail lying around in @file{~/mboxmail}.
21612 The other lines should be obvious.
21613
21614 See the man page for @code{mairixrc} for details and further options,
21615 especially regarding wildcard usage, which may be a little different
21616 than you are used to.
21617
21618 Now simply call @code{mairix} to create the index for the first time.
21619 Note that this may take a few minutes, but every following index will do
21620 the updates incrementally and hence is very fast.
21621
21622 @node Configuring nnmairix
21623 @subsection Configuring nnmairix
21624
21625 In group mode, type @kbd{G b c}
21626 (@code{nnmairix-create-server-and-default-group}).  This will ask you for all
21627 necessary information and create a @code{nnmairix} server as a foreign
21628 server.  You will have to specify the following:
21629
21630 @itemize @bullet
21631
21632 @item
21633 The @strong{name} of the @code{nnmairix} server---choose whatever you
21634 want.
21635
21636 @item
21637 The name of the @strong{back end server} where mairix should store its
21638 searches.  This must be a full server name, like @code{nnml:mymail}.
21639 Just hit @kbd{TAB} to see the available servers.  Currently, servers
21640 which are accessed through @code{nnmaildir}, @code{nnimap} and
21641 @code{nnml} are supported.  As explained above, for locally stored
21642 mails, this can be an existing server where you store your mails.
21643 However, you can also create e.g. a new @code{nnmaildir} or @code{nnml}
21644 server exclusively for @code{nnmairix} in your secondary select methods
21645 (@pxref{Finding the News}).  If you use a secondary @code{nnml} server
21646 just for mairix, make sure that you explicitly set the server variable
21647 @code{nnml-get-new-mail} to @code{nil}, or you might lose mail
21648 (@pxref{nnmairix caveats}).  If you want to use mairix remotely on an
21649 @acronym{IMAP} server, you have to choose the corresponding
21650 @code{nnimap} server here.
21651
21652 @item
21653 @vindex nnmairix-mairix-search-options
21654 The @strong{command} to call the mairix binary.  This will usually just
21655 be @code{mairix}, but you can also choose something like @code{ssh
21656 SERVER mairix} if you want to call mairix remotely, e.g. on your
21657 @acronym{IMAP} server.  If you want to add some default options to
21658 mairix, you could do this here, but better use the variable
21659 @code{nnmairix-mairix-search-options} instead.
21660
21661 @item
21662 The name of the @strong{default search group}.  This will be the group
21663 where all temporary mairix searches are stored, i.e. all searches which
21664 are not bound to permanent @code{nnmairix} groups.  Choose whatever you
21665 like.
21666
21667 @item
21668 If the mail back end is @code{nnimap} or @code{nnmaildir}, you will be
21669 asked if you work with @strong{Maildir++}, i.e. with hidden maildir
21670 folders (=beginning with a dot).  For example, you have to answer
21671 @samp{yes} here if you work with the Dovecot @acronym{IMAP}
21672 server.  Otherwise, you should answer @samp{no} here.
21673
21674 @end itemize
21675
21676 @node nnmairix keyboard shortcuts
21677 @subsection nnmairix keyboard shortcuts
21678
21679 In group mode:
21680
21681 @table @kbd
21682
21683 @item G b c
21684 @kindex G b c (Group)
21685 @findex nnmairix-create-server-and-default-group
21686 Creates @code{nnmairix} server and default search group for this server
21687 (@code{nnmairix-create-server-and-default-group}).  You should have done
21688 this by now (@pxref{Configuring nnmairix}).
21689
21690 @item G b s
21691 @kindex G b s (Group)
21692 @findex nnmairix-search
21693 Prompts for query which is then sent to the mairix binary.  Search
21694 results are put into the default search group which is automatically
21695 displayed (@code{nnmairix-search}).
21696
21697 @item G b m
21698 @kindex G b m (Group)
21699 @findex nnmairix-widget-search
21700 Allows you to create a mairix search or a permanent group more
21701 comfortably using graphical widgets, similar to a customization
21702 group.  Just try it to see how it works (@code{nnmairix-widget-search}).
21703
21704 @item G b i
21705 @kindex G b i (Group)
21706 @findex nnmairix-search-interactive
21707 Another command for creating a mairix query more comfortably, but uses
21708 only the minibuffer (@code{nnmairix-search-interactive}).
21709
21710 @item G b g
21711 @kindex G b g (Group)
21712 @findex nnmairix-create-search-group
21713 Creates a permanent group which is associated with a search query
21714 (@code{nnmairix-create-search-group}).  The @code{nnmairix} back end
21715 automatically calls mairix when you update this group with @kbd{g} or
21716 @kbd{M-g}.
21717
21718 @item G b q
21719 @kindex G b q (Group)
21720 @findex nnmairix-group-change-query-this-group
21721 Changes the search query for the @code{nnmairix} group under cursor
21722 (@code{nnmairix-group-change-query-this-group}).
21723
21724 @item G b t
21725 @kindex G b t (Group)
21726 @findex nnmairix-group-toggle-threads-this-group
21727 Toggles the 'threads' parameter for the @code{nnmairix} group under cursor,
21728 i.e.  if you want see the whole threads of the found messages
21729 (@code{nnmairix-group-toggle-threads-this-group}).
21730
21731 @item G b u
21732 @kindex G b u (Group)
21733 @findex nnmairix-update-database
21734 @vindex nnmairix-mairix-update-options
21735 Calls mairix binary for updating the database
21736 (@code{nnmairix-update-database}).  The default parameters are @code{-F}
21737 and @code{-Q} for making this as fast as possible (see variable
21738 @code{nnmairix-mairix-update-options} for defining these default
21739 options).
21740
21741 @item G b r
21742 @kindex G b r (Group)
21743 @findex nnmairix-group-toggle-readmarks-this-group
21744 Keep articles in this @code{nnmairix} group always read or unread, or leave the
21745 marks unchanged (@code{nnmairix-group-toggle-readmarks-this-group}).
21746
21747 @item G b d
21748 @kindex G b d (Group)
21749 @findex nnmairix-group-delete-recreate-this-group
21750 Recreate @code{nnmairix} group on the ``real'' mail back end
21751 (@code{nnmairix-group-delete-recreate-this-group}).  You can do this if
21752 you always get wrong article counts with a @code{nnmairix} group.
21753
21754 @item G b a
21755 @kindex G b a (Group)
21756 @findex nnmairix-group-toggle-allowfast-this-group
21757 Toggles the @code{allow-fast} parameters for group under cursor
21758 (@code{nnmairix-group-toggle-allowfast-this-group}).  The default
21759 behavior of @code{nnmairix} is to do a mairix search every time you
21760 update or enter the group.  With the @code{allow-fast} parameter set,
21761 mairix will only be called when you explicitly update the group, but not
21762 upon entering.  This makes entering the group faster, but it may also
21763 lead to dangling symlinks if something changed between updating and
21764 entering the group which is not yet in the mairix database.
21765
21766 @item G b p
21767 @kindex G b p (Group)
21768 @findex nnmairix-group-toggle-propmarks-this-group
21769 Toggle marks propagation for this group
21770 (@code{nnmairix-group-toggle-propmarks-this-group}).  (@pxref{Propagating
21771 marks}).
21772
21773 @item G b o
21774 @kindex G b o (Group)
21775 @findex nnmairix-propagate-marks
21776 Manually propagate marks (@code{nnmairix-propagate-marks}); needed only when
21777 @code{nnmairix-propagate-marks-upon-close} is set to @code{nil}.
21778
21779 @end table
21780
21781 In summary mode:
21782
21783 @table @kbd
21784
21785 @item $ m
21786 @kindex $ m (Summary)
21787 @findex nnmairix-widget-search-from-this-article
21788 Allows you to create a mairix query or group based on the current
21789 message using graphical widgets (same as @code{nnmairix-widget-search})
21790 (@code{nnmairix-widget-search-from-this-article}).
21791
21792 @item $ g
21793 @kindex $ g (Summary)
21794 @findex nnmairix-create-search-group-from-message
21795 Interactively creates a new search group with query based on the current
21796 message, but uses the minibuffer instead of graphical widgets
21797 (@code{nnmairix-create-search-group-from-message}).
21798
21799 @item $ t
21800 @kindex $ t (Summary)
21801 @findex nnmairix-search-thread-this-article
21802 Searches thread for the current article
21803 (@code{nnmairix-search-thread-this-article}).  This is effectively a
21804 shortcut for calling @code{nnmairix-search} with @samp{m:msgid} of the
21805 current article and enabled threads.
21806
21807 @item $ f
21808 @kindex $ f (Summary)
21809 @findex nnmairix-search-from-this-article
21810 Searches all messages from sender of the current article
21811 (@code{nnmairix-search-from-this-article}).  This is a shortcut for
21812 calling @code{nnmairix-search} with @samp{f:From}.
21813
21814 @item $ o
21815 @kindex $ o (Summary)
21816 @findex nnmairix-goto-original-article
21817 (Only in @code{nnmairix} groups!) Tries determine the group this article
21818 originally came from and displays the article in this group, so that
21819 e.g. replying to this article the correct posting styles/group
21820 parameters are applied (@code{nnmairix-goto-original-article}).  This
21821 function will use the registry if available, but can also parse the
21822 article file name as a fallback method.
21823
21824 @item $ u
21825 @kindex $ u (Summary)
21826 @findex nnmairix-remove-tick-mark-original-article
21827 Remove possibly existing tick mark from original article
21828 (@code{nnmairix-remove-tick-mark-original-article}).  (@pxref{nnmairix
21829 tips and tricks}).
21830
21831 @end table
21832
21833 @node Propagating marks
21834 @subsection Propagating marks
21835
21836 First of: you really need a patched mairix binary for using the marks
21837 propagation feature efficiently. Otherwise, you would have to update
21838 the mairix database all the time. You can get the patch at
21839
21840 @uref{http://www.randomsample.de/mairix-maildir-patch.tar}
21841
21842 You need the mairix v0.21 source code for this patch; everything else
21843 is explained in the accompanied readme file. If you don't want to use
21844 marks propagation, you don't have to apply these patches, but they also
21845 fix some annoyances regarding changing maildir flags, so it might still
21846 be useful to you.
21847
21848 With the patched mairix binary, you can use @code{nnmairix} as an
21849 alternative to mail splitting (@pxref{Fancy Mail Splitting}). For
21850 example, instead of splitting all mails from @samp{david@@foobar.com}
21851 into a group, you can simply create a search group with the query
21852 @samp{f:david@@foobar.com}. This is actually what ``smart folders'' are
21853 all about: simply put everything in one mail folder and dynamically
21854 create searches instead of splitting. This is more flexible, since you
21855 can dynamically change your folders any time you want to. This also
21856 implies that you will usually read your mails in the @code{nnmairix}
21857 groups instead of your ``real'' mail groups.
21858
21859 There is one problem, though: say you got a new mail from
21860 @samp{david@@foobar.com}; it will now show up in two groups, the
21861 ``real'' group (your INBOX, for example) and in the @code{nnmairix}
21862 search group (provided you have updated the mairix database). Now you
21863 enter the @code{nnmairix} group and read the mail. The mail will be
21864 marked as read, but only in the @code{nnmairix} group---in the ``real''
21865 mail group it will be still shown as unread.
21866
21867 You could now catch up the mail group (@pxref{Group Data}), but this is
21868 tedious and error prone, since you may overlook mails you don't have
21869 created @code{nnmairix} groups for. Of course, you could first use
21870 @code{nnmairix-goto-original-article} (@pxref{nnmairix keyboard
21871 shortcuts}) and then read the mail in the original group, but that's
21872 even more cumbersome.
21873
21874 Clearly, the easiest way would be if marks could somehow be
21875 automatically set for the original article. This is exactly what
21876 @emph{marks propagation} is about.
21877
21878 Marks propagation is deactivated by default. You can activate it for a
21879 certain @code{nnmairix} group with
21880 @code{nnmairix-group-toggle-propmarks-this-group} (bound to @kbd{G b
21881 p}). This function will warn you if you try to use it with your default
21882 search group; the reason is that the default search group is used for
21883 temporary searches, and it's easy to accidentally propagate marks from
21884 this group. However, you can ignore this warning if you really want to.
21885
21886 With marks propagation enabled, all the marks you set in a @code{nnmairix}
21887 group should now be propagated to the original article. For example,
21888 you can now tick an article (by default with @kbd{!}) and this mark should
21889 magically be set for the original article, too.
21890
21891 A few more remarks which you may or may not want to know:
21892
21893 @vindex nnmairix-propagate-marks-upon-close
21894 Marks will not be set immediately, but only upon closing a group. This
21895 not only makes marks propagation faster, it also avoids problems with
21896 dangling symlinks when dealing with maildir files (since changing flags
21897 will change the file name). You can also control when to propagate marks
21898 via @code{nnmairix-propagate-marks-upon-close} (see the doc-string for
21899 details).
21900
21901 Obviously, @code{nnmairix} will have to look up the original group for every
21902 article you want to set marks for. If available, @code{nnmairix} will first use
21903 the registry for determining the original group. The registry is very
21904 fast, hence you should really, really enable the registry when using
21905 marks propagation. If you don't have to worry about RAM and disc space,
21906 set @code{gnus-registry-max-entries} to a large enough value; to be on
21907 the safe side, choose roughly the amount of mails you index with mairix.
21908
21909 @vindex nnmairix-only-use-registry
21910 If you don't want to use the registry or the registry hasn't seen the
21911 original article yet, @code{nnmairix} will use an additional mairix
21912 search for determining the file name of the article. This, of course, is
21913 way slower than the registry---if you set hundreds or even thousands of
21914 marks this way, it might take some time. You can avoid this situation by
21915 setting @code{nnmairix-only-use-registry} to t.
21916
21917 Maybe you also want to propagate marks the other way round, i.e. if you
21918 tick an article in a "real" mail group, you'd like to have the same
21919 article in a @code{nnmairix} group ticked, too. For several good
21920 reasons, this can only be done efficiently if you use maildir. To
21921 immediately contradict myself, let me mention that it WON'T work with
21922 @code{nnmaildir}, since @code{nnmaildir} stores the marks externally and
21923 not in the file name. Therefore, propagating marks to @code{nnmairix}
21924 groups will usually only work if you use an IMAP server which uses
21925 maildir as its file format.
21926
21927 @vindex nnmairix-propagate-marks-to-nnmairix-groups
21928 If you work with this setup, just set
21929 @code{nnmairix-propagate-marks-to-nnmairix-groups} to @code{t} and see what
21930 happens. If you don't like what you see, just set it to @code{nil} again. One
21931 problem might be that you get a wrong number of unread articles; this
21932 usually happens when you delete or expire articles in the original
21933 groups. When this happens, you can recreate the @code{nnmairix} group on the
21934 back end using @kbd{G b d}.
21935
21936 @node nnmairix tips and tricks
21937 @subsection nnmairix tips and tricks
21938
21939 @itemize
21940 @item
21941 Checking Mail
21942
21943 @findex nnmairix-update-groups
21944 I put all my important mail groups at group level 1. The mairix groups
21945 have group level 5, so they do not get checked at start up (@pxref{Group
21946 Levels}).
21947
21948 I use the following to check for mails:
21949
21950 @lisp
21951 (defun my-check-mail-mairix-update (level)
21952   (interactive "P")
21953   ;; if no prefix given, set level=1
21954   (gnus-group-get-new-news (or level 1))
21955   (nnmairix-update-groups "mairixsearch" t t)
21956   (gnus-group-list-groups))
21957
21958 (define-key gnus-group-mode-map "g" 'my-check-mail-mairix-update)
21959 @end lisp
21960
21961 Instead of @samp{"mairixsearch"} use the name of your @code{nnmairix}
21962 server. See the doc string for @code{nnmairix-update-groups} for
21963 details.
21964
21965 @item
21966 Example: search group for ticked articles
21967
21968 For example, you can create a group for all ticked articles, where the
21969 articles always stay unread:
21970
21971 Hit @kbd{G b g}, enter group name (e.g. @samp{important}), use
21972 @samp{F:f} as query and do not include threads.
21973
21974 Now activate marks propagation for this group by using @kbd{G b p}. Then
21975 activate the always-unread feature by using @kbd{G b r} twice.
21976
21977 So far so good---but how do you remove the tick marks in the @code{nnmairix}
21978 group?  There are two options: You may simply use
21979 @code{nnmairix-remove-tick-mark-original-article} (bound to @kbd{$ u}) to remove
21980 tick marks from the original article. The other possibility is to set
21981 @code{nnmairix-propagate-marks-to-nnmairix-groups} to @code{t}, but see the above
21982 comments about this option.  If it works for you, the tick marks should
21983 also exist in the @code{nnmairix} group and you can remove them as usual,
21984 e.g. by marking an article as read.
21985
21986 When you have removed a tick mark from the original article, this
21987 article should vanish from the @code{nnmairix} group after you have updated the
21988 mairix database and updated the group.  Fortunately, there is a function
21989 for doing exactly that: @code{nnmairix-update-groups}. See the previous code
21990 snippet and the doc string for details.
21991
21992 @item
21993 Dealing with auto-subscription of mail groups
21994
21995 As described before, all @code{nnmairix} groups are in fact stored on
21996 the mail back end in the form @samp{zz_mairix-<NAME>-<NUMBER>}. You can
21997 see them when you enter the back end server in the server buffer. You
21998 should not subscribe these groups! Unfortunately, these groups will
21999 usually get @emph{auto-subscribed} when you use @code{nnmaildir} or
22000 @code{nnml}, i.e. you will suddenly see groups of the form
22001 @samp{zz_mairix*} pop up in your group buffer. If this happens to you,
22002 simply kill these groups with C-k.  For avoiding this, turn off
22003 auto-subscription completely by setting the variable
22004 @code{gnus-auto-subscribed-groups} to @code{nil} (@pxref{Filtering New
22005 Groups}), or if you like to keep this feature use the following kludge
22006 for turning it off for all groups beginning with @samp{zz_}:
22007
22008 @lisp
22009 (setq gnus-auto-subscribed-groups
22010       "^\\(nnml\\|nnfolder\\|nnmbox\\|nnmh\\|nnbabyl\\|nnmaildir\\).*:\\([^z]\\|z$\\|\\z[^z]\\|zz$\\|zz[^_]\\|zz_$\\).*")
22011 @end lisp
22012
22013 @end itemize
22014
22015 @node nnmairix caveats
22016 @subsection nnmairix caveats
22017
22018 @itemize
22019 @item
22020 You can create a secondary @code{nnml} server just for nnmairix, but then
22021 you have to explicitly set the corresponding server variable
22022 @code{nnml-get-new-mail} to @code{nil}.  Otherwise, new mail might get
22023 put into this secondary server (and would never show up again).  Here's
22024 an example server definition:
22025
22026 @lisp
22027 (nnml "mairix" (nnml-directory "mairix") (nnml-get-new-mail nil))
22028 @end lisp
22029
22030 (The @code{nnmaildir} back end also has a server variabe
22031 @code{get-new-mail}, but its default value is @code{nil}, so you don't
22032 have to explicitly set it if you use a @code{nnmaildir} server just for
22033 mairix.)
22034
22035 @item
22036 If you use the Gnus registry: don't use the registry with
22037 @code{nnmairix} groups (put them in
22038 @code{gnus-registry-unfollowed-groups}).  Be @emph{extra careful} if
22039 you use @code{gnus-registry-split-fancy-with-parent}; mails which are
22040 split into @code{nnmairix} groups are usually gone for good as soon as
22041 you check the group for new mail (yes, it has happened to me...).
22042
22043 @item
22044 Therefore: @emph{Never ever} put ``real'' mails into @code{nnmairix}
22045 groups (you shouldn't be able to, anyway).
22046
22047 @item
22048 If you use the Gnus agent (@pxref{Gnus Unplugged}): don't agentize
22049 @code{nnmairix} groups (though I have no idea what happens if you do).
22050
22051 @item
22052 mairix does only support us-ascii characters.
22053
22054 @item
22055 @code{nnmairix} uses a rather brute force method to force Gnus to
22056 completely reread the group on the mail back end after mairix was
22057 called---it simply deletes and re-creates the group on the mail
22058 back end. So far, this has worked for me without any problems, and I
22059 don't see how @code{nnmairix} could delete other mail groups than its
22060 own, but anyway: you really should have a backup of your mail
22061 folders.
22062
22063 @item
22064 All necessary information is stored in the group parameters
22065 (@pxref{Group Parameters}). This has the advantage that no active file
22066 is needed, but also implies that when you kill a @code{nnmairix} group,
22067 it is gone for good.
22068
22069 @item
22070 @findex nnmairix-purge-old-groups
22071 If you create and kill a lot of @code{nnmairix} groups, the
22072 ``zz_mairix-*'' groups will accumulate on the mail back end server. To
22073 delete old groups which are no longer needed, call
22074 @code{nnmairix-purge-old-groups}. Note that this assumes that you don't
22075 save any ``real'' mail in folders of the form
22076 @code{zz_mairix-<NAME>-<NUMBER>}. You can change the prefix of
22077 @code{nnmairix} groups by changing the variable
22078 @code{nnmairix-group-prefix}.
22079
22080 @item
22081 The following only applies if you @emph{don't} use the mentioned patch
22082 for mairix (@pxref{Propagating marks}):
22083
22084 A problem can occur when using @code{nnmairix} with maildir folders and
22085 comes with the fact that maildir stores mail flags like @samp{Seen} or
22086 @samp{Replied} by appending chars @samp{S} and @samp{R} to the message
22087 file name, respectively. This implies that currently you would have to
22088 update the mairix database not only when new mail arrives, but also when
22089 mail flags are changing. The same applies to new mails which are indexed
22090 while they are still in the @samp{new} folder but then get moved to
22091 @samp{cur} when Gnus has seen the mail. If you don't update the database
22092 after this has happened, a mairix query can lead to symlinks pointing to
22093 non-existing files. In Gnus, these messages will usually appear with
22094 ``(none)'' entries in the header and can't be accessed. If this happens
22095 to you, using @kbd{G b u} and updating the group will usually fix this.
22096
22097 @end itemize
22098
22099 @iftex
22100 @iflatex
22101 @chapter Message
22102 @include message.texi
22103 @chapter Emacs MIME
22104 @include emacs-mime.texi
22105 @chapter Sieve
22106 @include sieve.texi
22107 @chapter PGG
22108 @include pgg.texi
22109 @chapter SASL
22110 @include sasl.texi
22111 @end iflatex
22112 @end iftex
22113
22114 @node Various
22115 @chapter Various
22116
22117 @menu
22118 * Process/Prefix::              A convention used by many treatment commands.
22119 * Interactive::                 Making Gnus ask you many questions.
22120 * Symbolic Prefixes::           How to supply some Gnus functions with options.
22121 * Formatting Variables::        You can specify what buffers should look like.
22122 * Window Layout::               Configuring the Gnus buffer windows.
22123 * Faces and Fonts::             How to change how faces look.
22124 * Compilation::                 How to speed Gnus up.
22125 * Mode Lines::                  Displaying information in the mode lines.
22126 * Highlighting and Menus::      Making buffers look all nice and cozy.
22127 * Daemons::                     Gnus can do things behind your back.
22128 * Undo::                        Some actions can be undone.
22129 * Predicate Specifiers::        Specifying predicates.
22130 * Moderation::                  What to do if you're a moderator.
22131 * Fetching a Group::            Starting Gnus just to read a group.
22132 * Image Enhancements::          Modern versions of Emacs/XEmacs can display images.
22133 * Fuzzy Matching::              What's the big fuzz?
22134 * Thwarting Email Spam::        Simple ways to avoid unsolicited commercial email.
22135 * Spam Package::                A package for filtering and processing spam.
22136 * The Gnus Registry::           A package for tracking messages by Message-ID.
22137 * Other modes::                 Interaction with other modes.
22138 * Various Various::             Things that are really various.
22139 @end menu
22140
22141
22142 @node Process/Prefix
22143 @section Process/Prefix
22144 @cindex process/prefix convention
22145
22146 Many functions, among them functions for moving, decoding and saving
22147 articles, use what is known as the @dfn{Process/Prefix convention}.
22148
22149 This is a method for figuring out what articles the user wants the
22150 command to be performed on.
22151
22152 It goes like this:
22153
22154 If the numeric prefix is N, perform the operation on the next N
22155 articles, starting with the current one.  If the numeric prefix is
22156 negative, perform the operation on the previous N articles, starting
22157 with the current one.
22158
22159 @vindex transient-mark-mode
22160 If @code{transient-mark-mode} in non-@code{nil} and the region is
22161 active, all articles in the region will be worked upon.
22162
22163 If there is no numeric prefix, but some articles are marked with the
22164 process mark, perform the operation on the articles marked with
22165 the process mark.
22166
22167 If there is neither a numeric prefix nor any articles marked with the
22168 process mark, just perform the operation on the current article.
22169
22170 Quite simple, really, but it needs to be made clear so that surprises
22171 are avoided.
22172
22173 Commands that react to the process mark will push the current list of
22174 process marked articles onto a stack and will then clear all process
22175 marked articles.  You can restore the previous configuration with the
22176 @kbd{M P y} command (@pxref{Setting Process Marks}).
22177
22178 @vindex gnus-summary-goto-unread
22179 One thing that seems to shock & horrify lots of people is that, for
22180 instance, @kbd{3 d} does exactly the same as @kbd{d} @kbd{d} @kbd{d}.
22181 Since each @kbd{d} (which marks the current article as read) by default
22182 goes to the next unread article after marking, this means that @kbd{3 d}
22183 will mark the next three unread articles as read, no matter what the
22184 summary buffer looks like.  Set @code{gnus-summary-goto-unread} to
22185 @code{nil} for a more straightforward action.
22186
22187 Many commands do not use the process/prefix convention.  All commands
22188 that do explicitly say so in this manual.  To apply the process/prefix
22189 convention to commands that do not use it, you can use the @kbd{M-&}
22190 command.  For instance, to mark all the articles in the group as
22191 expirable, you could say @kbd{M P b M-& E}.
22192
22193
22194 @node Interactive
22195 @section Interactive
22196 @cindex interaction
22197
22198 @table @code
22199
22200 @item gnus-novice-user
22201 @vindex gnus-novice-user
22202 If this variable is non-@code{nil}, you are either a newcomer to the
22203 World of Usenet, or you are very cautious, which is a nice thing to be,
22204 really.  You will be given questions of the type ``Are you sure you want
22205 to do this?'' before doing anything dangerous.  This is @code{t} by
22206 default.
22207
22208 @item gnus-expert-user
22209 @vindex gnus-expert-user
22210 If this variable is non-@code{nil}, you will seldom be asked any
22211 questions by Gnus.  It will simply assume you know what you're doing,
22212 no matter how strange.  For example, quitting Gnus, exiting a group
22213 without an update, catching up with a group, deleting expired
22214 articles, and replying by mail to a news message will not require
22215 confirmation.
22216
22217 @item gnus-interactive-catchup
22218 @vindex gnus-interactive-catchup
22219 Require confirmation before catching up a group if non-@code{nil}.  It
22220 is @code{t} by default.
22221
22222 @item gnus-interactive-exit
22223 @vindex gnus-interactive-exit
22224 Require confirmation before exiting Gnus.  This variable is @code{t} by
22225 default.
22226 @end table
22227
22228
22229 @node Symbolic Prefixes
22230 @section Symbolic Prefixes
22231 @cindex symbolic prefixes
22232
22233 Quite a lot of Emacs commands react to the (numeric) prefix.  For
22234 instance, @kbd{C-u 4 C-f} moves point four characters forward, and
22235 @kbd{C-u 9 0 0 I s s p} adds a permanent @code{Subject} substring score
22236 rule of 900 to the current article.
22237
22238 This is all nice and well, but what if you want to give a command some
22239 additional information?  Well, what most commands do is interpret the
22240 ``raw'' prefix in some special way.  @kbd{C-u 0 C-x C-s} means that one
22241 doesn't want a backup file to be created when saving the current buffer,
22242 for instance.  But what if you want to save without making a backup
22243 file, and you want Emacs to flash lights and play a nice tune at the
22244 same time?  You can't, and you're probably perfectly happy that way.
22245
22246 @kindex M-i (Summary)
22247 @findex gnus-symbolic-argument
22248 I'm not, so I've added a second prefix---the @dfn{symbolic prefix}.  The
22249 prefix key is @kbd{M-i} (@code{gnus-symbolic-argument}), and the next
22250 character typed in is the value.  You can stack as many @kbd{M-i}
22251 prefixes as you want.  @kbd{M-i a C-M-u} means ``feed the @kbd{C-M-u}
22252 command the symbolic prefix @code{a}''.  @kbd{M-i a M-i b C-M-u} means
22253 ``feed the @kbd{C-M-u} command the symbolic prefixes @code{a} and
22254 @code{b}''.  You get the drift.
22255
22256 Typing in symbolic prefixes to commands that don't accept them doesn't
22257 hurt, but it doesn't do any good either.  Currently not many Gnus
22258 functions make use of the symbolic prefix.
22259
22260 If you're interested in how Gnus implements this, @pxref{Extended
22261 Interactive}.
22262
22263
22264 @node Formatting Variables
22265 @section Formatting Variables
22266 @cindex formatting variables
22267
22268 Throughout this manual you've probably noticed lots of variables called
22269 things like @code{gnus-group-line-format} and
22270 @code{gnus-summary-mode-line-format}.  These control how Gnus is to
22271 output lines in the various buffers.  There's quite a lot of them.
22272 Fortunately, they all use the same syntax, so there's not that much to
22273 be annoyed by.
22274
22275 Here's an example format spec (from the group buffer): @samp{%M%S%5y:
22276 %(%g%)\n}.  We see that it is indeed extremely ugly, and that there are
22277 lots of percentages everywhere.
22278
22279 @menu
22280 * Formatting Basics::           A formatting variable is basically a format string.
22281 * Mode Line Formatting::        Some rules about mode line formatting variables.
22282 * Advanced Formatting::         Modifying output in various ways.
22283 * User-Defined Specs::          Having Gnus call your own functions.
22284 * Formatting Fonts::            Making the formatting look colorful and nice.
22285 * Positioning Point::           Moving point to a position after an operation.
22286 * Tabulation::                  Tabulating your output.
22287 * Wide Characters::             Dealing with wide characters.
22288 @end menu
22289
22290 Currently Gnus uses the following formatting variables:
22291 @code{gnus-group-line-format}, @code{gnus-summary-line-format},
22292 @code{gnus-server-line-format}, @code{gnus-topic-line-format},
22293 @code{gnus-group-mode-line-format},
22294 @code{gnus-summary-mode-line-format},
22295 @code{gnus-article-mode-line-format},
22296 @code{gnus-server-mode-line-format}, and
22297 @code{gnus-summary-pick-line-format}.
22298
22299 All these format variables can also be arbitrary elisp forms.  In that
22300 case, they will be @code{eval}ed to insert the required lines.
22301
22302 @kindex M-x gnus-update-format
22303 @findex gnus-update-format
22304 Gnus includes a command to help you while creating your own format
22305 specs.  @kbd{M-x gnus-update-format} will @code{eval} the current form,
22306 update the spec in question and pop you to a buffer where you can
22307 examine the resulting Lisp code to be run to generate the line.
22308
22309
22310
22311 @node Formatting Basics
22312 @subsection Formatting Basics
22313
22314 Each @samp{%} element will be replaced by some string or other when the
22315 buffer in question is generated.  @samp{%5y} means ``insert the @samp{y}
22316 spec, and pad with spaces to get a 5-character field''.
22317
22318 As with normal C and Emacs Lisp formatting strings, the numerical
22319 modifier between the @samp{%} and the formatting type character will
22320 @dfn{pad} the output so that it is always at least that long.
22321 @samp{%5y} will make the field always (at least) five characters wide by
22322 padding with spaces to the left.  If you say @samp{%-5y}, it will pad to
22323 the right instead.
22324
22325 You may also wish to limit the length of the field to protect against
22326 particularly wide values.  For that you can say @samp{%4,6y}, which
22327 means that the field will never be more than 6 characters wide and never
22328 less than 4 characters wide.
22329
22330 Also Gnus supports some extended format specifications, such as
22331 @samp{%&user-date;}.
22332
22333
22334 @node Mode Line Formatting
22335 @subsection Mode Line Formatting
22336
22337 Mode line formatting variables (e.g.,
22338 @code{gnus-summary-mode-line-format}) follow the same rules as other,
22339 buffer line oriented formatting variables (@pxref{Formatting Basics})
22340 with the following two differences:
22341
22342 @enumerate
22343
22344 @item
22345 There must be no newline (@samp{\n}) at the end.
22346
22347 @item
22348 The special @samp{%%b} spec can be used to display the buffer name.
22349 Well, it's no spec at all, really---@samp{%%} is just a way to quote
22350 @samp{%} to allow it to pass through the formatting machinery unmangled,
22351 so that Emacs receives @samp{%b}, which is something the Emacs mode line
22352 display interprets to mean ``show the buffer name''.  For a full list of
22353 mode line specs Emacs understands, see the documentation of the
22354 @code{mode-line-format} variable.
22355
22356 @end enumerate
22357
22358
22359 @node Advanced Formatting
22360 @subsection Advanced Formatting
22361
22362 It is frequently useful to post-process the fields in some way.
22363 Padding, limiting, cutting off parts and suppressing certain values can
22364 be achieved by using @dfn{tilde modifiers}.  A typical tilde spec might
22365 look like @samp{%~(cut 3)~(ignore "0")y}.
22366
22367 These are the valid modifiers:
22368
22369 @table @code
22370 @item pad
22371 @itemx pad-left
22372 Pad the field to the left with spaces until it reaches the required
22373 length.
22374
22375 @item pad-right
22376 Pad the field to the right with spaces until it reaches the required
22377 length.
22378
22379 @item max
22380 @itemx max-left
22381 Cut off characters from the left until it reaches the specified length.
22382
22383 @item max-right
22384 Cut off characters from the right until it reaches the specified
22385 length.
22386
22387 @item cut
22388 @itemx cut-left
22389 Cut off the specified number of characters from the left.
22390
22391 @item cut-right
22392 Cut off the specified number of characters from the right.
22393
22394 @item ignore
22395 Return an empty string if the field is equal to the specified value.
22396
22397 @item form
22398 Use the specified form as the field value when the @samp{@@} spec is
22399 used.
22400
22401 Here's an example:
22402
22403 @lisp
22404 "~(form (current-time-string))@@"
22405 @end lisp
22406
22407 @end table
22408
22409 Let's take an example.  The @samp{%o} spec in the summary mode lines
22410 will return a date in compact ISO8601 format---@samp{19960809T230410}.
22411 This is quite a mouthful, so we want to shave off the century number and
22412 the time, leaving us with a six-character date.  That would be
22413 @samp{%~(cut-left 2)~(max-right 6)~(pad 6)o}.  (Cutting is done before
22414 maxing, and we need the padding to ensure that the date is never less
22415 than 6 characters to make it look nice in columns.)
22416
22417 Ignoring is done first; then cutting; then maxing; and then as the very
22418 last operation, padding.
22419
22420 If you use lots of these advanced thingies, you'll find that Gnus gets
22421 quite slow.  This can be helped enormously by running @kbd{M-x
22422 gnus-compile} when you are satisfied with the look of your lines.
22423 @xref{Compilation}.
22424
22425
22426 @node User-Defined Specs
22427 @subsection User-Defined Specs
22428
22429 All the specs allow for inserting user defined specifiers---@samp{u}.
22430 The next character in the format string should be a letter.  Gnus
22431 will call the function @code{gnus-user-format-function-}@samp{X}, where
22432 @samp{X} is the letter following @samp{%u}.  The function will be passed
22433 a single parameter---what the parameter means depends on what buffer
22434 it's being called from.  The function should return a string, which will
22435 be inserted into the buffer just like information from any other
22436 specifier.  This function may also be called with dummy values, so it
22437 should protect against that.
22438
22439 Also Gnus supports extended user-defined specs, such as @samp{%u&foo;}.
22440 Gnus will call the function @code{gnus-user-format-function-}@samp{foo}.
22441
22442 You can also use tilde modifiers (@pxref{Advanced Formatting} to achieve
22443 much the same without defining new functions.  Here's an example:
22444 @samp{%~(form (count-lines (point-min) (point)))@@}.  The form
22445 given here will be evaluated to yield the current line number, and then
22446 inserted.
22447
22448
22449 @node Formatting Fonts
22450 @subsection Formatting Fonts
22451
22452 @cindex %(, %)
22453 @vindex gnus-mouse-face
22454 There are specs for highlighting, and these are shared by all the format
22455 variables.  Text inside the @samp{%(} and @samp{%)} specifiers will get
22456 the special @code{mouse-face} property set, which means that it will be
22457 highlighted (with @code{gnus-mouse-face}) when you put the mouse pointer
22458 over it.
22459
22460 @cindex %@{, %@}
22461 @vindex gnus-face-0
22462 Text inside the @samp{%@{} and @samp{%@}} specifiers will have their
22463 normal faces set using @code{gnus-face-0}, which is @code{bold} by
22464 default.  If you say @samp{%1@{}, you'll get @code{gnus-face-1} instead,
22465 and so on.  Create as many faces as you wish.  The same goes for the
22466 @code{mouse-face} specs---you can say @samp{%3(hello%)} to have
22467 @samp{hello} mouse-highlighted with @code{gnus-mouse-face-3}.
22468
22469 @cindex %<<, %>>, guillemets
22470 @c @cindex %<<, %>>, %«, %», guillemets
22471 @vindex gnus-balloon-face-0
22472 Text inside the @samp{%<<} and @samp{%>>} specifiers will get the
22473 special @code{balloon-help} property set to
22474 @code{gnus-balloon-face-0}.  If you say @samp{%1<<}, you'll get
22475 @code{gnus-balloon-face-1} and so on.  The @code{gnus-balloon-face-*}
22476 variables should be either strings or symbols naming functions that
22477 return a string.  When the mouse passes over text with this property
22478 set, a balloon window will appear and display the string.  Please
22479 refer to @ref{Tooltips, ,Tooltips, emacs, The Emacs Manual},
22480 (in GNU Emacs) or the doc string of @code{balloon-help-mode} (in
22481 XEmacs) for more information on this.  (For technical reasons, the
22482 guillemets have been approximated as @samp{<<} and @samp{>>} in this
22483 paragraph.)
22484
22485 Here's an alternative recipe for the group buffer:
22486
22487 @lisp
22488 ;; @r{Create three face types.}
22489 (setq gnus-face-1 'bold)
22490 (setq gnus-face-3 'italic)
22491
22492 ;; @r{We want the article count to be in}
22493 ;; @r{a bold and green face.  So we create}
22494 ;; @r{a new face called @code{my-green-bold}.}
22495 (copy-face 'bold 'my-green-bold)
22496 ;; @r{Set the color.}
22497 (set-face-foreground 'my-green-bold "ForestGreen")
22498 (setq gnus-face-2 'my-green-bold)
22499
22500 ;; @r{Set the new & fancy format.}
22501 (setq gnus-group-line-format
22502       "%M%S%3@{%5y%@}%2[:%] %(%1@{%g%@}%)\n")
22503 @end lisp
22504
22505 I'm sure you'll be able to use this scheme to create totally unreadable
22506 and extremely vulgar displays.  Have fun!
22507
22508 Note that the @samp{%(} specs (and friends) do not make any sense on the
22509 mode-line variables.
22510
22511 @node Positioning Point
22512 @subsection Positioning Point
22513
22514 Gnus usually moves point to a pre-defined place on each line in most
22515 buffers.  By default, point move to the first colon character on the
22516 line.  You can customize this behavior in three different ways.
22517
22518 You can move the colon character to somewhere else on the line.
22519
22520 @findex gnus-goto-colon
22521 You can redefine the function that moves the point to the colon.  The
22522 function is called @code{gnus-goto-colon}.
22523
22524 But perhaps the most convenient way to deal with this, if you don't want
22525 to have a colon in your line, is to use the @samp{%*} specifier.  If you
22526 put a @samp{%*} somewhere in your format line definition, Gnus will
22527 place point there.
22528
22529
22530 @node Tabulation
22531 @subsection Tabulation
22532
22533 You can usually line up your displays by padding and cutting your
22534 strings.  However, when combining various strings of different size, it
22535 can often be more convenient to just output the strings, and then worry
22536 about lining up the following text afterwards.
22537
22538 To do that, Gnus supplies tabulator specs---@samp{%=}.  There are two
22539 different types---@dfn{hard tabulators} and @dfn{soft tabulators}.
22540
22541 @samp{%50=} will insert space characters to pad the line up to column
22542 50.  If the text is already past column 50, nothing will be inserted.
22543 This is the soft tabulator.
22544
22545 @samp{%-50=} will insert space characters to pad the line up to column
22546 50.  If the text is already past column 50, the excess text past column
22547 50 will be removed.  This is the hard tabulator.
22548
22549
22550 @node Wide Characters
22551 @subsection Wide Characters
22552
22553 Fixed width fonts in most countries have characters of the same width.
22554 Some countries, however, use Latin characters mixed with wider
22555 characters---most notable East Asian countries.
22556
22557 The problem is that when formatting, Gnus assumes that if a string is 10
22558 characters wide, it'll be 10 Latin characters wide on the screen.  In
22559 these countries, that's not true.
22560
22561 @vindex gnus-use-correct-string-widths
22562 To help fix this, you can set @code{gnus-use-correct-string-widths} to
22563 @code{t}.  This makes buffer generation slower, but the results will be
22564 prettier.  The default value under XEmacs is @code{t} but @code{nil}
22565 for Emacs.
22566
22567
22568 @node Window Layout
22569 @section Window Layout
22570 @cindex window layout
22571
22572 No, there's nothing here about X, so be quiet.
22573
22574 @vindex gnus-use-full-window
22575 If @code{gnus-use-full-window} non-@code{nil}, Gnus will delete all
22576 other windows and occupy the entire Emacs screen by itself.  It is
22577 @code{t} by default.
22578
22579 Setting this variable to @code{nil} kinda works, but there are
22580 glitches.  Use at your own peril.
22581
22582 @vindex gnus-buffer-configuration
22583 @code{gnus-buffer-configuration} describes how much space each Gnus
22584 buffer should be given.  Here's an excerpt of this variable:
22585
22586 @lisp
22587 ((group (vertical 1.0 (group 1.0 point)))
22588  (article (vertical 1.0 (summary 0.25 point)
22589                         (article 1.0))))
22590 @end lisp
22591
22592 This is an alist.  The @dfn{key} is a symbol that names some action or
22593 other.  For instance, when displaying the group buffer, the window
22594 configuration function will use @code{group} as the key.  A full list of
22595 possible names is listed below.
22596
22597 The @dfn{value} (i.e., the @dfn{split}) says how much space each buffer
22598 should occupy.  To take the @code{article} split as an example -
22599
22600 @lisp
22601 (article (vertical 1.0 (summary 0.25 point)
22602                        (article 1.0)))
22603 @end lisp
22604
22605 This @dfn{split} says that the summary buffer should occupy 25% of upper
22606 half of the screen, and that it is placed over the article buffer.  As
22607 you may have noticed, 100% + 25% is actually 125% (yup, I saw y'all
22608 reaching for that calculator there).  However, the special number
22609 @code{1.0} is used to signal that this buffer should soak up all the
22610 rest of the space available after the rest of the buffers have taken
22611 whatever they need.  There should be only one buffer with the @code{1.0}
22612 size spec per split.
22613
22614 Point will be put in the buffer that has the optional third element
22615 @code{point}.  In a @code{frame} split, the last subsplit having a leaf
22616 split where the tag @code{frame-focus} is a member (i.e. is the third or
22617 fourth element in the list, depending on whether the @code{point} tag is
22618 present) gets focus.
22619
22620 Here's a more complicated example:
22621
22622 @lisp
22623 (article (vertical 1.0 (group 4)
22624                        (summary 0.25 point)
22625                        (article 1.0)))
22626 @end lisp
22627
22628 If the size spec is an integer instead of a floating point number,
22629 then that number will be used to say how many lines a buffer should
22630 occupy, not a percentage.
22631
22632 If the @dfn{split} looks like something that can be @code{eval}ed (to be
22633 precise---if the @code{car} of the split is a function or a subr), this
22634 split will be @code{eval}ed.  If the result is non-@code{nil}, it will
22635 be used as a split.
22636
22637 Not complicated enough for you?  Well, try this on for size:
22638
22639 @lisp
22640 (article (horizontal 1.0
22641              (vertical 0.5
22642                  (group 1.0))
22643              (vertical 1.0
22644                  (summary 0.25 point)
22645                  (article 1.0))))
22646 @end lisp
22647
22648 Whoops.  Two buffers with the mystery 100% tag.  And what's that
22649 @code{horizontal} thingie?
22650
22651 If the first element in one of the split is @code{horizontal}, Gnus will
22652 split the window horizontally, giving you two windows side-by-side.
22653 Inside each of these strips you may carry on all you like in the normal
22654 fashion.  The number following @code{horizontal} says what percentage of
22655 the screen is to be given to this strip.
22656
22657 For each split, there @emph{must} be one element that has the 100% tag.
22658 The splitting is never accurate, and this buffer will eat any leftover
22659 lines from the splits.
22660
22661 To be slightly more formal, here's a definition of what a valid split
22662 may look like:
22663
22664 @example
22665 @group
22666 split      = frame | horizontal | vertical | buffer | form
22667 frame      = "(frame " size *split ")"
22668 horizontal = "(horizontal " size *split ")"
22669 vertical   = "(vertical " size *split ")"
22670 buffer     = "(" buf-name " " size *[ "point" ] *[ "frame-focus"] ")"
22671 size       = number | frame-params
22672 buf-name   = group | article | summary ...
22673 @end group
22674 @end example
22675
22676 The limitations are that the @code{frame} split can only appear as the
22677 top-level split.  @var{form} should be an Emacs Lisp form that should
22678 return a valid split.  We see that each split is fully recursive, and
22679 may contain any number of @code{vertical} and @code{horizontal} splits.
22680
22681 @vindex gnus-window-min-width
22682 @vindex gnus-window-min-height
22683 @cindex window height
22684 @cindex window width
22685 Finding the right sizes can be a bit complicated.  No window may be less
22686 than @code{gnus-window-min-height} (default 1) characters high, and all
22687 windows must be at least @code{gnus-window-min-width} (default 1)
22688 characters wide.  Gnus will try to enforce this before applying the
22689 splits.  If you want to use the normal Emacs window width/height limit,
22690 you can just set these two variables to @code{nil}.
22691
22692 If you're not familiar with Emacs terminology, @code{horizontal} and
22693 @code{vertical} splits may work the opposite way of what you'd expect.
22694 Windows inside a @code{horizontal} split are shown side-by-side, and
22695 windows within a @code{vertical} split are shown above each other.
22696
22697 @findex gnus-configure-frame
22698 If you want to experiment with window placement, a good tip is to call
22699 @code{gnus-configure-frame} directly with a split.  This is the function
22700 that does all the real work when splitting buffers.  Below is a pretty
22701 nonsensical configuration with 5 windows; two for the group buffer and
22702 three for the article buffer.  (I said it was nonsensical.)  If you
22703 @code{eval} the statement below, you can get an idea of how that would
22704 look straight away, without going through the normal Gnus channels.
22705 Play with it until you're satisfied, and then use
22706 @code{gnus-add-configuration} to add your new creation to the buffer
22707 configuration list.
22708
22709 @lisp
22710 (gnus-configure-frame
22711  '(horizontal 1.0
22712     (vertical 10
22713       (group 1.0)
22714       (article 0.3 point))
22715     (vertical 1.0
22716       (article 1.0)
22717       (horizontal 4
22718         (group 1.0)
22719         (article 10)))))
22720 @end lisp
22721
22722 You might want to have several frames as well.  No prob---just use the
22723 @code{frame} split:
22724
22725 @lisp
22726 (gnus-configure-frame
22727  '(frame 1.0
22728          (vertical 1.0
22729                    (summary 0.25 point frame-focus)
22730                    (article 1.0))
22731          (vertical ((height . 5) (width . 15)
22732                     (user-position . t)
22733                     (left . -1) (top . 1))
22734                    (picon 1.0))))
22735
22736 @end lisp
22737
22738 This split will result in the familiar summary/article window
22739 configuration in the first (or ``main'') frame, while a small additional
22740 frame will be created where picons will be shown.  As you can see,
22741 instead of the normal @code{1.0} top-level spec, each additional split
22742 should have a frame parameter alist as the size spec.
22743 @xref{Frame Parameters, , Frame Parameters, elisp, The GNU Emacs Lisp
22744 Reference Manual}.  Under XEmacs, a frame property list will be
22745 accepted, too---for instance, @code{(height 5 width 15 left -1 top 1)}
22746 is such a plist.
22747 The list of all possible keys for @code{gnus-buffer-configuration} can
22748 be found in its default value.
22749
22750 Note that the @code{message} key is used for both
22751 @code{gnus-group-mail} and @code{gnus-summary-mail-other-window}.  If
22752 it is desirable to distinguish between the two, something like this
22753 might be used:
22754
22755 @lisp
22756 (message (horizontal 1.0
22757                      (vertical 1.0 (message 1.0 point))
22758                      (vertical 0.24
22759                                (if (buffer-live-p gnus-summary-buffer)
22760                                    '(summary 0.5))
22761                                (group 1.0))))
22762 @end lisp
22763
22764 One common desire for a multiple frame split is to have a separate frame
22765 for composing mail and news while leaving the original frame intact.  To
22766 accomplish that, something like the following can be done:
22767
22768 @lisp
22769 (message
22770   (frame 1.0
22771          (if (not (buffer-live-p gnus-summary-buffer))
22772              (car (cdr (assoc 'group gnus-buffer-configuration)))
22773            (car (cdr (assoc 'summary gnus-buffer-configuration))))
22774          (vertical ((user-position . t) (top . 1) (left . 1)
22775                     (name . "Message"))
22776                    (message 1.0 point))))
22777 @end lisp
22778
22779 @findex gnus-add-configuration
22780 Since the @code{gnus-buffer-configuration} variable is so long and
22781 complicated, there's a function you can use to ease changing the config
22782 of a single setting: @code{gnus-add-configuration}.  If, for instance,
22783 you want to change the @code{article} setting, you could say:
22784
22785 @lisp
22786 (gnus-add-configuration
22787  '(article (vertical 1.0
22788                (group 4)
22789                (summary .25 point)
22790                (article 1.0))))
22791 @end lisp
22792
22793 You'd typically stick these @code{gnus-add-configuration} calls in your
22794 @file{~/.gnus.el} file or in some startup hook---they should be run after
22795 Gnus has been loaded.
22796
22797 @vindex gnus-always-force-window-configuration
22798 If all windows mentioned in the configuration are already visible, Gnus
22799 won't change the window configuration.  If you always want to force the
22800 ``right'' window configuration, you can set
22801 @code{gnus-always-force-window-configuration} to non-@code{nil}.
22802
22803 If you're using tree displays (@pxref{Tree Display}), and the tree
22804 window is displayed vertically next to another window, you may also want
22805 to fiddle with @code{gnus-tree-minimize-window} to avoid having the
22806 windows resized.
22807
22808 @subsection Example Window Configurations
22809
22810 @itemize @bullet
22811 @item
22812 Narrow left hand side occupied by group buffer.  Right hand side split
22813 between summary buffer (top one-sixth) and article buffer (bottom).
22814
22815 @ifinfo
22816 @example
22817 +---+---------+
22818 | G | Summary |
22819 | r +---------+
22820 | o |         |
22821 | u | Article |
22822 | p |         |
22823 +---+---------+
22824 @end example
22825 @end ifinfo
22826
22827 @lisp
22828 (gnus-add-configuration
22829  '(article
22830    (horizontal 1.0
22831                (vertical 25 (group 1.0))
22832                (vertical 1.0
22833                          (summary 0.16 point)
22834                          (article 1.0)))))
22835
22836 (gnus-add-configuration
22837  '(summary
22838    (horizontal 1.0
22839                (vertical 25 (group 1.0))
22840                (vertical 1.0 (summary 1.0 point)))))
22841 @end lisp
22842
22843 @end itemize
22844
22845
22846 @node Faces and Fonts
22847 @section Faces and Fonts
22848 @cindex faces
22849 @cindex fonts
22850 @cindex colors
22851
22852 Fiddling with fonts and faces used to be very difficult, but these days
22853 it is very simple.  You simply say @kbd{M-x customize-face}, pick out
22854 the face you want to alter, and alter it via the standard Customize
22855 interface.
22856
22857
22858 @node Compilation
22859 @section Compilation
22860 @cindex compilation
22861 @cindex byte-compilation
22862
22863 @findex gnus-compile
22864
22865 Remember all those line format specification variables?
22866 @code{gnus-summary-line-format}, @code{gnus-group-line-format}, and so
22867 on.  Now, Gnus will of course heed whatever these variables are, but,
22868 unfortunately, changing them will mean a quite significant slow-down.
22869 (The default values of these variables have byte-compiled functions
22870 associated with them, while the user-generated versions do not, of
22871 course.)
22872
22873 To help with this, you can run @kbd{M-x gnus-compile} after you've
22874 fiddled around with the variables and feel that you're (kind of)
22875 satisfied.  This will result in the new specs being byte-compiled, and
22876 you'll get top speed again.  Gnus will save these compiled specs in the
22877 @file{.newsrc.eld} file.  (User-defined functions aren't compiled by
22878 this function, though---you should compile them yourself by sticking
22879 them into the @file{~/.gnus.el} file and byte-compiling that file.)
22880
22881
22882 @node Mode Lines
22883 @section Mode Lines
22884 @cindex mode lines
22885
22886 @vindex gnus-updated-mode-lines
22887 @code{gnus-updated-mode-lines} says what buffers should keep their mode
22888 lines updated.  It is a list of symbols.  Supported symbols include
22889 @code{group}, @code{article}, @code{summary}, @code{server},
22890 @code{browse}, and @code{tree}.  If the corresponding symbol is present,
22891 Gnus will keep that mode line updated with information that may be
22892 pertinent.  If this variable is @code{nil}, screen refresh may be
22893 quicker.
22894
22895 @cindex display-time
22896
22897 @vindex gnus-mode-non-string-length
22898 By default, Gnus displays information on the current article in the mode
22899 lines of the summary and article buffers.  The information Gnus wishes
22900 to display (e.g. the subject of the article) is often longer than the
22901 mode lines, and therefore have to be cut off at some point.  The
22902 @code{gnus-mode-non-string-length} variable says how long the other
22903 elements on the line is (i.e., the non-info part).  If you put
22904 additional elements on the mode line (e.g. a clock), you should modify
22905 this variable:
22906
22907 @c Hook written by Francesco Potorti` <pot@cnuce.cnr.it>
22908 @lisp
22909 (add-hook 'display-time-hook
22910           (lambda () (setq gnus-mode-non-string-length
22911                            (+ 21
22912                               (if line-number-mode 5 0)
22913                               (if column-number-mode 4 0)
22914                               (length display-time-string)))))
22915 @end lisp
22916
22917 If this variable is @code{nil} (which is the default), the mode line
22918 strings won't be chopped off, and they won't be padded either.  Note
22919 that the default is unlikely to be desirable, as even the percentage
22920 complete in the buffer may be crowded off the mode line; the user should
22921 configure this variable appropriately for her configuration.
22922
22923
22924 @node Highlighting and Menus
22925 @section Highlighting and Menus
22926 @cindex visual
22927 @cindex highlighting
22928 @cindex menus
22929
22930 @vindex gnus-visual
22931 The @code{gnus-visual} variable controls most of the Gnus-prettifying
22932 aspects.  If @code{nil}, Gnus won't attempt to create menus or use fancy
22933 colors or fonts.  This will also inhibit loading the @file{gnus-vis.el}
22934 file.
22935
22936 This variable can be a list of visual properties that are enabled.  The
22937 following elements are valid, and are all included by default:
22938
22939 @table @code
22940 @item group-highlight
22941 Do highlights in the group buffer.
22942 @item summary-highlight
22943 Do highlights in the summary buffer.
22944 @item article-highlight
22945 Do highlights in the article buffer.
22946 @item highlight
22947 Turn on highlighting in all buffers.
22948 @item group-menu
22949 Create menus in the group buffer.
22950 @item summary-menu
22951 Create menus in the summary buffers.
22952 @item article-menu
22953 Create menus in the article buffer.
22954 @item browse-menu
22955 Create menus in the browse buffer.
22956 @item server-menu
22957 Create menus in the server buffer.
22958 @item score-menu
22959 Create menus in the score buffers.
22960 @item menu
22961 Create menus in all buffers.
22962 @end table
22963
22964 So if you only want highlighting in the article buffer and menus in all
22965 buffers, you could say something like:
22966
22967 @lisp
22968 (setq gnus-visual '(article-highlight menu))
22969 @end lisp
22970
22971 If you want highlighting only and no menus whatsoever, you'd say:
22972
22973 @lisp
22974 (setq gnus-visual '(highlight))
22975 @end lisp
22976
22977 If @code{gnus-visual} is @code{t}, highlighting and menus will be used
22978 in all Gnus buffers.
22979
22980 Other general variables that influence the look of all buffers include:
22981
22982 @table @code
22983 @item gnus-mouse-face
22984 @vindex gnus-mouse-face
22985 This is the face (i.e., font) used for mouse highlighting in Gnus.  No
22986 mouse highlights will be done if @code{gnus-visual} is @code{nil}.
22987
22988 @end table
22989
22990 There are hooks associated with the creation of all the different menus:
22991
22992 @table @code
22993
22994 @item gnus-article-menu-hook
22995 @vindex gnus-article-menu-hook
22996 Hook called after creating the article mode menu.
22997
22998 @item gnus-group-menu-hook
22999 @vindex gnus-group-menu-hook
23000 Hook called after creating the group mode menu.
23001
23002 @item gnus-summary-menu-hook
23003 @vindex gnus-summary-menu-hook
23004 Hook called after creating the summary mode menu.
23005
23006 @item gnus-server-menu-hook
23007 @vindex gnus-server-menu-hook
23008 Hook called after creating the server mode menu.
23009
23010 @item gnus-browse-menu-hook
23011 @vindex gnus-browse-menu-hook
23012 Hook called after creating the browse mode menu.
23013
23014 @item gnus-score-menu-hook
23015 @vindex gnus-score-menu-hook
23016 Hook called after creating the score mode menu.
23017
23018 @end table
23019
23020
23021 @node Daemons
23022 @section Daemons
23023 @cindex demons
23024 @cindex daemons
23025
23026 Gnus, being larger than any program ever written (allegedly), does lots
23027 of strange stuff that you may wish to have done while you're not
23028 present.  For instance, you may want it to check for new mail once in a
23029 while.  Or you may want it to close down all connections to all servers
23030 when you leave Emacs idle.  And stuff like that.
23031
23032 Gnus will let you do stuff like that by defining various
23033 @dfn{handlers}.  Each handler consists of three elements:  A
23034 @var{function}, a @var{time}, and an @var{idle} parameter.
23035
23036 Here's an example of a handler that closes connections when Emacs has
23037 been idle for thirty minutes:
23038
23039 @lisp
23040 (gnus-demon-close-connections nil 30)
23041 @end lisp
23042
23043 Here's a handler that scans for @acronym{PGP} headers every hour when
23044 Emacs is idle:
23045
23046 @lisp
23047 (gnus-demon-scan-pgp 60 t)
23048 @end lisp
23049
23050 This @var{time} parameter and that @var{idle} parameter work together
23051 in a strange, but wonderful fashion.  Basically, if @var{idle} is
23052 @code{nil}, then the function will be called every @var{time} minutes.
23053
23054 If @var{idle} is @code{t}, then the function will be called after
23055 @var{time} minutes only if Emacs is idle.  So if Emacs is never idle,
23056 the function will never be called.  But once Emacs goes idle, the
23057 function will be called every @var{time} minutes.
23058
23059 If @var{idle} is a number and @var{time} is a number, the function will
23060 be called every @var{time} minutes only when Emacs has been idle for
23061 @var{idle} minutes.
23062
23063 If @var{idle} is a number and @var{time} is @code{nil}, the function
23064 will be called once every time Emacs has been idle for @var{idle}
23065 minutes.
23066
23067 And if @var{time} is a string, it should look like @samp{07:31}, and
23068 the function will then be called once every day somewhere near that
23069 time.  Modified by the @var{idle} parameter, of course.
23070
23071 @vindex gnus-demon-timestep
23072 (When I say ``minute'' here, I really mean @code{gnus-demon-timestep}
23073 seconds.  This is 60 by default.  If you change that variable,
23074 all the timings in the handlers will be affected.)
23075
23076 So, if you want to add a handler, you could put something like this in
23077 your @file{~/.gnus.el} file:
23078
23079 @findex gnus-demon-add-handler
23080 @lisp
23081 (gnus-demon-add-handler 'gnus-demon-close-connections 30 t)
23082 @end lisp
23083
23084 @findex gnus-demon-add-scanmail
23085 @findex gnus-demon-add-rescan
23086 @findex gnus-demon-add-scan-timestamps
23087 @findex gnus-demon-add-disconnection
23088 Some ready-made functions to do this have been created:
23089 @code{gnus-demon-add-disconnection},
23090 @code{gnus-demon-add-nntp-close-connection},
23091 @code{gnus-demon-add-scan-timestamps}, @code{gnus-demon-add-rescan}, and
23092 @code{gnus-demon-add-scanmail}.  Just put those functions in your
23093 @file{~/.gnus.el} if you want those abilities.
23094
23095 @findex gnus-demon-init
23096 @findex gnus-demon-cancel
23097 @vindex gnus-demon-handlers
23098 If you add handlers to @code{gnus-demon-handlers} directly, you should
23099 run @code{gnus-demon-init} to make the changes take hold.  To cancel all
23100 daemons, you can use the @code{gnus-demon-cancel} function.
23101
23102 Note that adding daemons can be pretty naughty if you over do it.  Adding
23103 functions that scan all news and mail from all servers every two seconds
23104 is a sure-fire way of getting booted off any respectable system.  So
23105 behave.
23106
23107
23108 @node Undo
23109 @section Undo
23110 @cindex undo
23111
23112 It is very useful to be able to undo actions one has done.  In normal
23113 Emacs buffers, it's easy enough---you just push the @code{undo} button.
23114 In Gnus buffers, however, it isn't that simple.
23115
23116 The things Gnus displays in its buffer is of no value whatsoever to
23117 Gnus---it's all just data designed to look nice to the user.
23118 Killing a group in the group buffer with @kbd{C-k} makes the line
23119 disappear, but that's just a side-effect of the real action---the
23120 removal of the group in question from the internal Gnus structures.
23121 Undoing something like that can't be done by the normal Emacs
23122 @code{undo} function.
23123
23124 Gnus tries to remedy this somewhat by keeping track of what the user
23125 does and coming up with actions that would reverse the actions the user
23126 takes.  When the user then presses the @code{undo} key, Gnus will run
23127 the code to reverse the previous action, or the previous actions.
23128 However, not all actions are easily reversible, so Gnus currently offers
23129 a few key functions to be undoable.  These include killing groups,
23130 yanking groups, and changing the list of read articles of groups.
23131 That's it, really.  More functions may be added in the future, but each
23132 added function means an increase in data to be stored, so Gnus will
23133 never be totally undoable.
23134
23135 @findex gnus-undo-mode
23136 @vindex gnus-use-undo
23137 @findex gnus-undo
23138 The undoability is provided by the @code{gnus-undo-mode} minor mode.  It
23139 is used if @code{gnus-use-undo} is non-@code{nil}, which is the
23140 default.  The @kbd{C-M-_} key performs the @code{gnus-undo}
23141 command, which should feel kinda like the normal Emacs @code{undo}
23142 command.
23143
23144
23145 @node Predicate Specifiers
23146 @section Predicate Specifiers
23147 @cindex predicate specifiers
23148
23149 Some Gnus variables are @dfn{predicate specifiers}.  This is a special
23150 form that allows flexible specification of predicates without having
23151 to type all that much.
23152
23153 These specifiers are lists consisting of functions, symbols and lists.
23154
23155 Here's an example:
23156
23157 @lisp
23158 (or gnus-article-unseen-p
23159     gnus-article-unread-p)
23160 @end lisp
23161
23162 The available symbols are @code{or}, @code{and} and @code{not}.  The
23163 functions all take one parameter.
23164
23165 @findex gnus-make-predicate
23166 Internally, Gnus calls @code{gnus-make-predicate} on these specifiers
23167 to create a function that can be called.  This input parameter to this
23168 function will be passed along to all the functions in the predicate
23169 specifier.
23170
23171
23172 @node Moderation
23173 @section Moderation
23174 @cindex moderation
23175
23176 If you are a moderator, you can use the @file{gnus-mdrtn.el} package.
23177 It is not included in the standard Gnus package.  Write a mail to
23178 @samp{larsi@@gnus.org} and state what group you moderate, and you'll
23179 get a copy.
23180
23181 The moderation package is implemented as a minor mode for summary
23182 buffers.  Put
23183
23184 @lisp
23185 (add-hook 'gnus-summary-mode-hook 'gnus-moderate)
23186 @end lisp
23187
23188 in your @file{~/.gnus.el} file.
23189
23190 If you are the moderator of @samp{rec.zoofle}, this is how it's
23191 supposed to work:
23192
23193 @enumerate
23194 @item
23195 You split your incoming mail by matching on
23196 @samp{Newsgroups:.*rec.zoofle}, which will put all the to-be-posted
23197 articles in some mail group---for instance, @samp{nnml:rec.zoofle}.
23198
23199 @item
23200 You enter that group once in a while and post articles using the @kbd{e}
23201 (edit-and-post) or @kbd{s} (just send unedited) commands.
23202
23203 @item
23204 If, while reading the @samp{rec.zoofle} newsgroup, you happen upon some
23205 articles that weren't approved by you, you can cancel them with the
23206 @kbd{c} command.
23207 @end enumerate
23208
23209 To use moderation mode in these two groups, say:
23210
23211 @lisp
23212 (setq gnus-moderated-list
23213       "^nnml:rec.zoofle$\\|^rec.zoofle$")
23214 @end lisp
23215
23216
23217 @node Fetching a Group
23218 @section Fetching a Group
23219 @cindex fetching a group
23220
23221 @findex gnus-fetch-group
23222 It is sometimes convenient to be able to just say ``I want to read this
23223 group and I don't care whether Gnus has been started or not''.  This is
23224 perhaps more useful for people who write code than for users, but the
23225 command @code{gnus-fetch-group} provides this functionality in any case.
23226 It takes the group name as a parameter.
23227
23228
23229 @node Image Enhancements
23230 @section Image Enhancements
23231
23232 XEmacs, as well as Emacs 21@footnote{Emacs 21 on MS Windows doesn't
23233 support images, Emacs 22 does.} and up, are able to display pictures and
23234 stuff, so Gnus has taken advantage of that.
23235
23236 @menu
23237 * X-Face::                      Display a funky, teensy black-and-white image.
23238 * Face::                        Display a funkier, teensier colored image.
23239 * Smileys::                     Show all those happy faces the way they were meant to be shown.
23240 * Picons::                      How to display pictures of what you're reading.
23241 * Gravatars::                   Display the avatar of people you read.
23242 * XVarious::                    Other XEmacsy Gnusey variables.
23243 @end menu
23244
23245
23246 @node X-Face
23247 @subsection X-Face
23248 @cindex x-face
23249
23250 @code{X-Face} headers describe a 48x48 pixel black-and-white (1 bit
23251 depth) image that's supposed to represent the author of the message.
23252 It seems to be supported by an ever-growing number of mail and news
23253 readers.
23254
23255 @cindex x-face
23256 @findex gnus-article-display-x-face
23257 @vindex gnus-article-x-face-command
23258 @vindex gnus-article-x-face-too-ugly
23259 @iftex
23260 @iflatex
23261 \include{xface}
23262 @end iflatex
23263 @end iftex
23264 @c @anchor{X-Face}
23265
23266 Viewing an @code{X-Face} header either requires an Emacs that has
23267 @samp{compface} support (which most XEmacs versions have), or that you
23268 have suitable conversion or display programs installed.  If your Emacs
23269 has image support the default action is to display the face before the
23270 @code{From} header.  If there's no native @code{X-Face} support, Gnus
23271 will try to convert the @code{X-Face} header using external programs
23272 from the @code{pbmplus} package and friends, see below.  For XEmacs it's
23273 faster if XEmacs has been compiled with @code{X-Face} support.  The
23274 default action under Emacs without image support is to fork off the
23275 @code{display} program.
23276
23277 On a GNU/Linux system, the @code{display} program is included in the
23278 ImageMagick package.  For external conversion programs look for packages
23279 with names like @code{netpbm}, @code{libgr-progs} and @code{compface}.
23280 On Windows, you may use the packages @code{netpbm} and @code{compface}
23281 from @url{http://gnuwin32.sourceforge.net}.  You need to add the
23282 @code{bin} directory to your @code{PATH} environment variable.
23283 @c In fact only the following DLLs and binaries seem to be required:
23284 @c compface1.dll uncompface.exe libnetpbm10.dll icontopbm.exe
23285
23286 The variable @code{gnus-article-x-face-command} controls which programs
23287 are used to display the @code{X-Face} header.  If this variable is a
23288 string, this string will be executed in a sub-shell.  If it is a
23289 function, this function will be called with the face as the argument.
23290 If @code{gnus-article-x-face-too-ugly} (which is a regexp) matches the
23291 @code{From} header, the face will not be shown.
23292
23293 (Note: @code{x-face} is used in the variable/function names, not
23294 @code{xface}).
23295
23296 @noindent
23297 Face and variable:
23298
23299 @table @code
23300 @item gnus-x-face
23301 @vindex gnus-x-face
23302 Face to show X-Face.  The colors from this face are used as the
23303 foreground and background colors of the displayed X-Faces.  The
23304 default colors are black and white.
23305
23306 @item gnus-face-properties-alist
23307 @vindex gnus-face-properties-alist
23308 Alist of image types and properties applied to Face (@pxref{Face}) and
23309 X-Face images.  The default value is @code{((pbm . (:face gnus-x-face))
23310 (png . nil))} for Emacs or @code{((xface . (:face gnus-x-face)))} for
23311 XEmacs.  Here are examples:
23312
23313 @lisp
23314 ;; Specify the altitude of Face and X-Face images in the From header.
23315 (setq gnus-face-properties-alist
23316       '((pbm . (:face gnus-x-face :ascent 80))
23317         (png . (:ascent 80))))
23318
23319 ;; Show Face and X-Face images as pressed buttons.
23320 (setq gnus-face-properties-alist
23321       '((pbm . (:face gnus-x-face :relief -2))
23322         (png . (:relief -2))))
23323 @end lisp
23324
23325 @pxref{Image Descriptors, ,Image Descriptors, elisp, The Emacs Lisp
23326 Reference Manual} for the valid properties for various image types.
23327 Currently, @code{pbm} is used for X-Face images and @code{png} is used
23328 for Face images in Emacs.  Only the @code{:face} property is effective
23329 on the @code{xface} image type in XEmacs if it is built with the
23330 @samp{libcompface} library.
23331 @end table
23332
23333 If you use posting styles, you can use an @code{x-face-file} entry in
23334 @code{gnus-posting-styles}, @xref{Posting Styles}.  If you don't, Gnus
23335 provides a few convenience functions and variables to allow easier
23336 insertion of X-Face headers in outgoing messages.  You also need the
23337 above mentioned ImageMagick, netpbm or other image conversion packages
23338 (depending the values of the variables below) for these functions.
23339
23340 @findex gnus-random-x-face
23341 @vindex gnus-convert-pbm-to-x-face-command
23342 @vindex gnus-x-face-directory
23343 @code{gnus-random-x-face} goes through all the @samp{pbm} files in
23344 @code{gnus-x-face-directory} and picks one at random, and then
23345 converts it to the X-Face format by using the
23346 @code{gnus-convert-pbm-to-x-face-command} shell command.  The
23347 @samp{pbm} files should be 48x48 pixels big.  It returns the X-Face
23348 header data as a string.
23349
23350 @findex gnus-insert-random-x-face-header
23351 @code{gnus-insert-random-x-face-header} calls
23352 @code{gnus-random-x-face} and inserts a @samp{X-Face} header with the
23353 randomly generated data.
23354
23355 @findex gnus-x-face-from-file
23356 @vindex gnus-convert-image-to-x-face-command
23357 @code{gnus-x-face-from-file} takes a GIF file as the parameter, and then
23358 converts the file to X-Face format by using the
23359 @code{gnus-convert-image-to-x-face-command} shell command.
23360
23361 Here's how you would typically use the first function.  Put something
23362 like the following in your @file{~/.gnus.el} file:
23363
23364 @lisp
23365 (setq message-required-news-headers
23366       (nconc message-required-news-headers
23367              (list '(X-Face . gnus-random-x-face))))
23368 @end lisp
23369
23370 Using the last function would be something like this:
23371
23372 @lisp
23373 (setq message-required-news-headers
23374       (nconc message-required-news-headers
23375              (list '(X-Face . (lambda ()
23376                                 (gnus-x-face-from-file
23377                                  "~/My-face.gif"))))))
23378 @end lisp
23379
23380
23381 @node Face
23382 @subsection Face
23383 @cindex face
23384
23385 @c #### FIXME: faces and x-faces' implementations should really be harmonized.
23386
23387 @code{Face} headers are essentially a funkier version of @code{X-Face}
23388 ones. They describe a 48x48 pixel colored image that's supposed to
23389 represent the author of the message.
23390
23391 @cindex face
23392 @findex gnus-article-display-face
23393 The contents of a @code{Face} header must be a base64 encoded PNG image.
23394 See @uref{http://quimby.gnus.org/circus/face/} for the precise
23395 specifications.
23396
23397 The @code{gnus-face-properties-alist} variable affects the appearance of
23398 displayed Face images.  @xref{X-Face}.
23399
23400 Viewing an @code{Face} header requires an Emacs that is able to display
23401 PNG images.
23402 @c Maybe add this:
23403 @c (if (featurep 'xemacs)
23404 @c     (featurep 'png)
23405 @c   (image-type-available-p 'png))
23406
23407 Gnus provides a few convenience functions and variables to allow
23408 easier insertion of Face headers in outgoing messages.
23409
23410 @findex gnus-convert-png-to-face
23411 @code{gnus-convert-png-to-face} takes a 48x48 PNG image, no longer than
23412 726 bytes long, and converts it to a face.
23413
23414 @findex gnus-face-from-file
23415 @vindex gnus-convert-image-to-face-command
23416 @code{gnus-face-from-file} takes a JPEG file as the parameter, and then
23417 converts the file to Face format by using the
23418 @code{gnus-convert-image-to-face-command} shell command.
23419
23420 Here's how you would typically use this function. Put something like the
23421 following in your @file{~/.gnus.el} file:
23422
23423 @lisp
23424 (setq message-required-news-headers
23425       (nconc message-required-news-headers
23426              (list '(Face . (lambda ()
23427                               (gnus-face-from-file "~/face.jpg"))))))
23428 @end lisp
23429
23430
23431 @node Smileys
23432 @subsection Smileys
23433 @cindex smileys
23434
23435 @iftex
23436 @iflatex
23437 \gnusfig{-3cm}{0.5cm}{\epsfig{figure=ps/BigFace,height=20cm}}
23438 \input{smiley}
23439 @end iflatex
23440 @end iftex
23441
23442 @dfn{Smiley} is a package separate from Gnus, but since Gnus is
23443 currently the only package that uses Smiley, it is documented here.
23444
23445 In short---to use Smiley in Gnus, put the following in your
23446 @file{~/.gnus.el} file:
23447
23448 @lisp
23449 (setq gnus-treat-display-smileys t)
23450 @end lisp
23451
23452 Smiley maps text smiley faces---@samp{:-)}, @samp{8-)}, @samp{:-(} and
23453 the like---to pictures and displays those instead of the text smiley
23454 faces.  The conversion is controlled by a list of regexps that matches
23455 text and maps that to file names.
23456
23457 @vindex smiley-regexp-alist
23458 The alist used is specified by the @code{smiley-regexp-alist}
23459 variable.  The first item in each element is the regexp to be matched;
23460 the second element is the regexp match group that is to be replaced by
23461 the picture; and the third element is the name of the file to be
23462 displayed.
23463
23464 The following variables customize the appearance of the smileys:
23465
23466 @table @code
23467
23468 @item smiley-style
23469 @vindex smiley-style
23470 Specifies the smiley style.  Predefined smiley styles include
23471 @code{low-color} (small 13x14 pixel, three-color images), @code{medium}
23472 (more colorful images, 16x16 pixel), and @code{grayscale} (grayscale
23473 images, 14x14 pixel).  The default depends on the height of the default
23474 face.
23475
23476 @item smiley-data-directory
23477 @vindex smiley-data-directory
23478 Where Smiley will look for smiley faces files.  You shouldn't set this
23479 variable anymore.  Customize @code{smiley-style} instead.
23480
23481 @item gnus-smiley-file-types
23482 @vindex gnus-smiley-file-types
23483 List of suffixes on smiley file names to try.
23484
23485 @end table
23486
23487
23488 @node Picons
23489 @subsection Picons
23490
23491 @iftex
23492 @iflatex
23493 \include{picons}
23494 @end iflatex
23495 @end iftex
23496
23497 So@dots{}  You want to slow down your news reader even more!  This is a
23498 good way to do so.  It's also a great way to impress people staring
23499 over your shoulder as you read news.
23500
23501 What are Picons?  To quote directly from the Picons Web site:
23502
23503 @iftex
23504 @iflatex
23505 \margindex{}
23506 @end iflatex
23507 @end iftex
23508
23509 @quotation
23510 @dfn{Picons} is short for ``personal icons''.  They're small,
23511 constrained images used to represent users and domains on the net,
23512 organized into databases so that the appropriate image for a given
23513 e-mail address can be found.  Besides users and domains, there are picon
23514 databases for Usenet newsgroups and weather forecasts.  The picons are
23515 in either monochrome @code{XBM} format or color @code{XPM} and
23516 @code{GIF} formats.
23517 @end quotation
23518
23519 @vindex gnus-picon-databases
23520 For instructions on obtaining and installing the picons databases,
23521 point your Web browser at
23522 @uref{http://www.cs.indiana.edu/picons/ftp/index.html}.
23523
23524 If you are using Debian GNU/Linux, saying @samp{apt-get install
23525 picons.*} will install the picons where Gnus can find them.
23526
23527 To enable displaying picons, simply make sure that
23528 @code{gnus-picon-databases} points to the directory containing the
23529 Picons databases.
23530
23531 @vindex gnus-picon-style
23532 The variable @code{gnus-picon-style} controls how picons are displayed.
23533 If @code{inline}, the textual representation is replaced.  If
23534 @code{right}, picons are added right to the textual representation.
23535
23536 The following variables offer control over where things are located.
23537
23538 @table @code
23539
23540 @item gnus-picon-databases
23541 @vindex gnus-picon-databases
23542 The location of the picons database.  This is a list of directories
23543 containing the @file{news}, @file{domains}, @file{users} (and so on)
23544 subdirectories.  Defaults to @code{("/usr/lib/picon"
23545 "/usr/local/faces")}.
23546
23547 @item gnus-picon-news-directories
23548 @vindex gnus-picon-news-directories
23549 List of subdirectories to search in @code{gnus-picon-databases} for
23550 newsgroups faces.  @code{("news")} is the default.
23551
23552 @item gnus-picon-user-directories
23553 @vindex gnus-picon-user-directories
23554 List of subdirectories to search in @code{gnus-picon-databases} for user
23555 faces.  @code{("users" "usenix" "local" "misc")} is the default.
23556
23557 @item gnus-picon-domain-directories
23558 @vindex gnus-picon-domain-directories
23559 List of subdirectories to search in @code{gnus-picon-databases} for
23560 domain name faces.  Defaults to @code{("domains")}.  Some people may
23561 want to add @samp{"unknown"} to this list.
23562
23563 @item gnus-picon-file-types
23564 @vindex gnus-picon-file-types
23565 Ordered list of suffixes on picon file names to try.  Defaults to
23566 @code{("xpm" "gif" "xbm")} minus those not built-in your Emacs.
23567
23568 @item gnus-picon-inhibit-top-level-domains
23569 @vindex gnus-picon-inhibit-top-level-domains
23570 If non-@code{nil} (which is the default), don't display picons for
23571 things like @samp{.net} and @samp{.de}, which aren't usually very
23572 interesting.
23573
23574 @end table
23575
23576 @node Gravatars
23577 @subsection Gravatars
23578
23579 @iftex
23580 @iflatex
23581 \include{gravatars}
23582 @end iflatex
23583 @end iftex
23584
23585 A gravatar is an image registered to an e-mail address.
23586
23587 You can submit yours on-line at @uref{http://www.gravatar.com}.
23588
23589 The following variables offer control over how things are displayed.
23590
23591 @table @code
23592
23593 @item gnus-gravatar-size
23594 @vindex gnus-gravatar-size
23595 The size in pixels of gravatars. Gravatars are always square, so one
23596 number for the size is enough.
23597
23598 @item gnus-gravatar-properties
23599 @vindex gnus-gravatar-properties
23600 List of image properties applied to Gravatar images.
23601
23602 @item gnus-gravatar-too-ugly
23603 @vindex gnus-gravatar-too-ugly
23604 Regexp that matches mail addresses or names of people of which avatars
23605 should not be displayed, or @code{nil}.  It default to the value of
23606 @code{gnus-article-x-face-too-ugly} (@pxref{X-Face}).
23607
23608 @end table
23609
23610 If you want to see them in the From field, set:
23611 @lisp
23612 (setq gnus-treat-from-gravatar 'head)
23613 @end lisp
23614
23615 If you want to see them in the Cc and To fields, set:
23616
23617 @lisp
23618 (setq gnus-treat-mail-gravatar 'head)
23619 @end lisp
23620
23621
23622 @node XVarious
23623 @subsection Various XEmacs Variables
23624
23625 @table @code
23626 @item gnus-xmas-glyph-directory
23627 @vindex gnus-xmas-glyph-directory
23628 This is where Gnus will look for pictures.  Gnus will normally
23629 auto-detect this directory, but you may set it manually if you have an
23630 unusual directory structure.
23631
23632 @item gnus-xmas-modeline-glyph
23633 @vindex gnus-xmas-modeline-glyph
23634 A glyph displayed in all Gnus mode lines.  It is a tiny gnu head by
23635 default.
23636
23637 @end table
23638
23639 @subsubsection Toolbar
23640
23641 @table @code
23642
23643 @item gnus-use-toolbar
23644 @vindex gnus-use-toolbar
23645 This variable specifies the position to display the toolbar.  If
23646 @code{nil}, don't display toolbars.  If it is non-@code{nil}, it should
23647 be one of the symbols @code{default}, @code{top}, @code{bottom},
23648 @code{right}, and @code{left}.  @code{default} means to use the default
23649 toolbar, the rest mean to display the toolbar on the place which those
23650 names show.  The default is @code{default}.
23651
23652 @item gnus-toolbar-thickness
23653 @vindex gnus-toolbar-thickness
23654 Cons of the height and the width specifying the thickness of a toolbar.
23655 The height is used for the toolbar displayed on the top or the bottom,
23656 the width is used for the toolbar displayed on the right or the left.
23657 The default is that of the default toolbar.
23658
23659 @item gnus-group-toolbar
23660 @vindex gnus-group-toolbar
23661 The toolbar in the group buffer.
23662
23663 @item gnus-summary-toolbar
23664 @vindex gnus-summary-toolbar
23665 The toolbar in the summary buffer.
23666
23667 @item gnus-summary-mail-toolbar
23668 @vindex gnus-summary-mail-toolbar
23669 The toolbar in the summary buffer of mail groups.
23670
23671 @end table
23672
23673 @iftex
23674 @iflatex
23675 \margindex{}
23676 @end iflatex
23677 @end iftex
23678
23679
23680 @node Fuzzy Matching
23681 @section Fuzzy Matching
23682 @cindex fuzzy matching
23683
23684 Gnus provides @dfn{fuzzy matching} of @code{Subject} lines when doing
23685 things like scoring, thread gathering and thread comparison.
23686
23687 As opposed to regular expression matching, fuzzy matching is very fuzzy.
23688 It's so fuzzy that there's not even a definition of what @dfn{fuzziness}
23689 means, and the implementation has changed over time.
23690
23691 Basically, it tries to remove all noise from lines before comparing.
23692 @samp{Re: }, parenthetical remarks, white space, and so on, are filtered
23693 out of the strings before comparing the results.  This often leads to
23694 adequate results---even when faced with strings generated by text
23695 manglers masquerading as newsreaders.
23696
23697
23698 @node Thwarting Email Spam
23699 @section Thwarting Email Spam
23700 @cindex email spam
23701 @cindex spam
23702 @cindex UCE
23703 @cindex unsolicited commercial email
23704
23705 In these last days of the Usenet, commercial vultures are hanging about
23706 and grepping through news like crazy to find email addresses they can
23707 foist off their scams and products to.  As a reaction to this, many
23708 people have started putting nonsense addresses into their @code{From}
23709 lines.  I think this is counterproductive---it makes it difficult for
23710 people to send you legitimate mail in response to things you write, as
23711 well as making it difficult to see who wrote what.  This rewriting may
23712 perhaps be a bigger menace than the unsolicited commercial email itself
23713 in the end.
23714
23715 The biggest problem I have with email spam is that it comes in under
23716 false pretenses.  I press @kbd{g} and Gnus merrily informs me that I
23717 have 10 new emails.  I say ``Golly gee!  Happy is me!'' and select the
23718 mail group, only to find two pyramid schemes, seven advertisements
23719 (``New!  Miracle tonic for growing full, lustrous hair on your toes!'')
23720 and one mail asking me to repent and find some god.
23721
23722 This is annoying.  Here's what you can do about it.
23723
23724 @menu
23725 * The problem of spam::         Some background, and some solutions
23726 * Anti-Spam Basics::            Simple steps to reduce the amount of spam.
23727 * SpamAssassin::                How to use external anti-spam tools.
23728 * Hashcash::                    Reduce spam by burning CPU time.
23729 @end menu
23730
23731 @node The problem of spam
23732 @subsection The problem of spam
23733 @cindex email spam
23734 @cindex spam filtering approaches
23735 @cindex filtering approaches, spam
23736 @cindex UCE
23737 @cindex unsolicited commercial email
23738
23739 First, some background on spam.
23740
23741 If you have access to e-mail, you are familiar with spam (technically
23742 termed @acronym{UCE}, Unsolicited Commercial E-mail).  Simply put, it
23743 exists because e-mail delivery is very cheap compared to paper mail,
23744 so only a very small percentage of people need to respond to an UCE to
23745 make it worthwhile to the advertiser.  Ironically, one of the most
23746 common spams is the one offering a database of e-mail addresses for
23747 further spamming.  Senders of spam are usually called @emph{spammers},
23748 but terms like @emph{vermin}, @emph{scum}, @emph{sociopaths}, and
23749 @emph{morons} are in common use as well.
23750
23751 Spam comes from a wide variety of sources.  It is simply impossible to
23752 dispose of all spam without discarding useful messages.  A good
23753 example is the TMDA system, which requires senders
23754 unknown to you to confirm themselves as legitimate senders before
23755 their e-mail can reach you.  Without getting into the technical side
23756 of TMDA, a downside is clearly that e-mail from legitimate sources may
23757 be discarded if those sources can't or won't confirm themselves
23758 through the TMDA system.  Another problem with TMDA is that it
23759 requires its users to have a basic understanding of e-mail delivery
23760 and processing.
23761
23762 The simplest approach to filtering spam is filtering, at the mail
23763 server or when you sort through incoming mail.  If you get 200 spam
23764 messages per day from @samp{random-address@@vmadmin.com}, you block
23765 @samp{vmadmin.com}.  If you get 200 messages about @samp{VIAGRA}, you
23766 discard all messages with @samp{VIAGRA} in the message.  If you get
23767 lots of spam from Bulgaria, for example, you try to filter all mail
23768 from Bulgarian IPs.
23769
23770 This, unfortunately, is a great way to discard legitimate e-mail.  The
23771 risks of blocking a whole country (Bulgaria, Norway, Nigeria, China,
23772 etc.) or even a continent (Asia, Africa, Europe, etc.) from contacting
23773 you should be obvious, so don't do it if you have the choice.
23774
23775 In another instance, the very informative and useful RISKS digest has
23776 been blocked by overzealous mail filters because it @strong{contained}
23777 words that were common in spam messages.  Nevertheless, in isolated
23778 cases, with great care, direct filtering of mail can be useful.
23779
23780 Another approach to filtering e-mail is the distributed spam
23781 processing, for instance DCC implements such a system.  In essence,
23782 @var{N} systems around the world agree that a machine @var{X} in
23783 Ghana, Estonia, or California is sending out spam e-mail, and these
23784 @var{N} systems enter @var{X} or the spam e-mail from @var{X} into a
23785 database.  The criteria for spam detection vary---it may be the number
23786 of messages sent, the content of the messages, and so on.  When a user
23787 of the distributed processing system wants to find out if a message is
23788 spam, he consults one of those @var{N} systems.
23789
23790 Distributed spam processing works very well against spammers that send
23791 a large number of messages at once, but it requires the user to set up
23792 fairly complicated checks.  There are commercial and free distributed
23793 spam processing systems.  Distributed spam processing has its risks as
23794 well.  For instance legitimate e-mail senders have been accused of
23795 sending spam, and their web sites and mailing lists have been shut
23796 down for some time because of the incident.
23797
23798 The statistical approach to spam filtering is also popular.  It is
23799 based on a statistical analysis of previous spam messages.  Usually
23800 the analysis is a simple word frequency count, with perhaps pairs of
23801 words or 3-word combinations thrown into the mix.  Statistical
23802 analysis of spam works very well in most of the cases, but it can
23803 classify legitimate e-mail as spam in some cases.  It takes time to
23804 run the analysis, the full message must be analyzed, and the user has
23805 to store the database of spam analysis.  Statistical analysis on the
23806 server is gaining popularity.  This has the advantage of letting the
23807 user Just Read Mail, but has the disadvantage that it's harder to tell
23808 the server that it has misclassified mail.
23809
23810 Fighting spam is not easy, no matter what anyone says.  There is no
23811 magic switch that will distinguish Viagra ads from Mom's e-mails.
23812 Even people are having a hard time telling spam apart from non-spam,
23813 because spammers are actively looking to fool us into thinking they
23814 are Mom, essentially.  Spamming is irritating, irresponsible, and
23815 idiotic behavior from a bunch of people who think the world owes them
23816 a favor.  We hope the following sections will help you in fighting the
23817 spam plague.
23818
23819 @node Anti-Spam Basics
23820 @subsection Anti-Spam Basics
23821 @cindex email spam
23822 @cindex spam
23823 @cindex UCE
23824 @cindex unsolicited commercial email
23825
23826 One way of dealing with spam is having Gnus split out all spam into a
23827 @samp{spam} mail group (@pxref{Splitting Mail}).
23828
23829 First, pick one (1) valid mail address that you can be reached at, and
23830 put it in your @code{From} header of all your news articles.  (I've
23831 chosen @samp{larsi@@trym.ifi.uio.no}, but for many addresses on the form
23832 @samp{larsi+usenet@@ifi.uio.no} will be a better choice.  Ask your
23833 sysadmin whether your sendmail installation accepts keywords in the local
23834 part of the mail address.)
23835
23836 @lisp
23837 (setq message-default-news-headers
23838       "From: Lars Magne Ingebrigtsen <larsi@@trym.ifi.uio.no>\n")
23839 @end lisp
23840
23841 Then put the following split rule in @code{nnmail-split-fancy}
23842 (@pxref{Fancy Mail Splitting}):
23843
23844 @lisp
23845 (...
23846  (to "larsi@@trym.ifi.uio.no"
23847      (| ("subject" "re:.*" "misc")
23848         ("references" ".*@@.*" "misc")
23849         "spam"))
23850  ...)
23851 @end lisp
23852
23853 This says that all mail to this address is suspect, but if it has a
23854 @code{Subject} that starts with a @samp{Re:} or has a @code{References}
23855 header, it's probably ok.  All the rest goes to the @samp{spam} group.
23856 (This idea probably comes from Tim Pierce.)
23857
23858 In addition, many mail spammers talk directly to your @acronym{SMTP} server
23859 and do not include your email address explicitly in the @code{To}
23860 header.  Why they do this is unknown---perhaps it's to thwart this
23861 thwarting scheme?  In any case, this is trivial to deal with---you just
23862 put anything not addressed to you in the @samp{spam} group by ending
23863 your fancy split rule in this way:
23864
23865 @lisp
23866 (
23867  ...
23868  (to "larsi" "misc")
23869  "spam")
23870 @end lisp
23871
23872 In my experience, this will sort virtually everything into the right
23873 group.  You still have to check the @samp{spam} group from time to time to
23874 check for legitimate mail, though.  If you feel like being a good net
23875 citizen, you can even send off complaints to the proper authorities on
23876 each unsolicited commercial email---at your leisure.
23877
23878 This works for me.  It allows people an easy way to contact me (they can
23879 just press @kbd{r} in the usual way), and I'm not bothered at all with
23880 spam.  It's a win-win situation.  Forging @code{From} headers to point
23881 to non-existent domains is yucky, in my opinion.
23882
23883 Be careful with this approach.  Spammers are wise to it.
23884
23885
23886 @node SpamAssassin
23887 @subsection SpamAssassin, Vipul's Razor, DCC, etc
23888 @cindex SpamAssassin
23889 @cindex Vipul's Razor
23890 @cindex DCC
23891
23892 The days where the hints in the previous section were sufficient in
23893 avoiding spam are coming to an end.  There are many tools out there
23894 that claim to reduce the amount of spam you get.  This section could
23895 easily become outdated fast, as new products replace old, but
23896 fortunately most of these tools seem to have similar interfaces.  Even
23897 though this section will use SpamAssassin as an example, it should be
23898 easy to adapt it to most other tools.
23899
23900 Note that this section does not involve the @code{spam.el} package,
23901 which is discussed in the next section.  If you don't care for all
23902 the features of @code{spam.el}, you can make do with these simple
23903 recipes.
23904
23905 If the tool you are using is not installed on the mail server, you
23906 need to invoke it yourself.  Ideas on how to use the
23907 @code{:postscript} mail source parameter (@pxref{Mail Source
23908 Specifiers}) follow.
23909
23910 @lisp
23911 (setq mail-sources
23912       '((file :prescript "formail -bs spamassassin < /var/mail/%u")
23913         (pop :user "jrl"
23914              :server "pophost"
23915              :postscript
23916              "mv %t /tmp/foo; formail -bs spamc < /tmp/foo > %t")))
23917 @end lisp
23918
23919 Once you manage to process your incoming spool somehow, thus making
23920 the mail contain e.g.@: a header indicating it is spam, you are ready to
23921 filter it out.  Using normal split methods (@pxref{Splitting Mail}):
23922
23923 @lisp
23924 (setq nnmail-split-methods '(("spam"  "^X-Spam-Flag: YES")
23925                              ...))
23926 @end lisp
23927
23928 Or using fancy split methods (@pxref{Fancy Mail Splitting}):
23929
23930 @lisp
23931 (setq nnmail-split-methods 'nnmail-split-fancy
23932       nnmail-split-fancy '(| ("X-Spam-Flag" "YES" "spam")
23933                              ...))
23934 @end lisp
23935
23936 Some people might not like the idea of piping the mail through various
23937 programs using a @code{:prescript} (if some program is buggy, you
23938 might lose all mail).  If you are one of them, another solution is to
23939 call the external tools during splitting.  Example fancy split method:
23940
23941 @lisp
23942 (setq nnmail-split-fancy '(| (: kevin-spamassassin)
23943                              ...))
23944 (defun kevin-spamassassin ()
23945   (save-excursion
23946     (save-restriction
23947       (widen)
23948       (if (eq 1 (call-process-region (point-min) (point-max)
23949                                      "spamc" nil nil nil "-c"))
23950           "spam"))))
23951 @end lisp
23952
23953 Note that with the nnimap back end, message bodies will not be
23954 downloaded by default.  You need to set
23955 @code{nnimap-split-download-body} to @code{t} to do that
23956 (@pxref{Client-Side IMAP Splitting}).
23957
23958 That is about it.  As some spam is likely to get through anyway, you
23959 might want to have a nifty function to call when you happen to read
23960 spam.  And here is the nifty function:
23961
23962 @lisp
23963 (defun my-gnus-raze-spam ()
23964   "Submit SPAM to Vipul's Razor, then mark it as expirable."
23965   (interactive)
23966   (gnus-summary-save-in-pipe "razor-report -f -d" t)
23967   (gnus-summary-mark-as-expirable 1))
23968 @end lisp
23969
23970 @node Hashcash
23971 @subsection Hashcash
23972 @cindex hashcash
23973
23974 A novel technique to fight spam is to require senders to do something
23975 costly and demonstrably unique for each message they send.  This has
23976 the obvious drawback that you cannot rely on everyone in the world
23977 using this technique, since it is not part of the Internet standards,
23978 but it may be useful in smaller communities.
23979
23980 While the tools in the previous section work well in practice, they
23981 work only because the tools are constantly maintained and updated as
23982 new form of spam appears.  This means that a small percentage of spam
23983 will always get through.  It also means that somewhere, someone needs
23984 to read lots of spam to update these tools.  Hashcash avoids that, but
23985 instead prefers that everyone you contact through e-mail supports the
23986 scheme.  You can view the two approaches as pragmatic vs dogmatic.
23987 The approaches have their own advantages and disadvantages, but as
23988 often in the real world, a combination of them is stronger than either
23989 one of them separately.
23990
23991 @cindex X-Hashcash
23992 The ``something costly'' is to burn CPU time, more specifically to
23993 compute a hash collision up to a certain number of bits.  The
23994 resulting hashcash cookie is inserted in a @samp{X-Hashcash:} header.
23995 For more details, and for the external application @code{hashcash} you
23996 need to install to use this feature, see
23997 @uref{http://www.hashcash.org/}.  Even more information can be found
23998 at @uref{http://www.camram.org/}.
23999
24000 If you wish to generate hashcash for each message you send, you can
24001 customize @code{message-generate-hashcash} (@pxref{Mail Headers, ,Mail
24002 Headers,message, The Message Manual}), as in:
24003
24004 @lisp
24005 (setq message-generate-hashcash t)
24006 @end lisp
24007
24008 You will need to set up some additional variables as well:
24009
24010 @table @code
24011
24012 @item hashcash-default-payment
24013 @vindex hashcash-default-payment
24014 This variable indicates the default number of bits the hash collision
24015 should consist of.  By default this is 20.  Suggested useful values
24016 include 17 to 29.
24017
24018 @item hashcash-payment-alist
24019 @vindex hashcash-payment-alist
24020 Some receivers may require you to spend burn more CPU time than the
24021 default.  This variable contains a list of @samp{(@var{addr}
24022 @var{amount})} cells, where @var{addr} is the receiver (email address
24023 or newsgroup) and @var{amount} is the number of bits in the collision
24024 that is needed.  It can also contain @samp{(@var{addr} @var{string}
24025 @var{amount})} cells, where the @var{string} is the string to use
24026 (normally the email address or newsgroup name is used).
24027
24028 @item hashcash-path
24029 @vindex hashcash-path
24030 Where the @code{hashcash} binary is installed.  This variable should
24031 be automatically set by @code{executable-find}, but if it's @code{nil}
24032 (usually because the @code{hashcash} binary is not in your path)
24033 you'll get a warning when you check hashcash payments and an error
24034 when you generate hashcash payments.
24035
24036 @end table
24037
24038 Gnus can verify hashcash cookies, although this can also be done by
24039 hand customized mail filtering scripts.  To verify a hashcash cookie
24040 in a message, use the @code{mail-check-payment} function in the
24041 @code{hashcash.el} library.  You can also use the @code{spam.el}
24042 package with the @code{spam-use-hashcash} back end to validate hashcash
24043 cookies in incoming mail and filter mail accordingly (@pxref{Anti-spam
24044 Hashcash Payments}).
24045
24046 @node Spam Package
24047 @section Spam Package
24048 @cindex spam filtering
24049 @cindex spam
24050
24051 The Spam package provides Gnus with a centralized mechanism for
24052 detecting and filtering spam.  It filters new mail, and processes
24053 messages according to whether they are spam or ham.  (@dfn{Ham} is the
24054 name used throughout this manual to indicate non-spam messages.)
24055
24056 @menu
24057 * Spam Package Introduction::
24058 * Filtering Incoming Mail::
24059 * Detecting Spam in Groups::
24060 * Spam and Ham Processors::
24061 * Spam Package Configuration Examples::
24062 * Spam Back Ends::
24063 * Extending the Spam package::
24064 * Spam Statistics Package::
24065 @end menu
24066
24067 @node Spam Package Introduction
24068 @subsection Spam Package Introduction
24069 @cindex spam filtering
24070 @cindex spam filtering sequence of events
24071 @cindex spam
24072
24073 You must read this section to understand how the Spam package works.
24074 Do not skip, speed-read, or glance through this section.
24075
24076 Make sure you read the section on the @code{spam.el} sequence of
24077 events.  See @xref{Extending the Spam package}.
24078
24079 @cindex spam-initialize
24080 @vindex spam-use-stat
24081 To use the Spam package, you @strong{must} first run the function
24082 @code{spam-initialize}:
24083
24084 @example
24085 (spam-initialize)
24086 @end example
24087
24088 This autoloads @code{spam.el} and installs the various hooks necessary
24089 to let the Spam package do its job.  In order to make use of the Spam
24090 package, you have to set up certain group parameters and variables,
24091 which we will describe below.  All of the variables controlling the
24092 Spam package can be found in the @samp{spam} customization group.
24093
24094 There are two ``contact points'' between the Spam package and the rest
24095 of Gnus: checking new mail for spam, and leaving a group.
24096
24097 Checking new mail for spam is done in one of two ways: while splitting
24098 incoming mail, or when you enter a group.
24099
24100 The first way, checking for spam while splitting incoming mail, is
24101 suited to mail back ends such as @code{nnml} or @code{nnimap}, where
24102 new mail appears in a single spool file.  The Spam package processes
24103 incoming mail, and sends mail considered to be spam to a designated
24104 ``spam'' group.  @xref{Filtering Incoming Mail}.
24105
24106 The second way is suited to back ends such as @code{nntp}, which have
24107 no incoming mail spool, or back ends where the server is in charge of
24108 splitting incoming mail.  In this case, when you enter a Gnus group,
24109 the unseen or unread messages in that group are checked for spam.
24110 Detected spam messages are marked as spam.  @xref{Detecting Spam in
24111 Groups}.
24112
24113 @cindex spam back ends
24114 In either case, you have to tell the Spam package what method to use
24115 to detect spam messages.  There are several methods, or @dfn{spam back
24116 ends} (not to be confused with Gnus back ends!) to choose from: spam
24117 ``blacklists'' and ``whitelists'', dictionary-based filters, and so
24118 forth.  @xref{Spam Back Ends}.
24119
24120 In the Gnus summary buffer, messages that have been identified as spam
24121 always appear with a @samp{$} symbol.
24122
24123 The Spam package divides Gnus groups into three categories: ham
24124 groups, spam groups, and unclassified groups.  You should mark each of
24125 the groups you subscribe to as either a ham group or a spam group,
24126 using the @code{spam-contents} group parameter (@pxref{Group
24127 Parameters}).  Spam groups have a special property: when you enter a
24128 spam group, all unseen articles are marked as spam.  Thus, mail split
24129 into a spam group is automatically marked as spam.
24130
24131 Identifying spam messages is only half of the Spam package's job.  The
24132 second half comes into play whenever you exit a group buffer.  At this
24133 point, the Spam package does several things:
24134
24135 First, it calls @dfn{spam and ham processors} to process the articles
24136 according to whether they are spam or ham.  There is a pair of spam
24137 and ham processors associated with each spam back end, and what the
24138 processors do depends on the back end.  At present, the main role of
24139 spam and ham processors is for dictionary-based spam filters: they add
24140 the contents of the messages in the group to the filter's dictionary,
24141 to improve its ability to detect future spam.  The @code{spam-process}
24142 group parameter specifies what spam processors to use.  @xref{Spam and
24143 Ham Processors}.
24144
24145 If the spam filter failed to mark a spam message, you can mark it
24146 yourself, so that the message is processed as spam when you exit the
24147 group:
24148
24149 @table @kbd
24150 @item $
24151 @itemx M-d
24152 @itemx M s x
24153 @itemx S x
24154 @kindex $ (Summary)
24155 @kindex M-d (Summary)
24156 @kindex S x (Summary)
24157 @kindex M s x (Summary)
24158 @findex gnus-summary-mark-as-spam
24159 @findex gnus-summary-mark-as-spam
24160 Mark current article as spam, showing it with the @samp{$} mark
24161 (@code{gnus-summary-mark-as-spam}).
24162 @end table
24163
24164 @noindent
24165 Similarly, you can unmark an article if it has been erroneously marked
24166 as spam.  @xref{Setting Marks}.
24167
24168 Normally, a ham message found in a non-ham group is not processed as
24169 ham---the rationale is that it should be moved into a ham group for
24170 further processing (see below).  However, you can force these articles
24171 to be processed as ham by setting
24172 @code{spam-process-ham-in-spam-groups} and
24173 @code{spam-process-ham-in-nonham-groups}.
24174
24175 @vindex gnus-ham-process-destinations
24176 @vindex gnus-spam-process-destinations
24177 The second thing that the Spam package does when you exit a group is
24178 to move ham articles out of spam groups, and spam articles out of ham
24179 groups.  Ham in a spam group is moved to the group specified by the
24180 variable @code{gnus-ham-process-destinations}, or the group parameter
24181 @code{ham-process-destination}.  Spam in a ham group is moved to the
24182 group specified by the variable @code{gnus-spam-process-destinations},
24183 or the group parameter @code{spam-process-destination}.  If these
24184 variables are not set, the articles are left in their current group.
24185 If an article cannot be moved (e.g., with a read-only backend such
24186 as @acronym{NNTP}), it is copied.
24187
24188 If an article is moved to another group, it is processed again when
24189 you visit the new group.  Normally, this is not a problem, but if you
24190 want each article to be processed only once, load the
24191 @code{gnus-registry.el} package and set the variable
24192 @code{spam-log-to-registry} to @code{t}.  @xref{Spam Package
24193 Configuration Examples}.
24194
24195 Normally, spam groups ignore @code{gnus-spam-process-destinations}.
24196 However, if you set @code{spam-move-spam-nonspam-groups-only} to
24197 @code{nil}, spam will also be moved out of spam groups, depending on
24198 the @code{spam-process-destination} parameter.
24199
24200 The final thing the Spam package does is to mark spam articles as
24201 expired, which is usually the right thing to do.
24202
24203 If all this seems confusing, don't worry.  Soon it will be as natural
24204 as typing Lisp one-liners on a neural interface@dots{} err, sorry, that's
24205 50 years in the future yet.  Just trust us, it's not so bad.
24206
24207 @node Filtering Incoming Mail
24208 @subsection Filtering Incoming Mail
24209 @cindex spam filtering
24210 @cindex spam filtering incoming mail
24211 @cindex spam
24212
24213 To use the Spam package to filter incoming mail, you must first set up
24214 fancy mail splitting.  @xref{Fancy Mail Splitting}.  The Spam package
24215 defines a special splitting function that you can add to your fancy
24216 split variable (either @code{nnmail-split-fancy} or
24217 @code{nnimap-split-fancy}, depending on your mail back end):
24218
24219 @example
24220 (: spam-split)
24221 @end example
24222
24223 @vindex spam-split-group
24224 @noindent
24225 The @code{spam-split} function scans incoming mail according to your
24226 chosen spam back end(s), and sends messages identified as spam to a
24227 spam group.  By default, the spam group is a group named @samp{spam},
24228 but you can change this by customizing @code{spam-split-group}.  Make
24229 sure the contents of @code{spam-split-group} are an unqualified group
24230 name.  For instance, in an @code{nnimap} server @samp{your-server},
24231 the value @samp{spam} means @samp{nnimap+your-server:spam}.  The value
24232 @samp{nnimap+server:spam} is therefore wrong---it gives the group
24233 @samp{nnimap+your-server:nnimap+server:spam}.
24234
24235 @code{spam-split} does not modify the contents of messages in any way.
24236
24237 @vindex nnimap-split-download-body
24238 Note for IMAP users: if you use the @code{spam-check-bogofilter},
24239 @code{spam-check-ifile}, and @code{spam-check-stat} spam back ends,
24240 you should also set the variable @code{nnimap-split-download-body} to
24241 @code{t}.  These spam back ends are most useful when they can ``scan''
24242 the full message body.  By default, the nnimap back end only retrieves
24243 the message headers; @code{nnimap-split-download-body} tells it to
24244 retrieve the message bodies as well.  We don't set this by default
24245 because it will slow @acronym{IMAP} down, and that is not an
24246 appropriate decision to make on behalf of the user.  @xref{Client-Side
24247 IMAP Splitting}.
24248
24249 You have to specify one or more spam back ends for @code{spam-split}
24250 to use, by setting the @code{spam-use-*} variables.  @xref{Spam Back
24251 Ends}.  Normally, @code{spam-split} simply uses all the spam back ends
24252 you enabled in this way.  However, you can tell @code{spam-split} to
24253 use only some of them.  Why this is useful?  Suppose you are using the
24254 @code{spam-use-regex-headers} and @code{spam-use-blackholes} spam back
24255 ends, and the following split rule:
24256
24257 @example
24258  nnimap-split-fancy '(|
24259                       (any "ding" "ding")
24260                       (: spam-split)
24261                       ;; @r{default mailbox}
24262                       "mail")
24263 @end example
24264
24265 @noindent
24266 The problem is that you want all ding messages to make it to the ding
24267 folder.  But that will let obvious spam (for example, spam detected by
24268 SpamAssassin, and @code{spam-use-regex-headers}) through, when it's
24269 sent to the ding list.  On the other hand, some messages to the ding
24270 list are from a mail server in the blackhole list, so the invocation
24271 of @code{spam-split} can't be before the ding rule.
24272
24273 The solution is to let SpamAssassin headers supersede ding rules, and
24274 perform the other @code{spam-split} rules (including a second
24275 invocation of the regex-headers check) after the ding rule.  This is
24276 done by passing a parameter to @code{spam-split}:
24277
24278 @example
24279 nnimap-split-fancy
24280       '(|
24281         ;; @r{spam detected by @code{spam-use-regex-headers} goes to @samp{regex-spam}}
24282         (: spam-split "regex-spam" 'spam-use-regex-headers)
24283         (any "ding" "ding")
24284         ;; @r{all other spam detected by spam-split goes to @code{spam-split-group}}
24285         (: spam-split)
24286         ;; @r{default mailbox}
24287         "mail")
24288 @end example
24289
24290 @noindent
24291 This lets you invoke specific @code{spam-split} checks depending on
24292 your particular needs, and target the results of those checks to a
24293 particular spam group.  You don't have to throw all mail into all the
24294 spam tests.  Another reason why this is nice is that messages to
24295 mailing lists you have rules for don't have to have resource-intensive
24296 blackhole checks performed on them.  You could also specify different
24297 spam checks for your nnmail split vs. your nnimap split.  Go crazy.
24298
24299 You should set the @code{spam-use-*} variables for whatever spam back
24300 ends you intend to use.  The reason is that when loading
24301 @file{spam.el}, some conditional loading is done depending on what
24302 @code{spam-use-xyz} variables you have set.  @xref{Spam Back Ends}.
24303
24304 @c @emph{TODO: spam.el needs to provide a uniform way of training all the
24305 @c statistical databases.  Some have that functionality built-in, others
24306 @c don't.}
24307
24308 @node Detecting Spam in Groups
24309 @subsection Detecting Spam in Groups
24310
24311 To detect spam when visiting a group, set the group's
24312 @code{spam-autodetect} and @code{spam-autodetect-methods} group
24313 parameters.  These are accessible with @kbd{G c} or @kbd{G p}, as
24314 usual (@pxref{Group Parameters}).
24315
24316 You should set the @code{spam-use-*} variables for whatever spam back
24317 ends you intend to use.  The reason is that when loading
24318 @file{spam.el}, some conditional loading is done depending on what
24319 @code{spam-use-xyz} variables you have set.
24320
24321 By default, only unseen articles are processed for spam.  You can
24322 force Gnus to recheck all messages in the group by setting the
24323 variable @code{spam-autodetect-recheck-messages} to @code{t}.
24324
24325 If you use the @code{spam-autodetect} method of checking for spam, you
24326 can specify different spam detection methods for different groups.
24327 For instance, the @samp{ding} group may have @code{spam-use-BBDB} as
24328 the autodetection method, while the @samp{suspect} group may have the
24329 @code{spam-use-blacklist} and @code{spam-use-bogofilter} methods
24330 enabled.  Unlike with @code{spam-split}, you don't have any control
24331 over the @emph{sequence} of checks, but this is probably unimportant.
24332
24333 @node Spam and Ham Processors
24334 @subsection Spam and Ham Processors
24335 @cindex spam filtering
24336 @cindex spam filtering variables
24337 @cindex spam variables
24338 @cindex spam
24339
24340 @vindex gnus-spam-process-newsgroups
24341 Spam and ham processors specify special actions to take when you exit
24342 a group buffer.  Spam processors act on spam messages, and ham
24343 processors on ham messages.  At present, the main role of these
24344 processors is to update the dictionaries of dictionary-based spam back
24345 ends such as Bogofilter (@pxref{Bogofilter}) and the Spam Statistics
24346 package (@pxref{Spam Statistics Filtering}).
24347
24348 The spam and ham processors that apply to each group are determined by
24349 the group's@code{spam-process} group parameter.  If this group
24350 parameter is not defined, they are determined by the variable
24351 @code{gnus-spam-process-newsgroups}.
24352
24353 @vindex gnus-spam-newsgroup-contents
24354 Gnus learns from the spam you get.  You have to collect your spam in
24355 one or more spam groups, and set or customize the variable
24356 @code{spam-junk-mailgroups} as appropriate.  You can also declare
24357 groups to contain spam by setting their group parameter
24358 @code{spam-contents} to @code{gnus-group-spam-classification-spam}, or
24359 by customizing the corresponding variable
24360 @code{gnus-spam-newsgroup-contents}.  The @code{spam-contents} group
24361 parameter and the @code{gnus-spam-newsgroup-contents} variable can
24362 also be used to declare groups as @emph{ham} groups if you set their
24363 classification to @code{gnus-group-spam-classification-ham}.  If
24364 groups are not classified by means of @code{spam-junk-mailgroups},
24365 @code{spam-contents}, or @code{gnus-spam-newsgroup-contents}, they are
24366 considered @emph{unclassified}.  All groups are unclassified by
24367 default.
24368
24369 @vindex gnus-spam-mark
24370 @cindex $
24371 In spam groups, all messages are considered to be spam by default:
24372 they get the @samp{$} mark (@code{gnus-spam-mark}) when you enter the
24373 group.  If you have seen a message, had it marked as spam, then
24374 unmarked it, it won't be marked as spam when you enter the group
24375 thereafter.  You can disable that behavior, so all unread messages
24376 will get the @samp{$} mark, if you set the
24377 @code{spam-mark-only-unseen-as-spam} parameter to @code{nil}.  You
24378 should remove the @samp{$} mark when you are in the group summary
24379 buffer for every message that is not spam after all.  To remove the
24380 @samp{$} mark, you can use @kbd{M-u} to ``unread'' the article, or
24381 @kbd{d} for declaring it read the non-spam way.  When you leave a
24382 group, all spam-marked (@samp{$}) articles are sent to a spam
24383 processor which will study them as spam samples.
24384
24385 Messages may also be deleted in various other ways, and unless
24386 @code{ham-marks} group parameter gets overridden below, marks @samp{R}
24387 and @samp{r} for default read or explicit delete, marks @samp{X} and
24388 @samp{K} for automatic or explicit kills, as well as mark @samp{Y} for
24389 low scores, are all considered to be associated with articles which
24390 are not spam.  This assumption might be false, in particular if you
24391 use kill files or score files as means for detecting genuine spam, you
24392 should then adjust the @code{ham-marks} group parameter.
24393
24394 @defvar ham-marks
24395 You can customize this group or topic parameter to be the list of
24396 marks you want to consider ham.  By default, the list contains the
24397 deleted, read, killed, kill-filed, and low-score marks (the idea is
24398 that these articles have been read, but are not spam).  It can be
24399 useful to also include the tick mark in the ham marks.  It is not
24400 recommended to make the unread mark a ham mark, because it normally
24401 indicates a lack of classification.  But you can do it, and we'll be
24402 happy for you.
24403 @end defvar
24404
24405 @defvar spam-marks
24406 You can customize this group or topic parameter to be the list of
24407 marks you want to consider spam.  By default, the list contains only
24408 the spam mark.  It is not recommended to change that, but you can if
24409 you really want to.
24410 @end defvar
24411
24412 When you leave @emph{any} group, regardless of its
24413 @code{spam-contents} classification, all spam-marked articles are sent
24414 to a spam processor, which will study these as spam samples.  If you
24415 explicit kill a lot, you might sometimes end up with articles marked
24416 @samp{K} which you never saw, and which might accidentally contain
24417 spam.  Best is to make sure that real spam is marked with @samp{$},
24418 and nothing else.
24419
24420 @vindex gnus-ham-process-destinations
24421 When you leave a @emph{spam} group, all spam-marked articles are
24422 marked as expired after processing with the spam processor.  This is
24423 not done for @emph{unclassified} or @emph{ham} groups.  Also, any
24424 @strong{ham} articles in a spam group will be moved to a location
24425 determined by either the @code{ham-process-destination} group
24426 parameter or a match in the @code{gnus-ham-process-destinations}
24427 variable, which is a list of regular expressions matched with group
24428 names (it's easiest to customize this variable with @kbd{M-x
24429 customize-variable @key{RET} gnus-ham-process-destinations}).  Each
24430 group name list is a standard Lisp list, if you prefer to customize
24431 the variable manually.  If the @code{ham-process-destination}
24432 parameter is not set, ham articles are left in place.  If the
24433 @code{spam-mark-ham-unread-before-move-from-spam-group} parameter is
24434 set, the ham articles are marked as unread before being moved.
24435
24436 If ham can not be moved---because of a read-only back end such as
24437 @acronym{NNTP}, for example, it will be copied.
24438
24439 Note that you can use multiples destinations per group or regular
24440 expression!  This enables you to send your ham to a regular mail
24441 group and to a @emph{ham training} group.
24442
24443 When you leave a @emph{ham} group, all ham-marked articles are sent to
24444 a ham processor, which will study these as non-spam samples.
24445
24446 @vindex spam-process-ham-in-spam-groups
24447 By default the variable @code{spam-process-ham-in-spam-groups} is
24448 @code{nil}.  Set it to @code{t} if you want ham found in spam groups
24449 to be processed.  Normally this is not done, you are expected instead
24450 to send your ham to a ham group and process it there.
24451
24452 @vindex spam-process-ham-in-nonham-groups
24453 By default the variable @code{spam-process-ham-in-nonham-groups} is
24454 @code{nil}.  Set it to @code{t} if you want ham found in non-ham (spam
24455 or unclassified) groups to be processed.  Normally this is not done,
24456 you are expected instead to send your ham to a ham group and process
24457 it there.
24458
24459 @vindex gnus-spam-process-destinations
24460 When you leave a @emph{ham} or @emph{unclassified} group, all
24461 @strong{spam} articles are moved to a location determined by either
24462 the @code{spam-process-destination} group parameter or a match in the
24463 @code{gnus-spam-process-destinations} variable, which is a list of
24464 regular expressions matched with group names (it's easiest to
24465 customize this variable with @kbd{M-x customize-variable @key{RET}
24466 gnus-spam-process-destinations}).  Each group name list is a standard
24467 Lisp list, if you prefer to customize the variable manually.  If the
24468 @code{spam-process-destination} parameter is not set, the spam
24469 articles are only expired.  The group name is fully qualified, meaning
24470 that if you see @samp{nntp:servername} before the group name in the
24471 group buffer then you need it here as well.
24472
24473 If spam can not be moved---because of a read-only back end such as
24474 @acronym{NNTP}, for example, it will be copied.
24475
24476 Note that you can use multiples destinations per group or regular
24477 expression!  This enables you to send your spam to multiple @emph{spam
24478 training} groups.
24479
24480 @vindex spam-log-to-registry
24481 The problem with processing ham and spam is that Gnus doesn't track
24482 this processing by default.  Enable the @code{spam-log-to-registry}
24483 variable so @code{spam.el} will use @code{gnus-registry.el} to track
24484 what articles have been processed, and avoid processing articles
24485 multiple times.  Keep in mind that if you limit the number of registry
24486 entries, this won't work as well as it does without a limit.
24487
24488 @vindex spam-mark-only-unseen-as-spam
24489 Set this variable if you want only unseen articles in spam groups to
24490 be marked as spam.  By default, it is set.  If you set it to
24491 @code{nil}, unread articles will also be marked as spam.
24492
24493 @vindex spam-mark-ham-unread-before-move-from-spam-group
24494 Set this variable if you want ham to be unmarked before it is moved
24495 out of the spam group.  This is very useful when you use something
24496 like the tick mark @samp{!} to mark ham---the article will be placed
24497 in your @code{ham-process-destination}, unmarked as if it came fresh
24498 from the mail server.
24499
24500 @vindex spam-autodetect-recheck-messages
24501 When autodetecting spam, this variable tells @code{spam.el} whether
24502 only unseen articles or all unread articles should be checked for
24503 spam.  It is recommended that you leave it off.
24504
24505 @node Spam Package Configuration Examples
24506 @subsection Spam Package Configuration Examples
24507 @cindex spam filtering
24508 @cindex spam filtering configuration examples
24509 @cindex spam configuration examples
24510 @cindex spam
24511
24512 @subsubheading Ted's setup
24513
24514 From Ted Zlatanov <tzz@@lifelogs.com>.
24515 @example
24516 ;; @r{for @code{gnus-registry-split-fancy-with-parent} and spam autodetection}
24517 ;; @r{see @file{gnus-registry.el} for more information}
24518 (gnus-registry-initialize)
24519 (spam-initialize)
24520
24521 (setq
24522  spam-log-to-registry t     ; @r{for spam autodetection}
24523  spam-use-BBDB t
24524  spam-use-regex-headers t   ; @r{catch X-Spam-Flag (SpamAssassin)}
24525  ;; @r{all groups with @samp{spam} in the name contain spam}
24526  gnus-spam-newsgroup-contents
24527   '(("spam" gnus-group-spam-classification-spam))
24528  ;; @r{see documentation for these}
24529  spam-move-spam-nonspam-groups-only nil
24530  spam-mark-only-unseen-as-spam t
24531  spam-mark-ham-unread-before-move-from-spam-group t
24532  ;; @r{understand what this does before you copy it to your own setup!}
24533  ;; @r{for nnimap you'll probably want to set nnimap-split-methods, see the manual}
24534  nnimap-split-fancy '(|
24535                       ;; @r{trace references to parents and put in their group}
24536                       (: gnus-registry-split-fancy-with-parent)
24537                       ;; @r{this will catch server-side SpamAssassin tags}
24538                       (: spam-split 'spam-use-regex-headers)
24539                       (any "ding" "ding")
24540                       ;; @r{note that spam by default will go to @samp{spam}}
24541                       (: spam-split)
24542                       ;; @r{default mailbox}
24543                       "mail"))
24544
24545 ;; @r{my parameters, set with @kbd{G p}}
24546
24547 ;; @r{all nnml groups, and all nnimap groups except}
24548 ;; @r{@samp{nnimap+mail.lifelogs.com:train} and}
24549 ;; @r{@samp{nnimap+mail.lifelogs.com:spam}: any spam goes to nnimap training,}
24550 ;; @r{because it must have been detected manually}
24551
24552 ((spam-process-destination . "nnimap+mail.lifelogs.com:train"))
24553
24554 ;; @r{all @acronym{NNTP} groups}
24555 ;; @r{autodetect spam with the blacklist and ham with the BBDB}
24556 ((spam-autodetect-methods spam-use-blacklist spam-use-BBDB)
24557 ;; @r{send all spam to the training group}
24558  (spam-process-destination . "nnimap+mail.lifelogs.com:train"))
24559
24560 ;; @r{only some @acronym{NNTP} groups, where I want to autodetect spam}
24561 ((spam-autodetect . t))
24562
24563 ;; @r{my nnimap @samp{nnimap+mail.lifelogs.com:spam} group}
24564
24565 ;; @r{this is a spam group}
24566 ((spam-contents gnus-group-spam-classification-spam)
24567
24568  ;; @r{any spam (which happens when I enter for all unseen messages,}
24569  ;; @r{because of the @code{gnus-spam-newsgroup-contents} setting above), goes to}
24570  ;; @r{@samp{nnimap+mail.lifelogs.com:train} unless I mark it as ham}
24571
24572  (spam-process-destination "nnimap+mail.lifelogs.com:train")
24573
24574  ;; @r{any ham goes to my @samp{nnimap+mail.lifelogs.com:mail} folder, but}
24575  ;; @r{also to my @samp{nnimap+mail.lifelogs.com:trainham} folder for training}
24576
24577  (ham-process-destination "nnimap+mail.lifelogs.com:mail"
24578                           "nnimap+mail.lifelogs.com:trainham")
24579  ;; @r{in this group, only @samp{!} marks are ham}
24580  (ham-marks
24581   (gnus-ticked-mark))
24582  ;; @r{remembers senders in the blacklist on the way out---this is}
24583  ;; @r{definitely not needed, it just makes me feel better}
24584  (spam-process (gnus-group-spam-exit-processor-blacklist)))
24585
24586 ;; @r{Later, on the @acronym{IMAP} server I use the @samp{train} group for training}
24587 ;; @r{SpamAssassin to recognize spam, and the @samp{trainham} group fora}
24588 ;; @r{recognizing ham---but Gnus has nothing to do with it.}
24589
24590 @end example
24591
24592 @subsubheading Using @code{spam.el} on an IMAP server with a statistical filter on the server
24593 From Reiner Steib <reiner.steib@@gmx.de>.
24594
24595 My provider has set up bogofilter (in combination with @acronym{DCC}) on
24596 the mail server (@acronym{IMAP}).  Recognized spam goes to
24597 @samp{spam.detected}, the rest goes through the normal filter rules,
24598 i.e. to @samp{some.folder} or to @samp{INBOX}.  Training on false
24599 positives or negatives is done by copying or moving the article to
24600 @samp{training.ham} or @samp{training.spam} respectively.  A cron job on
24601 the server feeds those to bogofilter with the suitable ham or spam
24602 options and deletes them from the @samp{training.ham} and
24603 @samp{training.spam} folders.
24604
24605 With the following entries in @code{gnus-parameters}, @code{spam.el}
24606 does most of the job for me:
24607
24608 @lisp
24609    ("nnimap:spam\\.detected"
24610     (gnus-article-sort-functions '(gnus-article-sort-by-chars))
24611     (ham-process-destination "nnimap:INBOX" "nnimap:training.ham")
24612     (spam-contents gnus-group-spam-classification-spam))
24613    ("nnimap:\\(INBOX\\|other-folders\\)"
24614     (spam-process-destination . "nnimap:training.spam")
24615     (spam-contents gnus-group-spam-classification-ham))
24616 @end lisp
24617
24618 @itemize
24619
24620 @item @b{The Spam folder:}
24621
24622 In the folder @samp{spam.detected}, I have to check for false positives
24623 (i.e. legitimate mails, that were wrongly judged as spam by
24624 bogofilter or DCC).
24625
24626 Because of the @code{gnus-group-spam-classification-spam} entry, all
24627 messages are marked as spam (with @code{$}).  When I find a false
24628 positive, I mark the message with some other ham mark
24629 (@code{ham-marks}, @ref{Spam and Ham Processors}).  On group exit,
24630 those messages are copied to both groups, @samp{INBOX} (where I want
24631 to have the article) and @samp{training.ham} (for training bogofilter)
24632 and deleted from the @samp{spam.detected} folder.
24633
24634 The @code{gnus-article-sort-by-chars} entry simplifies detection of
24635 false positives for me.  I receive lots of worms (sweN, @dots{}), that all
24636 have a similar size.  Grouping them by size (i.e. chars) makes finding
24637 other false positives easier.  (Of course worms aren't @i{spam}
24638 (@acronym{UCE}, @acronym{UBE}) strictly speaking.  Anyhow, bogofilter is
24639 an excellent tool for filtering those unwanted mails for me.)
24640
24641 @item @b{Ham folders:}
24642
24643 In my ham folders, I just hit @kbd{S x}
24644 (@code{gnus-summary-mark-as-spam}) whenever I see an unrecognized spam
24645 mail (false negative).  On group exit, those messages are moved to
24646 @samp{training.spam}.
24647 @end itemize
24648
24649 @subsubheading Reporting spam articles in Gmane groups with @code{spam-report.el}
24650
24651 From Reiner Steib <reiner.steib@@gmx.de>.
24652
24653 With following entry in @code{gnus-parameters}, @kbd{S x}
24654 (@code{gnus-summary-mark-as-spam}) marks articles in @code{gmane.*}
24655 groups as spam and reports the to Gmane at group exit:
24656
24657 @lisp
24658    ("^gmane\\."
24659     (spam-process (gnus-group-spam-exit-processor-report-gmane)))
24660 @end lisp
24661
24662 Additionally, I use @code{(setq spam-report-gmane-use-article-number nil)}
24663 because I don't read the groups directly from news.gmane.org, but
24664 through my local news server (leafnode).  I.e. the article numbers are
24665 not the same as on news.gmane.org, thus @code{spam-report.el} has to check
24666 the @code{X-Report-Spam} header to find the correct number.
24667
24668 @node Spam Back Ends
24669 @subsection Spam Back Ends
24670 @cindex spam back ends
24671
24672 The spam package offers a variety of back ends for detecting spam.
24673 Each back end defines a set of methods for detecting spam
24674 (@pxref{Filtering Incoming Mail}, @pxref{Detecting Spam in Groups}),
24675 and a pair of spam and ham processors (@pxref{Spam and Ham
24676 Processors}).
24677
24678 @menu
24679 * Blacklists and Whitelists::
24680 * BBDB Whitelists::
24681 * Gmane Spam Reporting::
24682 * Anti-spam Hashcash Payments::
24683 * Blackholes::
24684 * Regular Expressions Header Matching::
24685 * Bogofilter::
24686 * SpamAssassin back end::
24687 * ifile spam filtering::
24688 * Spam Statistics Filtering::
24689 * SpamOracle::
24690 @end menu
24691
24692 @node Blacklists and Whitelists
24693 @subsubsection Blacklists and Whitelists
24694 @cindex spam filtering
24695 @cindex whitelists, spam filtering
24696 @cindex blacklists, spam filtering
24697 @cindex spam
24698
24699 @defvar spam-use-blacklist
24700
24701 Set this variable to @code{t} if you want to use blacklists when
24702 splitting incoming mail.  Messages whose senders are in the blacklist
24703 will be sent to the @code{spam-split-group}.  This is an explicit
24704 filter, meaning that it acts only on mail senders @emph{declared} to
24705 be spammers.
24706
24707 @end defvar
24708
24709 @defvar spam-use-whitelist
24710
24711 Set this variable to @code{t} if you want to use whitelists when
24712 splitting incoming mail.  Messages whose senders are not in the
24713 whitelist will be sent to the next spam-split rule.  This is an
24714 explicit filter, meaning that unless someone is in the whitelist, their
24715 messages are not assumed to be spam or ham.
24716
24717 @end defvar
24718
24719 @defvar spam-use-whitelist-exclusive
24720
24721 Set this variable to @code{t} if you want to use whitelists as an
24722 implicit filter, meaning that every message will be considered spam
24723 unless the sender is in the whitelist.  Use with care.
24724
24725 @end defvar
24726
24727 @defvar gnus-group-spam-exit-processor-blacklist
24728
24729 Add this symbol to a group's @code{spam-process} parameter by
24730 customizing the group parameters or the
24731 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
24732 added to a group's @code{spam-process} parameter, the senders of
24733 spam-marked articles will be added to the blacklist.
24734
24735 @emph{WARNING}
24736
24737 Instead of the obsolete
24738 @code{gnus-group-spam-exit-processor-blacklist}, it is recommended
24739 that you use @code{(spam spam-use-blacklist)}.  Everything will work
24740 the same way, we promise.
24741
24742 @end defvar
24743
24744 @defvar gnus-group-ham-exit-processor-whitelist
24745
24746 Add this symbol to a group's @code{spam-process} parameter by
24747 customizing the group parameters or the
24748 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
24749 added to a group's @code{spam-process} parameter, the senders of
24750 ham-marked articles in @emph{ham} groups will be added to the
24751 whitelist.
24752
24753 @emph{WARNING}
24754
24755 Instead of the obsolete
24756 @code{gnus-group-ham-exit-processor-whitelist}, it is recommended
24757 that you use @code{(ham spam-use-whitelist)}.  Everything will work
24758 the same way, we promise.
24759
24760 @end defvar
24761
24762 Blacklists are lists of regular expressions matching addresses you
24763 consider to be spam senders.  For instance, to block mail from any
24764 sender at @samp{vmadmin.com}, you can put @samp{vmadmin.com} in your
24765 blacklist.  You start out with an empty blacklist.  Blacklist entries
24766 use the Emacs regular expression syntax.
24767
24768 Conversely, whitelists tell Gnus what addresses are considered
24769 legitimate.  All messages from whitelisted addresses are considered
24770 non-spam.  Also see @ref{BBDB Whitelists}.  Whitelist entries use the
24771 Emacs regular expression syntax.
24772
24773 The blacklist and whitelist file locations can be customized with the
24774 @code{spam-directory} variable (@file{~/News/spam} by default), or
24775 the @code{spam-whitelist} and @code{spam-blacklist} variables
24776 directly.  The whitelist and blacklist files will by default be in the
24777 @code{spam-directory} directory, named @file{whitelist} and
24778 @file{blacklist} respectively.
24779
24780 @node BBDB Whitelists
24781 @subsubsection BBDB Whitelists
24782 @cindex spam filtering
24783 @cindex BBDB whitelists, spam filtering
24784 @cindex BBDB, spam filtering
24785 @cindex spam
24786
24787 @defvar spam-use-BBDB
24788
24789 Analogous to @code{spam-use-whitelist} (@pxref{Blacklists and
24790 Whitelists}), but uses the BBDB as the source of whitelisted
24791 addresses, without regular expressions.  You must have the BBDB loaded
24792 for @code{spam-use-BBDB} to work properly.  Messages whose senders are
24793 not in the BBDB will be sent to the next spam-split rule.  This is an
24794 explicit filter, meaning that unless someone is in the BBDB, their
24795 messages are not assumed to be spam or ham.
24796
24797 @end defvar
24798
24799 @defvar spam-use-BBDB-exclusive
24800
24801 Set this variable to @code{t} if you want to use the BBDB as an
24802 implicit filter, meaning that every message will be considered spam
24803 unless the sender is in the BBDB.  Use with care.  Only sender
24804 addresses in the BBDB will be allowed through; all others will be
24805 classified as spammers.
24806
24807 While @code{spam-use-BBDB-exclusive} @emph{can} be used as an alias
24808 for @code{spam-use-BBDB} as far as @code{spam.el} is concerned, it is
24809 @emph{not} a separate back end.  If you set
24810 @code{spam-use-BBDB-exclusive} to t, @emph{all} your BBDB splitting
24811 will be exclusive.
24812
24813 @end defvar
24814
24815 @defvar gnus-group-ham-exit-processor-BBDB
24816
24817 Add this symbol to a group's @code{spam-process} parameter by
24818 customizing the group parameters or the
24819 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
24820 added to a group's @code{spam-process} parameter, the senders of
24821 ham-marked articles in @emph{ham} groups will be added to the
24822 BBDB.
24823
24824 @emph{WARNING}
24825
24826 Instead of the obsolete
24827 @code{gnus-group-ham-exit-processor-BBDB}, it is recommended
24828 that you use @code{(ham spam-use-BBDB)}.  Everything will work
24829 the same way, we promise.
24830
24831 @end defvar
24832
24833 @node Gmane Spam Reporting
24834 @subsubsection Gmane Spam Reporting
24835 @cindex spam reporting
24836 @cindex Gmane, spam reporting
24837 @cindex Gmane, spam reporting
24838 @cindex spam
24839
24840 @defvar gnus-group-spam-exit-processor-report-gmane
24841
24842 Add this symbol to a group's @code{spam-process} parameter by
24843 customizing the group parameters or the
24844 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
24845 added to a group's @code{spam-process} parameter, the spam-marked
24846 articles groups will be reported to the Gmane administrators via a
24847 HTTP request.
24848
24849 Gmane can be found at @uref{http://gmane.org}.
24850
24851 @emph{WARNING}
24852
24853 Instead of the obsolete
24854 @code{gnus-group-spam-exit-processor-report-gmane}, it is recommended
24855 that you use @code{(spam spam-use-gmane)}.  Everything will work the
24856 same way, we promise.
24857
24858 @end defvar
24859
24860 @defvar spam-report-gmane-use-article-number
24861
24862 This variable is @code{t} by default.  Set it to @code{nil} if you are
24863 running your own news server, for instance, and the local article
24864 numbers don't correspond to the Gmane article numbers.  When
24865 @code{spam-report-gmane-use-article-number} is @code{nil},
24866 @code{spam-report.el} will fetch the number from the article headers.
24867
24868 @end defvar
24869
24870 @defvar spam-report-user-mail-address
24871
24872 Mail address exposed in the User-Agent spam reports to Gmane.  It allows
24873 the Gmane administrators to contact you in case of misreports.  The
24874 default is @code{user-mail-address}.
24875
24876 @end defvar
24877
24878 @node Anti-spam Hashcash Payments
24879 @subsubsection Anti-spam Hashcash Payments
24880 @cindex spam filtering
24881 @cindex hashcash, spam filtering
24882 @cindex spam
24883
24884 @defvar spam-use-hashcash
24885
24886 Similar to @code{spam-use-whitelist} (@pxref{Blacklists and
24887 Whitelists}), but uses hashcash tokens for whitelisting messages
24888 instead of the sender address.  Messages without a hashcash payment
24889 token will be sent to the next spam-split rule.  This is an explicit
24890 filter, meaning that unless a hashcash token is found, the messages
24891 are not assumed to be spam or ham.
24892
24893 @end defvar
24894
24895 @node Blackholes
24896 @subsubsection Blackholes
24897 @cindex spam filtering
24898 @cindex blackholes, spam filtering
24899 @cindex spam
24900
24901 @defvar spam-use-blackholes
24902
24903 This option is disabled by default.  You can let Gnus consult the
24904 blackhole-type distributed spam processing systems (DCC, for instance)
24905 when you set this option.  The variable @code{spam-blackhole-servers}
24906 holds the list of blackhole servers Gnus will consult.  The current
24907 list is fairly comprehensive, but make sure to let us know if it
24908 contains outdated servers.
24909
24910 The blackhole check uses the @code{dig.el} package, but you can tell
24911 @code{spam.el} to use @code{dns.el} instead for better performance if
24912 you set @code{spam-use-dig} to @code{nil}.  It is not recommended at
24913 this time to set @code{spam-use-dig} to @code{nil} despite the
24914 possible performance improvements, because some users may be unable to
24915 use it, but you can try it and see if it works for you.
24916
24917 @end defvar
24918
24919 @defvar spam-blackhole-servers
24920
24921 The list of servers to consult for blackhole checks.
24922
24923 @end defvar
24924
24925 @defvar spam-blackhole-good-server-regex
24926
24927 A regular expression for IPs that should not be checked against the
24928 blackhole server list.  When set to @code{nil}, it has no effect.
24929
24930 @end defvar
24931
24932 @defvar spam-use-dig
24933
24934 Use the @code{dig.el} package instead of the @code{dns.el} package.
24935 The default setting of @code{t} is recommended.
24936
24937 @end defvar
24938
24939 Blackhole checks are done only on incoming mail.  There is no spam or
24940 ham processor for blackholes.
24941
24942 @node Regular Expressions Header Matching
24943 @subsubsection Regular Expressions Header Matching
24944 @cindex spam filtering
24945 @cindex regular expressions header matching, spam filtering
24946 @cindex spam
24947
24948 @defvar spam-use-regex-headers
24949
24950 This option is disabled by default.  You can let Gnus check the
24951 message headers against lists of regular expressions when you set this
24952 option.  The variables @code{spam-regex-headers-spam} and
24953 @code{spam-regex-headers-ham} hold the list of regular expressions.
24954 Gnus will check against the message headers to determine if the
24955 message is spam or ham, respectively.
24956
24957 @end defvar
24958
24959 @defvar spam-regex-headers-spam
24960
24961 The list of regular expressions that, when matched in the headers of
24962 the message, positively identify it as spam.
24963
24964 @end defvar
24965
24966 @defvar spam-regex-headers-ham
24967
24968 The list of regular expressions that, when matched in the headers of
24969 the message, positively identify it as ham.
24970
24971 @end defvar
24972
24973 Regular expression header checks are done only on incoming mail.
24974 There is no specific spam or ham processor for regular expressions.
24975
24976 @node Bogofilter
24977 @subsubsection Bogofilter
24978 @cindex spam filtering
24979 @cindex bogofilter, spam filtering
24980 @cindex spam
24981
24982 @defvar spam-use-bogofilter
24983
24984 Set this variable if you want @code{spam-split} to use Eric Raymond's
24985 speedy Bogofilter.
24986
24987 With a minimum of care for associating the @samp{$} mark for spam
24988 articles only, Bogofilter training all gets fairly automatic.  You
24989 should do this until you get a few hundreds of articles in each
24990 category, spam or not.  The command @kbd{S t} in summary mode, either
24991 for debugging or for curiosity, shows the @emph{spamicity} score of
24992 the current article (between 0.0 and 1.0).
24993
24994 Bogofilter determines if a message is spam based on a specific
24995 threshold.  That threshold can be customized, consult the Bogofilter
24996 documentation.
24997
24998 If the @code{bogofilter} executable is not in your path, Bogofilter
24999 processing will be turned off.
25000
25001 You should not enable this if you use @code{spam-use-bogofilter-headers}.
25002
25003 @end defvar
25004
25005 @table @kbd
25006 @item M s t
25007 @itemx S t
25008 @kindex M s t
25009 @kindex S t
25010 @findex spam-bogofilter-score
25011 Get the Bogofilter spamicity score (@code{spam-bogofilter-score}).
25012 @end table
25013
25014 @defvar spam-use-bogofilter-headers
25015
25016 Set this variable if you want @code{spam-split} to use Eric Raymond's
25017 speedy Bogofilter, looking only at the message headers.  It works
25018 similarly to @code{spam-use-bogofilter}, but the @code{X-Bogosity} header
25019 must be in the message already.  Normally you would do this with a
25020 procmail recipe or something similar; consult the Bogofilter
25021 installation documents for details.
25022
25023 You should not enable this if you use @code{spam-use-bogofilter}.
25024
25025 @end defvar
25026
25027 @defvar gnus-group-spam-exit-processor-bogofilter
25028 Add this symbol to a group's @code{spam-process} parameter by
25029 customizing the group parameters or the
25030 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
25031 added to a group's @code{spam-process} parameter, spam-marked articles
25032 will be added to the Bogofilter spam database.
25033
25034 @emph{WARNING}
25035
25036 Instead of the obsolete
25037 @code{gnus-group-spam-exit-processor-bogofilter}, it is recommended
25038 that you use @code{(spam spam-use-bogofilter)}.  Everything will work
25039 the same way, we promise.
25040 @end defvar
25041
25042 @defvar gnus-group-ham-exit-processor-bogofilter
25043 Add this symbol to a group's @code{spam-process} parameter by
25044 customizing the group parameters or the
25045 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
25046 added to a group's @code{spam-process} parameter, the ham-marked
25047 articles in @emph{ham} groups will be added to the Bogofilter database
25048 of non-spam messages.
25049
25050 @emph{WARNING}
25051
25052 Instead of the obsolete
25053 @code{gnus-group-ham-exit-processor-bogofilter}, it is recommended
25054 that you use @code{(ham spam-use-bogofilter)}.  Everything will work
25055 the same way, we promise.
25056 @end defvar
25057
25058 @defvar spam-bogofilter-database-directory
25059
25060 This is the directory where Bogofilter will store its databases.  It
25061 is not specified by default, so Bogofilter will use its own default
25062 database directory.
25063
25064 @end defvar
25065
25066 The Bogofilter mail classifier is similar to @command{ifile} in intent and
25067 purpose.  A ham and a spam processor are provided, plus the
25068 @code{spam-use-bogofilter} and @code{spam-use-bogofilter-headers}
25069 variables to indicate to spam-split that Bogofilter should either be
25070 used, or has already been used on the article.  The 0.9.2.1 version of
25071 Bogofilter was used to test this functionality.
25072
25073 @node SpamAssassin back end
25074 @subsubsection SpamAssassin back end
25075 @cindex spam filtering
25076 @cindex spamassassin, spam filtering
25077 @cindex spam
25078
25079 @defvar spam-use-spamassassin
25080
25081 Set this variable if you want @code{spam-split} to use SpamAssassin.
25082
25083 SpamAssassin assigns a score to each article based on a set of rules
25084 and tests, including a Bayesian filter.  The Bayesian filter can be
25085 trained by associating the @samp{$} mark for spam articles.  The
25086 spam score can be viewed by using the command @kbd{S t} in summary
25087 mode.
25088
25089 If you set this variable, each article will be processed by
25090 SpamAssassin when @code{spam-split} is called.  If your mail is
25091 preprocessed by SpamAssassin, and you want to just use the
25092 SpamAssassin headers, set @code{spam-use-spamassassin-headers}
25093 instead.
25094
25095 You should not enable this if you use
25096 @code{spam-use-spamassassin-headers}.
25097
25098 @end defvar
25099
25100 @defvar spam-use-spamassassin-headers
25101
25102 Set this variable if your mail is preprocessed by SpamAssassin and
25103 want @code{spam-split} to split based on the SpamAssassin headers.
25104
25105 You should not enable this if you use @code{spam-use-spamassassin}.
25106
25107 @end defvar
25108
25109 @defvar spam-spamassassin-program
25110
25111 This variable points to the SpamAssassin executable.  If you have
25112 @code{spamd} running, you can set this variable to the @code{spamc}
25113 executable for faster processing.  See the SpamAssassin documentation
25114 for more information on @code{spamd}/@code{spamc}.
25115
25116 @end defvar
25117
25118 SpamAssassin is a powerful and flexible spam filter that uses a wide
25119 variety of tests to identify spam.  A ham and a spam processors are
25120 provided, plus the @code{spam-use-spamassassin} and
25121 @code{spam-use-spamassassin-headers} variables to indicate to
25122 spam-split that SpamAssassin should be either used, or has already
25123 been used on the article.  The 2.63 version of SpamAssassin was used
25124 to test this functionality.
25125
25126 @node ifile spam filtering
25127 @subsubsection ifile spam filtering
25128 @cindex spam filtering
25129 @cindex ifile, spam filtering
25130 @cindex spam
25131
25132 @defvar spam-use-ifile
25133
25134 Enable this variable if you want @code{spam-split} to use @command{ifile}, a
25135 statistical analyzer similar to Bogofilter.
25136
25137 @end defvar
25138
25139 @defvar spam-ifile-all-categories
25140
25141 Enable this variable if you want @code{spam-use-ifile} to give you all
25142 the ifile categories, not just spam/non-spam.  If you use this, make
25143 sure you train ifile as described in its documentation.
25144
25145 @end defvar
25146
25147 @defvar spam-ifile-spam-category
25148
25149 This is the category of spam messages as far as ifile is concerned.
25150 The actual string used is irrelevant, but you probably want to leave
25151 the default value of @samp{spam}.
25152 @end defvar
25153
25154 @defvar spam-ifile-database
25155
25156 This is the filename for the ifile database.  It is not specified by
25157 default, so ifile will use its own default database name.
25158
25159 @end defvar
25160
25161 The ifile mail classifier is similar to Bogofilter in intent and
25162 purpose.  A ham and a spam processor are provided, plus the
25163 @code{spam-use-ifile} variable to indicate to spam-split that ifile
25164 should be used.  The 1.2.1 version of ifile was used to test this
25165 functionality.
25166
25167 @node Spam Statistics Filtering
25168 @subsubsection Spam Statistics Filtering
25169 @cindex spam filtering
25170 @cindex spam-stat, spam filtering
25171 @cindex spam-stat
25172 @cindex spam
25173
25174 This back end uses the Spam Statistics Emacs Lisp package to perform
25175 statistics-based filtering (@pxref{Spam Statistics Package}).  Before
25176 using this, you may want to perform some additional steps to
25177 initialize your Spam Statistics dictionary.  @xref{Creating a
25178 spam-stat dictionary}.
25179
25180 @defvar spam-use-stat
25181
25182 @end defvar
25183
25184 @defvar gnus-group-spam-exit-processor-stat
25185 Add this symbol to a group's @code{spam-process} parameter by
25186 customizing the group parameters or the
25187 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
25188 added to a group's @code{spam-process} parameter, the spam-marked
25189 articles will be added to the spam-stat database of spam messages.
25190
25191 @emph{WARNING}
25192
25193 Instead of the obsolete
25194 @code{gnus-group-spam-exit-processor-stat}, it is recommended
25195 that you use @code{(spam spam-use-stat)}.  Everything will work
25196 the same way, we promise.
25197 @end defvar
25198
25199 @defvar gnus-group-ham-exit-processor-stat
25200 Add this symbol to a group's @code{spam-process} parameter by
25201 customizing the group parameters or the
25202 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
25203 added to a group's @code{spam-process} parameter, the ham-marked
25204 articles in @emph{ham} groups will be added to the spam-stat database
25205 of non-spam messages.
25206
25207 @emph{WARNING}
25208
25209 Instead of the obsolete
25210 @code{gnus-group-ham-exit-processor-stat}, it is recommended
25211 that you use @code{(ham spam-use-stat)}.  Everything will work
25212 the same way, we promise.
25213 @end defvar
25214
25215 This enables @code{spam.el} to cooperate with @file{spam-stat.el}.
25216 @file{spam-stat.el} provides an internal (Lisp-only) spam database,
25217 which unlike ifile or Bogofilter does not require external programs.
25218 A spam and a ham processor, and the @code{spam-use-stat} variable for
25219 @code{spam-split} are provided.
25220
25221 @node SpamOracle
25222 @subsubsection Using SpamOracle with Gnus
25223 @cindex spam filtering
25224 @cindex SpamOracle
25225 @cindex spam
25226
25227 An easy way to filter out spam is to use SpamOracle.  SpamOracle is an
25228 statistical mail filtering tool written by Xavier Leroy and needs to be
25229 installed separately.
25230
25231 There are several ways to use SpamOracle with Gnus.  In all cases, your
25232 mail is piped through SpamOracle in its @emph{mark} mode.  SpamOracle will
25233 then enter an @samp{X-Spam} header indicating whether it regards the
25234 mail as a spam mail or not.
25235
25236 One possibility is to run SpamOracle as a @code{:prescript} from the
25237 @xref{Mail Source Specifiers}, (@pxref{SpamAssassin}).  This method has
25238 the advantage that the user can see the @emph{X-Spam} headers.
25239
25240 The easiest method is to make @file{spam.el} (@pxref{Spam Package})
25241 call SpamOracle.
25242
25243 @vindex spam-use-spamoracle
25244 To enable SpamOracle usage by @code{spam.el}, set the variable
25245 @code{spam-use-spamoracle} to @code{t} and configure the
25246 @code{nnmail-split-fancy} or @code{nnimap-split-fancy}.  @xref{Spam
25247 Package}.  In this example the @samp{INBOX} of an nnimap server is
25248 filtered using SpamOracle.  Mails recognized as spam mails will be
25249 moved to @code{spam-split-group}, @samp{Junk} in this case.  Ham
25250 messages stay in @samp{INBOX}:
25251
25252 @example
25253 (setq spam-use-spamoracle t
25254       spam-split-group "Junk"
25255       ;; @r{for nnimap you'll probably want to set nnimap-split-methods, see the manual}
25256       nnimap-split-inbox '("INBOX")
25257       nnimap-split-fancy '(| (: spam-split) "INBOX"))
25258 @end example
25259
25260 @defvar spam-use-spamoracle
25261 Set to @code{t} if you want Gnus to enable spam filtering using
25262 SpamOracle.
25263 @end defvar
25264
25265 @defvar spam-spamoracle-binary
25266 Gnus uses the SpamOracle binary called @file{spamoracle} found in the
25267 user's PATH.  Using the variable @code{spam-spamoracle-binary}, this
25268 can be customized.
25269 @end defvar
25270
25271 @defvar spam-spamoracle-database
25272 By default, SpamOracle uses the file @file{~/.spamoracle.db} as a database to
25273 store its analysis.  This is controlled by the variable
25274 @code{spam-spamoracle-database} which defaults to @code{nil}.  That means
25275 the default SpamOracle database will be used.  In case you want your
25276 database to live somewhere special, set
25277 @code{spam-spamoracle-database} to this path.
25278 @end defvar
25279
25280 SpamOracle employs a statistical algorithm to determine whether a
25281 message is spam or ham.  In order to get good results, meaning few
25282 false hits or misses, SpamOracle needs training.  SpamOracle learns
25283 the characteristics of your spam mails.  Using the @emph{add} mode
25284 (training mode) one has to feed good (ham) and spam mails to
25285 SpamOracle.  This can be done by pressing @kbd{|} in the Summary
25286 buffer and pipe the mail to a SpamOracle process or using
25287 @file{spam.el}'s spam- and ham-processors, which is much more
25288 convenient.  For a detailed description of spam- and ham-processors,
25289 @xref{Spam Package}.
25290
25291 @defvar gnus-group-spam-exit-processor-spamoracle
25292 Add this symbol to a group's @code{spam-process} parameter by
25293 customizing the group parameter or the
25294 @code{gnus-spam-process-newsgroups} variable.  When this symbol is added
25295 to a group's @code{spam-process} parameter, spam-marked articles will be
25296 sent to SpamOracle as spam samples.
25297
25298 @emph{WARNING}
25299
25300 Instead of the obsolete
25301 @code{gnus-group-spam-exit-processor-spamoracle}, it is recommended
25302 that you use @code{(spam spam-use-spamoracle)}.  Everything will work
25303 the same way, we promise.
25304 @end defvar
25305
25306 @defvar gnus-group-ham-exit-processor-spamoracle
25307 Add this symbol to a group's @code{spam-process} parameter by
25308 customizing the group parameter or the
25309 @code{gnus-spam-process-newsgroups} variable.  When this symbol is added
25310 to a group's @code{spam-process} parameter, the ham-marked articles in
25311 @emph{ham} groups will be sent to the SpamOracle as samples of ham
25312 messages.
25313
25314 @emph{WARNING}
25315
25316 Instead of the obsolete
25317 @code{gnus-group-ham-exit-processor-spamoracle}, it is recommended
25318 that you use @code{(ham spam-use-spamoracle)}.  Everything will work
25319 the same way, we promise.
25320 @end defvar
25321
25322 @emph{Example:} These are the Group Parameters of a group that has been
25323 classified as a ham group, meaning that it should only contain ham
25324 messages.
25325 @example
25326  ((spam-contents gnus-group-spam-classification-ham)
25327   (spam-process ((ham spam-use-spamoracle)
25328                  (spam spam-use-spamoracle))))
25329 @end example
25330 For this group the @code{spam-use-spamoracle} is installed for both
25331 ham and spam processing.  If the group contains spam message
25332 (e.g. because SpamOracle has not had enough sample messages yet) and
25333 the user marks some messages as spam messages, these messages will be
25334 processed by SpamOracle.  The processor sends the messages to
25335 SpamOracle as new samples for spam.
25336
25337 @node Extending the Spam package
25338 @subsection Extending the Spam package
25339 @cindex spam filtering
25340 @cindex spam elisp package, extending
25341 @cindex extending the spam elisp package
25342
25343 Say you want to add a new back end called blackbox.  For filtering
25344 incoming mail, provide the following:
25345
25346 @enumerate
25347
25348 @item
25349 Code
25350
25351 @lisp
25352 (defvar spam-use-blackbox nil
25353   "True if blackbox should be used.")
25354 @end lisp
25355
25356 Write @code{spam-check-blackbox} if Blackbox can check incoming mail.
25357
25358 Write @code{spam-blackbox-register-routine} and
25359 @code{spam-blackbox-unregister-routine} using the bogofilter
25360 register/unregister routines as a start, or other restister/unregister
25361 routines more appropriate to Blackbox, if Blackbox can
25362 register/unregister spam and ham.
25363
25364 @item
25365 Functionality
25366
25367 The @code{spam-check-blackbox} function should return @samp{nil} or
25368 @code{spam-split-group}, observing the other conventions.  See the
25369 existing @code{spam-check-*} functions for examples of what you can
25370 do, and stick to the template unless you fully understand the reasons
25371 why you aren't.
25372
25373 @end enumerate
25374
25375 For processing spam and ham messages, provide the following:
25376
25377 @enumerate
25378
25379 @item
25380 Code
25381
25382 Note you don't have to provide a spam or a ham processor.  Only
25383 provide them if Blackbox supports spam or ham processing.
25384
25385 Also, ham and spam processors are being phased out as single
25386 variables.  Instead the form @code{(spam spam-use-blackbox)} or
25387 @code{(ham spam-use-blackbox)} is favored.  For now, spam/ham
25388 processor variables are still around but they won't be for long.
25389
25390 @lisp
25391 (defvar gnus-group-spam-exit-processor-blackbox "blackbox-spam"
25392   "The Blackbox summary exit spam processor.
25393 Only applicable to spam groups.")
25394
25395 (defvar gnus-group-ham-exit-processor-blackbox "blackbox-ham"
25396   "The whitelist summary exit ham processor.
25397 Only applicable to non-spam (unclassified and ham) groups.")
25398
25399 @end lisp
25400
25401 @item
25402 Gnus parameters
25403
25404 Add
25405 @lisp
25406 (const :tag "Spam: Blackbox" (spam spam-use-blackbox))
25407 (const :tag "Ham: Blackbox"  (ham spam-use-blackbox))
25408 @end lisp
25409 to the @code{spam-process} group parameter in @code{gnus.el}.  Make
25410 sure you do it twice, once for the parameter and once for the
25411 variable customization.
25412
25413 Add
25414 @lisp
25415 (variable-item spam-use-blackbox)
25416 @end lisp
25417 to the @code{spam-autodetect-methods} group parameter in
25418 @code{gnus.el} if Blackbox can check incoming mail for spam contents.
25419
25420 Finally, use the appropriate @code{spam-install-*-backend} function in
25421 @code{spam.el}.  Here are the available functions.
25422
25423
25424 @enumerate
25425
25426 @item
25427 @code{spam-install-backend-alias}
25428
25429 This function will simply install an alias for a back end that does
25430 everything like the original back end.  It is currently only used to
25431 make @code{spam-use-BBDB-exclusive} act like @code{spam-use-BBDB}.
25432
25433 @item
25434 @code{spam-install-nocheck-backend}
25435
25436 This function installs a back end that has no check function, but can
25437 register/unregister ham or spam.  The @code{spam-use-gmane} back end is
25438 such a back end.
25439
25440 @item
25441 @code{spam-install-checkonly-backend}
25442
25443 This function will install a back end that can only check incoming mail
25444 for spam contents.  It can't register or unregister messages.
25445 @code{spam-use-blackholes} and @code{spam-use-hashcash} are such
25446 back ends.
25447
25448 @item
25449 @code{spam-install-statistical-checkonly-backend}
25450
25451 This function installs a statistical back end (one which requires the
25452 full body of a message to check it) that can only check incoming mail
25453 for contents.  @code{spam-use-regex-body} is such a filter.
25454
25455 @item
25456 @code{spam-install-statistical-backend}
25457
25458 This function install a statistical back end with incoming checks and
25459 registration/unregistration routines.  @code{spam-use-bogofilter} is
25460 set up this way.
25461
25462 @item
25463 @code{spam-install-backend}
25464
25465 This is the most normal back end installation, where a back end that can
25466 check and register/unregister messages is set up without statistical
25467 abilities.  The @code{spam-use-BBDB} is such a back end.
25468
25469 @item
25470 @code{spam-install-mover-backend}
25471
25472 Mover back ends are internal to @code{spam.el} and specifically move
25473 articles around when the summary is exited.  You will very probably
25474 never install such a back end.
25475 @end enumerate
25476
25477 @end enumerate
25478
25479 @node Spam Statistics Package
25480 @subsection Spam Statistics Package
25481 @cindex Paul Graham
25482 @cindex Graham, Paul
25483 @cindex naive Bayesian spam filtering
25484 @cindex Bayesian spam filtering, naive
25485 @cindex spam filtering, naive Bayesian
25486
25487 Paul Graham has written an excellent essay about spam filtering using
25488 statistics: @uref{http://www.paulgraham.com/spam.html,A Plan for
25489 Spam}.  In it he describes the inherent deficiency of rule-based
25490 filtering as used by SpamAssassin, for example: Somebody has to write
25491 the rules, and everybody else has to install these rules.  You are
25492 always late.  It would be much better, he argues, to filter mail based
25493 on whether it somehow resembles spam or non-spam.  One way to measure
25494 this is word distribution.  He then goes on to describe a solution
25495 that checks whether a new mail resembles any of your other spam mails
25496 or not.
25497
25498 The basic idea is this:  Create a two collections of your mail, one
25499 with spam, one with non-spam.  Count how often each word appears in
25500 either collection, weight this by the total number of mails in the
25501 collections, and store this information in a dictionary.  For every
25502 word in a new mail, determine its probability to belong to a spam or a
25503 non-spam mail.  Use the 15 most conspicuous words, compute the total
25504 probability of the mail being spam.  If this probability is higher
25505 than a certain threshold, the mail is considered to be spam.
25506
25507 The Spam Statistics package adds support to Gnus for this kind of
25508 filtering.  It can be used as one of the back ends of the Spam package
25509 (@pxref{Spam Package}), or by itself.
25510
25511 Before using the Spam Statistics package, you need to set it up.
25512 First, you need two collections of your mail, one with spam, one with
25513 non-spam.  Then you need to create a dictionary using these two
25514 collections, and save it.  And last but not least, you need to use
25515 this dictionary in your fancy mail splitting rules.
25516
25517 @menu
25518 * Creating a spam-stat dictionary::
25519 * Splitting mail using spam-stat::
25520 * Low-level interface to the spam-stat dictionary::
25521 @end menu
25522
25523 @node Creating a spam-stat dictionary
25524 @subsubsection Creating a spam-stat dictionary
25525
25526 Before you can begin to filter spam based on statistics, you must
25527 create these statistics based on two mail collections, one with spam,
25528 one with non-spam.  These statistics are then stored in a dictionary
25529 for later use.  In order for these statistics to be meaningful, you
25530 need several hundred emails in both collections.
25531
25532 Gnus currently supports only the nnml back end for automated dictionary
25533 creation.  The nnml back end stores all mails in a directory, one file
25534 per mail.  Use the following:
25535
25536 @defun spam-stat-process-spam-directory
25537 Create spam statistics for every file in this directory.  Every file
25538 is treated as one spam mail.
25539 @end defun
25540
25541 @defun spam-stat-process-non-spam-directory
25542 Create non-spam statistics for every file in this directory.  Every
25543 file is treated as one non-spam mail.
25544 @end defun
25545
25546 Usually you would call @code{spam-stat-process-spam-directory} on a
25547 directory such as @file{~/Mail/mail/spam} (this usually corresponds to
25548 the group @samp{nnml:mail.spam}), and you would call
25549 @code{spam-stat-process-non-spam-directory} on a directory such as
25550 @file{~/Mail/mail/misc} (this usually corresponds to the group
25551 @samp{nnml:mail.misc}).
25552
25553 When you are using @acronym{IMAP}, you won't have the mails available
25554 locally, so that will not work.  One solution is to use the Gnus Agent
25555 to cache the articles.  Then you can use directories such as
25556 @file{"~/News/agent/nnimap/mail.yourisp.com/personal_spam"} for
25557 @code{spam-stat-process-spam-directory}.  @xref{Agent as Cache}.
25558
25559 @defvar spam-stat
25560 This variable holds the hash-table with all the statistics---the
25561 dictionary we have been talking about.  For every word in either
25562 collection, this hash-table stores a vector describing how often the
25563 word appeared in spam and often it appeared in non-spam mails.
25564 @end defvar
25565
25566 If you want to regenerate the statistics from scratch, you need to
25567 reset the dictionary.
25568
25569 @defun spam-stat-reset
25570 Reset the @code{spam-stat} hash-table, deleting all the statistics.
25571 @end defun
25572
25573 When you are done, you must save the dictionary.  The dictionary may
25574 be rather large.  If you will not update the dictionary incrementally
25575 (instead, you will recreate it once a month, for example), then you
25576 can reduce the size of the dictionary by deleting all words that did
25577 not appear often enough or that do not clearly belong to only spam or
25578 only non-spam mails.
25579
25580 @defun spam-stat-reduce-size
25581 Reduce the size of the dictionary.  Use this only if you do not want
25582 to update the dictionary incrementally.
25583 @end defun
25584
25585 @defun spam-stat-save
25586 Save the dictionary.
25587 @end defun
25588
25589 @defvar spam-stat-file
25590 The filename used to store the dictionary.  This defaults to
25591 @file{~/.spam-stat.el}.
25592 @end defvar
25593
25594 @node Splitting mail using spam-stat
25595 @subsubsection Splitting mail using spam-stat
25596
25597 This section describes how to use the Spam statistics
25598 @emph{independently} of the @xref{Spam Package}.
25599
25600 First, add the following to your @file{~/.gnus.el} file:
25601
25602 @lisp
25603 (require 'spam-stat)
25604 (spam-stat-load)
25605 @end lisp
25606
25607 This will load the necessary Gnus code, and the dictionary you
25608 created.
25609
25610 Next, you need to adapt your fancy splitting rules:  You need to
25611 determine how to use @code{spam-stat}.  The following examples are for
25612 the nnml back end.  Using the nnimap back end works just as well.  Just
25613 use @code{nnimap-split-fancy} instead of @code{nnmail-split-fancy}.
25614
25615 In the simplest case, you only have two groups, @samp{mail.misc} and
25616 @samp{mail.spam}.  The following expression says that mail is either
25617 spam or it should go into @samp{mail.misc}.  If it is spam, then
25618 @code{spam-stat-split-fancy} will return @samp{mail.spam}.
25619
25620 @lisp
25621 (setq nnmail-split-fancy
25622       `(| (: spam-stat-split-fancy)
25623           "mail.misc"))
25624 @end lisp
25625
25626 @defvar spam-stat-split-fancy-spam-group
25627 The group to use for spam.  Default is @samp{mail.spam}.
25628 @end defvar
25629
25630 If you also filter mail with specific subjects into other groups, use
25631 the following expression.  Only mails not matching the regular
25632 expression are considered potential spam.
25633
25634 @lisp
25635 (setq nnmail-split-fancy
25636       `(| ("Subject" "\\bspam-stat\\b" "mail.emacs")
25637           (: spam-stat-split-fancy)
25638           "mail.misc"))
25639 @end lisp
25640
25641 If you want to filter for spam first, then you must be careful when
25642 creating the dictionary.  Note that @code{spam-stat-split-fancy} must
25643 consider both mails in @samp{mail.emacs} and in @samp{mail.misc} as
25644 non-spam, therefore both should be in your collection of non-spam
25645 mails, when creating the dictionary!
25646
25647 @lisp
25648 (setq nnmail-split-fancy
25649       `(| (: spam-stat-split-fancy)
25650           ("Subject" "\\bspam-stat\\b" "mail.emacs")
25651           "mail.misc"))
25652 @end lisp
25653
25654 You can combine this with traditional filtering.  Here, we move all
25655 HTML-only mails into the @samp{mail.spam.filtered} group.  Note that since
25656 @code{spam-stat-split-fancy} will never see them, the mails in
25657 @samp{mail.spam.filtered} should be neither in your collection of spam mails,
25658 nor in your collection of non-spam mails, when creating the
25659 dictionary!
25660
25661 @lisp
25662 (setq nnmail-split-fancy
25663       `(| ("Content-Type" "text/html" "mail.spam.filtered")
25664           (: spam-stat-split-fancy)
25665           ("Subject" "\\bspam-stat\\b" "mail.emacs")
25666           "mail.misc"))
25667 @end lisp
25668
25669
25670 @node Low-level interface to the spam-stat dictionary
25671 @subsubsection Low-level interface to the spam-stat dictionary
25672
25673 The main interface to using @code{spam-stat}, are the following functions:
25674
25675 @defun spam-stat-buffer-is-spam
25676 Called in a buffer, that buffer is considered to be a new spam mail.
25677 Use this for new mail that has not been processed before.
25678 @end defun
25679
25680 @defun spam-stat-buffer-is-no-spam
25681 Called in a buffer, that buffer is considered to be a new non-spam
25682 mail.  Use this for new mail that has not been processed before.
25683 @end defun
25684
25685 @defun spam-stat-buffer-change-to-spam
25686 Called in a buffer, that buffer is no longer considered to be normal
25687 mail but spam.  Use this to change the status of a mail that has
25688 already been processed as non-spam.
25689 @end defun
25690
25691 @defun spam-stat-buffer-change-to-non-spam
25692 Called in a buffer, that buffer is no longer considered to be spam but
25693 normal mail.  Use this to change the status of a mail that has already
25694 been processed as spam.
25695 @end defun
25696
25697 @defun spam-stat-save
25698 Save the hash table to the file.  The filename used is stored in the
25699 variable @code{spam-stat-file}.
25700 @end defun
25701
25702 @defun spam-stat-load
25703 Load the hash table from a file.  The filename used is stored in the
25704 variable @code{spam-stat-file}.
25705 @end defun
25706
25707 @defun spam-stat-score-word
25708 Return the spam score for a word.
25709 @end defun
25710
25711 @defun spam-stat-score-buffer
25712 Return the spam score for a buffer.
25713 @end defun
25714
25715 @defun spam-stat-split-fancy
25716 Use this function for fancy mail splitting.  Add the rule @samp{(:
25717 spam-stat-split-fancy)} to @code{nnmail-split-fancy}
25718 @end defun
25719
25720 Make sure you load the dictionary before using it.  This requires the
25721 following in your @file{~/.gnus.el} file:
25722
25723 @lisp
25724 (require 'spam-stat)
25725 (spam-stat-load)
25726 @end lisp
25727
25728 Typical test will involve calls to the following functions:
25729
25730 @smallexample
25731 Reset: (setq spam-stat (make-hash-table :test 'equal))
25732 Learn spam: (spam-stat-process-spam-directory "~/Mail/mail/spam")
25733 Learn non-spam: (spam-stat-process-non-spam-directory "~/Mail/mail/misc")
25734 Save table: (spam-stat-save)
25735 File size: (nth 7 (file-attributes spam-stat-file))
25736 Number of words: (hash-table-count spam-stat)
25737 Test spam: (spam-stat-test-directory "~/Mail/mail/spam")
25738 Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc")
25739 Reduce table size: (spam-stat-reduce-size)
25740 Save table: (spam-stat-save)
25741 File size: (nth 7 (file-attributes spam-stat-file))
25742 Number of words: (hash-table-count spam-stat)
25743 Test spam: (spam-stat-test-directory "~/Mail/mail/spam")
25744 Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc")
25745 @end smallexample
25746
25747 Here is how you would create your dictionary:
25748
25749 @smallexample
25750 Reset: (setq spam-stat (make-hash-table :test 'equal))
25751 Learn spam: (spam-stat-process-spam-directory "~/Mail/mail/spam")
25752 Learn non-spam: (spam-stat-process-non-spam-directory "~/Mail/mail/misc")
25753 Repeat for any other non-spam group you need...
25754 Reduce table size: (spam-stat-reduce-size)
25755 Save table: (spam-stat-save)
25756 @end smallexample
25757
25758 @node The Gnus Registry
25759 @section The Gnus Registry
25760 @cindex registry
25761 @cindex split
25762 @cindex track
25763
25764 The Gnus registry is a package that tracks messages by their
25765 Message-ID across all backends.  This allows Gnus users to do several
25766 cool things, be the envy of the locals, get free haircuts, and be
25767 experts on world issues.  Well, maybe not all of those, but the
25768 features are pretty cool.
25769
25770 Although they will be explained in detail shortly, here's a quick list
25771 of said features in case your attention span is...  never mind.
25772
25773 @enumerate
25774 @item
25775 Split messages to their parent
25776
25777 This keeps discussions in the same group.  You can use the subject and
25778 the sender in addition to the Message-ID.  Several strategies are
25779 available.
25780
25781 @item
25782 Refer to messages by ID
25783
25784 Commands like @code{gnus-summary-refer-parent-article} can take
25785 advantage of the registry to jump to the referred article, regardless
25786 of the group the message is in.
25787
25788 @item
25789 Store custom flags and keywords
25790
25791 The registry can store custom flags and keywords for a message.  For
25792 instance, you can mark a message ``To-Do'' this way and the flag will
25793 persist whether the message is in the nnimap, nnml, nnmaildir,
25794 etc. backends.
25795
25796 @item
25797 Store arbitrary data
25798
25799 Through a simple ELisp API, the registry can remember any data for a
25800 message.  A built-in inverse map, when activated, allows quick lookups
25801 of all messages matching a particular set of criteria.
25802 @end enumerate
25803
25804 @menu
25805 * Setup::
25806 * Fancy splitting to parent::
25807 * Registry Article Refer Method::
25808 * Store custom flags and keywords::
25809 * Store arbitrary data::
25810 @end menu
25811
25812 @node Setup
25813 @subsection Setup
25814
25815 Fortunately, setting up the Gnus registry is pretty easy:
25816
25817 @lisp
25818 (setq gnus-registry-max-entries 2500
25819       gnus-registry-use-long-group-names t)
25820
25821 (gnus-registry-initialize)
25822 @end lisp
25823
25824 This adds registry saves to Gnus newsrc saves (which happen on exit
25825 and when you press @kbd{s} from the @code{*Group*} buffer.  It also
25826 adds registry calls to article actions in Gnus (copy, move, etc.)  so
25827 it's not easy to undo the initialization.  See
25828 @code{gnus-registry-initialize} for the gory details.
25829
25830 Here are other settings used by the author of the registry (understand
25831 what they do before you copy them blindly).
25832
25833 @lisp
25834 (setq
25835  gnus-registry-split-strategy 'majority
25836  gnus-registry-ignored-groups '(("nntp" t)
25837                                 ("nnrss" t)
25838                                 ("spam" t)
25839                                 ("train" t))
25840  gnus-registry-max-entries 500000
25841  gnus-registry-use-long-group-names t
25842  gnus-registry-track-extra '(sender subject))
25843 @end lisp
25844
25845 They say: keep a lot of messages around, use long group names, track
25846 messages by sender and subject (not just parent Message-ID), and when
25847 the registry splits incoming mail, use a majority rule to decide where
25848 messages should go if there's more than one possibility.  In addition,
25849 the registry should ignore messages in groups that match ``nntp'',
25850 ``nnrss'', ``spam'', or ``train.''
25851
25852 You are doubtless impressed by all this, but you ask: ``I am a Gnus
25853 user, I customize to live.  Give me more.''  Here you go, these are
25854 the general settings.
25855
25856 @defvar gnus-registry-unfollowed-groups
25857 The groups that will not be followed by
25858 @code{gnus-registry-split-fancy-with-parent}.  They will still be
25859 remembered by the registry.  This is a list of regular expressions.
25860 @end defvar
25861
25862 @defvar gnus-registry-ignored-groups
25863 The groups that will not be remembered by the registry.  This is a
25864 list of regular expressions, also available through Group/Topic
25865 customization (so you can ignore or keep a specific group or a whole
25866 topic).
25867 @end defvar
25868
25869 @defvar gnus-registry-use-long-group-names
25870 Whether the registry will use long group names.  It's recommended to
25871 set this to @code{t}, although everything works if you don't.  Future
25872 functionality will require it.
25873 @end defvar
25874
25875 @defvar gnus-registry-max-entries
25876 The number (an integer or @code{nil} for unlimited) of entries the
25877 registry will keep.
25878 @end defvar
25879
25880 @defvar gnus-registry-cache-file
25881 The file where the registry will be stored between Gnus sessions.
25882 @end defvar
25883
25884 @node Registry Article Refer Method
25885 @subsection Fetching by @code{Message-ID} Using the Registry
25886
25887 The registry knows how to map each @code{Message-ID} to the group it's
25888 in.  This can be leveraged to enhance the ``article refer method'',
25889 the thing that tells Gnus how to look up an article given its
25890 Message-ID (@pxref{Finding the Parent}).
25891
25892 @vindex nnregistry
25893 @vindex gnus-refer-article-method
25894
25895 The @code{nnregistry} refer method does exactly that.  It has the
25896 advantage that an article may be found regardless of the group it's
25897 in---provided its @code{Message-ID} is known to the registry.  It can
25898 be enabled by augmenting the start-up file with something along these
25899 lines:
25900
25901 @example
25902 ;; Keep enough entries to have a good hit rate when referring to an
25903 ;; article using the registry.  Use long group names so that Gnus
25904 ;; knows where the article is.
25905 (setq gnus-registry-max-entries 2500
25906       gnus-registry-use-long-group-names t)
25907
25908 (gnus-registry-initialize)
25909
25910 (setq gnus-refer-article-method
25911       '(current
25912         (nnregistry)
25913         (nnweb "gmane" (nnweb-type gmane))))
25914 @end example
25915
25916 The example above instructs Gnus to first look up the article in the
25917 current group, or, alternatively, using the registry, and finally, if
25918 all else fails, using Gmane.
25919
25920 @node Fancy splitting to parent
25921 @subsection Fancy splitting to parent
25922
25923 Simply put, this lets you put followup e-mail where it belongs.
25924
25925 Every message has a Message-ID, which is unique, and the registry
25926 remembers it.  When the message is moved or copied, the registry will
25927 notice this and offer the new group as a choice to the splitting
25928 strategy.
25929
25930 When a followup is made, usually it mentions the original message's
25931 Message-ID in the headers.  The registry knows this and uses that
25932 mention to find the group where the original message lives.  You only
25933 have to put a rule like this:
25934
25935 @lisp
25936 (setq nnimap-my-split-fancy '(|
25937
25938       ;; split to parent: you need this
25939       (: gnus-registry-split-fancy-with-parent)
25940
25941       ;; other rules, as an example
25942       (: spam-split)
25943       ;; default mailbox
25944       "mail")
25945 @end lisp
25946
25947 in your fancy split setup.  In addition, you may want to customize the
25948 following variables.
25949
25950 @defvar gnus-registry-track-extra
25951 This is a list of symbols, so it's best to change it from the
25952 Customize interface.  By default it's @code{nil}, but you may want to
25953 track @code{subject} and @code{sender} as well when splitting by parent.
25954 It may work for you.  It can be annoying if your mail flow is large and
25955 people don't stick to the same groups.
25956 @end defvar
25957
25958 @defvar gnus-registry-split-strategy
25959 This is a symbol, so it's best to change it from the Customize
25960 interface.  By default it's @code{nil}, but you may want to set it to
25961 @code{majority} or @code{first} to split by sender or subject based on
25962 the majority of matches or on the first found.
25963 @end defvar
25964
25965 @node Store custom flags and keywords
25966 @subsection Store custom flags and keywords
25967
25968 The registry lets you set custom flags and keywords per message.  You
25969 can use the Gnus->Registry Marks menu or the @kbd{M M x} keyboard
25970 shortcuts, where @code{x} is the first letter of the mark's name.
25971
25972 @defvar gnus-registry-marks
25973 The custom marks that the registry can use.  You can modify the
25974 default list, if you like.  If you do, you'll have to exit Emacs
25975 before they take effect (you can also unload the registry and reload
25976 it or evaluate the specific macros you'll need, but you probably don't
25977 want to bother).  Use the Customize interface to modify the list.
25978
25979 By default this list has the @code{Important}, @code{Work},
25980 @code{Personal}, @code{To-Do}, and @code{Later} marks.  They all have
25981 keyboard shortcuts like @kbd{M M i} for Important, using the first
25982 letter.
25983 @end defvar
25984
25985 @defun gnus-registry-mark-article
25986 Call this function to mark an article with a custom registry mark.  It
25987 will offer the available marks for completion.
25988 @end defun
25989
25990 @node Store arbitrary data
25991 @subsection Store arbitrary data
25992
25993 The registry has a simple API that uses a Message-ID as the key to
25994 store arbitrary data (as long as it can be converted to a list for
25995 storage).
25996
25997 @defun gnus-registry-store-extra-entry (id key value)
25998 Store @code{value} in the extra data key @code{key} for message
25999 @code{id}.
26000 @end defun
26001
26002 @defun gnus-registry-delete-extra-entry (id key)
26003 Delete the extra data key @code{key} for message @code{id}.
26004 @end defun
26005
26006 @defun gnus-registry-fetch-extra (id key)
26007 Get the extra data key @code{key} for message @code{id}.
26008 @end defun
26009
26010 @defvar gnus-registry-extra-entries-precious
26011 If any extra entries are precious, their presence will make the
26012 registry keep the whole entry forever, even if there are no groups for
26013 the Message-ID and if the size limit of the registry is reached.  By
26014 default this is just @code{(marks)} so the custom registry marks are
26015 precious.
26016 @end defvar
26017
26018 @node Other modes
26019 @section Interaction with other modes
26020
26021 @subsection Dired
26022 @cindex dired
26023
26024 @code{gnus-dired-minor-mode} provides some useful functions for dired
26025 buffers.  It is enabled with
26026 @lisp
26027 (add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode)
26028 @end lisp
26029
26030 @table @kbd
26031 @item C-c C-m C-a
26032 @findex gnus-dired-attach
26033 @cindex attachments, selection via dired
26034 Send dired's marked files as an attachment (@code{gnus-dired-attach}).
26035 You will be prompted for a message buffer.
26036
26037 @item C-c C-m C-l
26038 @findex gnus-dired-find-file-mailcap
26039 Visit a file according to the appropriate mailcap entry
26040 (@code{gnus-dired-find-file-mailcap}).  With prefix, open file in a new
26041 buffer.
26042
26043 @item C-c C-m C-p
26044 @findex gnus-dired-print
26045 Print file according to the mailcap entry (@code{gnus-dired-print}).  If
26046 there is no print command, print in a PostScript image.
26047 @end table
26048
26049 @node Various Various
26050 @section Various Various
26051 @cindex mode lines
26052 @cindex highlights
26053
26054 @table @code
26055
26056 @item gnus-home-directory
26057 @vindex gnus-home-directory
26058 All Gnus file and directory variables will be initialized from this
26059 variable, which defaults to @file{~/}.
26060
26061 @item gnus-directory
26062 @vindex gnus-directory
26063 Most Gnus storage file and directory variables will be initialized from
26064 this variable, which defaults to the @env{SAVEDIR} environment
26065 variable, or @file{~/News/} if that variable isn't set.
26066
26067 Note that Gnus is mostly loaded when the @file{~/.gnus.el} file is read.
26068 This means that other directory variables that are initialized from this
26069 variable won't be set properly if you set this variable in
26070 @file{~/.gnus.el}.  Set this variable in @file{.emacs} instead.
26071
26072 @item gnus-default-directory
26073 @vindex gnus-default-directory
26074 Not related to the above variable at all---this variable says what the
26075 default directory of all Gnus buffers should be.  If you issue commands
26076 like @kbd{C-x C-f}, the prompt you'll get starts in the current buffer's
26077 default directory.  If this variable is @code{nil} (which is the
26078 default), the default directory will be the default directory of the
26079 buffer you were in when you started Gnus.
26080
26081 @item gnus-verbose
26082 @vindex gnus-verbose
26083 This variable is an integer between zero and ten.  The higher the value,
26084 the more messages will be displayed.  If this variable is zero, Gnus
26085 will never flash any messages, if it is seven (which is the default),
26086 most important messages will be shown, and if it is ten, Gnus won't ever
26087 shut up, but will flash so many messages it will make your head swim.
26088
26089 @item gnus-verbose-backends
26090 @vindex gnus-verbose-backends
26091 This variable works the same way as @code{gnus-verbose}, but it applies
26092 to the Gnus back ends instead of Gnus proper.
26093
26094 @item gnus-add-timestamp-to-message
26095 @vindex gnus-add-timestamp-to-message
26096 This variable controls whether to add timestamps to messages that are
26097 controlled by @code{gnus-verbose} and @code{gnus-verbose-backends} and
26098 are issued.  The default value is @code{nil} which means never to add
26099 timestamp.  If it is @code{log}, add timestamps to only the messages
26100 that go into the @samp{*Messages*} buffer (in XEmacs, it is the
26101 @w{@samp{ *Message-Log*}} buffer).  If it is neither @code{nil} nor
26102 @code{log}, add timestamps not only to log messages but also to the ones
26103 displayed in the echo area.
26104
26105 @item nnheader-max-head-length
26106 @vindex nnheader-max-head-length
26107 When the back ends read straight heads of articles, they all try to read
26108 as little as possible.  This variable (default 8192) specifies
26109 the absolute max length the back ends will try to read before giving up
26110 on finding a separator line between the head and the body.  If this
26111 variable is @code{nil}, there is no upper read bound.  If it is
26112 @code{t}, the back ends won't try to read the articles piece by piece,
26113 but read the entire articles.  This makes sense with some versions of
26114 @code{ange-ftp} or @code{efs}.
26115
26116 @item nnheader-head-chop-length
26117 @vindex nnheader-head-chop-length
26118 This variable (default 2048) says how big a piece of each article to
26119 read when doing the operation described above.
26120
26121 @item nnheader-file-name-translation-alist
26122 @vindex nnheader-file-name-translation-alist
26123 @cindex file names
26124 @cindex invalid characters in file names
26125 @cindex characters in file names
26126 This is an alist that says how to translate characters in file names.
26127 For instance, if @samp{:} is invalid as a file character in file names
26128 on your system (you OS/2 user you), you could say something like:
26129
26130 @lisp
26131 @group
26132 (setq nnheader-file-name-translation-alist
26133       '((?: . ?_)))
26134 @end group
26135 @end lisp
26136
26137 In fact, this is the default value for this variable on OS/2 and MS
26138 Windows (phooey) systems.
26139
26140 @item gnus-hidden-properties
26141 @vindex gnus-hidden-properties
26142 This is a list of properties to use to hide ``invisible'' text.  It is
26143 @code{(invisible t intangible t)} by default on most systems, which
26144 makes invisible text invisible and intangible.
26145
26146 @item gnus-parse-headers-hook
26147 @vindex gnus-parse-headers-hook
26148 A hook called before parsing headers.  It can be used, for instance, to
26149 gather statistics on the headers fetched, or perhaps you'd like to prune
26150 some headers.  I don't see why you'd want that, though.
26151
26152 @item gnus-shell-command-separator
26153 @vindex gnus-shell-command-separator
26154 String used to separate two shell commands.  The default is @samp{;}.
26155
26156 @item gnus-invalid-group-regexp
26157 @vindex gnus-invalid-group-regexp
26158
26159 Regexp to match ``invalid'' group names when querying user for a group
26160 name.  The default value catches some @strong{really} invalid group
26161 names who could possibly mess up Gnus internally (like allowing
26162 @samp{:} in a group name, which is normally used to delimit method and
26163 group).
26164
26165 @acronym{IMAP} users might want to allow @samp{/} in group names though.
26166
26167 @item gnus-safe-html-newsgroups
26168 @vindex gnus-safe-html-newsgroups
26169 Groups in which links in html articles are considered all safe.  The
26170 value may be a regexp matching those groups, a list of group names, or
26171 @code{nil}.  This overrides @code{mm-w3m-safe-url-regexp}.  The default
26172 value is @code{"\\`nnrss[+:]"}.  This is effective only when emacs-w3m
26173 renders html articles, i.e., in the case @code{mm-text-html-renderer} is
26174 set to @code{w3m}.  @xref{Display Customization, ,Display Customization,
26175 emacs-mime, The Emacs MIME Manual}.
26176
26177 @end table
26178
26179 @node The End
26180 @chapter The End
26181
26182 Well, that's the manual---you can get on with your life now.  Keep in
26183 touch.  Say hello to your cats from me.
26184
26185 My @strong{ghod}---I just can't stand goodbyes.  Sniffle.
26186
26187 Ol' Charles Reznikoff said it pretty well, so I leave the floor to him:
26188
26189 @quotation
26190 @strong{Te Deum}
26191
26192 @sp 1
26193 Not because of victories @*
26194 I sing,@*
26195 having none,@*
26196 but for the common sunshine,@*
26197 the breeze,@*
26198 the largess of the spring.
26199
26200 @sp 1
26201 Not for victory@*
26202 but for the day's work done@*
26203 as well as I was able;@*
26204 not for a seat upon the dais@*
26205 but at the common table.@*
26206 @end quotation
26207
26208
26209 @node Appendices
26210 @chapter Appendices
26211
26212 @menu
26213 * XEmacs::                      Requirements for installing under XEmacs.
26214 * History::                     How Gnus got where it is today.
26215 * On Writing Manuals::          Why this is not a beginner's guide.
26216 * Terminology::                 We use really difficult, like, words here.
26217 * Customization::               Tailoring Gnus to your needs.
26218 * Troubleshooting::             What you might try if things do not work.
26219 * Gnus Reference Guide::        Rilly, rilly technical stuff.
26220 * Emacs for Heathens::          A short introduction to Emacsian terms.
26221 * Frequently Asked Questions::  The Gnus FAQ
26222 @end menu
26223
26224
26225 @node XEmacs
26226 @section XEmacs
26227 @cindex XEmacs
26228 @cindex installing under XEmacs
26229
26230 XEmacs is distributed as a collection of packages.  You should install
26231 whatever packages the Gnus XEmacs package requires.  The current
26232 requirements are @samp{gnus}, @samp{mail-lib}, @samp{xemacs-base},
26233 @samp{eterm}, @samp{sh-script}, @samp{net-utils}, @samp{os-utils},
26234 @samp{dired}, @samp{mh-e}, @samp{sieve}, @samp{ps-print}, @samp{W3},
26235 @samp{pgg}, @samp{mailcrypt}, @samp{ecrypto}, and @samp{sasl}.
26236
26237
26238 @node History
26239 @section History
26240
26241 @cindex history
26242 @sc{gnus} was written by Masanobu @sc{Umeda}.  When autumn crept up in
26243 '94, Lars Magne Ingebrigtsen grew bored and decided to rewrite Gnus.
26244
26245 If you want to investigate the person responsible for this outrage,
26246 you can point your (feh!) web browser to
26247 @uref{http://quimby.gnus.org/}.  This is also the primary
26248 distribution point for the new and spiffy versions of Gnus, and is
26249 known as The Site That Destroys Newsrcs And Drives People Mad.
26250
26251 During the first extended alpha period of development, the new Gnus was
26252 called ``(ding) Gnus''.  @dfn{(ding)} is, of course, short for
26253 @dfn{ding is not Gnus}, which is a total and utter lie, but who cares?
26254 (Besides, the ``Gnus'' in this abbreviation should probably be
26255 pronounced ``news'' as @sc{Umeda} intended, which makes it a more
26256 appropriate name, don't you think?)
26257
26258 In any case, after spending all that energy on coming up with a new and
26259 spunky name, we decided that the name was @emph{too} spunky, so we
26260 renamed it back again to ``Gnus''.  But in mixed case.  ``Gnus'' vs.
26261 ``@sc{gnus}''.  New vs. old.
26262
26263 @menu
26264 * Gnus Versions::               What Gnus versions have been released.
26265 * Other Gnus Versions::         Other Gnus versions that also have been released.
26266 * Why?::                        What's the point of Gnus?
26267 * Compatibility::               Just how compatible is Gnus with @sc{gnus}?
26268 * Conformity::                  Gnus tries to conform to all standards.
26269 * Emacsen::                     Gnus can be run on a few modern Emacsen.
26270 * Gnus Development::            How Gnus is developed.
26271 * Contributors::                Oodles of people.
26272 * New Features::                Pointers to some of the new stuff in Gnus.
26273 @end menu
26274
26275
26276 @node Gnus Versions
26277 @subsection Gnus Versions
26278 @cindex ding Gnus
26279 @cindex September Gnus
26280 @cindex Red Gnus
26281 @cindex Quassia Gnus
26282 @cindex Pterodactyl Gnus
26283 @cindex Oort Gnus
26284 @cindex No Gnus
26285 @cindex Gnus versions
26286
26287 The first ``proper'' release of Gnus 5 was done in November 1995 when it
26288 was included in the Emacs 19.30 distribution (132 (ding) Gnus releases
26289 plus 15 Gnus 5.0 releases).
26290
26291 In May 1996 the next Gnus generation (aka. ``September Gnus'' (after 99
26292 releases)) was released under the name ``Gnus 5.2'' (40 releases).
26293
26294 On July 28th 1996 work on Red Gnus was begun, and it was released on
26295 January 25th 1997 (after 84 releases) as ``Gnus 5.4'' (67 releases).
26296
26297 On September 13th 1997, Quassia Gnus was started and lasted 37 releases.
26298 It was released as ``Gnus 5.6'' on March 8th 1998 (46 releases).
26299
26300 Gnus 5.6 begat Pterodactyl Gnus on August 29th 1998 and was released as
26301 ``Gnus 5.8'' (after 99 releases and a CVS repository) on December 3rd
26302 1999.
26303
26304 On the 26th of October 2000, Oort Gnus was begun and was released as
26305 Gnus 5.10 on May 1st 2003 (24 releases).
26306
26307 On the January 4th 2004, No Gnus was begun.
26308
26309 On April 19, 2010 Gnus development was moved to Git.  See
26310 http://git.gnus.org for details (http://www.gnus.org will be updated
26311 with the information when possible).
26312
26313 If you happen upon a version of Gnus that has a prefixed name --
26314 ``(ding) Gnus'', ``September Gnus'', ``Red Gnus'', ``Quassia Gnus'',
26315 ``Pterodactyl Gnus'', ``Oort Gnus'', ``No Gnus'' -- don't panic.
26316 Don't let it know that you're frightened.  Back away.  Slowly.  Whatever
26317 you do, don't run.  Walk away, calmly, until you're out of its reach.
26318 Find a proper released version of Gnus and snuggle up to that instead.
26319
26320
26321 @node Other Gnus Versions
26322 @subsection Other Gnus Versions
26323 @cindex Semi-gnus
26324
26325 In addition to the versions of Gnus which have had their releases
26326 coordinated by Lars, one major development has been Semi-gnus from
26327 Japan.  It's based on a library called @acronym{SEMI}, which provides
26328 @acronym{MIME} capabilities.
26329
26330 These Gnusae are based mainly on Gnus 5.6 and Pterodactyl Gnus.
26331 Collectively, they are called ``Semi-gnus'', and different strains are
26332 called T-gnus, ET-gnus, Nana-gnus and Chaos.  These provide powerful
26333 @acronym{MIME} and multilingualization things, especially important for
26334 Japanese users.
26335
26336
26337 @node Why?
26338 @subsection Why?
26339
26340 What's the point of Gnus?
26341
26342 I want to provide a ``rad'', ``happening'', ``way cool'' and ``hep''
26343 newsreader, that lets you do anything you can think of.  That was my
26344 original motivation, but while working on Gnus, it has become clear to
26345 me that this generation of newsreaders really belong in the stone age.
26346 Newsreaders haven't developed much since the infancy of the net.  If the
26347 volume continues to rise with the current rate of increase, all current
26348 newsreaders will be pretty much useless.  How do you deal with
26349 newsgroups that have thousands of new articles each day?  How do you
26350 keep track of millions of people who post?
26351
26352 Gnus offers no real solutions to these questions, but I would very much
26353 like to see Gnus being used as a testing ground for new methods of
26354 reading and fetching news.  Expanding on @sc{Umeda}-san's wise decision
26355 to separate the newsreader from the back ends, Gnus now offers a simple
26356 interface for anybody who wants to write new back ends for fetching mail
26357 and news from different sources.  I have added hooks for customizations
26358 everywhere I could imagine it being useful.  By doing so, I'm inviting
26359 every one of you to explore and invent.
26360
26361 May Gnus never be complete.  @kbd{C-u 100 M-x all-hail-emacs} and
26362 @kbd{C-u 100 M-x all-hail-xemacs}.
26363
26364
26365 @node Compatibility
26366 @subsection Compatibility
26367
26368 @cindex compatibility
26369 Gnus was designed to be fully compatible with @sc{gnus}.  Almost all key
26370 bindings have been kept.  More key bindings have been added, of course,
26371 but only in one or two obscure cases have old bindings been changed.
26372
26373 Our motto is:
26374 @quotation
26375 @cartouche
26376 @center In a cloud bones of steel.
26377 @end cartouche
26378 @end quotation
26379
26380 All commands have kept their names.  Some internal functions have changed
26381 their names.
26382
26383 The @code{gnus-uu} package has changed drastically.  @xref{Decoding
26384 Articles}.
26385
26386 One major compatibility question is the presence of several summary
26387 buffers.  All variables relevant while reading a group are
26388 buffer-local to the summary buffer they belong in.  Although many
26389 important variables have their values copied into their global
26390 counterparts whenever a command is executed in the summary buffer, this
26391 change might lead to incorrect values being used unless you are careful.
26392
26393 All code that relies on knowledge of @sc{gnus} internals will probably
26394 fail.  To take two examples: Sorting @code{gnus-newsrc-alist} (or
26395 changing it in any way, as a matter of fact) is strictly verboten.  Gnus
26396 maintains a hash table that points to the entries in this alist (which
26397 speeds up many functions), and changing the alist directly will lead to
26398 peculiar results.
26399
26400 @cindex hilit19
26401 @cindex highlighting
26402 Old hilit19 code does not work at all.  In fact, you should probably
26403 remove all hilit code from all Gnus hooks
26404 (@code{gnus-group-prepare-hook} and @code{gnus-summary-prepare-hook}).
26405 Gnus provides various integrated functions for highlighting.  These are
26406 faster and more accurate.  To make life easier for everybody, Gnus will
26407 by default remove all hilit calls from all hilit hooks.  Uncleanliness!
26408 Away!
26409
26410 Packages like @code{expire-kill} will no longer work.  As a matter of
26411 fact, you should probably remove all old @sc{gnus} packages (and other
26412 code) when you start using Gnus.  More likely than not, Gnus already
26413 does what you have written code to make @sc{gnus} do.  (Snicker.)
26414
26415 Even though old methods of doing things are still supported, only the
26416 new methods are documented in this manual.  If you detect a new method of
26417 doing something while reading this manual, that does not mean you have
26418 to stop doing it the old way.
26419
26420 Gnus understands all @sc{gnus} startup files.
26421
26422 @kindex M-x gnus-bug
26423 @findex gnus-bug
26424 @cindex reporting bugs
26425 @cindex bugs
26426 Overall, a casual user who hasn't written much code that depends on
26427 @sc{gnus} internals should suffer no problems.  If problems occur,
26428 please let me know by issuing that magic command @kbd{M-x gnus-bug}.
26429
26430 @vindex gnus-bug-create-help-buffer
26431 If you are in the habit of sending bug reports @emph{very} often, you
26432 may find the helpful help buffer annoying after a while.  If so, set
26433 @code{gnus-bug-create-help-buffer} to @code{nil} to avoid having it pop
26434 up at you.
26435
26436
26437 @node Conformity
26438 @subsection Conformity
26439
26440 No rebels without a clue here, ma'am.  We conform to all standards known
26441 to (wo)man.  Except for those standards and/or conventions we disagree
26442 with, of course.
26443
26444 @table @strong
26445
26446 @item RFC (2)822
26447 @cindex RFC 822
26448 @cindex RFC 2822
26449 There are no known breaches of this standard.
26450
26451 @item RFC 1036
26452 @cindex RFC 1036
26453 There are no known breaches of this standard, either.
26454
26455 @item Son-of-RFC 1036
26456 @cindex Son-of-RFC 1036
26457 We do have some breaches to this one.
26458
26459 @table @emph
26460
26461 @item X-Newsreader
26462 @itemx User-Agent
26463 These are considered to be ``vanity headers'', while I consider them
26464 to be consumer information.  After seeing so many badly formatted
26465 articles coming from @code{tin} and @code{Netscape} I know not to use
26466 either of those for posting articles.  I would not have known that if
26467 it wasn't for the @code{X-Newsreader} header.
26468 @end table
26469
26470 @item USEFOR
26471 @cindex USEFOR
26472 USEFOR is an IETF working group writing a successor to RFC 1036, based
26473 on Son-of-RFC 1036.  They have produced a number of drafts proposing
26474 various changes to the format of news articles.  The Gnus towers will
26475 look into implementing the changes when the draft is accepted as an RFC.
26476
26477 @item MIME - RFC 2045-2049 etc
26478 @cindex @acronym{MIME}
26479 All the various @acronym{MIME} RFCs are supported.
26480
26481 @item Disposition Notifications - RFC 2298
26482 Message Mode is able to request notifications from the receiver.
26483
26484 @item PGP - RFC 1991 and RFC 2440
26485 @cindex RFC 1991
26486 @cindex RFC 2440
26487 RFC 1991 is the original @acronym{PGP} message specification,
26488 published as an informational RFC.  RFC 2440 was the follow-up, now
26489 called Open PGP, and put on the Standards Track.  Both document a
26490 non-@acronym{MIME} aware @acronym{PGP} format.  Gnus supports both
26491 encoding (signing and encryption) and decoding (verification and
26492 decryption).
26493
26494 @item PGP/MIME - RFC 2015/3156
26495 RFC 2015 (superseded by 3156 which references RFC 2440 instead of RFC
26496 1991) describes the @acronym{MIME}-wrapping around the RFC 1991/2440 format.
26497 Gnus supports both encoding and decoding.
26498
26499 @item S/MIME - RFC 2633
26500 RFC 2633 describes the @acronym{S/MIME} format.
26501
26502 @item IMAP - RFC 1730/2060, RFC 2195, RFC 2086, RFC 2359, RFC 2595, RFC 1731
26503 RFC 1730 is @acronym{IMAP} version 4, updated somewhat by RFC 2060
26504 (@acronym{IMAP} 4 revision 1).  RFC 2195 describes CRAM-MD5
26505 authentication for @acronym{IMAP}.  RFC 2086 describes access control
26506 lists (ACLs) for @acronym{IMAP}.  RFC 2359 describes a @acronym{IMAP}
26507 protocol enhancement.  RFC 2595 describes the proper @acronym{TLS}
26508 integration (STARTTLS) with @acronym{IMAP}.  RFC 1731 describes the
26509 GSSAPI/Kerberos4 mechanisms for @acronym{IMAP}.
26510
26511 @end table
26512
26513 If you ever notice Gnus acting non-compliant with regards to the texts
26514 mentioned above, don't hesitate to drop a note to Gnus Towers and let us
26515 know.
26516
26517
26518 @node Emacsen
26519 @subsection Emacsen
26520 @cindex Emacsen
26521 @cindex XEmacs
26522 @cindex Mule
26523 @cindex Emacs
26524
26525 This version of Gnus should work on:
26526
26527 @itemize @bullet
26528
26529 @item
26530 Emacs 21.1 and up.
26531
26532 @item
26533 XEmacs 21.4 and up.
26534
26535 @end itemize
26536
26537 This Gnus version will absolutely not work on any Emacsen older than
26538 that.  Not reliably, at least.  Older versions of Gnus may work on older
26539 Emacs versions.  Particularly, Gnus 5.10.8 should also work on Emacs
26540 20.7 and XEmacs 21.1.
26541
26542 @c No-merge comment: The paragraph added in v5-10 here must not be
26543 @c synced here!
26544
26545 @node Gnus Development
26546 @subsection Gnus Development
26547
26548 Gnus is developed in a two-phased cycle.  The first phase involves much
26549 discussion on the development mailing list @samp{ding@@gnus.org}, where people
26550 propose changes and new features, post patches and new back ends.  This
26551 phase is called the @dfn{alpha} phase, since the Gnusae released in this
26552 phase are @dfn{alpha releases}, or (perhaps more commonly in other
26553 circles) @dfn{snapshots}.  During this phase, Gnus is assumed to be
26554 unstable and should not be used by casual users.  Gnus alpha releases
26555 have names like ``Oort Gnus'' and ``No Gnus''.  @xref{Gnus Versions}.
26556
26557 After futzing around for 10-100 alpha releases, Gnus is declared
26558 @dfn{frozen}, and only bug fixes are applied.  Gnus loses the prefix,
26559 and is called things like ``Gnus 5.10.1'' instead.  Normal people are
26560 supposed to be able to use these, and these are mostly discussed on the
26561 @samp{gnu.emacs.gnus} newsgroup.  This newgroup is mirrored to the
26562 mailing list @samp{info-gnus-english@@gnu.org} which is carried on Gmane
26563 as @samp{gmane.emacs.gnus.user}.  These releases are finally integrated
26564 in Emacs.
26565
26566 @cindex Incoming*
26567 @vindex mail-source-delete-incoming
26568 Some variable defaults differ between alpha Gnusae and released Gnusae,
26569 in particular, @code{mail-source-delete-incoming}.  This is to prevent
26570 lossage of mail if an alpha release hiccups while handling the mail.
26571 @xref{Mail Source Customization}.
26572
26573 The division of discussion between the ding mailing list and the Gnus
26574 newsgroup is not purely based on publicity concerns.  It's true that
26575 having people write about the horrible things that an alpha Gnus release
26576 can do (sometimes) in a public forum may scare people off, but more
26577 importantly, talking about new experimental features that have been
26578 introduced may confuse casual users.  New features are frequently
26579 introduced, fiddled with, and judged to be found wanting, and then
26580 either discarded or totally rewritten.  People reading the mailing list
26581 usually keep up with these rapid changes, while people on the newsgroup
26582 can't be assumed to do so.
26583
26584 So if you have problems with or questions about the alpha versions,
26585 direct those to the ding mailing list @samp{ding@@gnus.org}.  This list
26586 is also available on Gmane as @samp{gmane.emacs.gnus.general}.
26587
26588 @cindex Incoming*
26589 @vindex mail-source-delete-incoming
26590 Some variable defaults differ between alpha Gnusae and released Gnusae,
26591 in particular, @code{mail-source-delete-incoming}.  This is to prevent
26592 lossage of mail if an alpha release hiccups while handling the mail.
26593 @xref{Mail Source Customization}.
26594
26595 @node Contributors
26596 @subsection Contributors
26597 @cindex contributors
26598
26599 The new Gnus version couldn't have been done without the help of all the
26600 people on the (ding) mailing list.  Every day for over a year I have
26601 gotten billions of nice bug reports from them, filling me with joy,
26602 every single one of them.  Smooches.  The people on the list have been
26603 tried beyond endurance, what with my ``oh, that's a neat idea <type
26604 type>, yup, I'll release it right away <ship off> no wait, that doesn't
26605 work at all <type type>, yup, I'll ship that one off right away <ship
26606 off> no, wait, that absolutely does not work'' policy for releases.
26607 Micro$oft---bah.  Amateurs.  I'm @emph{much} worse.  (Or is that
26608 ``worser''? ``much worser''?  ``worsest''?)
26609
26610 I would like to take this opportunity to thank the Academy for@dots{}  oops,
26611 wrong show.
26612
26613 @itemize @bullet
26614
26615 @item
26616 Masanobu @sc{Umeda}---the writer of the original @sc{gnus}.
26617
26618 @item
26619 Shenghuo Zhu---uudecode.el, mm-uu.el, rfc1843.el,
26620 nnwarchive and many, many other things connected with @acronym{MIME} and
26621 other types of en/decoding, as well as general bug fixing, new
26622 functionality and stuff.
26623
26624 @item
26625 Per Abrahamsen---custom, scoring, highlighting and @sc{soup} code (as
26626 well as numerous other things).
26627
26628 @item
26629 Luis Fernandes---design and graphics.
26630
26631 @item
26632 Joe Reiss---creator of the smiley faces.
26633
26634 @item
26635 Justin Sheehy---the @acronym{FAQ} maintainer.
26636
26637 @item
26638 Erik Naggum---help, ideas, support, code and stuff.
26639
26640 @item
26641 Wes Hardaker---@file{gnus-picon.el} and the manual section on
26642 @dfn{picons} (@pxref{Picons}).
26643
26644 @item
26645 Kim-Minh Kaplan---further work on the picon code.
26646
26647 @item
26648 Brad Miller---@file{gnus-gl.el} and the GroupLens manual section.
26649
26650 @item
26651 Sudish Joseph---innumerable bug fixes.
26652
26653 @item
26654 Ilja Weis---@file{gnus-topic.el}.
26655
26656 @item
26657 Steven L. Baur---lots and lots and lots of bugs detections and fixes.
26658
26659 @item
26660 Vladimir Alexiev---the refcard and reference booklets.
26661
26662 @item
26663 Felix Lee & Jamie Zawinski---I stole some pieces from the XGnus
26664 distribution by Felix Lee and JWZ.
26665
26666 @item
26667 Scott Byer---@file{nnfolder.el} enhancements & rewrite.
26668
26669 @item
26670 Peter Mutsaers---orphan article scoring code.
26671
26672 @item
26673 Ken Raeburn---POP mail support.
26674
26675 @item
26676 Hallvard B Furuseth---various bits and pieces, especially dealing with
26677 .newsrc files.
26678
26679 @item
26680 Brian Edmonds---@file{gnus-bbdb.el}.
26681
26682 @item
26683 David Moore---rewrite of @file{nnvirtual.el} and many other things.
26684
26685 @item
26686 Kevin Davidson---came up with the name @dfn{ding}, so blame him.
26687
26688 @item
26689 Fran@,{c}ois Pinard---many, many interesting and thorough bug reports, as
26690 well as autoconf support.
26691
26692 @end itemize
26693
26694 This manual was proof-read by Adrian Aichner, with Ricardo Nassif, Mark
26695 Borges, and Jost Krieger proof-reading parts of the manual.
26696
26697 The following people have contributed many patches and suggestions:
26698
26699 Christopher Davis,
26700 Andrew Eskilsson,
26701 Kai Grossjohann,
26702 Kevin Greiner,
26703 Jesper Harder,
26704 Paul Jarc,
26705 Simon Josefsson,
26706 David K@aa{}gedal,
26707 Richard Pieri,
26708 Fabrice Popineau,
26709 Daniel Quinlan,
26710 Michael Shields,
26711 Reiner Steib,
26712 Jason L. Tibbitts, III,
26713 Jack Vinson,
26714 Katsumi Yamaoka, @c Yamaoka
26715 and
26716 Teodor Zlatanov.
26717
26718 Also thanks to the following for patches and stuff:
26719
26720 Jari Aalto,
26721 Adrian Aichner,
26722 Vladimir Alexiev,
26723 Russ Allbery,
26724 Peter Arius,
26725 Matt Armstrong,
26726 Marc Auslander,
26727 Miles Bader,
26728 Alexei V. Barantsev,
26729 Frank Bennett,
26730 Robert Bihlmeyer,
26731 Chris Bone,
26732 Mark Borges,
26733 Mark Boyns,
26734 Lance A. Brown,
26735 Rob Browning,
26736 Kees de Bruin,
26737 Martin Buchholz,
26738 Joe Buehler,
26739 Kevin Buhr,
26740 Alastair Burt,
26741 Joao Cachopo,
26742 Zlatko Calusic,
26743 Massimo Campostrini,
26744 Castor,
26745 David Charlap,
26746 Dan Christensen,
26747 Kevin Christian,
26748 Jae-you Chung, @c ?
26749 James H. Cloos, Jr.,
26750 Laura Conrad,
26751 Michael R. Cook,
26752 Glenn Coombs,
26753 Andrew J. Cosgriff,
26754 Neil Crellin,
26755 Frank D. Cringle,
26756 Geoffrey T. Dairiki,
26757 Andre Deparade,
26758 Ulrik Dickow,
26759 Dave Disser,
26760 Rui-Tao Dong, @c ?
26761 Joev Dubach,
26762 Michael Welsh Duggan,
26763 Dave Edmondson,
26764 Paul Eggert,
26765 Mark W. Eichin,
26766 Karl Eichwalder,
26767 Enami Tsugutomo, @c Enami
26768 Michael Ernst,
26769 Luc Van Eycken,
26770 Sam Falkner,
26771 Nelson Jose dos Santos Ferreira,
26772 Sigbjorn Finne,
26773 Sven Fischer,
26774 Paul Fisher,
26775 Decklin Foster,
26776 Gary D. Foster,
26777 Paul Franklin,
26778 Guy Geens,
26779 Arne Georg Gleditsch,
26780 David S. Goldberg,
26781 Michelangelo Grigni,
26782 Dale Hagglund,
26783 D. Hall,
26784 Magnus Hammerin,
26785 Kenichi Handa, @c Handa
26786 Raja R. Harinath,
26787 Yoshiki Hayashi, @c Hayashi
26788 P. E. Jareth Hein,
26789 Hisashige Kenji, @c Hisashige
26790 Scott Hofmann,
26791 Tassilo Horn,
26792 Marc Horowitz,
26793 Gunnar Horrigmo,
26794 Richard Hoskins,
26795 Brad Howes,
26796 Miguel de Icaza,
26797 Fran@,{c}ois Felix Ingrand,
26798 Tatsuya Ichikawa, @c Ichikawa
26799 Ishikawa Ichiro, @c Ishikawa
26800 Lee Iverson,
26801 Iwamuro Motonori, @c Iwamuro
26802 Rajappa Iyer,
26803 Andreas Jaeger,
26804 Adam P. Jenkins,
26805 Randell Jesup,
26806 Fred Johansen,
26807 Gareth Jones,
26808 Greg Klanderman,
26809 Karl Kleinpaste,
26810 Michael Klingbeil,
26811 Peter Skov Knudsen,
26812 Shuhei Kobayashi, @c Kobayashi
26813 Petr Konecny,
26814 Koseki Yoshinori, @c Koseki
26815 Thor Kristoffersen,
26816 Jens Lautenbacher,
26817 Martin Larose,
26818 Seokchan Lee, @c Lee
26819 Joerg Lenneis,
26820 Carsten Leonhardt,
26821 James LewisMoss,
26822 Christian Limpach,
26823 Markus Linnala,
26824 Dave Love,
26825 Mike McEwan,
26826 Tonny Madsen,
26827 Shlomo Mahlab,
26828 Nat Makarevitch,
26829 Istvan Marko,
26830 David Martin,
26831 Jason R. Mastaler,
26832 Gordon Matzigkeit,
26833 Timo Metzemakers,
26834 Richard Mlynarik,
26835 Lantz Moore,
26836 Morioka Tomohiko, @c Morioka
26837 Erik Toubro Nielsen,
26838 Hrvoje Niksic,
26839 Andy Norman,
26840 Fred Oberhauser,
26841 C. R. Oldham,
26842 Alexandre Oliva,
26843 Ken Olstad,
26844 Masaharu Onishi, @c Onishi
26845 Hideki Ono, @c Ono
26846 Ettore Perazzoli,
26847 William Perry,
26848 Stephen Peters,
26849 Jens-Ulrik Holger Petersen,
26850 Ulrich Pfeifer,
26851 Matt Pharr,
26852 Andy Piper,
26853 John McClary Prevost,
26854 Bill Pringlemeir,
26855 Mike Pullen,
26856 Jim Radford,
26857 Colin Rafferty,
26858 Lasse Rasinen,
26859 Lars Balker Rasmussen,
26860 Joe Reiss,
26861 Renaud Rioboo,
26862 Roland B. Roberts,
26863 Bart Robinson,
26864 Christian von Roques,
26865 Markus Rost,
26866 Jason Rumney,
26867 Wolfgang Rupprecht,
26868 Jay Sachs,
26869 Dewey M. Sasser,
26870 Conrad Sauerwald,
26871 Loren Schall,
26872 Dan Schmidt,
26873 Ralph Schleicher,
26874 Philippe Schnoebelen,
26875 Andreas Schwab,
26876 Randal L. Schwartz,
26877 Danny Siu,
26878 Matt Simmons,
26879 Paul D. Smith,
26880 Jeff Sparkes,
26881 Toby Speight,
26882 Michael Sperber,
26883 Darren Stalder,
26884 Richard Stallman,
26885 Greg Stark,
26886 Sam Steingold,
26887 Paul Stevenson,
26888 Jonas Steverud,
26889 Paul Stodghill,
26890 Kiyokazu Suto, @c Suto
26891 Kurt Swanson,
26892 Samuel Tardieu,
26893 Teddy,
26894 Chuck Thompson,
26895 Tozawa Akihiko, @c Tozawa
26896 Philippe Troin,
26897 James Troup,
26898 Trung Tran-Duc,
26899 Jack Twilley,
26900 Aaron M. Ucko,
26901 Aki Vehtari,
26902 Didier Verna,
26903 Vladimir Volovich,
26904 Jan Vroonhof,
26905 Stefan Waldherr,
26906 Pete Ware,
26907 Barry A. Warsaw,
26908 Christoph Wedler,
26909 Joe Wells,
26910 Lee Willis,
26911 and
26912 Lloyd Zusman.
26913
26914
26915 For a full overview of what each person has done, the ChangeLogs
26916 included in the Gnus alpha distributions should give ample reading
26917 (550kB and counting).
26918
26919 Apologies to everybody that I've forgotten, of which there are many, I'm
26920 sure.
26921
26922 Gee, that's quite a list of people.  I guess that must mean that there
26923 actually are people who are using Gnus.  Who'd'a thunk it!
26924
26925
26926 @node New Features
26927 @subsection New Features
26928 @cindex new features
26929
26930 @menu
26931 * ding Gnus::                   New things in Gnus 5.0/5.1, the first new Gnus.
26932 * September Gnus::              The Thing Formally Known As Gnus 5.2/5.3.
26933 * Red Gnus::                    Third time best---Gnus 5.4/5.5.
26934 * Quassia Gnus::                Two times two is four, or Gnus 5.6/5.7.
26935 * Pterodactyl Gnus::            Pentad also starts with P, AKA Gnus 5.8/5.9.
26936 * Oort Gnus::                   It's big.  It's far out.  Gnus 5.10/5.11.
26937 * No Gnus::                     Very punny.
26938 @end menu
26939
26940 These lists are, of course, just @emph{short} overviews of the
26941 @emph{most} important new features.  No, really.  There are tons more.
26942 Yes, we have feeping creaturism in full effect.
26943
26944 @node ding Gnus
26945 @subsubsection (ding) Gnus
26946
26947 New features in Gnus 5.0/5.1:
26948
26949 @itemize @bullet
26950
26951 @item
26952 The look of all buffers can be changed by setting format-like variables
26953 (@pxref{Group Buffer Format} and @pxref{Summary Buffer Format}).
26954
26955 @item
26956 Local spool and several @acronym{NNTP} servers can be used at once
26957 (@pxref{Select Methods}).
26958
26959 @item
26960 You can combine groups into virtual groups (@pxref{Virtual Groups}).
26961
26962 @item
26963 You can read a number of different mail formats (@pxref{Getting Mail}).
26964 All the mail back ends implement a convenient mail expiry scheme
26965 (@pxref{Expiring Mail}).
26966
26967 @item
26968 Gnus can use various strategies for gathering threads that have lost
26969 their roots (thereby gathering loose sub-threads into one thread) or it
26970 can go back and retrieve enough headers to build a complete thread
26971 (@pxref{Customizing Threading}).
26972
26973 @item
26974 Killed groups can be displayed in the group buffer, and you can read
26975 them as well (@pxref{Listing Groups}).
26976
26977 @item
26978 Gnus can do partial group updates---you do not have to retrieve the
26979 entire active file just to check for new articles in a few groups
26980 (@pxref{The Active File}).
26981
26982 @item
26983 Gnus implements a sliding scale of subscribedness to groups
26984 (@pxref{Group Levels}).
26985
26986 @item
26987 You can score articles according to any number of criteria
26988 (@pxref{Scoring}).  You can even get Gnus to find out how to score
26989 articles for you (@pxref{Adaptive Scoring}).
26990
26991 @item
26992 Gnus maintains a dribble buffer that is auto-saved the normal Emacs
26993 manner, so it should be difficult to lose much data on what you have
26994 read if your machine should go down (@pxref{Auto Save}).
26995
26996 @item
26997 Gnus now has its own startup file (@file{~/.gnus.el}) to avoid
26998 cluttering up the @file{.emacs} file.
26999
27000 @item
27001 You can set the process mark on both groups and articles and perform
27002 operations on all the marked items (@pxref{Process/Prefix}).
27003
27004 @item
27005 You can list subsets of groups according to, well, anything
27006 (@pxref{Listing Groups}).
27007
27008 @item
27009 You can browse foreign servers and subscribe to groups from those
27010 servers (@pxref{Browse Foreign Server}).
27011
27012 @item
27013 Gnus can fetch articles, asynchronously, on a second connection to the
27014 server (@pxref{Asynchronous Fetching}).
27015
27016 @item
27017 You can cache articles locally (@pxref{Article Caching}).
27018
27019 @item
27020 The uudecode functions have been expanded and generalized
27021 (@pxref{Decoding Articles}).
27022
27023 @item
27024 You can still post uuencoded articles, which was a little-known feature
27025 of @sc{gnus}' past (@pxref{Uuencoding and Posting}).
27026
27027 @item
27028 Fetching parents (and other articles) now actually works without
27029 glitches (@pxref{Finding the Parent}).
27030
27031 @item
27032 Gnus can fetch @acronym{FAQ}s and group descriptions (@pxref{Group Information}).
27033
27034 @item
27035 Digests (and other files) can be used as the basis for groups
27036 (@pxref{Document Groups}).
27037
27038 @item
27039 Articles can be highlighted and customized (@pxref{Customizing
27040 Articles}).
27041
27042 @item
27043 URLs and other external references can be buttonized (@pxref{Article
27044 Buttons}).
27045
27046 @item
27047 You can do lots of strange stuff with the Gnus window & frame
27048 configuration (@pxref{Window Layout}).
27049
27050 @end itemize
27051
27052
27053 @node September Gnus
27054 @subsubsection September Gnus
27055
27056 @iftex
27057 @iflatex
27058 \gnusfig{-28cm}{0cm}{\epsfig{figure=ps/september,height=20cm}}
27059 @end iflatex
27060 @end iftex
27061
27062 New features in Gnus 5.2/5.3:
27063
27064 @itemize @bullet
27065
27066 @item
27067 A new message composition mode is used.  All old customization variables
27068 for @code{mail-mode}, @code{rnews-reply-mode} and @code{gnus-msg} are
27069 now obsolete.
27070
27071 @item
27072 Gnus is now able to generate @dfn{sparse} threads---threads where
27073 missing articles are represented by empty nodes (@pxref{Customizing
27074 Threading}).
27075
27076 @lisp
27077 (setq gnus-build-sparse-threads 'some)
27078 @end lisp
27079
27080 @item
27081 Outgoing articles are stored on a special archive server
27082 (@pxref{Archived Messages}).
27083
27084 @item
27085 Partial thread regeneration now happens when articles are
27086 referred.
27087
27088 @item
27089 Gnus can make use of GroupLens predictions.
27090
27091 @item
27092 Picons (personal icons) can be displayed under XEmacs (@pxref{Picons}).
27093
27094 @item
27095 A @code{trn}-like tree buffer can be displayed (@pxref{Tree Display}).
27096
27097 @lisp
27098 (setq gnus-use-trees t)
27099 @end lisp
27100
27101 @item
27102 An @code{nn}-like pick-and-read minor mode is available for the summary
27103 buffers (@pxref{Pick and Read}).
27104
27105 @lisp
27106 (add-hook 'gnus-summary-mode-hook 'gnus-pick-mode)
27107 @end lisp
27108
27109 @item
27110 In binary groups you can use a special binary minor mode (@pxref{Binary
27111 Groups}).
27112
27113 @item
27114 Groups can be grouped in a folding topic hierarchy (@pxref{Group
27115 Topics}).
27116
27117 @lisp
27118 (add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
27119 @end lisp
27120
27121 @item
27122 Gnus can re-send and bounce mail (@pxref{Summary Mail Commands}).
27123
27124 @item
27125 Groups can now have a score, and bubbling based on entry frequency
27126 is possible (@pxref{Group Score}).
27127
27128 @lisp
27129 (add-hook 'gnus-summary-exit-hook 'gnus-summary-bubble-group)
27130 @end lisp
27131
27132 @item
27133 Groups can be process-marked, and commands can be performed on
27134 groups of groups (@pxref{Marking Groups}).
27135
27136 @item
27137 Caching is possible in virtual groups.
27138
27139 @item
27140 @code{nndoc} now understands all kinds of digests, mail boxes, rnews
27141 news batches, ClariNet briefs collections, and just about everything
27142 else (@pxref{Document Groups}).
27143
27144 @item
27145 Gnus has a new back end (@code{nnsoup}) to create/read SOUP packets.
27146
27147 @item
27148 The Gnus cache is much faster.
27149
27150 @item
27151 Groups can be sorted according to many criteria (@pxref{Sorting
27152 Groups}).
27153
27154 @item
27155 New group parameters have been introduced to set list-addresses and
27156 expiry times (@pxref{Group Parameters}).
27157
27158 @item
27159 All formatting specs allow specifying faces to be used
27160 (@pxref{Formatting Fonts}).
27161
27162 @item
27163 There are several more commands for setting/removing/acting on process
27164 marked articles on the @kbd{M P} submap (@pxref{Setting Process Marks}).
27165
27166 @item
27167 The summary buffer can be limited to show parts of the available
27168 articles based on a wide range of criteria.  These commands have been
27169 bound to keys on the @kbd{/} submap (@pxref{Limiting}).
27170
27171 @item
27172 Articles can be made persistent with the @kbd{*} command
27173 (@pxref{Persistent Articles}).
27174
27175 @item
27176 All functions for hiding article elements are now toggles.
27177
27178 @item
27179 Article headers can be buttonized (@pxref{Article Washing}).
27180
27181 @item
27182 All mail back ends support fetching articles by @code{Message-ID}.
27183
27184 @item
27185 Duplicate mail can now be treated properly (@pxref{Duplicates}).
27186
27187 @item
27188 All summary mode commands are available directly from the article
27189 buffer (@pxref{Article Keymap}).
27190
27191 @item
27192 Frames can be part of @code{gnus-buffer-configuration} (@pxref{Window
27193 Layout}).
27194
27195 @item
27196 Mail can be re-scanned by a daemonic process (@pxref{Daemons}).
27197 @iftex
27198 @iflatex
27199 \marginpar[\mbox{}\hfill\epsfig{figure=ps/fseptember,height=5cm}]{\epsfig{figure=ps/fseptember,height=5cm}}
27200 @end iflatex
27201 @end iftex
27202
27203 @item
27204 Groups can be made permanently visible (@pxref{Listing Groups}).
27205
27206 @lisp
27207 (setq gnus-permanently-visible-groups "^nnml:")
27208 @end lisp
27209
27210 @item
27211 Many new hooks have been introduced to make customizing easier.
27212
27213 @item
27214 Gnus respects the @code{Mail-Copies-To} header.
27215
27216 @item
27217 Threads can be gathered by looking at the @code{References} header
27218 (@pxref{Customizing Threading}).
27219
27220 @lisp
27221 (setq gnus-summary-thread-gathering-function
27222       'gnus-gather-threads-by-references)
27223 @end lisp
27224
27225 @item
27226 Read articles can be stored in a special backlog buffer to avoid
27227 refetching (@pxref{Article Backlog}).
27228
27229 @lisp
27230 (setq gnus-keep-backlog 50)
27231 @end lisp
27232
27233 @item
27234 A clean copy of the current article is always stored in a separate
27235 buffer to allow easier treatment.
27236
27237 @item
27238 Gnus can suggest where to save articles (@pxref{Saving Articles}).
27239
27240 @item
27241 Gnus doesn't have to do as much prompting when saving (@pxref{Saving
27242 Articles}).
27243
27244 @lisp
27245 (setq gnus-prompt-before-saving t)
27246 @end lisp
27247
27248 @item
27249 @code{gnus-uu} can view decoded files asynchronously while fetching
27250 articles (@pxref{Other Decode Variables}).
27251
27252 @lisp
27253 (setq gnus-uu-grabbed-file-functions 'gnus-uu-grab-view)
27254 @end lisp
27255
27256 @item
27257 Filling in the article buffer now works properly on cited text
27258 (@pxref{Article Washing}).
27259
27260 @item
27261 Hiding cited text adds buttons to toggle hiding, and how much
27262 cited text to hide is now customizable (@pxref{Article Hiding}).
27263
27264 @lisp
27265 (setq gnus-cited-lines-visible 2)
27266 @end lisp
27267
27268 @item
27269 Boring headers can be hidden (@pxref{Article Hiding}).
27270
27271 @item
27272 Default scoring values can now be set from the menu bar.
27273
27274 @item
27275 Further syntax checking of outgoing articles have been added.
27276
27277 @end itemize
27278
27279
27280 @node Red Gnus
27281 @subsubsection Red Gnus
27282
27283 New features in Gnus 5.4/5.5:
27284
27285 @iftex
27286 @iflatex
27287 \gnusfig{-5.5cm}{-4cm}{\epsfig{figure=ps/red,height=20cm}}
27288 @end iflatex
27289 @end iftex
27290
27291 @itemize @bullet
27292
27293 @item
27294 @file{nntp.el} has been totally rewritten in an asynchronous fashion.
27295
27296 @item
27297 Article prefetching functionality has been moved up into
27298 Gnus (@pxref{Asynchronous Fetching}).
27299
27300 @item
27301 Scoring can now be performed with logical operators like @code{and},
27302 @code{or}, @code{not}, and parent redirection (@pxref{Advanced
27303 Scoring}).
27304
27305 @item
27306 Article washing status can be displayed in the
27307 article mode line (@pxref{Misc Article}).
27308
27309 @item
27310 @file{gnus.el} has been split into many smaller files.
27311
27312 @item
27313 Suppression of duplicate articles based on Message-ID can be done
27314 (@pxref{Duplicate Suppression}).
27315
27316 @lisp
27317 (setq gnus-suppress-duplicates t)
27318 @end lisp
27319
27320 @item
27321 New variables for specifying what score and adapt files are to be
27322 considered home score and adapt files (@pxref{Home Score File}) have
27323 been added.
27324
27325 @item
27326 @code{nndoc} was rewritten to be easily extendable (@pxref{Document
27327 Server Internals}).
27328
27329 @item
27330 Groups can inherit group parameters from parent topics (@pxref{Topic
27331 Parameters}).
27332
27333 @item
27334 Article editing has been revamped and is now actually usable.
27335
27336 @item
27337 Signatures can be recognized in more intelligent fashions
27338 (@pxref{Article Signature}).
27339
27340 @item
27341 Summary pick mode has been made to look more @code{nn}-like.  Line
27342 numbers are displayed and the @kbd{.} command can be used to pick
27343 articles (@code{Pick and Read}).
27344
27345 @item
27346 Commands for moving the @file{.newsrc.eld} from one server to
27347 another have been added (@pxref{Changing Servers}).
27348
27349 @item
27350 There's a way now to specify that ``uninteresting'' fields be suppressed
27351 when generating lines in buffers (@pxref{Advanced Formatting}).
27352
27353 @item
27354 Several commands in the group buffer can be undone with @kbd{C-M-_}
27355 (@pxref{Undo}).
27356
27357 @item
27358 Scoring can be done on words using the new score type @code{w}
27359 (@pxref{Score File Format}).
27360
27361 @item
27362 Adaptive scoring can be done on a Subject word-by-word basis
27363 (@pxref{Adaptive Scoring}).
27364
27365 @lisp
27366 (setq gnus-use-adaptive-scoring '(word))
27367 @end lisp
27368
27369 @item
27370 Scores can be decayed (@pxref{Score Decays}).
27371
27372 @lisp
27373 (setq gnus-decay-scores t)
27374 @end lisp
27375
27376 @item
27377 Scoring can be performed using a regexp on the Date header.  The Date is
27378 normalized to compact ISO 8601 format first (@pxref{Score File Format}).
27379
27380 @item
27381 A new command has been added to remove all data on articles from
27382 the native server (@pxref{Changing Servers}).
27383
27384 @item
27385 A new command for reading collections of documents
27386 (@code{nndoc} with @code{nnvirtual} on top) has been added---@kbd{C-M-d}
27387 (@pxref{Really Various Summary Commands}).
27388
27389 @item
27390 Process mark sets can be pushed and popped (@pxref{Setting Process
27391 Marks}).
27392
27393 @item
27394 A new mail-to-news back end makes it possible to post even when the @acronym{NNTP}
27395 server doesn't allow posting (@pxref{Mail-To-News Gateways}).
27396
27397 @item
27398 A new back end for reading searches from Web search engines
27399 (@dfn{DejaNews}, @dfn{Alta Vista}, @dfn{InReference}) has been added
27400 (@pxref{Web Searches}).
27401
27402 @item
27403 Groups inside topics can now be sorted using the standard sorting
27404 functions, and each topic can be sorted independently (@pxref{Topic
27405 Sorting}).
27406
27407 @item
27408 Subsets of the groups can be sorted independently (@code{Sorting
27409 Groups}).
27410
27411 @item
27412 Cached articles can be pulled into the groups (@pxref{Summary Generation
27413 Commands}).
27414 @iftex
27415 @iflatex
27416 \marginpar[\mbox{}\hfill\epsfig{figure=ps/fred,width=3cm}]{\epsfig{figure=ps/fred,width=3cm}}
27417 @end iflatex
27418 @end iftex
27419
27420 @item
27421 Score files are now applied in a more reliable order (@pxref{Score
27422 Variables}).
27423
27424 @item
27425 Reports on where mail messages end up can be generated (@pxref{Splitting
27426 Mail}).
27427
27428 @item
27429 More hooks and functions have been added to remove junk from incoming
27430 mail before saving the mail (@pxref{Washing Mail}).
27431
27432 @item
27433 Emphasized text can be properly fontisized:
27434
27435 @end itemize
27436
27437
27438 @node Quassia Gnus
27439 @subsubsection Quassia Gnus
27440
27441 New features in Gnus 5.6:
27442
27443 @itemize @bullet
27444
27445 @item
27446 New functionality for using Gnus as an offline newsreader has been
27447 added.  A plethora of new commands and modes have been added.
27448 @xref{Gnus Unplugged}, for the full story.
27449
27450 @item
27451 The @code{nndraft} back end has returned, but works differently than
27452 before.  All Message buffers are now also articles in the @code{nndraft}
27453 group, which is created automatically.
27454
27455 @item
27456 @code{gnus-alter-header-function} can now be used to alter header
27457 values.
27458
27459 @item
27460 @code{gnus-summary-goto-article} now accept Message-ID's.
27461
27462 @item
27463 A new Message command for deleting text in the body of a message
27464 outside the region: @kbd{C-c C-v}.
27465
27466 @item
27467 You can now post to component group in @code{nnvirtual} groups with
27468 @kbd{C-u C-c C-c}.
27469
27470 @item
27471  @code{nntp-rlogin-program}---new variable to ease customization.
27472
27473 @item
27474 @code{C-u C-c C-c} in @code{gnus-article-edit-mode} will now inhibit
27475 re-highlighting of the article buffer.
27476
27477 @item
27478 New element in @code{gnus-boring-article-headers}---@code{long-to}.
27479
27480 @item
27481 @kbd{M-i} symbolic prefix command.  @xref{Symbolic Prefixes}, for
27482 details.
27483
27484 @item
27485 @kbd{L} and @kbd{I} in the summary buffer now take the symbolic prefix
27486 @kbd{a} to add the score rule to the @file{all.SCORE} file.
27487
27488 @item
27489 @code{gnus-simplify-subject-functions} variable to allow greater
27490 control over simplification.
27491
27492 @item
27493 @kbd{A T}---new command for fetching the current thread.
27494
27495 @item
27496 @kbd{/ T}---new command for including the current thread in the
27497 limit.
27498
27499 @item
27500 @kbd{M-RET} is a new Message command for breaking cited text.
27501
27502 @item
27503 @samp{\\1}-expressions are now valid in @code{nnmail-split-methods}.
27504
27505 @item
27506 The @code{custom-face-lookup} function has been removed.
27507 If you used this function in your initialization files, you must
27508 rewrite them to use @code{face-spec-set} instead.
27509
27510 @item
27511 Canceling now uses the current select method.  Symbolic prefix
27512 @kbd{a} forces normal posting method.
27513
27514 @item
27515 New command to translate M******** sm*rtq**t*s into proper
27516 text---@kbd{W d}.
27517
27518 @item
27519 For easier debugging of @code{nntp}, you can set
27520 @code{nntp-record-commands} to a non-@code{nil} value.
27521
27522 @item
27523 @code{nntp} now uses @file{~/.authinfo}, a @file{.netrc}-like file, for
27524 controlling where and how to send @sc{authinfo} to @acronym{NNTP} servers.
27525
27526 @item
27527 A command for editing group parameters from the summary buffer
27528 has been added.
27529
27530 @item
27531 A history of where mails have been split is available.
27532
27533 @item
27534 A new article date command has been added---@code{article-date-iso8601}.
27535
27536 @item
27537 Subjects can be simplified when threading by setting
27538 @code{gnus-score-thread-simplify}.
27539
27540 @item
27541 A new function for citing in Message has been
27542 added---@code{message-cite-original-without-signature}.
27543
27544 @item
27545 @code{article-strip-all-blank-lines}---new article command.
27546
27547 @item
27548 A new Message command to kill to the end of the article has
27549 been added.
27550
27551 @item
27552 A minimum adaptive score can be specified by using the
27553 @code{gnus-adaptive-word-minimum} variable.
27554
27555 @item
27556 The ``lapsed date'' article header can be kept continually
27557 updated by the @code{gnus-start-date-timer} command.
27558
27559 @item
27560 Web listserv archives can be read with the @code{nnlistserv} back end.
27561
27562 @item
27563 Old dejanews archives can now be read by @code{nnweb}.
27564
27565 @end itemize
27566
27567 @node Pterodactyl Gnus
27568 @subsubsection Pterodactyl Gnus
27569
27570 New features in Gnus 5.8:
27571
27572 @itemize @bullet
27573
27574 @item
27575 The mail-fetching functions have changed.  See the manual for the
27576 many details.  In particular, all procmail fetching variables are gone.
27577
27578 If you used procmail like in
27579
27580 @lisp
27581 (setq nnmail-use-procmail t)
27582 (setq nnmail-spool-file 'procmail)
27583 (setq nnmail-procmail-directory "~/mail/incoming/")
27584 (setq nnmail-procmail-suffix "\\.in")
27585 @end lisp
27586
27587 this now has changed to
27588
27589 @lisp
27590 (setq mail-sources
27591       '((directory :path "~/mail/incoming/"
27592                    :suffix ".in")))
27593 @end lisp
27594
27595 @xref{Mail Source Specifiers}.
27596
27597 @item
27598 Gnus is now a @acronym{MIME}-capable reader.  This affects many parts of
27599 Gnus, and adds a slew of new commands.  See the manual for details.
27600
27601 @item
27602 Gnus has also been multilingualized.  This also affects too
27603 many parts of Gnus to summarize here, and adds many new variables.
27604
27605 @item
27606 @code{gnus-auto-select-first} can now be a function to be
27607 called to position point.
27608
27609 @item
27610 The user can now decide which extra headers should be included in
27611 summary buffers and @acronym{NOV} files.
27612
27613 @item
27614 @code{gnus-article-display-hook} has been removed.  Instead, a number
27615 of variables starting with @code{gnus-treat-} have been added.
27616
27617 @item
27618 The Gnus posting styles have been redone again and now works in a
27619 subtly different manner.
27620
27621 @item
27622 New web-based back ends have been added: @code{nnslashdot},
27623 @code{nnwarchive} and @code{nnultimate}.  nnweb has been revamped,
27624 again, to keep up with ever-changing layouts.
27625
27626 @item
27627 Gnus can now read @acronym{IMAP} mail via @code{nnimap}.
27628
27629 @end itemize
27630
27631 @node Oort Gnus
27632 @subsubsection Oort Gnus
27633 @cindex Oort Gnus
27634
27635 New features in Gnus 5.10:
27636
27637 @itemize @bullet
27638
27639 @item Installation changes
27640 @c ***********************
27641
27642 @itemize @bullet
27643 @item
27644 Upgrading from previous (stable) version if you have used Oort.
27645
27646 If you have tried Oort (the unstable Gnus branch leading to this
27647 release) but went back to a stable version, be careful when upgrading to
27648 this version.  In particular, you will probably want to remove all
27649 @file{.marks} (nnml) and @file{.mrk} (nnfolder) files, so that flags are
27650 read from your @file{.newsrc.eld} instead of from the
27651 @file{.marks}/@file{.mrk} file where this release store flags.  See a
27652 later entry for more information about marks.  Note that downgrading
27653 isn't save in general.
27654
27655 @item
27656 Lisp files are now installed in @file{.../site-lisp/gnus/} by default.
27657 It defaulted to @file{.../site-lisp/} formerly.  In addition to this,
27658 the new installer issues a warning if other Gnus installations which
27659 will shadow the latest one are detected.  You can then remove those
27660 shadows manually or remove them using @code{make
27661 remove-installed-shadows}.
27662
27663 @item
27664 New @file{make.bat} for compiling and installing Gnus under MS Windows
27665
27666 Use @file{make.bat} if you want to install Gnus under MS Windows, the
27667 first argument to the batch-program should be the directory where
27668 @file{xemacs.exe} respectively @file{emacs.exe} is located, if you want
27669 to install Gnus after compiling it, give @file{make.bat} @code{/copy} as
27670 the second parameter.
27671
27672 @file{make.bat} has been rewritten from scratch, it now features
27673 automatic recognition of XEmacs and GNU Emacs, generates
27674 @file{gnus-load.el}, checks if errors occur while compilation and
27675 generation of info files and reports them at the end of the build
27676 process.  It now uses @code{makeinfo} if it is available and falls
27677 back to @file{infohack.el} otherwise.  @file{make.bat} should now
27678 install all files which are necessary to run Gnus and be generally a
27679 complete replacement for the @code{configure; make; make install}
27680 cycle used under Unix systems.
27681
27682 The new @file{make.bat} makes @file{make-x.bat} and @file{xemacs.mak}
27683 superfluous, so they have been removed.
27684
27685 @item
27686 @file{~/News/overview/} not used.
27687
27688 As a result of the following change, the @file{~/News/overview/}
27689 directory is not used any more.  You can safely delete the entire
27690 hierarchy.
27691
27692 @c FIXME: `gnus-load' is mentioned in README, which is not included in
27693 @c the repository.  We should find a better place for this item.
27694 @item
27695 @code{(require 'gnus-load)}
27696
27697 If you use a stand-alone Gnus distribution, you'd better add
27698 @code{(require 'gnus-load)} into your @file{~/.emacs} after adding the Gnus
27699 lisp directory into load-path.
27700
27701 File @file{gnus-load.el} contains autoload commands, functions and variables,
27702 some of which may not be included in distributions of Emacsen.
27703
27704 @end itemize
27705
27706 @item New packages and libraries within Gnus
27707 @c *****************************************
27708
27709 @itemize @bullet
27710
27711 @item
27712 The revised Gnus @acronym{FAQ} is included in the manual,
27713 @xref{Frequently Asked Questions}.
27714
27715 @item
27716 @acronym{TLS} wrapper shipped with Gnus
27717
27718 @acronym{TLS}/@acronym{SSL} is now supported in @acronym{IMAP} and
27719 @acronym{NNTP} via @file{tls.el} and GNUTLS.
27720
27721 @item
27722 Improved anti-spam features.
27723
27724 Gnus is now able to take out spam from your mail and news streams
27725 using a wide variety of programs and filter rules.  Among the supported
27726 methods are RBL blocklists, bogofilter and white/blacklists.  Hooks
27727 for easy use of external packages such as SpamAssassin and Hashcash
27728 are also new.  @ref{Thwarting Email Spam} and @ref{Spam Package}.
27729 @c FIXME: @xref{Spam Package}?.  Should this be under Misc?
27730
27731 @item
27732 Gnus supports server-side mail filtering using Sieve.
27733
27734 Sieve rules can be added as Group Parameters for groups, and the
27735 complete Sieve script is generated using @kbd{D g} from the Group
27736 buffer, and then uploaded to the server using @kbd{C-c C-l} in the
27737 generated Sieve buffer.  @xref{Sieve Commands}, and the new Sieve
27738 manual @ref{Top, , Top, sieve, Emacs Sieve}.
27739
27740 @end itemize
27741
27742 @item Changes in group mode
27743 @c ************************
27744
27745 @itemize @bullet
27746
27747 @item
27748 @code{gnus-group-read-ephemeral-group} can be called interactively,
27749 using @kbd{G M}.
27750
27751 @item
27752 Retrieval of charters and control messages
27753
27754 There are new commands for fetching newsgroup charters (@kbd{H c}) and
27755 control messages (@kbd{H C}).
27756
27757 @item
27758 The new variable @code{gnus-parameters} can be used to set group parameters.
27759
27760 Earlier this was done only via @kbd{G p} (or @kbd{G c}), which stored
27761 the parameters in @file{~/.newsrc.eld}, but via this variable you can
27762 enjoy the powers of customize, and simplified backups since you set the
27763 variable in @file{~/.gnus.el} instead of @file{~/.newsrc.eld}.  The
27764 variable maps regular expressions matching group names to group
27765 parameters, a'la:
27766 @lisp
27767 (setq gnus-parameters
27768       '(("mail\\..*"
27769          (gnus-show-threads nil)
27770          (gnus-use-scoring nil))
27771         ("^nnimap:\\(foo.bar\\)$"
27772          (to-group . "\\1"))))
27773 @end lisp
27774
27775 @item
27776 Unread count correct in nnimap groups.
27777
27778 The estimated number of unread articles in the group buffer should now
27779 be correct for nnimap groups.  This is achieved by calling
27780 @code{nnimap-fixup-unread-after-getting-new-news} from the
27781 @code{gnus-setup-news-hook} (called on startup) and
27782 @code{gnus-after-getting-new-news-hook}. (called after getting new
27783 mail).  If you have modified those variables from the default, you may
27784 want to add @code{nnimap-fixup-unread-after-getting-new-news} again.  If
27785 you were happy with the estimate and want to save some (minimal) time
27786 when getting new mail, remove the function.
27787
27788 @item
27789 Group names are treated as UTF-8 by default.
27790
27791 This is supposedly what USEFOR wanted to migrate to.  See
27792 @code{gnus-group-name-charset-group-alist} and
27793 @code{gnus-group-name-charset-method-alist} for customization.
27794
27795 @item
27796 @code{gnus-group-charset-alist} and
27797 @code{gnus-group-ignored-charsets-alist}.
27798
27799 The regexps in these variables are compared with full group names
27800 instead of real group names in 5.8.  Users who customize these
27801 variables should change those regexps accordingly.  For example:
27802 @lisp
27803 ("^han\\>" euc-kr) -> ("\\(^\\|:\\)han\\>" euc-kr)
27804 @end lisp
27805
27806 @item
27807 Old intermediate incoming mail files (@file{Incoming*}) are deleted
27808 after a couple of days, not immediately.  @xref{Mail Source
27809 Customization}.  (New in Gnus 5.10.10 / Emacs 22.2)
27810
27811 @end itemize
27812
27813 @item Changes in summary and article mode
27814 @c **************************************
27815
27816 @itemize @bullet
27817
27818 @item
27819 @kbd{F} (@code{gnus-article-followup-with-original}) and @kbd{R}
27820 (@code{gnus-article-reply-with-original}) only yank the text in the
27821 region if the region is active.
27822
27823 @item
27824 In draft groups, @kbd{e} is now bound to @code{gnus-draft-edit-message}.
27825 Use @kbd{B w} for @code{gnus-summary-edit-article} instead.
27826
27827 @item
27828 Article Buttons
27829
27830 More buttons for URLs, mail addresses, Message-IDs, Info links, man
27831 pages and Emacs or Gnus related references.  @xref{Article Buttons}.  The
27832 variables @code{gnus-button-@var{*}-level} can be used to control the
27833 appearance of all article buttons.  @xref{Article Button Levels}.
27834
27835 @item
27836 Single-part yenc encoded attachments can be decoded.
27837
27838 @item
27839 Picons
27840
27841 The picons code has been reimplemented to work in GNU Emacs---some of
27842 the previous options have been removed or renamed.
27843
27844 Picons are small ``personal icons'' representing users, domain and
27845 newsgroups, which can be displayed in the Article buffer.
27846 @xref{Picons}.
27847
27848 @item
27849 If the new option @code{gnus-treat-body-boundary} is non-@code{nil}, a
27850 boundary line is drawn at the end of the headers.
27851
27852 @item
27853 Signed article headers (X-PGP-Sig) can be verified with @kbd{W p}.
27854
27855 @item
27856 The Summary Buffer uses an arrow in the fringe to indicate the current
27857 article.  Use @code{(setq gnus-summary-display-arrow nil)} to disable it.
27858
27859 @item
27860 Warn about email replies to news
27861
27862 Do you often find yourself replying to news by email by mistake?  Then
27863 the new option @code{gnus-confirm-mail-reply-to-news} is just the thing for
27864 you.
27865
27866 @item
27867 If the new option @code{gnus-summary-display-while-building} is
27868 non-@code{nil}, the summary buffer is shown and updated as it's being
27869 built.
27870
27871 @item
27872 The new @code{recent} mark @samp{.} indicates newly arrived messages (as
27873 opposed to old but unread messages).
27874
27875 @item
27876 Gnus supports RFC 2369 mailing list headers, and adds a number of
27877 related commands in mailing list groups.  @xref{Mailing List}.
27878
27879 @item
27880 The Date header can be displayed in a format that can be read aloud
27881 in English.  @xref{Article Date}.
27882
27883 @item
27884 diffs are automatically highlighted in groups matching
27885 @code{mm-uu-diff-groups-regexp}
27886
27887 @item
27888 Better handling of Microsoft citation styles
27889
27890 Gnus now tries to recognize the mangled header block that some Microsoft
27891 mailers use to indicate that the rest of the message is a citation, even
27892 though it is not quoted in any way.  The variable
27893 @code{gnus-cite-unsightly-citation-regexp} matches the start of these
27894 citations.
27895
27896 The new command @kbd{W Y f}
27897 (@code{gnus-article-outlook-deuglify-article}) allows deuglifying broken
27898 Outlook (Express) articles.
27899
27900 @item
27901 @code{gnus-article-skip-boring}
27902
27903 If you set @code{gnus-article-skip-boring} to @code{t}, then Gnus will
27904 not scroll down to show you a page that contains only boring text,
27905 which by default means cited text and signature.  You can customize
27906 what is skippable using @code{gnus-article-boring-faces}.
27907
27908 This feature is especially useful if you read many articles that
27909 consist of a little new content at the top with a long, untrimmed
27910 message cited below.
27911
27912 @item
27913 Smileys (@samp{:-)}, @samp{;-)} etc) are now displayed graphically in
27914 Emacs too.
27915
27916 Put @code{(setq gnus-treat-display-smileys nil)} in @file{~/.gnus.el} to
27917 disable it.
27918
27919 @item
27920 Face headers handling.  @xref{Face}.
27921
27922 @item
27923 In the summary buffer, the new command @kbd{/ N} inserts new messages
27924 and @kbd{/ o} inserts old messages.
27925
27926 @item
27927 Gnus decodes morse encoded messages if you press @kbd{W m}.
27928
27929 @item
27930 @code{gnus-summary-line-format}
27931
27932 The default value changed to @samp{%U%R%z%I%(%[%4L: %-23,23f%]%)
27933 %s\n}.  Moreover @code{gnus-extra-headers},
27934 @code{nnmail-extra-headers} and @code{gnus-ignored-from-addresses}
27935 changed their default so that the users name will be replaced by the
27936 recipient's name or the group name posting to for @acronym{NNTP}
27937 groups.
27938
27939 @item
27940 Deleting of attachments.
27941
27942 The command @code{gnus-mime-save-part-and-strip} (bound to @kbd{C-o}
27943 on @acronym{MIME} buttons) saves a part and replaces the part with an
27944 external one.  @code{gnus-mime-delete-part} (bound to @kbd{d} on
27945 @acronym{MIME} buttons) removes a part.  It works only on back ends
27946 that support editing.
27947
27948 @item
27949 @code{gnus-default-charset}
27950
27951 The default value is determined from the
27952 @code{current-language-environment} variable, instead of
27953 @code{iso-8859-1}.  Also the @samp{.*} item in
27954 @code{gnus-group-charset-alist} is removed.
27955
27956 @item
27957 Printing capabilities are enhanced.
27958
27959 Gnus supports Muttprint natively with @kbd{O P} from the Summary and
27960 Article buffers.  Also, each individual @acronym{MIME} part can be
27961 printed using @kbd{p} on the @acronym{MIME} button.
27962
27963 @item
27964 Extended format specs.
27965
27966 Format spec @samp{%&user-date;} is added into
27967 @code{gnus-summary-line-format-alist}.  Also, user defined extended
27968 format specs are supported.  The extended format specs look like
27969 @samp{%u&foo;}, which invokes function
27970 @code{gnus-user-format-function-@var{foo}}.  Because @samp{&} is used as the
27971 escape character, old user defined format @samp{%u&} is no longer supported.
27972
27973 @item
27974 @kbd{/ *} (@code{gnus-summary-limit-include-cached}) is rewritten.
27975 @c FIXME: Was this a user-visible change?
27976
27977 It was aliased to @kbd{Y c}
27978 (@code{gnus-summary-insert-cached-articles}).  The new function filters
27979 out other articles.
27980
27981 @item
27982 Some limiting commands accept a @kbd{C-u} prefix to negate the match.
27983
27984 If @kbd{C-u} is used on subject, author or extra headers, i.e., @kbd{/
27985 s}, @kbd{/ a}, and @kbd{/ x}
27986 (@code{gnus-summary-limit-to-@{subject,author,extra@}}) respectively, the
27987 result will be to display all articles that do not match the expression.
27988
27989 @item
27990 Gnus inlines external parts (message/external).
27991
27992 @end itemize
27993
27994 @item Changes in Message mode and related Gnus features
27995 @c ****************************************************
27996
27997 @itemize @bullet
27998
27999 @item
28000 Delayed articles
28001
28002 You can delay the sending of a message with @kbd{C-c C-j} in the Message
28003 buffer.  The messages are delivered at specified time.  This is useful
28004 for sending yourself reminders.  @xref{Delayed Articles}.
28005
28006 @item
28007 If the new option @code{nnml-use-compressed-files} is non-@code{nil},
28008 the nnml back end allows compressed message files.
28009
28010 @item
28011 The new option @code{gnus-gcc-mark-as-read} automatically marks
28012 Gcc articles as read.
28013
28014 @item
28015 Externalizing of attachments
28016
28017 If @code{gnus-gcc-externalize-attachments} or
28018 @code{message-fcc-externalize-attachments} is non-@code{nil}, attach
28019 local files as external parts.
28020
28021 @item
28022 The envelope sender address can be customized when using Sendmail.
28023 @xref{Mail Variables, Mail Variables,, message, Message Manual}.
28024
28025 @item
28026 Gnus no longer generate the Sender: header automatically.
28027
28028 Earlier it was generated when the user configurable email address was
28029 different from the Gnus guessed default user address.  As the guessing
28030 algorithm is rarely correct these days, and (more controversially) the
28031 only use of the Sender: header was to check if you are entitled to
28032 cancel/supersede news (which is now solved by Cancel Locks instead,
28033 see another entry), generation of the header has been disabled by
28034 default.  See the variables @code{message-required-headers},
28035 @code{message-required-news-headers}, and
28036 @code{message-required-mail-headers}.
28037
28038 @item
28039 Features from third party @file{message-utils.el} added to @file{message.el}.
28040
28041 Message now asks if you wish to remove @samp{(was: <old subject>)} from
28042 subject lines (see @code{message-subject-trailing-was-query}).  @kbd{C-c
28043 M-m} and @kbd{C-c M-f} inserts markers indicating included text.
28044 @kbd{C-c C-f a} adds a X-No-Archive: header.  @kbd{C-c C-f x} inserts
28045 appropriate headers and a note in the body for cross-postings and
28046 followups (see the variables @code{message-cross-post-@var{*}}).
28047
28048 @item
28049 References and X-Draft-From headers are no longer generated when you
28050 start composing messages and @code{message-generate-headers-first} is
28051 @code{nil}.
28052
28053 @item
28054 Easy inclusion of X-Faces headers.  @xref{X-Face}.
28055
28056 @item
28057 Group Carbon Copy (GCC) quoting
28058
28059 To support groups that contains SPC and other weird characters, groups
28060 are quoted before they are placed in the Gcc: header.  This means
28061 variables such as @code{gnus-message-archive-group} should no longer
28062 contain quote characters to make groups containing SPC work.  Also, if
28063 you are using the string @samp{nnml:foo, nnml:bar} (indicating Gcc
28064 into two groups) you must change it to return the list
28065 @code{("nnml:foo" "nnml:bar")}, otherwise the Gcc: line will be quoted
28066 incorrectly.  Note that returning the string @samp{nnml:foo, nnml:bar}
28067 was incorrect earlier, it just didn't generate any problems since it
28068 was inserted directly.
28069
28070 @item
28071 @code{message-insinuate-rmail}
28072
28073 @c FIXME should that not be 'message-user-agent?
28074 Adding @code{(message-insinuate-rmail)} and @code{(setq
28075 mail-user-agent 'gnus-user-agent)} in @file{.emacs} convinces Rmail to
28076 compose, reply and forward messages in message-mode, where you can
28077 enjoy the power of @acronym{MML}.
28078
28079 @item
28080 @code{message-minibuffer-local-map}
28081
28082 The line below enables BBDB in resending a message:
28083 @lisp
28084 (define-key message-minibuffer-local-map [(tab)]
28085   'bbdb-complete-name)
28086 @end lisp
28087
28088 @item
28089 @code{gnus-posting-styles}
28090
28091 Add a new format of match like
28092 @lisp
28093 ((header "to" "larsi.*org")
28094  (Organization "Somewhere, Inc."))
28095 @end lisp
28096 The old format like the lines below is obsolete, but still accepted.
28097 @lisp
28098 (header "to" "larsi.*org"
28099         (Organization "Somewhere, Inc."))
28100 @end lisp
28101
28102 @item
28103 @code{message-ignored-news-headers} and @code{message-ignored-mail-headers}
28104
28105 @samp{X-Draft-From} and @samp{X-Gnus-Agent-Meta-Information} have been
28106 added into these two variables.  If you customized those, perhaps you
28107 need add those two headers too.
28108
28109 @item
28110 Gnus supports the ``format=flowed'' (RFC 2646) parameter.  On
28111 composing messages, it is enabled by @code{use-hard-newlines}.
28112 Decoding format=flowed was present but not documented in earlier
28113 versions.
28114
28115 @item
28116 The option @code{mm-fill-flowed} can be used to disable treatment of
28117 ``format=flowed'' messages.  Also, flowed text is disabled when sending
28118 inline PGP signed messages.  @xref{Flowed text, , Flowed text,
28119 emacs-mime, The Emacs MIME Manual}.  (New in Gnus 5.10.7)
28120 @c This entry is also present in the node "No Gnus".
28121
28122 @item
28123 Gnus supports the generation of RFC 2298 Disposition Notification requests.
28124
28125 This is invoked with the @kbd{C-c M-n} key binding from message mode.
28126
28127 @item
28128 Message supports the Importance: (RFC 2156) header.
28129
28130 In the message buffer, @kbd{C-c C-f C-i} or @kbd{C-c C-u} cycles through
28131 the valid values.
28132
28133 @item
28134 Gnus supports Cancel Locks in News.
28135
28136 This means a header @samp{Cancel-Lock} is inserted in news posting.  It is
28137 used to determine if you wrote an article or not (for canceling and
28138 superseding).  Gnus generates a random password string the first time
28139 you post a message, and saves it in your @file{~/.emacs} using the Custom
28140 system.  While the variable is called @code{canlock-password}, it is not
28141 security sensitive data.  Publishing your canlock string on the web
28142 will not allow anyone to be able to anything she could not already do.
28143 The behavior can be changed by customizing @code{message-insert-canlock}.
28144
28145 @item
28146 Gnus supports @acronym{PGP} (RFC 1991/2440), @acronym{PGP/MIME} (RFC
28147 2015/3156) and @acronym{S/MIME} (RFC 2630-2633).
28148
28149 It needs an external @acronym{S/MIME} and OpenPGP implementation, but no
28150 additional Lisp libraries.  This add several menu items to the
28151 Attachments menu, and @kbd{C-c RET} key bindings, when composing
28152 messages.  This also obsoletes @code{gnus-article-hide-pgp-hook}.
28153
28154 @item
28155 @acronym{MML} (Mime compose) prefix changed from @kbd{M-m} to @kbd{C-c
28156 C-m}.
28157
28158 This change was made to avoid conflict with the standard binding of
28159 @code{back-to-indentation}, which is also useful in message mode.
28160
28161 @item
28162 The default for @code{message-forward-show-mml} changed to the symbol
28163 @code{best}.
28164
28165 The behavior for the @code{best} value is to show @acronym{MML} (i.e.,
28166 convert to @acronym{MIME}) when appropriate.  @acronym{MML} will not be
28167 used when forwarding signed or encrypted messages, as the conversion
28168 invalidate the digital signature.
28169
28170 @item
28171 If @code{auto-compression-mode} is enabled, attachments are automatically
28172 decompressed when activated.
28173 @c FIXME: Does this affect article or message mode?
28174
28175 @item
28176 Support for non-@acronym{ASCII} domain names
28177
28178 Message supports non-@acronym{ASCII} domain names in From:, To: and
28179 Cc: and will query you whether to perform encoding when you try to
28180 send a message.  The variable @code{message-use-idna} controls this.
28181 Gnus will also decode non-@acronym{ASCII} domain names in From:, To:
28182 and Cc: when you view a message.  The variable @code{gnus-use-idna}
28183 controls this.
28184
28185 @item You can now drag and drop attachments to the Message buffer.
28186 See @code{mml-dnd-protocol-alist} and @code{mml-dnd-attach-options}.
28187 @xref{MIME, ,MIME, message, Message Manual}.
28188 @c New in 5.10.9 / 5.11 (Emacs 22.1)
28189
28190 @item @code{auto-fill-mode} is enabled by default in Message mode.
28191 See @code{message-fill-column}.  @xref{Various Message Variables, ,
28192 Message Headers, message, Message Manual}.
28193 @c New in Gnus 5.10.12 / 5.11 (Emacs 22.3)
28194
28195 @end itemize
28196
28197 @item Changes in back ends
28198 @c ***********************
28199
28200 @itemize @bullet
28201 @item
28202 Gnus can display RSS newsfeeds as a newsgroup.  @xref{RSS}.
28203
28204 @item
28205 The nndoc back end now supports mailman digests and exim bounces.
28206
28207 @item
28208 Gnus supports Maildir groups.
28209
28210 Gnus includes a new back end @file{nnmaildir.el}.  @xref{Maildir}.
28211
28212 @item
28213 The nnml and nnfolder back ends store marks for each groups.
28214
28215 This makes it possible to take backup of nnml/nnfolder servers/groups
28216 separately of @file{~/.newsrc.eld}, while preserving marks.  It also
28217 makes it possible to share articles and marks between users (without
28218 sharing the @file{~/.newsrc.eld} file) within e.g. a department.  It
28219 works by storing the marks stored in @file{~/.newsrc.eld} in a per-group
28220 file @file{.marks} (for nnml) and @file{@var{groupname}.mrk} (for
28221 nnfolder, named @var{groupname}).  If the nnml/nnfolder is moved to
28222 another machine, Gnus will automatically use the @file{.marks} or
28223 @file{.mrk} file instead of the information in @file{~/.newsrc.eld}.
28224 The new server variables @code{nnml-marks-is-evil} and
28225 @code{nnfolder-marks-is-evil} can be used to disable this feature.
28226
28227 @end itemize
28228
28229 @item Appearance
28230 @c *************
28231
28232 @itemize @bullet
28233
28234 @item
28235 The menu bar item (in Group and Summary buffer) named ``Misc'' has
28236 been renamed to ``Gnus''.
28237
28238 @item
28239 The menu bar item (in Message mode) named ``@acronym{MML}'' has been
28240 renamed to ``Attachments''.  Note that this menu also contains security
28241 related stuff, like signing and encryption (@pxref{Security, Security,,
28242 message, Message Manual}).
28243
28244 @item
28245 The tool bars have been updated to use GNOME icons in Group, Summary and
28246 Message mode.  You can also customize the tool bars: @kbd{M-x
28247 customize-apropos RET -tool-bar$} should get you started.  This is a new
28248 feature in Gnus 5.10.10.  (Only for Emacs, not in XEmacs.)
28249
28250 @item The tool bar icons are now (de)activated correctly
28251 in the group buffer, see the variable @code{gnus-group-update-tool-bar}.
28252 Its default value depends on your Emacs version.  This is a new feature
28253 in Gnus 5.10.9.
28254 @end itemize
28255
28256
28257 @item Miscellaneous changes
28258 @c ************************
28259
28260 @itemize @bullet
28261
28262 @item
28263 @code{gnus-agent}
28264
28265 The Gnus Agent has seen a major updated and is now enabled by default,
28266 and all nntp and nnimap servers from @code{gnus-select-method} and
28267 @code{gnus-secondary-select-method} are agentized by default.  Earlier
28268 only the server in @code{gnus-select-method} was agentized by the
28269 default, and the agent was disabled by default.  When the agent is
28270 enabled, headers are now also retrieved from the Agent cache instead
28271 of the back ends when possible.  Earlier this only happened in the
28272 unplugged state.  You can enroll or remove servers with @kbd{J a} and
28273 @kbd{J r} in the server buffer.  Gnus will not download articles into
28274 the Agent cache, unless you instruct it to do so, though, by using
28275 @kbd{J u} or @kbd{J s} from the Group buffer.  You revert to the old
28276 behavior of having the Agent disabled with @code{(setq gnus-agent
28277 nil)}.  Note that putting @code{(gnus-agentize)} in @file{~/.gnus.el}
28278 is not needed any more.
28279
28280 @item
28281 Gnus reads the @acronym{NOV} and articles in the Agent if plugged.
28282
28283 If one reads an article while plugged, and the article already exists
28284 in the Agent, it won't get downloaded once more.  @code{(setq
28285 gnus-agent-cache nil)} reverts to the old behavior.
28286
28287 @item
28288 Dired integration
28289
28290 @code{gnus-dired-minor-mode} (see @ref{Other modes}) installs key
28291 bindings in dired buffers to send a file as an attachment, open a file
28292 using the appropriate mailcap entry, and print a file using the mailcap
28293 entry.
28294
28295 @item
28296 The format spec @code{%C} for positioning point has changed to @code{%*}.
28297
28298 @item
28299 @code{gnus-slave-unplugged}
28300
28301 A new command which starts Gnus offline in slave mode.
28302
28303 @end itemize
28304
28305 @end itemize
28306
28307 @node No Gnus
28308 @subsubsection No Gnus
28309 @cindex No Gnus
28310
28311 New features in No Gnus:
28312 @c FIXME: Gnus 5.12?
28313
28314 @include gnus-news.texi
28315
28316 @iftex
28317
28318 @page
28319 @node The Manual
28320 @section The Manual
28321 @cindex colophon
28322 @cindex manual
28323
28324 This manual was generated from a TeXinfo file and then run through
28325 either @code{texi2dvi}
28326 @iflatex
28327 or my own home-brewed TeXinfo to \LaTeX\ transformer,
28328 and then run through @code{latex} and @code{dvips}
28329 @end iflatex
28330 to get what you hold in your hands now.
28331
28332 The following conventions have been used:
28333
28334 @enumerate
28335
28336 @item
28337 This is a @samp{string}
28338
28339 @item
28340 This is a @kbd{keystroke}
28341
28342 @item
28343 This is a @file{file}
28344
28345 @item
28346 This is a @code{symbol}
28347
28348 @end enumerate
28349
28350 So if I were to say ``set @code{flargnoze} to @samp{yes}'', that would
28351 mean:
28352
28353 @lisp
28354 (setq flargnoze "yes")
28355 @end lisp
28356
28357 If I say ``set @code{flumphel} to @code{yes}'', that would mean:
28358
28359 @lisp
28360 (setq flumphel 'yes)
28361 @end lisp
28362
28363 @samp{yes} and @code{yes} are two @emph{very} different things---don't
28364 ever get them confused.
28365
28366 @iflatex
28367 @c @head
28368 Of course, everything in this manual is of vital interest, so you should
28369 read it all.  Several times.  However, if you feel like skimming the
28370 manual, look for that gnu head you should see in the margin over
28371 there---it means that what's being discussed is of more importance than
28372 the rest of the stuff.  (On the other hand, if everything is infinitely
28373 important, how can anything be more important than that?  Just one more
28374 of the mysteries of this world, I guess.)
28375 @end iflatex
28376
28377 @end iftex
28378
28379
28380 @node On Writing Manuals
28381 @section On Writing Manuals
28382
28383 I guess most manuals are written after-the-fact; documenting a program
28384 that's already there.  This is not how this manual is written.  When
28385 implementing something, I write the manual entry for that something
28386 straight away.  I then see that it's difficult to explain the
28387 functionality, so I write how it's supposed to be, and then I change the
28388 implementation.  Writing the documentation and writing the code go hand
28389 in hand.
28390
28391 This, of course, means that this manual has no, or little, flow.  It
28392 documents absolutely everything in Gnus, but often not where you're
28393 looking for it.  It is a reference manual, and not a guide to how to get
28394 started with Gnus.
28395
28396 That would be a totally different book, that should be written using the
28397 reference manual as source material.  It would look quite different.
28398
28399
28400 @page
28401 @node Terminology
28402 @section Terminology
28403
28404 @cindex terminology
28405 @table @dfn
28406
28407 @item news
28408 @cindex news
28409 This is what you are supposed to use this thing for---reading news.
28410 News is generally fetched from a nearby @acronym{NNTP} server, and is
28411 generally publicly available to everybody.  If you post news, the entire
28412 world is likely to read just what you have written, and they'll all
28413 snigger mischievously.  Behind your back.
28414
28415 @item mail
28416 @cindex mail
28417 Everything that's delivered to you personally is mail.  Some news/mail
28418 readers (like Gnus) blur the distinction between mail and news, but
28419 there is a difference.  Mail is private.  News is public.  Mailing is
28420 not posting, and replying is not following up.
28421
28422 @item reply
28423 @cindex reply
28424 Send a mail to the person who has written what you are reading.
28425
28426 @item follow up
28427 @cindex follow up
28428 Post an article to the current newsgroup responding to the article you
28429 are reading.
28430
28431 @item back end
28432 @cindex back end
28433 Gnus considers mail and news to be mostly the same, really.  The only
28434 difference is how to access the actual articles.  News articles are
28435 commonly fetched via the protocol @acronym{NNTP}, whereas mail
28436 messages could be read from a file on the local disk.  The internal
28437 architecture of Gnus thus comprises a ``front end'' and a number of
28438 ``back ends''.  Internally, when you enter a group (by hitting
28439 @key{RET}, say), you thereby invoke a function in the front end in
28440 Gnus.  The front end then ``talks'' to a back end and says things like
28441 ``Give me the list of articles in the foo group'' or ``Show me article
28442 number 4711''.
28443
28444 So a back end mainly defines either a protocol (the @code{nntp} back
28445 end accesses news via @acronym{NNTP}, the @code{nnimap} back end
28446 accesses mail via @acronym{IMAP}) or a file format and directory
28447 layout (the @code{nnspool} back end accesses news via the common
28448 ``spool directory'' format, the @code{nnml} back end access mail via a
28449 file format and directory layout that's quite similar).
28450
28451 Gnus does not handle the underlying media, so to speak---this is all
28452 done by the back ends.  A back end is a collection of functions to
28453 access the articles.
28454
28455 However, sometimes the term ``back end'' is also used where ``server''
28456 would have been more appropriate.  And then there is the term ``select
28457 method'' which can mean either.  The Gnus terminology can be quite
28458 confusing.
28459
28460 @item native
28461 @cindex native
28462 Gnus will always use one method (and back end) as the @dfn{native}, or
28463 default, way of getting news.
28464
28465 @item foreign
28466 @cindex foreign
28467 You can also have any number of foreign groups active at the same time.
28468 These are groups that use non-native non-secondary back ends for getting
28469 news.
28470
28471 @item secondary
28472 @cindex secondary
28473 Secondary back ends are somewhere half-way between being native and being
28474 foreign, but they mostly act like they are native.
28475
28476 @item article
28477 @cindex article
28478 A message that has been posted as news.
28479
28480 @item mail message
28481 @cindex mail message
28482 A message that has been mailed.
28483
28484 @item message
28485 @cindex message
28486 A mail message or news article
28487
28488 @item head
28489 @cindex head
28490 The top part of a message, where administrative information (etc.) is
28491 put.
28492
28493 @item body
28494 @cindex body
28495 The rest of an article.  Everything not in the head is in the
28496 body.
28497
28498 @item header
28499 @cindex header
28500 A line from the head of an article.
28501
28502 @item headers
28503 @cindex headers
28504 A collection of such lines, or a collection of heads.  Or even a
28505 collection of @acronym{NOV} lines.
28506
28507 @item @acronym{NOV}
28508 @cindex @acronym{NOV}
28509 @acronym{NOV} stands for News OverView, which is a type of news server
28510 header which provide datas containing the condensed header information
28511 of articles.  They are produced by the server itself; in the @code{nntp}
28512 back end Gnus uses the ones that the @acronym{NNTP} server makes, but
28513 Gnus makes them by itself for some backends (in particular, @code{nnml}).
28514
28515 When Gnus enters a group, it asks the back end for the headers of all
28516 unread articles in the group.  Most servers support the News OverView
28517 format, which is more compact and much faster to read and parse than the
28518 normal @sc{head} format.
28519
28520 The @acronym{NOV} data consist of one or more text lines (@pxref{Text
28521 Lines, ,Motion by Text Lines, elisp, The Emacs Lisp Reference Manual})
28522 where each line has the header information of one article.  The header
28523 information is a tab-separated series of the header's contents including
28524 an article number, a subject, an author, a date, a message-id,
28525 references, etc.
28526
28527 Those data enable Gnus to generate summary lines quickly.  However, if
28528 the server does not support @acronym{NOV} or you disable it purposely or
28529 for some reason, Gnus will try to generate the header information by
28530 parsing each article's headers one by one.  It will take time.
28531 Therefore, it is not usually a good idea to set nn*-nov-is-evil
28532 (@pxref{Slow/Expensive Connection}) to a non-@code{nil} value unless you
28533 know that the server makes wrong @acronym{NOV} data.
28534
28535 @item level
28536 @cindex levels
28537 Each group is subscribed at some @dfn{level} or other (1-9).  The ones
28538 that have a lower level are ``more'' subscribed than the groups with a
28539 higher level.  In fact, groups on levels 1-5 are considered
28540 @dfn{subscribed}; 6-7 are @dfn{unsubscribed}; 8 are @dfn{zombies}; and 9
28541 are @dfn{killed}.  Commands for listing groups and scanning for new
28542 articles will all use the numeric prefix as @dfn{working level}.
28543
28544 @item killed groups
28545 @cindex killed groups
28546 No information on killed groups is stored or updated, which makes killed
28547 groups much easier to handle than subscribed groups.
28548
28549 @item zombie groups
28550 @cindex zombie groups
28551 Just like killed groups, only slightly less dead.
28552
28553 @item active file
28554 @cindex active file
28555 The news server has to keep track of what articles it carries, and what
28556 groups exist.  All this information in stored in the active file, which
28557 is rather large, as you might surmise.
28558
28559 @item bogus groups
28560 @cindex bogus groups
28561 A group that exists in the @file{.newsrc} file, but isn't known to the
28562 server (i.e.,  it isn't in the active file), is a @emph{bogus group}.
28563 This means that the group probably doesn't exist (any more).
28564
28565 @item activating
28566 @cindex activating groups
28567 The act of asking the server for info on a group and computing the
28568 number of unread articles is called @dfn{activating the group}.
28569 Un-activated groups are listed with @samp{*} in the group buffer.
28570
28571 @item spool
28572 @cindex spool
28573 News servers store their articles locally in one fashion or other.
28574 One old-fashioned storage method is to have just one file per
28575 article.  That's called a ``traditional spool''.
28576
28577 @item server
28578 @cindex server
28579 A machine one can connect to and get news (or mail) from.
28580
28581 @item select method
28582 @cindex select method
28583 A structure that specifies the back end, the server and the virtual
28584 server settings.
28585
28586 @item virtual server
28587 @cindex virtual server
28588 A named select method.  Since a select method defines all there is to
28589 know about connecting to a (physical) server, taking the thing as a
28590 whole is a virtual server.
28591
28592 @item washing
28593 @cindex washing
28594 Taking a buffer and running it through a filter of some sort.  The
28595 result will (more often than not) be cleaner and more pleasing than the
28596 original.
28597
28598 @item ephemeral groups
28599 @cindex ephemeral groups
28600 @cindex temporary groups
28601 Most groups store data on what articles you have read.  @dfn{Ephemeral}
28602 groups are groups that will have no data stored---when you exit the
28603 group, it'll disappear into the aether.
28604
28605 @item solid groups
28606 @cindex solid groups
28607 This is the opposite of ephemeral groups.  All groups listed in the
28608 group buffer are solid groups.
28609
28610 @item sparse articles
28611 @cindex sparse articles
28612 These are article placeholders shown in the summary buffer when
28613 @code{gnus-build-sparse-threads} has been switched on.
28614
28615 @item threading
28616 @cindex threading
28617 To put responses to articles directly after the articles they respond
28618 to---in a hierarchical fashion.
28619
28620 @item root
28621 @cindex root
28622 @cindex thread root
28623 The first article in a thread is the root.  It is the ancestor of all
28624 articles in the thread.
28625
28626 @item parent
28627 @cindex parent
28628 An article that has responses.
28629
28630 @item child
28631 @cindex child
28632 An article that responds to a different article---its parent.
28633
28634 @item digest
28635 @cindex digest
28636 A collection of messages in one file.  The most common digest format is
28637 specified by RFC 1153.
28638
28639 @item splitting
28640 @cindex splitting, terminology
28641 @cindex mail sorting
28642 @cindex mail filtering (splitting)
28643 The action of sorting your emails according to certain rules. Sometimes
28644 incorrectly called mail filtering.
28645
28646 @end table
28647
28648
28649 @page
28650 @node Customization
28651 @section Customization
28652 @cindex general customization
28653
28654 All variables are properly documented elsewhere in this manual.  This
28655 section is designed to give general pointers on how to customize Gnus
28656 for some quite common situations.
28657
28658 @menu
28659 * Slow/Expensive Connection::   You run a local Emacs and get the news elsewhere.
28660 * Slow Terminal Connection::    You run a remote Emacs.
28661 * Little Disk Space::           You feel that having large setup files is icky.
28662 * Slow Machine::                You feel like buying a faster machine.
28663 @end menu
28664
28665
28666 @node Slow/Expensive Connection
28667 @subsection Slow/Expensive Connection
28668
28669 If you run Emacs on a machine locally, and get your news from a machine
28670 over some very thin strings, you want to cut down on the amount of data
28671 Gnus has to get from the server.
28672
28673 @table @code
28674
28675 @item gnus-read-active-file
28676 Set this to @code{nil}, which will inhibit Gnus from requesting the
28677 entire active file from the server.  This file is often very large.  You
28678 also have to set @code{gnus-check-new-newsgroups} and
28679 @code{gnus-check-bogus-newsgroups} to @code{nil} to make sure that Gnus
28680 doesn't suddenly decide to fetch the active file anyway.
28681
28682 @item gnus-nov-is-evil
28683 @vindex gnus-nov-is-evil
28684 Usually this one must @emph{always} be @code{nil} (which is the
28685 default).  If, for example, you wish to not use @acronym{NOV}
28686 (@pxref{Terminology}) with the @code{nntp} back end (@pxref{Crosspost
28687 Handling}), set @code{nntp-nov-is-evil} to a non-@code{nil} value
28688 instead of setting this.  But you normally do not need to set
28689 @code{nntp-nov-is-evil} since Gnus by itself will detect whether the
28690 @acronym{NNTP} server supports @acronym{NOV}.  Anyway, grabbing article
28691 headers from the @acronym{NNTP} server will not be very fast if you tell
28692 Gnus not to use @acronym{NOV}.
28693
28694 As the variables for the other back ends, there are
28695 @code{nndiary-nov-is-evil}, @code{nndir-nov-is-evil},
28696 @code{nnfolder-nov-is-evil}, @code{nnimap-nov-is-evil},
28697 @code{nnml-nov-is-evil}, and @code{nnspool-nov-is-evil}.  Note that a
28698 non-@code{nil} value for @code{gnus-nov-is-evil} overrides all those
28699 variables.
28700 @end table
28701
28702
28703 @node Slow Terminal Connection
28704 @subsection Slow Terminal Connection
28705
28706 Let's say you use your home computer for dialing up the system that runs
28707 Emacs and Gnus.  If your modem is slow, you want to reduce (as much as
28708 possible) the amount of data sent over the wires.
28709
28710 @table @code
28711
28712 @item gnus-auto-center-summary
28713 Set this to @code{nil} to inhibit Gnus from re-centering the summary
28714 buffer all the time.  If it is @code{vertical}, do only vertical
28715 re-centering.  If it is neither @code{nil} nor @code{vertical}, do both
28716 horizontal and vertical recentering.
28717
28718 @item gnus-visible-headers
28719 Cut down on the headers included in the articles to the
28720 minimum.  You can, in fact, make do without them altogether---most of the
28721 useful data is in the summary buffer, anyway.  Set this variable to
28722 @samp{^NEVVVVER} or @samp{From:}, or whatever you feel you need.
28723
28724 Use the following to enable all the available hiding features:
28725 @lisp
28726 (setq gnus-treat-hide-headers 'head
28727       gnus-treat-hide-signature t
28728       gnus-treat-hide-citation t)
28729 @end lisp
28730
28731 @item gnus-use-full-window
28732 By setting this to @code{nil}, you can make all the windows smaller.
28733 While this doesn't really cut down much generally, it means that you
28734 have to see smaller portions of articles before deciding that you didn't
28735 want to read them anyway.
28736
28737 @item gnus-thread-hide-subtree
28738 If this is non-@code{nil}, all threads in the summary buffer will be
28739 hidden initially.
28740
28741
28742 @item gnus-updated-mode-lines
28743 If this is @code{nil}, Gnus will not put information in the buffer mode
28744 lines, which might save some time.
28745 @end table
28746
28747
28748 @node Little Disk Space
28749 @subsection Little Disk Space
28750 @cindex disk space
28751
28752 The startup files can get rather large, so you may want to cut their
28753 sizes a bit if you are running out of space.
28754
28755 @table @code
28756
28757 @item gnus-save-newsrc-file
28758 If this is @code{nil}, Gnus will never save @file{.newsrc}---it will
28759 only save @file{.newsrc.eld}.  This means that you will not be able to
28760 use any other newsreaders than Gnus.  This variable is @code{t} by
28761 default.
28762
28763 @item gnus-read-newsrc-file
28764 If this is @code{nil}, Gnus will never read @file{.newsrc}---it will
28765 only read @file{.newsrc.eld}.  This means that you will not be able to
28766 use any other newsreaders than Gnus.  This variable is @code{t} by
28767 default.
28768
28769 @item gnus-save-killed-list
28770 If this is @code{nil}, Gnus will not save the list of dead groups.  You
28771 should also set @code{gnus-check-new-newsgroups} to @code{ask-server}
28772 and @code{gnus-check-bogus-newsgroups} to @code{nil} if you set this
28773 variable to @code{nil}.  This variable is @code{t} by default.
28774
28775 @end table
28776
28777
28778 @node Slow Machine
28779 @subsection Slow Machine
28780 @cindex slow machine
28781
28782 If you have a slow machine, or are just really impatient, there are a
28783 few things you can do to make Gnus run faster.
28784
28785 Set @code{gnus-check-new-newsgroups} and
28786 @code{gnus-check-bogus-newsgroups} to @code{nil} to make startup faster.
28787
28788 Set @code{gnus-show-threads}, @code{gnus-use-cross-reference} and
28789 @code{gnus-nov-is-evil} to @code{nil} to make entering and exiting the
28790 summary buffer faster.  Also @pxref{Slow/Expensive Connection}.
28791
28792
28793 @page
28794 @node Troubleshooting
28795 @section Troubleshooting
28796 @cindex troubleshooting
28797
28798 Gnus works @emph{so} well straight out of the box---I can't imagine any
28799 problems, really.
28800
28801 Ahem.
28802
28803 @enumerate
28804
28805 @item
28806 Make sure your computer is switched on.
28807
28808 @item
28809 Make sure that you really load the current Gnus version.  If you have
28810 been running @sc{gnus}, you need to exit Emacs and start it up again before
28811 Gnus will work.
28812
28813 @item
28814 Try doing an @kbd{M-x gnus-version}.  If you get something that looks
28815 like @c
28816 @samp{No Gnus v0.10} @c Adjust ../Makefile.in if you change this line!
28817 @c
28818 you have the right files loaded.  Otherwise you have some old @file{.el}
28819 files lying around.  Delete these.
28820
28821 @item
28822 Read the help group (@kbd{G h} in the group buffer) for a
28823 @acronym{FAQ} and a how-to.
28824
28825 @item
28826 @vindex max-lisp-eval-depth
28827 Gnus works on many recursive structures, and in some extreme (and very
28828 rare) cases Gnus may recurse down ``too deeply'' and Emacs will beep at
28829 you.  If this happens to you, set @code{max-lisp-eval-depth} to 500 or
28830 something like that.
28831 @end enumerate
28832
28833 If all else fails, report the problem as a bug.
28834
28835 @cindex bugs
28836 @cindex reporting bugs
28837
28838 @kindex M-x gnus-bug
28839 @findex gnus-bug
28840 If you find a bug in Gnus, you can report it with the @kbd{M-x gnus-bug}
28841 command.  @kbd{M-x set-variable RET debug-on-error RET t RET}, and send
28842 me the backtrace.  I will fix bugs, but I can only fix them if you send
28843 me a precise description as to how to reproduce the bug.
28844
28845 You really can never be too detailed in a bug report.  Always use the
28846 @kbd{M-x gnus-bug} command when you make bug reports, even if it creates
28847 a 10Kb mail each time you use it, and even if you have sent me your
28848 environment 500 times before.  I don't care.  I want the full info each
28849 time.
28850
28851 It is also important to remember that I have no memory whatsoever.  If
28852 you send a bug report, and I send you a reply, and then you just send
28853 back ``No, it's not! Moron!'', I will have no idea what you are
28854 insulting me about.  Always over-explain everything.  It's much easier
28855 for all of us---if I don't have all the information I need, I will just
28856 mail you and ask for more info, and everything takes more time.
28857
28858 If the problem you're seeing is very visual, and you can't quite explain
28859 it, copy the Emacs window to a file (with @code{xwd}, for instance), put
28860 it somewhere it can be reached, and include the URL of the picture in
28861 the bug report.
28862
28863 @cindex patches
28864 If you would like to contribute a patch to fix bugs or make
28865 improvements, please produce the patch using @samp{diff -u}.
28866
28867 @cindex edebug
28868 If you want to debug your problem further before reporting, possibly
28869 in order to solve the problem yourself and send a patch, you can use
28870 edebug.  Debugging Lisp code is documented in the Elisp manual
28871 (@pxref{Debugging, , Debugging Lisp Programs, elisp, The GNU Emacs
28872 Lisp Reference Manual}).  To get you started with edebug, consider if
28873 you discover some weird behavior when pressing @kbd{c}, the first
28874 step is to do @kbd{C-h k c} and click on the hyperlink (Emacs only) in
28875 the documentation buffer that leads you to the function definition,
28876 then press @kbd{M-x edebug-defun RET} with point inside that function,
28877 return to Gnus and press @kbd{c} to invoke the code.  You will be
28878 placed in the lisp buffer and can single step using @kbd{SPC} and
28879 evaluate expressions using @kbd{M-:} or inspect variables using
28880 @kbd{C-h v}, abort execution with @kbd{q}, and resume execution with
28881 @kbd{c} or @kbd{g}.
28882
28883 @cindex elp
28884 @cindex profile
28885 @cindex slow
28886 Sometimes, a problem do not directly generate an elisp error but
28887 manifests itself by causing Gnus to be very slow.  In these cases, you
28888 can use @kbd{M-x toggle-debug-on-quit} and press @kbd{C-g} when things are
28889 slow, and then try to analyze the backtrace (repeating the procedure
28890 helps isolating the real problem areas).
28891
28892 A fancier approach is to use the elisp profiler, ELP.  The profiler is
28893 (or should be) fully documented elsewhere, but to get you started
28894 there are a few steps that need to be followed.  First, instrument the
28895 part of Gnus you are interested in for profiling, e.g. @kbd{M-x
28896 elp-instrument-package RET gnus} or @kbd{M-x elp-instrument-package
28897 RET message}.  Then perform the operation that is slow and press
28898 @kbd{M-x elp-results}.  You will then see which operations that takes
28899 time, and can debug them further.  If the entire operation takes much
28900 longer than the time spent in the slowest function in the profiler
28901 output, you probably profiled the wrong part of Gnus.  To reset
28902 profiling statistics, use @kbd{M-x elp-reset-all}.  @kbd{M-x
28903 elp-restore-all} is supposed to remove profiling, but given the
28904 complexities and dynamic code generation in Gnus, it might not always
28905 work perfectly.
28906
28907 @cindex gnu.emacs.gnus
28908 @cindex ding mailing list
28909 If you just need help, you are better off asking on
28910 @samp{gnu.emacs.gnus}.  I'm not very helpful.  You can also ask on
28911 @email{ding@@gnus.org, the ding mailing list}.  Write to
28912 @email{ding-request@@gnus.org} to subscribe.
28913
28914
28915 @page
28916 @node Gnus Reference Guide
28917 @section Gnus Reference Guide
28918
28919 It is my hope that other people will figure out smart stuff that Gnus
28920 can do, and that other people will write those smart things as well.  To
28921 facilitate that I thought it would be a good idea to describe the inner
28922 workings of Gnus.  And some of the not-so-inner workings, while I'm at
28923 it.
28924
28925 You can never expect the internals of a program not to change, but I
28926 will be defining (in some details) the interface between Gnus and its
28927 back ends (this is written in stone), the format of the score files
28928 (ditto), data structures (some are less likely to change than others)
28929 and general methods of operation.
28930
28931 @menu
28932 * Gnus Utility Functions::      Common functions and variable to use.
28933 * Back End Interface::          How Gnus communicates with the servers.
28934 * Score File Syntax::           A BNF definition of the score file standard.
28935 * Headers::                     How Gnus stores headers internally.
28936 * Ranges::                      A handy format for storing mucho numbers.
28937 * Group Info::                  The group info format.
28938 * Extended Interactive::        Symbolic prefixes and stuff.
28939 * Emacs/XEmacs Code::           Gnus can be run under all modern Emacsen.
28940 * Various File Formats::        Formats of files that Gnus use.
28941 @end menu
28942
28943
28944 @node Gnus Utility Functions
28945 @subsection Gnus Utility Functions
28946 @cindex Gnus utility functions
28947 @cindex utility functions
28948 @cindex functions
28949 @cindex internal variables
28950
28951 When writing small functions to be run from hooks (and stuff), it's
28952 vital to have access to the Gnus internal functions and variables.
28953 Below is a list of the most common ones.
28954
28955 @table @code
28956
28957 @item gnus-newsgroup-name
28958 @vindex gnus-newsgroup-name
28959 This variable holds the name of the current newsgroup.
28960
28961 @item gnus-find-method-for-group
28962 @findex gnus-find-method-for-group
28963 A function that returns the select method for @var{group}.
28964
28965 @item gnus-group-real-name
28966 @findex gnus-group-real-name
28967 Takes a full (prefixed) Gnus group name, and returns the unprefixed
28968 name.
28969
28970 @item gnus-group-prefixed-name
28971 @findex gnus-group-prefixed-name
28972 Takes an unprefixed group name and a select method, and returns the full
28973 (prefixed) Gnus group name.
28974
28975 @item gnus-get-info
28976 @findex gnus-get-info
28977 Returns the group info list for @var{group}.
28978
28979 @item gnus-group-unread
28980 @findex gnus-group-unread
28981 The number of unread articles in @var{group}, or @code{t} if that is
28982 unknown.
28983
28984 @item gnus-active
28985 @findex gnus-active
28986 The active entry for @var{group}.
28987
28988 @item gnus-set-active
28989 @findex gnus-set-active
28990 Set the active entry for @var{group}.
28991
28992 @item gnus-add-current-to-buffer-list
28993 @findex gnus-add-current-to-buffer-list
28994 Adds the current buffer to the list of buffers to be killed on Gnus
28995 exit.
28996
28997 @item gnus-continuum-version
28998 @findex gnus-continuum-version
28999 Takes a Gnus version string as a parameter and returns a floating point
29000 number.  Earlier versions will always get a lower number than later
29001 versions.
29002
29003 @item gnus-group-read-only-p
29004 @findex gnus-group-read-only-p
29005 Says whether @var{group} is read-only or not.
29006
29007 @item gnus-news-group-p
29008 @findex gnus-news-group-p
29009 Says whether @var{group} came from a news back end.
29010
29011 @item gnus-ephemeral-group-p
29012 @findex gnus-ephemeral-group-p
29013 Says whether @var{group} is ephemeral or not.
29014
29015 @item gnus-server-to-method
29016 @findex gnus-server-to-method
29017 Returns the select method corresponding to @var{server}.
29018
29019 @item gnus-server-equal
29020 @findex gnus-server-equal
29021 Says whether two virtual servers are equal.
29022
29023 @item gnus-group-native-p
29024 @findex gnus-group-native-p
29025 Says whether @var{group} is native or not.
29026
29027 @item gnus-group-secondary-p
29028 @findex gnus-group-secondary-p
29029 Says whether @var{group} is secondary or not.
29030
29031 @item gnus-group-foreign-p
29032 @findex gnus-group-foreign-p
29033 Says whether @var{group} is foreign or not.
29034
29035 @item gnus-group-find-parameter
29036 @findex gnus-group-find-parameter
29037 Returns the parameter list of @var{group}.  If given a second parameter,
29038 returns the value of that parameter for @var{group}.
29039
29040 @item gnus-group-set-parameter
29041 @findex gnus-group-set-parameter
29042 Takes three parameters; @var{group}, @var{parameter} and @var{value}.
29043
29044 @item gnus-narrow-to-body
29045 @findex gnus-narrow-to-body
29046 Narrows the current buffer to the body of the article.
29047
29048 @item gnus-check-backend-function
29049 @findex gnus-check-backend-function
29050 Takes two parameters, @var{function} and @var{group}.  If the back end
29051 @var{group} comes from supports @var{function}, return non-@code{nil}.
29052
29053 @lisp
29054 (gnus-check-backend-function "request-scan" "nnml:misc")
29055 @result{} t
29056 @end lisp
29057
29058 @item gnus-read-method
29059 @findex gnus-read-method
29060 Prompts the user for a select method.
29061
29062 @end table
29063
29064
29065 @node Back End Interface
29066 @subsection Back End Interface
29067
29068 Gnus doesn't know anything about @acronym{NNTP}, spools, mail or virtual
29069 groups.  It only knows how to talk to @dfn{virtual servers}.  A virtual
29070 server is a @dfn{back end} and some @dfn{back end variables}.  As examples
29071 of the first, we have @code{nntp}, @code{nnspool} and @code{nnmbox}.  As
29072 examples of the latter we have @code{nntp-port-number} and
29073 @code{nnmbox-directory}.
29074
29075 When Gnus asks for information from a back end---say @code{nntp}---on
29076 something, it will normally include a virtual server name in the
29077 function parameters.  (If not, the back end should use the ``current''
29078 virtual server.)  For instance, @code{nntp-request-list} takes a virtual
29079 server as its only (optional) parameter.  If this virtual server hasn't
29080 been opened, the function should fail.
29081
29082 Note that a virtual server name has no relation to some physical server
29083 name.  Take this example:
29084
29085 @lisp
29086 (nntp "odd-one"
29087       (nntp-address "ifi.uio.no")
29088       (nntp-port-number 4324))
29089 @end lisp
29090
29091 Here the virtual server name is @samp{odd-one} while the name of
29092 the physical server is @samp{ifi.uio.no}.
29093
29094 The back ends should be able to switch between several virtual servers.
29095 The standard back ends implement this by keeping an alist of virtual
29096 server environments that they pull down/push up when needed.
29097
29098 There are two groups of interface functions: @dfn{required functions},
29099 which must be present, and @dfn{optional functions}, which Gnus will
29100 always check for presence before attempting to call 'em.
29101
29102 All these functions are expected to return data in the buffer
29103 @code{nntp-server-buffer} (@samp{ *nntpd*}), which is somewhat
29104 unfortunately named, but we'll have to live with it.  When I talk about
29105 @dfn{resulting data}, I always refer to the data in that buffer.  When I
29106 talk about @dfn{return value}, I talk about the function value returned by
29107 the function call.  Functions that fail should return @code{nil} as the
29108 return value.
29109
29110 Some back ends could be said to be @dfn{server-forming} back ends, and
29111 some might be said not to be.  The latter are back ends that generally
29112 only operate on one group at a time, and have no concept of ``server''
29113 ---they have a group, and they deliver info on that group and nothing
29114 more.
29115
29116 Gnus identifies each message by way of group name and article number.  A
29117 few remarks about these article numbers might be useful.  First of all,
29118 the numbers are positive integers.  Secondly, it is normally not
29119 possible for later articles to ``re-use'' older article numbers without
29120 confusing Gnus.  That is, if a group has ever contained a message
29121 numbered 42, then no other message may get that number, or Gnus will get
29122 mightily confused.@footnote{See the function
29123 @code{nnchoke-request-update-info}, @ref{Optional Back End Functions}.}
29124 Third, article numbers must be assigned in order of arrival in the
29125 group; this is not necessarily the same as the date of the message.
29126
29127 The previous paragraph already mentions all the ``hard'' restrictions that
29128 article numbers must fulfill.  But it seems that it might be useful to
29129 assign @emph{consecutive} article numbers, for Gnus gets quite confused
29130 if there are holes in the article numbering sequence.  However, due to
29131 the ``no-reuse'' restriction, holes cannot be avoided altogether.  It's
29132 also useful for the article numbers to start at 1 to avoid running out
29133 of numbers as long as possible.
29134
29135 Note that by convention, back ends are named @code{nnsomething}, but
29136 Gnus also comes with some @code{nnnotbackends}, such as
29137 @file{nnheader.el}, @file{nnmail.el} and @file{nnoo.el}.
29138
29139 In the examples and definitions I will refer to the imaginary back end
29140 @code{nnchoke}.
29141
29142 @cindex @code{nnchoke}
29143
29144 @menu
29145 * Required Back End Functions::  Functions that must be implemented.
29146 * Optional Back End Functions::  Functions that need not be implemented.
29147 * Error Messaging::             How to get messages and report errors.
29148 * Writing New Back Ends::       Extending old back ends.
29149 * Hooking New Back Ends Into Gnus::  What has to be done on the Gnus end.
29150 * Mail-like Back Ends::         Some tips on mail back ends.
29151 @end menu
29152
29153
29154 @node Required Back End Functions
29155 @subsubsection Required Back End Functions
29156
29157 @table @code
29158
29159 @item (nnchoke-retrieve-headers ARTICLES &optional GROUP SERVER FETCH-OLD)
29160
29161 @var{articles} is either a range of article numbers or a list of
29162 @code{Message-ID}s.  Current back ends do not fully support either---only
29163 sequences (lists) of article numbers, and most back ends do not support
29164 retrieval of @code{Message-ID}s.  But they should try for both.
29165
29166 The result data should either be HEADs or @acronym{NOV} lines, and the result
29167 value should either be @code{headers} or @code{nov} to reflect this.
29168 This might later be expanded to @code{various}, which will be a mixture
29169 of HEADs and @acronym{NOV} lines, but this is currently not supported by Gnus.
29170
29171 If @var{fetch-old} is non-@code{nil} it says to try fetching ``extra
29172 headers'', in some meaning of the word.  This is generally done by
29173 fetching (at most) @var{fetch-old} extra headers less than the smallest
29174 article number in @code{articles}, and filling the gaps as well.  The
29175 presence of this parameter can be ignored if the back end finds it
29176 cumbersome to follow the request.  If this is non-@code{nil} and not a
29177 number, do maximum fetches.
29178
29179 Here's an example HEAD:
29180
29181 @example
29182 221 1056 Article retrieved.
29183 Path: ifi.uio.no!sturles
29184 From: sturles@@ifi.uio.no (Sturle Sunde)
29185 Newsgroups: ifi.discussion
29186 Subject: Re: Something very droll
29187 Date: 27 Oct 1994 14:02:57 +0100
29188 Organization: Dept. of Informatics, University of Oslo, Norway
29189 Lines: 26
29190 Message-ID: <38o8e1$a0o@@holmenkollen.ifi.uio.no>
29191 References: <38jdmq$4qu@@visbur.ifi.uio.no>
29192 NNTP-Posting-Host: holmenkollen.ifi.uio.no
29193 .
29194 @end example
29195
29196 So a @code{headers} return value would imply that there's a number of
29197 these in the data buffer.
29198
29199 Here's a BNF definition of such a buffer:
29200
29201 @example
29202 headers        = *head
29203 head           = error / valid-head
29204 error-message  = [ "4" / "5" ] 2number " " <error message> eol
29205 valid-head     = valid-message *header "." eol
29206 valid-message  = "221 " <number> " Article retrieved." eol
29207 header         = <text> eol
29208 @end example
29209
29210 @cindex BNF
29211 (The version of BNF used here is the one used in RFC822.)
29212
29213 If the return value is @code{nov}, the data buffer should contain
29214 @dfn{network overview database} lines.  These are basically fields
29215 separated by tabs.
29216
29217 @example
29218 nov-buffer = *nov-line
29219 nov-line   = field 7*8[ <TAB> field ] eol
29220 field      = <text except TAB>
29221 @end example
29222
29223 For a closer look at what should be in those fields,
29224 @pxref{Headers}.
29225
29226
29227 @item (nnchoke-open-server SERVER &optional DEFINITIONS)
29228
29229 @var{server} is here the virtual server name.  @var{definitions} is a
29230 list of @code{(VARIABLE VALUE)} pairs that define this virtual server.
29231
29232 If the server can't be opened, no error should be signaled.  The back end
29233 may then choose to refuse further attempts at connecting to this
29234 server.  In fact, it should do so.
29235
29236 If the server is opened already, this function should return a
29237 non-@code{nil} value.  There should be no data returned.
29238
29239
29240 @item (nnchoke-close-server &optional SERVER)
29241
29242 Close connection to @var{server} and free all resources connected
29243 to it.  Return @code{nil} if the server couldn't be closed for some
29244 reason.
29245
29246 There should be no data returned.
29247
29248
29249 @item (nnchoke-request-close)
29250
29251 Close connection to all servers and free all resources that the back end
29252 have reserved.  All buffers that have been created by that back end
29253 should be killed.  (Not the @code{nntp-server-buffer}, though.)  This
29254 function is generally only called when Gnus is shutting down.
29255
29256 There should be no data returned.
29257
29258
29259 @item (nnchoke-server-opened &optional SERVER)
29260
29261 If @var{server} is the current virtual server, and the connection to the
29262 physical server is alive, then this function should return a
29263 non-@code{nil} value.  This function should under no circumstances
29264 attempt to reconnect to a server we have lost connection to.
29265
29266 There should be no data returned.
29267
29268
29269 @item (nnchoke-status-message &optional SERVER)
29270
29271 This function should return the last error message from @var{server}.
29272
29273 There should be no data returned.
29274
29275
29276 @item (nnchoke-request-article ARTICLE &optional GROUP SERVER TO-BUFFER)
29277
29278 The result data from this function should be the article specified by
29279 @var{article}.  This might either be a @code{Message-ID} or a number.
29280 It is optional whether to implement retrieval by @code{Message-ID}, but
29281 it would be nice if that were possible.
29282
29283 If @var{to-buffer} is non-@code{nil}, the result data should be returned
29284 in this buffer instead of the normal data buffer.  This is to make it
29285 possible to avoid copying large amounts of data from one buffer to
29286 another, while Gnus mainly requests articles to be inserted directly
29287 into its article buffer.
29288
29289 If it is at all possible, this function should return a cons cell where
29290 the @code{car} is the group name the article was fetched from, and the @code{cdr} is
29291 the article number.  This will enable Gnus to find out what the real
29292 group and article numbers are when fetching articles by
29293 @code{Message-ID}.  If this isn't possible, @code{t} should be returned
29294 on successful article retrieval.
29295
29296
29297 @item (nnchoke-request-group GROUP &optional SERVER FAST INFO)
29298
29299 Get data on @var{group}.  This function also has the side effect of
29300 making @var{group} the current group.
29301
29302 If @var{fast}, don't bother to return useful data, just make @var{group}
29303 the current group.
29304
29305 If @var{info}, it allows the backend to update the group info
29306 structure.
29307
29308 Here's an example of some result data and a definition of the same:
29309
29310 @example
29311 211 56 1000 1059 ifi.discussion
29312 @end example
29313
29314 The first number is the status, which should be 211.  Next is the
29315 total number of articles in the group, the lowest article number, the
29316 highest article number, and finally the group name.  Note that the total
29317 number of articles may be less than one might think while just
29318 considering the highest and lowest article numbers, but some articles
29319 may have been canceled.  Gnus just discards the total-number, so
29320 whether one should take the bother to generate it properly (if that is a
29321 problem) is left as an exercise to the reader.  If the group contains no
29322 articles, the lowest article number should be reported as 1 and the
29323 highest as 0.
29324
29325 @example
29326 group-status = [ error / info ] eol
29327 error        = [ "4" / "5" ] 2<number> " " <Error message>
29328 info         = "211 " 3* [ <number> " " ] <string>
29329 @end example
29330
29331
29332 @item (nnchoke-close-group GROUP &optional SERVER)
29333
29334 Close @var{group} and free any resources connected to it.  This will be
29335 a no-op on most back ends.
29336
29337 There should be no data returned.
29338
29339
29340 @item (nnchoke-request-list &optional SERVER)
29341
29342 Return a list of all groups available on @var{server}.  And that means
29343 @emph{all}.
29344
29345 Here's an example from a server that only carries two groups:
29346
29347 @example
29348 ifi.test 0000002200 0000002000 y
29349 ifi.discussion 3324 3300 n
29350 @end example
29351
29352 On each line we have a group name, then the highest article number in
29353 that group, the lowest article number, and finally a flag.  If the group
29354 contains no articles, the lowest article number should be reported as 1
29355 and the highest as 0.
29356
29357 @example
29358 active-file = *active-line
29359 active-line = name " " <number> " " <number> " " flags eol
29360 name        = <string>
29361 flags       = "n" / "y" / "m" / "x" / "j" / "=" name
29362 @end example
29363
29364 The flag says whether the group is read-only (@samp{n}), is moderated
29365 (@samp{m}), is dead (@samp{x}), is aliased to some other group
29366 (@samp{=other-group}) or none of the above (@samp{y}).
29367
29368
29369 @item (nnchoke-request-post &optional SERVER)
29370
29371 This function should post the current buffer.  It might return whether
29372 the posting was successful or not, but that's not required.  If, for
29373 instance, the posting is done asynchronously, it has generally not been
29374 completed by the time this function concludes.  In that case, this
29375 function should set up some kind of sentinel to beep the user loud and
29376 clear if the posting could not be completed.
29377
29378 There should be no result data from this function.
29379
29380 @end table
29381
29382
29383 @node Optional Back End Functions
29384 @subsubsection Optional Back End Functions
29385
29386 @table @code
29387
29388 @item (nnchoke-retrieve-groups GROUPS &optional SERVER)
29389
29390 @var{groups} is a list of groups, and this function should request data
29391 on all those groups.  How it does it is of no concern to Gnus, but it
29392 should attempt to do this in a speedy fashion.
29393
29394 The return value of this function can be either @code{active} or
29395 @code{group}, which says what the format of the result data is.  The
29396 former is in the same format as the data from
29397 @code{nnchoke-request-list}, while the latter is a buffer full of lines
29398 in the same format as @code{nnchoke-request-group} gives.
29399
29400 @example
29401 group-buffer = *active-line / *group-status
29402 @end example
29403
29404
29405 @item (nnchoke-request-update-info GROUP INFO &optional SERVER)
29406
29407 A Gnus group info (@pxref{Group Info}) is handed to the back end for
29408 alterations.  This comes in handy if the back end really carries all
29409 the information (as is the case with virtual and imap groups).  This
29410 function should destructively alter the info to suit its needs, and
29411 should return a non-@code{nil} value (exceptionally,
29412 @code{nntp-request-update-info} always returns @code{nil} not to waste
29413 the network resources).
29414
29415 There should be no result data from this function.
29416
29417
29418 @item (nnchoke-request-type GROUP &optional ARTICLE)
29419
29420 When the user issues commands for ``sending news'' (@kbd{F} in the
29421 summary buffer, for instance), Gnus has to know whether the article the
29422 user is following up on is news or mail.  This function should return
29423 @code{news} if @var{article} in @var{group} is news, @code{mail} if it
29424 is mail and @code{unknown} if the type can't be decided.  (The
29425 @var{article} parameter is necessary in @code{nnvirtual} groups which
29426 might very well combine mail groups and news groups.)  Both @var{group}
29427 and @var{article} may be @code{nil}.
29428
29429 There should be no result data from this function.
29430
29431
29432 @item (nnchoke-request-set-mark GROUP ACTION &optional SERVER)
29433
29434 Set/remove/add marks on articles.  Normally Gnus handles the article
29435 marks (such as read, ticked, expired etc) internally, and store them in
29436 @file{~/.newsrc.eld}.  Some back ends (such as @acronym{IMAP}) however carry
29437 all information about the articles on the server, so Gnus need to
29438 propagate the mark information to the server.
29439
29440 @var{action} is a list of mark setting requests, having this format:
29441
29442 @example
29443 (RANGE ACTION MARK)
29444 @end example
29445
29446 @var{range} is a range of articles you wish to update marks on.
29447 @var{action} is @code{add} or @code{del}, used to add marks or remove
29448 marks (preserving all marks not mentioned).  @var{mark} is a list of
29449 marks; where each mark is a symbol.  Currently used marks are
29450 @code{read}, @code{tick}, @code{reply}, @code{expire}, @code{killed},
29451 @code{dormant}, @code{save}, @code{download}, @code{unsend},
29452 @code{forward} and @code{recent}, but your back end should, if
29453 possible, not limit itself to these.
29454
29455 Given contradictory actions, the last action in the list should be the
29456 effective one.  That is, if your action contains a request to add the
29457 @code{tick} mark on article 1 and, later in the list, a request to
29458 remove the mark on the same article, the mark should in fact be removed.
29459
29460 An example action list:
29461
29462 @example
29463 (((5 12 30) 'del '(tick))
29464  ((10 . 90) 'add '(read expire))
29465  ((92 94) 'del '(read)))
29466 @end example
29467
29468 The function should return a range of articles it wasn't able to set the
29469 mark on (currently not used for anything).
29470
29471 There should be no result data from this function.
29472
29473 @item (nnchoke-request-update-mark GROUP ARTICLE MARK)
29474
29475 If the user tries to set a mark that the back end doesn't like, this
29476 function may change the mark.  Gnus will use whatever this function
29477 returns as the mark for @var{article} instead of the original
29478 @var{mark}.  If the back end doesn't care, it must return the original
29479 @var{mark}, and not @code{nil} or any other type of garbage.
29480
29481 The only use for this I can see is what @code{nnvirtual} does with
29482 it---if a component group is auto-expirable, marking an article as read
29483 in the virtual group should result in the article being marked as
29484 expirable.
29485
29486 There should be no result data from this function.
29487
29488
29489 @item (nnchoke-request-scan &optional GROUP SERVER)
29490
29491 This function may be called at any time (by Gnus or anything else) to
29492 request that the back end check for incoming articles, in one way or
29493 another.  A mail back end will typically read the spool file or query
29494 the @acronym{POP} server when this function is invoked.  The
29495 @var{group} doesn't have to be heeded---if the back end decides that
29496 it is too much work just scanning for a single group, it may do a
29497 total scan of all groups.  It would be nice, however, to keep things
29498 local if that's practical.
29499
29500 There should be no result data from this function.
29501
29502
29503 @item (nnchoke-request-group-description GROUP &optional SERVER)
29504
29505 The result data from this function should be a description of
29506 @var{group}.
29507
29508 @example
29509 description-line = name <TAB> description eol
29510 name             = <string>
29511 description      = <text>
29512 @end example
29513
29514 @item (nnchoke-request-list-newsgroups &optional SERVER)
29515
29516 The result data from this function should be the description of all
29517 groups available on the server.
29518
29519 @example
29520 description-buffer = *description-line
29521 @end example
29522
29523
29524 @item (nnchoke-request-newgroups DATE &optional SERVER)
29525
29526 The result data from this function should be all groups that were
29527 created after @samp{date}, which is in normal human-readable date format
29528 (i.e., the date format used in mail and news headers, and returned by
29529 the function @code{message-make-date} by default).  The data should be
29530 in the active buffer format.
29531
29532 It is okay for this function to return ``too many'' groups; some back ends
29533 might find it cheaper to return the full list of groups, rather than
29534 just the new groups.  But don't do this for back ends with many groups.
29535 Normally, if the user creates the groups herself, there won't be too
29536 many groups, so @code{nnml} and the like are probably safe.  But for
29537 back ends like @code{nntp}, where the groups have been created by the
29538 server, it is quite likely that there can be many groups.
29539
29540
29541 @item (nnchoke-request-create-group GROUP &optional SERVER)
29542
29543 This function should create an empty group with name @var{group}.
29544
29545 There should be no return data.
29546
29547
29548 @item (nnchoke-request-expire-articles ARTICLES &optional GROUP SERVER FORCE)
29549
29550 This function should run the expiry process on all articles in the
29551 @var{articles} range (which is currently a simple list of article
29552 numbers.)  It is left up to the back end to decide how old articles
29553 should be before they are removed by this function.  If @var{force} is
29554 non-@code{nil}, all @var{articles} should be deleted, no matter how new
29555 they are.
29556
29557 This function should return a list of articles that it did not/was not
29558 able to delete.
29559
29560 There should be no result data returned.
29561
29562
29563 @item (nnchoke-request-move-article ARTICLE GROUP SERVER ACCEPT-FORM &optional LAST)
29564
29565 This function should move @var{article} (which is a number) from
29566 @var{group} by calling @var{accept-form}.
29567
29568 This function should ready the article in question for moving by
29569 removing any header lines it has added to the article, and generally
29570 should ``tidy up'' the article.  Then it should @code{eval}
29571 @var{accept-form} in the buffer where the ``tidy'' article is.  This
29572 will do the actual copying.  If this @code{eval} returns a
29573 non-@code{nil} value, the article should be removed.
29574
29575 If @var{last} is @code{nil}, that means that there is a high likelihood
29576 that there will be more requests issued shortly, so that allows some
29577 optimizations.
29578
29579 The function should return a cons where the @code{car} is the group name and
29580 the @code{cdr} is the article number that the article was entered as.
29581
29582 There should be no data returned.
29583
29584
29585 @item (nnchoke-request-accept-article GROUP &optional SERVER LAST)
29586
29587 This function takes the current buffer and inserts it into @var{group}.
29588 If @var{last} in @code{nil}, that means that there will be more calls to
29589 this function in short order.
29590
29591 The function should return a cons where the @code{car} is the group name and
29592 the @code{cdr} is the article number that the article was entered as.
29593
29594 The group should exist before the back end is asked to accept the
29595 article for that group.
29596
29597 There should be no data returned.
29598
29599
29600 @item (nnchoke-request-replace-article ARTICLE GROUP BUFFER)
29601
29602 This function should remove @var{article} (which is a number) from
29603 @var{group} and insert @var{buffer} there instead.
29604
29605 There should be no data returned.
29606
29607
29608 @item (nnchoke-request-delete-group GROUP FORCE &optional SERVER)
29609
29610 This function should delete @var{group}.  If @var{force}, it should
29611 really delete all the articles in the group, and then delete the group
29612 itself.  (If there is such a thing as ``the group itself''.)
29613
29614 There should be no data returned.
29615
29616
29617 @item (nnchoke-request-rename-group GROUP NEW-NAME &optional SERVER)
29618
29619 This function should rename @var{group} into @var{new-name}.  All
29620 articles in @var{group} should move to @var{new-name}.
29621
29622 There should be no data returned.
29623
29624 @end table
29625
29626
29627 @node Error Messaging
29628 @subsubsection Error Messaging
29629
29630 @findex nnheader-report
29631 @findex nnheader-get-report
29632 The back ends should use the function @code{nnheader-report} to report
29633 error conditions---they should not raise errors when they aren't able to
29634 perform a request.  The first argument to this function is the back end
29635 symbol, and the rest are interpreted as arguments to @code{format} if
29636 there are multiple of them, or just a string if there is one of them.
29637 This function must always returns @code{nil}.
29638
29639 @lisp
29640 (nnheader-report 'nnchoke "You did something totally bogus")
29641
29642 (nnheader-report 'nnchoke "Could not request group %s" group)
29643 @end lisp
29644
29645 Gnus, in turn, will call @code{nnheader-get-report} when it gets a
29646 @code{nil} back from a server, and this function returns the most
29647 recently reported message for the back end in question.  This function
29648 takes one argument---the server symbol.
29649
29650 Internally, these functions access @var{back-end}@code{-status-string},
29651 so the @code{nnchoke} back end will have its error message stored in
29652 @code{nnchoke-status-string}.
29653
29654
29655 @node Writing New Back Ends
29656 @subsubsection Writing New Back Ends
29657
29658 Many back ends are quite similar.  @code{nnml} is just like
29659 @code{nnspool}, but it allows you to edit the articles on the server.
29660 @code{nnmh} is just like @code{nnml}, but it doesn't use an active file,
29661 and it doesn't maintain overview databases.  @code{nndir} is just like
29662 @code{nnml}, but it has no concept of ``groups'', and it doesn't allow
29663 editing articles.
29664
29665 It would make sense if it were possible to ``inherit'' functions from
29666 back ends when writing new back ends.  And, indeed, you can do that if you
29667 want to.  (You don't have to if you don't want to, of course.)
29668
29669 All the back ends declare their public variables and functions by using a
29670 package called @code{nnoo}.
29671
29672 To inherit functions from other back ends (and allow other back ends to
29673 inherit functions from the current back end), you should use the
29674 following macros:
29675
29676 @table @code
29677
29678 @item nnoo-declare
29679 This macro declares the first parameter to be a child of the subsequent
29680 parameters.  For instance:
29681
29682 @lisp
29683 (nnoo-declare nndir
29684   nnml nnmh)
29685 @end lisp
29686
29687 @code{nndir} has declared here that it intends to inherit functions from
29688 both @code{nnml} and @code{nnmh}.
29689
29690 @item defvoo
29691 This macro is equivalent to @code{defvar}, but registers the variable as
29692 a public server variable.  Most state-oriented variables should be
29693 declared with @code{defvoo} instead of @code{defvar}.
29694
29695 In addition to the normal @code{defvar} parameters, it takes a list of
29696 variables in the parent back ends to map the variable to when executing
29697 a function in those back ends.
29698
29699 @lisp
29700 (defvoo nndir-directory nil
29701   "Where nndir will look for groups."
29702   nnml-current-directory nnmh-current-directory)
29703 @end lisp
29704
29705 This means that @code{nnml-current-directory} will be set to
29706 @code{nndir-directory} when an @code{nnml} function is called on behalf
29707 of @code{nndir}.  (The same with @code{nnmh}.)
29708
29709 @item nnoo-define-basics
29710 This macro defines some common functions that almost all back ends should
29711 have.
29712
29713 @lisp
29714 (nnoo-define-basics nndir)
29715 @end lisp
29716
29717 @item deffoo
29718 This macro is just like @code{defun} and takes the same parameters.  In
29719 addition to doing the normal @code{defun} things, it registers the
29720 function as being public so that other back ends can inherit it.
29721
29722 @item nnoo-map-functions
29723 This macro allows mapping of functions from the current back end to
29724 functions from the parent back ends.
29725
29726 @lisp
29727 (nnoo-map-functions nndir
29728   (nnml-retrieve-headers 0 nndir-current-group 0 0)
29729   (nnmh-request-article 0 nndir-current-group 0 0))
29730 @end lisp
29731
29732 This means that when @code{nndir-retrieve-headers} is called, the first,
29733 third, and fourth parameters will be passed on to
29734 @code{nnml-retrieve-headers}, while the second parameter is set to the
29735 value of @code{nndir-current-group}.
29736
29737 @item nnoo-import
29738 This macro allows importing functions from back ends.  It should be the
29739 last thing in the source file, since it will only define functions that
29740 haven't already been defined.
29741
29742 @lisp
29743 (nnoo-import nndir
29744   (nnmh
29745    nnmh-request-list
29746    nnmh-request-newgroups)
29747   (nnml))
29748 @end lisp
29749
29750 This means that calls to @code{nndir-request-list} should just be passed
29751 on to @code{nnmh-request-list}, while all public functions from
29752 @code{nnml} that haven't been defined in @code{nndir} yet should be
29753 defined now.
29754
29755 @end table
29756
29757 Below is a slightly shortened version of the @code{nndir} back end.
29758
29759 @lisp
29760 ;;; @r{nndir.el --- single directory newsgroup access for Gnus}
29761 ;; @r{Copyright (C) 1995,1996 Free Software Foundation, Inc.}
29762
29763 ;;; @r{Code:}
29764
29765 (require 'nnheader)
29766 (require 'nnmh)
29767 (require 'nnml)
29768 (require 'nnoo)
29769 (eval-when-compile (require 'cl))
29770
29771 (nnoo-declare nndir
29772   nnml nnmh)
29773
29774 (defvoo nndir-directory nil
29775   "Where nndir will look for groups."
29776   nnml-current-directory nnmh-current-directory)
29777
29778 (defvoo nndir-nov-is-evil nil
29779   "*Non-nil means that nndir will never retrieve NOV headers."
29780   nnml-nov-is-evil)
29781
29782 (defvoo nndir-current-group ""
29783   nil
29784   nnml-current-group nnmh-current-group)
29785 (defvoo nndir-top-directory nil nil nnml-directory nnmh-directory)
29786 (defvoo nndir-get-new-mail nil nil nnml-get-new-mail nnmh-get-new-mail)
29787
29788 (defvoo nndir-status-string "" nil nnmh-status-string)
29789 (defconst nndir-version "nndir 1.0")
29790
29791 ;;; @r{Interface functions.}
29792
29793 (nnoo-define-basics nndir)
29794
29795 (deffoo nndir-open-server (server &optional defs)
29796   (setq nndir-directory
29797         (or (cadr (assq 'nndir-directory defs))
29798             server))
29799   (unless (assq 'nndir-directory defs)
29800     (push `(nndir-directory ,server) defs))
29801   (push `(nndir-current-group
29802           ,(file-name-nondirectory
29803             (directory-file-name nndir-directory)))
29804         defs)
29805   (push `(nndir-top-directory
29806           ,(file-name-directory (directory-file-name nndir-directory)))
29807         defs)
29808   (nnoo-change-server 'nndir server defs))
29809
29810 (nnoo-map-functions nndir
29811   (nnml-retrieve-headers 0 nndir-current-group 0 0)
29812   (nnmh-request-article 0 nndir-current-group 0 0)
29813   (nnmh-request-group nndir-current-group 0 0)
29814   (nnmh-close-group nndir-current-group 0))
29815
29816 (nnoo-import nndir
29817   (nnmh
29818    nnmh-status-message
29819    nnmh-request-list
29820    nnmh-request-newgroups))
29821
29822 (provide 'nndir)
29823 @end lisp
29824
29825
29826 @node Hooking New Back Ends Into Gnus
29827 @subsubsection Hooking New Back Ends Into Gnus
29828
29829 @vindex gnus-valid-select-methods
29830 @findex gnus-declare-backend
29831 Having Gnus start using your new back end is rather easy---you just
29832 declare it with the @code{gnus-declare-backend} functions.  This will
29833 enter the back end into the @code{gnus-valid-select-methods} variable.
29834
29835 @code{gnus-declare-backend} takes two parameters---the back end name and
29836 an arbitrary number of @dfn{abilities}.
29837
29838 Here's an example:
29839
29840 @lisp
29841 (gnus-declare-backend "nnchoke" 'mail 'respool 'address)
29842 @end lisp
29843
29844 The above line would then go in the @file{nnchoke.el} file.
29845
29846 The abilities can be:
29847
29848 @table @code
29849 @item mail
29850 This is a mailish back end---followups should (probably) go via mail.
29851 @item post
29852 This is a newsish back end---followups should (probably) go via news.
29853 @item post-mail
29854 This back end supports both mail and news.
29855 @item none
29856 This is neither a post nor mail back end---it's something completely
29857 different.
29858 @item respool
29859 It supports respooling---or rather, it is able to modify its source
29860 articles and groups.
29861 @item address
29862 The name of the server should be in the virtual server name.  This is
29863 true for almost all back ends.
29864 @item prompt-address
29865 The user should be prompted for an address when doing commands like
29866 @kbd{B} in the group buffer.  This is true for back ends like
29867 @code{nntp}, but not @code{nnmbox}, for instance.
29868 @end table
29869
29870
29871 @node Mail-like Back Ends
29872 @subsubsection Mail-like Back Ends
29873
29874 One of the things that separate the mail back ends from the rest of the
29875 back ends is the heavy dependence by most of the mail back ends on
29876 common functions in @file{nnmail.el}.  For instance, here's the
29877 definition of @code{nnml-request-scan}:
29878
29879 @lisp
29880 (deffoo nnml-request-scan (&optional group server)
29881   (setq nnml-article-file-alist nil)
29882   (nnmail-get-new-mail 'nnml 'nnml-save-nov nnml-directory group))
29883 @end lisp
29884
29885 It simply calls @code{nnmail-get-new-mail} with a few parameters,
29886 and @code{nnmail} takes care of all the moving and splitting of the
29887 mail.
29888
29889 This function takes four parameters.
29890
29891 @table @var
29892 @item method
29893 This should be a symbol to designate which back end is responsible for
29894 the call.
29895
29896 @item exit-function
29897 This function should be called after the splitting has been performed.
29898
29899 @item temp-directory
29900 Where the temporary files should be stored.
29901
29902 @item group
29903 This optional argument should be a group name if the splitting is to be
29904 performed for one group only.
29905 @end table
29906
29907 @code{nnmail-get-new-mail} will call @var{back-end}@code{-save-mail} to
29908 save each article.  @var{back-end}@code{-active-number} will be called to
29909 find the article number assigned to this article.
29910
29911 The function also uses the following variables:
29912 @var{back-end}@code{-get-new-mail} (to see whether to get new mail for
29913 this back end); and @var{back-end}@code{-group-alist} and
29914 @var{back-end}@code{-active-file} to generate the new active file.
29915 @var{back-end}@code{-group-alist} should be a group-active alist, like
29916 this:
29917
29918 @example
29919 (("a-group" (1 . 10))
29920  ("some-group" (34 . 39)))
29921 @end example
29922
29923
29924 @node Score File Syntax
29925 @subsection Score File Syntax
29926
29927 Score files are meant to be easily parseable, but yet extremely
29928 mallable.  It was decided that something that had the same read syntax
29929 as an Emacs Lisp list would fit that spec.
29930
29931 Here's a typical score file:
29932
29933 @lisp
29934 (("summary"
29935   ("win95" -10000 nil s)
29936   ("Gnus"))
29937  ("from"
29938   ("Lars" -1000))
29939  (mark -100))
29940 @end lisp
29941
29942 BNF definition of a score file:
29943
29944 @example
29945 score-file      = "" / "(" *element ")"
29946 element         = rule / atom
29947 rule            = string-rule / number-rule / date-rule
29948 string-rule     = "(" quote string-header quote space *string-match ")"
29949 number-rule     = "(" quote number-header quote space *number-match ")"
29950 date-rule       = "(" quote date-header quote space *date-match ")"
29951 quote           = <ascii 34>
29952 string-header   = "subject" / "from" / "references" / "message-id" /
29953                   "xref" / "body" / "head" / "all" / "followup"
29954 number-header   = "lines" / "chars"
29955 date-header     = "date"
29956 string-match    = "(" quote <string> quote [ "" / [ space score [ "" /
29957                   space date [ "" / [ space string-match-t ] ] ] ] ] ")"
29958 score           = "nil" / <integer>
29959 date            = "nil" / <natural number>
29960 string-match-t  = "nil" / "s" / "substring" / "S" / "Substring" /
29961                   "r" / "regex" / "R" / "Regex" /
29962                   "e" / "exact" / "E" / "Exact" /
29963                   "f" / "fuzzy" / "F" / "Fuzzy"
29964 number-match    = "(" <integer> [ "" / [ space score [ "" /
29965                   space date [ "" / [ space number-match-t ] ] ] ] ] ")"
29966 number-match-t  = "nil" / "=" / "<" / ">" / ">=" / "<="
29967 date-match      = "(" quote <string> quote [ "" / [ space score [ "" /
29968                   space date [ "" / [ space date-match-t ] ] ] ] ")"
29969 date-match-t    = "nil" / "at" / "before" / "after"
29970 atom            = "(" [ required-atom / optional-atom ] ")"
29971 required-atom   = mark / expunge / mark-and-expunge / files /
29972                   exclude-files / read-only / touched
29973 optional-atom   = adapt / local / eval
29974 mark            = "mark" space nil-or-number
29975 nil-or-number   = "nil" / <integer>
29976 expunge         = "expunge" space nil-or-number
29977 mark-and-expunge = "mark-and-expunge" space nil-or-number
29978 files           = "files" *[ space <string> ]
29979 exclude-files   = "exclude-files" *[ space <string> ]
29980 read-only       = "read-only" [ space "nil" / space "t" ]
29981 adapt        = "adapt" [ space "ignore" / space "t" / space adapt-rule ]
29982 adapt-rule      = "(" *[ <string> *[ "(" <string> <integer> ")" ] ")"
29983 local           = "local" *[ space "(" <string> space <form> ")" ]
29984 eval            = "eval" space <form>
29985 space           = *[ " " / <TAB> / <NEWLINE> ]
29986 @end example
29987
29988 Any unrecognized elements in a score file should be ignored, but not
29989 discarded.
29990
29991 As you can see, white space is needed, but the type and amount of white
29992 space is irrelevant.  This means that formatting of the score file is
29993 left up to the programmer---if it's simpler to just spew it all out on
29994 one looong line, then that's ok.
29995
29996 The meaning of the various atoms are explained elsewhere in this
29997 manual (@pxref{Score File Format}).
29998
29999
30000 @node Headers
30001 @subsection Headers
30002
30003 Internally Gnus uses a format for storing article headers that
30004 corresponds to the @acronym{NOV} format in a mysterious fashion.  One could
30005 almost suspect that the author looked at the @acronym{NOV} specification and
30006 just shamelessly @emph{stole} the entire thing, and one would be right.
30007
30008 @dfn{Header} is a severely overloaded term.  ``Header'' is used in
30009 RFC 1036 to talk about lines in the head of an article (e.g.,
30010 @code{From}).  It is used by many people as a synonym for
30011 ``head''---``the header and the body''.  (That should be avoided, in my
30012 opinion.)  And Gnus uses a format internally that it calls ``header'',
30013 which is what I'm talking about here.  This is a 9-element vector,
30014 basically, with each header (ouch) having one slot.
30015
30016 These slots are, in order: @code{number}, @code{subject}, @code{from},
30017 @code{date}, @code{id}, @code{references}, @code{chars}, @code{lines},
30018 @code{xref}, and @code{extra}.  There are macros for accessing and
30019 setting these slots---they all have predictable names beginning with
30020 @code{mail-header-} and @code{mail-header-set-}, respectively.
30021
30022 All these slots contain strings, except the @code{extra} slot, which
30023 contains an alist of header/value pairs (@pxref{To From Newsgroups}).
30024
30025
30026 @node Ranges
30027 @subsection Ranges
30028
30029 @sc{gnus} introduced a concept that I found so useful that I've started
30030 using it a lot and have elaborated on it greatly.
30031
30032 The question is simple: If you have a large amount of objects that are
30033 identified by numbers (say, articles, to take a @emph{wild} example)
30034 that you want to qualify as being ``included'', a normal sequence isn't
30035 very useful.  (A 200,000 length sequence is a bit long-winded.)
30036
30037 The solution is as simple as the question: You just collapse the
30038 sequence.
30039
30040 @example
30041 (1 2 3 4 5 6 10 11 12)
30042 @end example
30043
30044 is transformed into
30045
30046 @example
30047 ((1 . 6) (10 . 12))
30048 @end example
30049
30050 To avoid having those nasty @samp{(13 . 13)} elements to denote a
30051 lonesome object, a @samp{13} is a valid element:
30052
30053 @example
30054 ((1 . 6) 7 (10 . 12))
30055 @end example
30056
30057 This means that comparing two ranges to find out whether they are equal
30058 is slightly tricky:
30059
30060 @example
30061 ((1 . 5) 7 8 (10 . 12))
30062 @end example
30063
30064 and
30065
30066 @example
30067 ((1 . 5) (7 . 8) (10 . 12))
30068 @end example
30069
30070 are equal.  In fact, any non-descending list is a range:
30071
30072 @example
30073 (1 2 3 4 5)
30074 @end example
30075
30076 is a perfectly valid range, although a pretty long-winded one.  This is
30077 also valid:
30078
30079 @example
30080 (1 . 5)
30081 @end example
30082
30083 and is equal to the previous range.
30084
30085 Here's a BNF definition of ranges.  Of course, one must remember the
30086 semantic requirement that the numbers are non-descending.  (Any number
30087 of repetition of the same number is allowed, but apt to disappear in
30088 range handling.)
30089
30090 @example
30091 range           = simple-range / normal-range
30092 simple-range    = "(" number " . " number ")"
30093 normal-range    = "(" start-contents ")"
30094 contents        = "" / simple-range *[ " " contents ] /
30095                   number *[ " " contents ]
30096 @end example
30097
30098 Gnus currently uses ranges to keep track of read articles and article
30099 marks.  I plan on implementing a number of range operators in C if The
30100 Powers That Be are willing to let me.  (I haven't asked yet, because I
30101 need to do some more thinking on what operators I need to make life
30102 totally range-based without ever having to convert back to normal
30103 sequences.)
30104
30105
30106 @node Group Info
30107 @subsection Group Info
30108
30109 Gnus stores all permanent info on groups in a @dfn{group info} list.
30110 This list is from three to six elements (or more) long and exhaustively
30111 describes the group.
30112
30113 Here are two example group infos; one is a very simple group while the
30114 second is a more complex one:
30115
30116 @example
30117 ("no.group" 5 ((1 . 54324)))
30118
30119 ("nnml:my.mail" 3 ((1 . 5) 9 (20 . 55))
30120                 ((tick (15 . 19)) (replied 3 6 (19 . 3)))
30121                 (nnml "")
30122                 ((auto-expire . t) (to-address . "ding@@gnus.org")))
30123 @end example
30124
30125 The first element is the @dfn{group name}---as Gnus knows the group,
30126 anyway.  The second element is the @dfn{subscription level}, which
30127 normally is a small integer.  (It can also be the @dfn{rank}, which is a
30128 cons cell where the @code{car} is the level and the @code{cdr} is the
30129 score.)  The third element is a list of ranges of read articles.  The
30130 fourth element is a list of lists of article marks of various kinds.
30131 The fifth element is the select method (or virtual server, if you like).
30132 The sixth element is a list of @dfn{group parameters}, which is what
30133 this section is about.
30134
30135 Any of the last three elements may be missing if they are not required.
30136 In fact, the vast majority of groups will normally only have the first
30137 three elements, which saves quite a lot of cons cells.
30138
30139 Here's a BNF definition of the group info format:
30140
30141 @example
30142 info          = "(" group space ralevel space read
30143                 [ "" / [ space marks-list [ "" / [ space method [ "" /
30144                 space parameters ] ] ] ] ] ")"
30145 group         = quote <string> quote
30146 ralevel       = rank / level
30147 level         = <integer in the range of 1 to inf>
30148 rank          = "(" level "." score ")"
30149 score         = <integer in the range of 1 to inf>
30150 read          = range
30151 marks-lists   = nil / "(" *marks ")"
30152 marks         = "(" <string> range ")"
30153 method        = "(" <string> *elisp-forms ")"
30154 parameters    = "(" *elisp-forms ")"
30155 @end example
30156
30157 Actually that @samp{marks} rule is a fib.  A @samp{marks} is a
30158 @samp{<string>} consed on to a @samp{range}, but that's a bitch to say
30159 in pseudo-BNF.
30160
30161 If you have a Gnus info and want to access the elements, Gnus offers a
30162 series of macros for getting/setting these elements.
30163
30164 @table @code
30165 @item gnus-info-group
30166 @itemx gnus-info-set-group
30167 @findex gnus-info-group
30168 @findex gnus-info-set-group
30169 Get/set the group name.
30170
30171 @item gnus-info-rank
30172 @itemx gnus-info-set-rank
30173 @findex gnus-info-rank
30174 @findex gnus-info-set-rank
30175 Get/set the group rank (@pxref{Group Score}).
30176
30177 @item gnus-info-level
30178 @itemx gnus-info-set-level
30179 @findex gnus-info-level
30180 @findex gnus-info-set-level
30181 Get/set the group level.
30182
30183 @item gnus-info-score
30184 @itemx gnus-info-set-score
30185 @findex gnus-info-score
30186 @findex gnus-info-set-score
30187 Get/set the group score (@pxref{Group Score}).
30188
30189 @item gnus-info-read
30190 @itemx gnus-info-set-read
30191 @findex gnus-info-read
30192 @findex gnus-info-set-read
30193 Get/set the ranges of read articles.
30194
30195 @item gnus-info-marks
30196 @itemx gnus-info-set-marks
30197 @findex gnus-info-marks
30198 @findex gnus-info-set-marks
30199 Get/set the lists of ranges of marked articles.
30200
30201 @item gnus-info-method
30202 @itemx gnus-info-set-method
30203 @findex gnus-info-method
30204 @findex gnus-info-set-method
30205 Get/set the group select method.
30206
30207 @item gnus-info-params
30208 @itemx gnus-info-set-params
30209 @findex gnus-info-params
30210 @findex gnus-info-set-params
30211 Get/set the group parameters.
30212 @end table
30213
30214 All the getter functions take one parameter---the info list.  The setter
30215 functions take two parameters---the info list and the new value.
30216
30217 The last three elements in the group info aren't mandatory, so it may be
30218 necessary to extend the group info before setting the element.  If this
30219 is necessary, you can just pass on a non-@code{nil} third parameter to
30220 the three final setter functions to have this happen automatically.
30221
30222
30223 @node Extended Interactive
30224 @subsection Extended Interactive
30225 @cindex interactive
30226 @findex gnus-interactive
30227
30228 Gnus extends the standard Emacs @code{interactive} specification
30229 slightly to allow easy use of the symbolic prefix (@pxref{Symbolic
30230 Prefixes}).  Here's an example of how this is used:
30231
30232 @lisp
30233 (defun gnus-summary-increase-score (&optional score symp)
30234   (interactive (gnus-interactive "P\ny"))
30235   ...
30236   )
30237 @end lisp
30238
30239 The best thing to do would have been to implement
30240 @code{gnus-interactive} as a macro which would have returned an
30241 @code{interactive} form, but this isn't possible since Emacs checks
30242 whether a function is interactive or not by simply doing an @code{assq}
30243 on the lambda form.  So, instead we have @code{gnus-interactive}
30244 function that takes a string and returns values that are usable to
30245 @code{interactive}.
30246
30247 This function accepts (almost) all normal @code{interactive} specs, but
30248 adds a few more.
30249
30250 @table @samp
30251 @item y
30252 @vindex gnus-current-prefix-symbol
30253 The current symbolic prefix---the @code{gnus-current-prefix-symbol}
30254 variable.
30255
30256 @item Y
30257 @vindex gnus-current-prefix-symbols
30258 A list of the current symbolic prefixes---the
30259 @code{gnus-current-prefix-symbol} variable.
30260
30261 @item A
30262 The current article number---the @code{gnus-summary-article-number}
30263 function.
30264
30265 @item H
30266 The current article header---the @code{gnus-summary-article-header}
30267 function.
30268
30269 @item g
30270 The current group name---the @code{gnus-group-group-name}
30271 function.
30272
30273 @end table
30274
30275
30276 @node Emacs/XEmacs Code
30277 @subsection Emacs/XEmacs Code
30278 @cindex XEmacs
30279 @cindex Emacsen
30280
30281 While Gnus runs under Emacs, XEmacs and Mule, I decided that one of the
30282 platforms must be the primary one.  I chose Emacs.  Not because I don't
30283 like XEmacs or Mule, but because it comes first alphabetically.
30284
30285 This means that Gnus will byte-compile under Emacs with nary a warning,
30286 while XEmacs will pump out gigabytes of warnings while byte-compiling.
30287 As I use byte-compilation warnings to help me root out trivial errors in
30288 Gnus, that's very useful.
30289
30290 I've also consistently used Emacs function interfaces, but have used
30291 Gnusey aliases for the functions.  To take an example:  Emacs defines a
30292 @code{run-at-time} function while XEmacs defines a @code{start-itimer}
30293 function.  I then define a function called @code{gnus-run-at-time} that
30294 takes the same parameters as the Emacs @code{run-at-time}.  When running
30295 Gnus under Emacs, the former function is just an alias for the latter.
30296 However, when running under XEmacs, the former is an alias for the
30297 following function:
30298
30299 @lisp
30300 (defun gnus-xmas-run-at-time (time repeat function &rest args)
30301   (start-itimer
30302    "gnus-run-at-time"
30303    `(lambda ()
30304       (,function ,@@args))
30305    time repeat))
30306 @end lisp
30307
30308 This sort of thing has been done for bunches of functions.  Gnus does
30309 not redefine any native Emacs functions while running under XEmacs---it
30310 does this @code{defalias} thing with Gnus equivalents instead.  Cleaner
30311 all over.
30312
30313 In the cases where the XEmacs function interface was obviously cleaner,
30314 I used it instead.  For example @code{gnus-region-active-p} is an alias
30315 for @code{region-active-p} in XEmacs, whereas in Emacs it is a function.
30316
30317 Of course, I could have chosen XEmacs as my native platform and done
30318 mapping functions the other way around.  But I didn't.  The performance
30319 hit these indirections impose on Gnus under XEmacs should be slight.
30320
30321
30322 @node Various File Formats
30323 @subsection Various File Formats
30324
30325 @menu
30326 * Active File Format::          Information on articles and groups available.
30327 * Newsgroups File Format::      Group descriptions.
30328 @end menu
30329
30330
30331 @node Active File Format
30332 @subsubsection Active File Format
30333
30334 The active file lists all groups available on the server in
30335 question.  It also lists the highest and lowest current article numbers
30336 in each group.
30337
30338 Here's an excerpt from a typical active file:
30339
30340 @example
30341 soc.motss 296030 293865 y
30342 alt.binaries.pictures.fractals 3922 3913 n
30343 comp.sources.unix 1605 1593 m
30344 comp.binaries.ibm.pc 5097 5089 y
30345 no.general 1000 900 y
30346 @end example
30347
30348 Here's a pseudo-BNF definition of this file:
30349
30350 @example
30351 active      = *group-line
30352 group-line  = group spc high-number spc low-number spc flag <NEWLINE>
30353 group       = <non-white-space string>
30354 spc         = " "
30355 high-number = <non-negative integer>
30356 low-number  = <positive integer>
30357 flag        = "y" / "n" / "m" / "j" / "x" / "=" group
30358 @end example
30359
30360 For a full description of this file, see the manual pages for
30361 @samp{innd}, in particular @samp{active(5)}.
30362
30363
30364 @node Newsgroups File Format
30365 @subsubsection Newsgroups File Format
30366
30367 The newsgroups file lists groups along with their descriptions.  Not all
30368 groups on the server have to be listed,  and not all groups in the file
30369 have to exist on the server.  The file is meant purely as information to
30370 the user.
30371
30372 The format is quite simple; a group name, a tab, and the description.
30373 Here's the definition:
30374
30375 @example
30376 newsgroups    = *line
30377 line          = group tab description <NEWLINE>
30378 group         = <non-white-space string>
30379 tab           = <TAB>
30380 description   = <string>
30381 @end example
30382
30383
30384 @page
30385 @node Emacs for Heathens
30386 @section Emacs for Heathens
30387
30388 Believe it or not, but some people who use Gnus haven't really used
30389 Emacs much before they embarked on their journey on the Gnus Love Boat.
30390 If you are one of those unfortunates whom ``@kbd{C-M-a}'', ``kill the
30391 region'', and ``set @code{gnus-flargblossen} to an alist where the key
30392 is a regexp that is used for matching on the group name'' are magical
30393 phrases with little or no meaning, then this appendix is for you.  If
30394 you are already familiar with Emacs, just ignore this and go fondle your
30395 cat instead.
30396
30397 @menu
30398 * Keystrokes::                  Entering text and executing commands.
30399 * Emacs Lisp::                  The built-in Emacs programming language.
30400 @end menu
30401
30402
30403 @node Keystrokes
30404 @subsection Keystrokes
30405
30406 @itemize @bullet
30407 @item
30408 Q: What is an experienced Emacs user?
30409
30410 @item
30411 A: A person who wishes that the terminal had pedals.
30412 @end itemize
30413
30414 Yes, when you use Emacs, you are apt to use the control key, the shift
30415 key and the meta key a lot.  This is very annoying to some people
30416 (notably @code{vi}le users), and the rest of us just love the hell out
30417 of it.  Just give up and submit.  Emacs really does stand for
30418 ``Escape-Meta-Alt-Control-Shift'', and not ``Editing Macros'', as you
30419 may have heard from other disreputable sources (like the Emacs author).
30420
30421 The shift keys are normally located near your pinky fingers, and are
30422 normally used to get capital letters and stuff.  You probably use it all
30423 the time.  The control key is normally marked ``CTRL'' or something like
30424 that.  The meta key is, funnily enough, never marked as such on any
30425 keyboard.  The one I'm currently at has a key that's marked ``Alt'',
30426 which is the meta key on this keyboard.  It's usually located somewhere
30427 to the left hand side of the keyboard, usually on the bottom row.
30428
30429 Now, us Emacs people don't say ``press the meta-control-m key'',
30430 because that's just too inconvenient.  We say ``press the @kbd{C-M-m}
30431 key''.  @kbd{M-} is the prefix that means ``meta'' and ``C-'' is the
30432 prefix that means ``control''.  So ``press @kbd{C-k}'' means ``press
30433 down the control key, and hold it down while you press @kbd{k}''.
30434 ``Press @kbd{C-M-k}'' means ``press down and hold down the meta key and
30435 the control key and then press @kbd{k}''.  Simple, ay?
30436
30437 This is somewhat complicated by the fact that not all keyboards have a
30438 meta key.  In that case you can use the ``escape'' key.  Then @kbd{M-k}
30439 means ``press escape, release escape, press @kbd{k}''.  That's much more
30440 work than if you have a meta key, so if that's the case, I respectfully
30441 suggest you get a real keyboard with a meta key.  You can't live without
30442 it.
30443
30444
30445
30446 @node Emacs Lisp
30447 @subsection Emacs Lisp
30448
30449 Emacs is the King of Editors because it's really a Lisp interpreter.
30450 Each and every key you tap runs some Emacs Lisp code snippet, and since
30451 Emacs Lisp is an interpreted language, that means that you can configure
30452 any key to run any arbitrary code.  You just, like, do it.
30453
30454 Gnus is written in Emacs Lisp, and is run as a bunch of interpreted
30455 functions.  (These are byte-compiled for speed, but it's still
30456 interpreted.)  If you decide that you don't like the way Gnus does
30457 certain things, it's trivial to have it do something a different way.
30458 (Well, at least if you know how to write Lisp code.)  However, that's
30459 beyond the scope of this manual, so we are simply going to talk about
30460 some common constructs that you normally use in your @file{~/.gnus.el}
30461 file to customize Gnus.  (You can also use the @file{~/.emacs} file, but
30462 in order to set things of Gnus up, it is much better to use the
30463 @file{~/.gnus.el} file, @xref{Startup Files}.)
30464
30465 If you want to set the variable @code{gnus-florgbnize} to four (4), you
30466 write the following:
30467
30468 @lisp
30469 (setq gnus-florgbnize 4)
30470 @end lisp
30471
30472 This function (really ``special form'') @code{setq} is the one that can
30473 set a variable to some value.  This is really all you need to know.  Now
30474 you can go and fill your @file{~/.gnus.el} file with lots of these to
30475 change how Gnus works.
30476
30477 If you have put that thing in your @file{~/.gnus.el} file, it will be
30478 read and @code{eval}ed (which is Lisp-ese for ``run'') the next time you
30479 start Gnus.  If you want to change the variable right away, simply say
30480 @kbd{C-x C-e} after the closing parenthesis.  That will @code{eval} the
30481 previous ``form'', which is a simple @code{setq} statement here.
30482
30483 Go ahead---just try it, if you're located at your Emacs.  After you
30484 @kbd{C-x C-e}, you will see @samp{4} appear in the echo area, which
30485 is the return value of the form you @code{eval}ed.
30486
30487 Some pitfalls:
30488
30489 If the manual says ``set @code{gnus-read-active-file} to @code{some}'',
30490 that means:
30491
30492 @lisp
30493 (setq gnus-read-active-file 'some)
30494 @end lisp
30495
30496 On the other hand, if the manual says ``set @code{gnus-nntp-server-file} to
30497 @samp{/etc/nntpserver}'', that means:
30498
30499 @lisp
30500 (setq gnus-nntp-server-file "/etc/nntpserver")
30501 @end lisp
30502
30503 So be careful not to mix up strings (the latter) with symbols (the
30504 former).  The manual is unambiguous, but it can be confusing.
30505
30506 @page
30507 @include gnus-faq.texi
30508
30509 @node GNU Free Documentation License
30510 @chapter GNU Free Documentation License
30511 @include doclicense.texi
30512
30513 @node Index
30514 @chapter Index
30515 @printindex cp
30516
30517 @node Key Index
30518 @chapter Key Index
30519 @printindex ky
30520
30521 @bye
30522
30523 @iftex
30524 @iflatex
30525 \end{document}
30526 @end iflatex
30527 @end iftex
30528
30529 @c Local Variables:
30530 @c mode: texinfo
30531 @c coding: iso-8859-1
30532 @c End: