5be0f1b0dd18048fdd1c4da1d34d21558bee3285
[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, 1996, 1997, 1998, 1999, 2000, 2001,
13 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
14
15 @quotation
16 Permission is granted to copy, distribute and/or modify this document
17 under the terms of the GNU Free Documentation License, Version 1.2 or
18 any later version published by the Free Software Foundation; with no
19 Invariant Sections, with the Front-Cover texts being ``A GNU
20 Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
21 license is included in the section entitled ``GNU Free Documentation
22 License'' in the Emacs manual.
23
24 (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
25 this GNU Manual, like GNU software.  Copies published by the Free
26 Software Foundation raise funds for GNU development.''
27
28 This document is part of a collection distributed under the GNU Free
29 Documentation License.  If you want to distribute this document
30 separately from the collection, you can do so by adding a copy of the
31 license to the document, as described in section 6 of the license.
32 @end quotation
33 @end copying
34
35 @iftex
36 @iflatex
37 \documentclass[twoside,a4paper,openright,11pt]{book}
38 \usepackage[latin1]{inputenc}
39 \usepackage{pagestyle}
40 \usepackage{epsfig}
41 \usepackage{pixidx}
42 \input{gnusconfig.tex}
43
44 \ifx\pdfoutput\undefined
45 \else
46 \usepackage[pdftex,bookmarks,colorlinks=true]{hyperref}
47 \usepackage{thumbpdf}
48 \pdfcompresslevel=9
49 \fi
50
51 \makeindex
52 \begin{document}
53
54 % Adjust ../Makefile.in if you change the following line:
55 \newcommand{\gnusversionname}{No Gnus v0.4}
56 \newcommand{\gnuschaptername}{}
57 \newcommand{\gnussectionname}{}
58
59 \newcommand{\gnusbackslash}{/}
60
61 \newcommand{\gnusref}[1]{``#1'' on page \pageref{#1}}
62 \ifx\pdfoutput\undefined
63 \newcommand{\gnusuref}[1]{\gnustt{#1}}
64 \else
65 \newcommand{\gnusuref}[1]{\href{#1}{\gnustt{#1}}}
66 \fi
67 \newcommand{\gnusxref}[1]{See ``#1'' on page \pageref{#1}}
68 \newcommand{\gnuspxref}[1]{see ``#1'' on page \pageref{#1}}
69
70 \newcommand{\gnuskindex}[1]{\index{#1}}
71 \newcommand{\gnusindex}[1]{\index{#1}}
72
73 \newcommand{\gnustt}[1]{{\gnusselectttfont{}#1}}
74 \newcommand{\gnuscode}[1]{\gnustt{#1}}
75 \newcommand{\gnusasis}[1]{\gnustt{#1}}
76 \newcommand{\gnusurl}[1]{\gnustt{#1}}
77 \newcommand{\gnuscommand}[1]{\gnustt{#1}}
78 \newcommand{\gnusenv}[1]{\gnustt{#1}}
79 \newcommand{\gnussamp}[1]{``{\fontencoding{OT1}\gnusselectttfont{}#1}''}
80 \newcommand{\gnuslisp}[1]{\gnustt{#1}}
81 \newcommand{\gnuskbd}[1]{`\gnustt{#1}'}
82 \newcommand{\gnuskey}[1]{`\gnustt{#1}'}
83 \newcommand{\gnusfile}[1]{`\gnustt{#1}'}
84 \newcommand{\gnusdfn}[1]{\textit{#1}}
85 \newcommand{\gnusi}[1]{\textit{#1}}
86 \newcommand{\gnusr}[1]{\textrm{#1}}
87 \newcommand{\gnusstrong}[1]{\textbf{#1}}
88 \newcommand{\gnusemph}[1]{\textit{#1}}
89 \newcommand{\gnusvar}[1]{{\fontsize{10pt}{10}\selectfont\textsl{\textsf{#1}}}}
90 \newcommand{\gnussc}[1]{\textsc{#1}}
91 \newcommand{\gnustitle}[1]{{\huge\textbf{#1}}}
92 \newcommand{\gnusversion}[1]{{\small\textit{#1}}}
93 \newcommand{\gnusauthor}[1]{{\large\textbf{#1}}}
94 \newcommand{\gnusresult}[1]{\gnustt{=> #1}}
95 \newcommand{\gnusacronym}[1]{\textsc{#1}}
96 \newcommand{\gnusemail}[1]{\textit{#1}}
97
98 \newcommand{\gnusbullet}{{${\bullet}$}}
99 \newcommand{\gnusdollar}{\$}
100 \newcommand{\gnusampersand}{\&}
101 \newcommand{\gnuspercent}{\%}
102 \newcommand{\gnushash}{\#}
103 \newcommand{\gnushat}{\symbol{"5E}}
104 \newcommand{\gnusunderline}{\symbol{"5F}}
105 \newcommand{\gnusnot}{$\neg$}
106 \newcommand{\gnustilde}{\symbol{"7E}}
107 \newcommand{\gnusless}{{$<$}}
108 \newcommand{\gnusgreater}{{$>$}}
109 \newcommand{\gnusbraceleft}{{$>$}}
110 \newcommand{\gnusbraceright}{{$>$}}
111
112 \newcommand{\gnushead}{\raisebox{-1cm}{\epsfig{figure=ps/gnus-head,height=1cm}}}
113 \newcommand{\gnusinteresting}{
114 \marginpar[\mbox{}\hfill\gnushead]{\gnushead}
115 }
116
117 \newcommand{\gnuscleardoublepage}{\ifodd\count0\mbox{}\clearpage\thispagestyle{empty}\mbox{}\clearpage\else\clearpage\fi}
118
119 \newcommand{\gnuspagechapter}[1]{
120 {\mbox{}}
121 }
122
123 \newdimen{\gnusdimen}
124 \gnusdimen 0pt
125
126 \newcommand{\gnuschapter}[2]{
127 \gnuscleardoublepage
128 \ifdim \gnusdimen = 0pt\setcounter{page}{1}\pagestyle{gnus}\pagenumbering{arabic} \gnusdimen 1pt\fi
129 \chapter{#2}
130 \renewcommand{\gnussectionname}{}
131 \renewcommand{\gnuschaptername}{#2}
132 \thispagestyle{empty}
133 \hspace*{-2cm}
134 \begin{picture}(500,500)(0,0)
135 \put(480,350){\makebox(0,0)[tr]{#1}}
136 \put(40,300){\makebox(500,50)[bl]{{\Huge\bf{#2}}}}
137 \end{picture}
138 \clearpage
139 }
140
141 \newcommand{\gnusfigure}[3]{
142 \begin{figure}
143 \mbox{}\ifodd\count0\hspace*{-0.8cm}\else\hspace*{-3cm}\fi\begin{picture}(440,#2)
144 #3
145 \end{picture}
146 \caption{#1}
147 \end{figure}
148 }
149
150 \newcommand{\gnusicon}[1]{
151 \marginpar[\mbox{}\hfill\raisebox{-1.5cm}{\epsfig{figure=ps/#1-up,height=1.5cm}}]{\raisebox{-1cm}{\epsfig{figure=ps/#1-up,height=1cm}}}
152 }
153
154 \newcommand{\gnuspicon}[1]{
155 \margindex{\epsfig{figure=#1,width=2cm}}
156 }
157
158 \newcommand{\gnusxface}[2]{
159 \margindex{\epsfig{figure=#1,width=1cm}\epsfig{figure=#2,width=1cm}}
160 }
161
162 \newcommand{\gnussmiley}[2]{
163 \margindex{\makebox[2cm]{\hfill\epsfig{figure=#1,width=0.5cm}\hfill\epsfig{figure=#2,width=0.5cm}\hfill}}
164 }
165
166 \newcommand{\gnusitemx}[1]{\mbox{}\vspace*{-\itemsep}\vspace*{-\parsep}\item#1}
167
168 \newcommand{\gnussection}[1]{
169 \renewcommand{\gnussectionname}{#1}
170 \section{#1}
171 }
172
173 \newenvironment{codelist}%
174 {\begin{list}{}{
175 }
176 }{\end{list}}
177
178 \newenvironment{asislist}%
179 {\begin{list}{}{
180 }
181 }{\end{list}}
182
183 \newenvironment{kbdlist}%
184 {\begin{list}{}{
185 \labelwidth=0cm
186 }
187 }{\end{list}}
188
189 \newenvironment{dfnlist}%
190 {\begin{list}{}{
191 }
192 }{\end{list}}
193
194 \newenvironment{stronglist}%
195 {\begin{list}{}{
196 }
197 }{\end{list}}
198
199 \newenvironment{samplist}%
200 {\begin{list}{}{
201 }
202 }{\end{list}}
203
204 \newenvironment{varlist}%
205 {\begin{list}{}{
206 }
207 }{\end{list}}
208
209 \newenvironment{emphlist}%
210 {\begin{list}{}{
211 }
212 }{\end{list}}
213
214 \newlength\gnusheadtextwidth
215 \setlength{\gnusheadtextwidth}{\headtextwidth}
216 \addtolength{\gnusheadtextwidth}{1cm}
217
218 \newpagestyle{gnuspreamble}%
219 {
220 {
221 \ifodd\count0
222 {
223 \hspace*{-0.23cm}\underline{\makebox[\gnusheadtextwidth]{\mbox{}}\textbf{\hfill\roman{page}}}
224 }
225 \else
226 {
227 \hspace*{-3.25cm}\underline{\makebox[\gnusheadtextwidth]{\textbf{\roman{page}\hfill\mbox{}}}
228 }
229 }
230 \fi
231 }
232 }
233 {
234 \ifodd\count0
235 \mbox{} \hfill
236 \raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}}
237 \else
238 \raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}}
239 \hfill \mbox{}
240 \fi
241 }
242
243 \newpagestyle{gnusindex}%
244 {
245 {
246 \ifodd\count0
247 {
248 \hspace*{-0.23cm}\underline{\makebox[\gnusheadtextwidth]{\textbf{\gnuschaptername\hfill\arabic{page}}}}
249 }
250 \else
251 {
252 \hspace*{-3.25cm}\underline{\makebox[\gnusheadtextwidth]{\textbf{\arabic{page}\hfill\gnuschaptername}}}
253 }
254 \fi
255 }
256 }
257 {
258 \ifodd\count0
259 \mbox{} \hfill
260 \raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}}
261 \else
262 \raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}}
263 \hfill \mbox{}
264 \fi
265 }
266
267 \newpagestyle{gnus}%
268 {
269 {
270 \ifodd\count0
271 {
272 \makebox[12cm]{\hspace*{3.1cm}\underline{\makebox[\gnusheadtextwidth]{\textbf{\arabic{chapter}.\arabic{section}} \textbf{\gnussectionname\hfill\arabic{page}}}}}
273 }
274 \else
275 {
276 \makebox[12cm]{\hspace*{-2.95cm}\underline{\makebox[\gnusheadtextwidth]{\textbf{\arabic{page}\hfill\gnuschaptername}}}}
277 }
278 \fi
279 }
280 }
281 {
282 \ifodd\count0
283 \mbox{} \hfill
284 \raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}}
285 \else
286 \raisebox{-0.5cm}{\epsfig{figure=ps/gnus-big-logo,height=1cm}}
287 \hfill \mbox{}
288 \fi
289 }
290
291 \pagenumbering{roman}
292 \pagestyle{gnuspreamble}
293
294 @end iflatex
295 @end iftex
296
297 @iftex
298 @iflatex
299
300 \begin{titlepage}
301 {
302
303 %\addtolength{\oddsidemargin}{-5cm}
304 %\addtolength{\evensidemargin}{-5cm}
305 \parindent=0cm
306 \addtolength{\textheight}{2cm}
307
308 \gnustitle{\gnustitlename}\hfill\gnusversion{\gnusversionname}\\
309 \rule{15cm}{1mm}\\
310 \vfill
311 \hspace*{0cm}\epsfig{figure=ps/gnus-big-logo,height=15cm}
312 \vfill
313 \rule{15cm}{1mm}\\
314 \gnusauthor{by Lars Magne Ingebrigtsen}
315 \newpage
316 }
317
318 \mbox{}
319 \vfill
320
321 \thispagestyle{empty}
322
323 @c @insertcopying
324 \newpage
325 \end{titlepage}
326 @end iflatex
327 @end iftex
328
329 @ifnottex
330 @insertcopying
331 @end ifnottex
332
333 @dircategory Emacs
334 @direntry
335 * Gnus: (gnus).         The newsreader Gnus.
336 @end direntry
337 @iftex
338 @finalout
339 @end iftex
340 @setchapternewpage odd
341
342
343
344 @titlepage
345 @title Gnus Manual
346
347 @author by Lars Magne Ingebrigtsen
348 @page
349 @vskip 0pt plus 1filll
350 @insertcopying
351 @end titlepage
352
353
354 @node Top
355 @top The Gnus Newsreader
356
357 @ifinfo
358
359 You can read news (and mail) from within Emacs by using Gnus.  The news
360 can be gotten by any nefarious means you can think of---@acronym{NNTP}, local
361 spool or your mbox file.  All at the same time, if you want to push your
362 luck.
363
364 @c Adjust ../Makefile.in if you change the following line:
365 This manual corresponds to No Gnus v0.4.
366
367 @end ifinfo
368
369 @iftex
370
371 @iflatex
372 \tableofcontents
373 \gnuscleardoublepage
374 @end iflatex
375
376 Gnus is the advanced, self-documenting, customizable, extensible
377 unreal-time newsreader for GNU Emacs.
378
379 Oops.  That sounds oddly familiar, so let's start over again to avoid
380 being accused of plagiarism:
381
382 Gnus is a message-reading laboratory.  It will let you look at just
383 about anything as if it were a newsgroup.  You can read mail with it,
384 you can browse directories with it, you can @code{ftp} with it---you
385 can even read news with it!
386
387 Gnus tries to empower people who read news the same way Emacs empowers
388 people who edit text.  Gnus sets no limits to what the user should be
389 allowed to do.  Users are encouraged to extend Gnus to make it behave
390 like they want it to behave.  A program should not control people;
391 people should be empowered to do what they want by using (or abusing)
392 the program.
393
394 @end iftex
395
396 @menu
397 * Starting Up::              Finding news can be a pain.
398 * Group Buffer::             Selecting, subscribing and killing groups.
399 * Summary Buffer::           Reading, saving and posting articles.
400 * Article Buffer::           Displaying and handling articles.
401 * Composing Messages::       Information on sending mail and news.
402 * Select Methods::           Gnus reads all messages from various select methods.
403 * Scoring::                  Assigning values to articles.
404 * Various::                  General purpose settings.
405 * The End::                  Farewell and goodbye.
406 * Appendices::               Terminology, Emacs intro, @acronym{FAQ}, History, Internals.
407 * Index::                    Variable, function and concept index.
408 * Key Index::                Key Index.
409
410 Other related manuals
411
412 * Message:(message).         Composing messages.
413 * Emacs-MIME:(emacs-mime).   Composing messages; @acronym{MIME}-specific parts.
414 * Sieve:(sieve).             Managing Sieve scripts in Emacs.
415 * PGG:(pgg).                 @acronym{PGP/MIME} with Gnus.
416 * SASL:(sasl).               @acronym{SASL} authentication in Emacs.
417
418 @detailmenu
419  --- The Detailed Node Listing ---
420
421 Starting Gnus
422
423 * Finding the News::            Choosing a method for getting news.
424 * The First Time::              What does Gnus do the first time you start it?
425 * The Server is Down::          How can I read my mail then?
426 * Slave Gnusae::                You can have more than one Gnus active at a time.
427 * Fetching a Group::            Starting Gnus just to read a group.
428 * New Groups::                  What is Gnus supposed to do with new groups?
429 * Changing Servers::            You may want to move from one server to another.
430 * Startup Files::               Those pesky startup files---@file{.newsrc}.
431 * Auto Save::                   Recovering from a crash.
432 * The Active File::             Reading the active file over a slow line Takes Time.
433 * Startup Variables::           Other variables you might change.
434
435 New Groups
436
437 * Checking New Groups::         Determining what groups are new.
438 * Subscription Methods::        What Gnus should do with new groups.
439 * Filtering New Groups::        Making Gnus ignore certain new groups.
440
441 Group Buffer
442
443 * Group Buffer Format::         Information listed and how you can change it.
444 * Group Maneuvering::           Commands for moving in the group buffer.
445 * Selecting a Group::           Actually reading news.
446 * Subscription Commands::       Unsubscribing, killing, subscribing.
447 * Group Data::                  Changing the info for a group.
448 * Group Levels::                Levels? What are those, then?
449 * Group Score::                 A mechanism for finding out what groups you like.
450 * Marking Groups::              You can mark groups for later processing.
451 * Foreign Groups::              Creating and editing groups.
452 * Group Parameters::            Each group may have different parameters set.
453 * Listing Groups::              Gnus can list various subsets of the groups.
454 * Sorting Groups::              Re-arrange the group order.
455 * Group Maintenance::           Maintaining a tidy @file{.newsrc} file.
456 * Browse Foreign Server::       You can browse a server.  See what it has to offer.
457 * Exiting Gnus::                Stop reading news and get some work done.
458 * Group Topics::                A folding group mode divided into topics.
459 * Misc Group Stuff::            Other stuff that you can to do.
460
461 Group Buffer Format
462
463 * Group Line Specification::    Deciding how the group buffer is to look.
464 * Group Mode Line Specification::  The group buffer mode line.
465 * Group Highlighting::          Having nice colors in the group buffer.
466
467 Group Topics
468
469 * Topic Commands::              Interactive E-Z commands.
470 * Topic Variables::             How to customize the topics the Lisp Way.
471 * Topic Sorting::               Sorting each topic individually.
472 * Topic Topology::              A map of the world.
473 * Topic Parameters::            Parameters that apply to all groups in a topic.
474
475 Misc Group Stuff
476
477 * Scanning New Messages::       Asking Gnus to see whether new messages have arrived.
478 * Group Information::           Information and help on groups and Gnus.
479 * Group Timestamp::             Making Gnus keep track of when you last read a group.
480 * File Commands::               Reading and writing the Gnus files.
481 * Sieve Commands::              Managing Sieve scripts.
482
483 Summary Buffer
484
485 * Summary Buffer Format::       Deciding how the summary buffer is to look.
486 * Summary Maneuvering::         Moving around the summary buffer.
487 * Choosing Articles::           Reading articles.
488 * Paging the Article::          Scrolling the current article.
489 * Reply Followup and Post::     Posting articles.
490 * Delayed Articles::            Send articles at a later time.
491 * Marking Articles::            Marking articles as read, expirable, etc.
492 * Limiting::                    You can limit the summary buffer.
493 * Threading::                   How threads are made.
494 * Sorting the Summary Buffer::  How articles and threads are sorted.
495 * Asynchronous Fetching::       Gnus might be able to pre-fetch articles.
496 * Article Caching::             You may store articles in a cache.
497 * Persistent Articles::         Making articles expiry-resistant.
498 * Article Backlog::             Having already read articles hang around.
499 * Saving Articles::             Ways of customizing article saving.
500 * Decoding Articles::           Gnus can treat series of (uu)encoded articles.
501 * Article Treatment::           The article buffer can be mangled at will.
502 * MIME Commands::               Doing MIMEy things with the articles.
503 * Charsets::                    Character set issues.
504 * Article Commands::            Doing various things with the article buffer.
505 * Summary Sorting::             Sorting the summary buffer in various ways.
506 * Finding the Parent::          No child support? Get the parent.
507 * Alternative Approaches::      Reading using non-default summaries.
508 * Tree Display::                A more visual display of threads.
509 * Mail Group Commands::         Some commands can only be used in mail groups.
510 * Various Summary Stuff::       What didn't fit anywhere else.
511 * Exiting the Summary Buffer::  Returning to the Group buffer,
512                                 or reselecting the current group.
513 * Crosspost Handling::          How crossposted articles are dealt with.
514 * Duplicate Suppression::       An alternative when crosspost handling fails.
515 * Security::                    Decrypt and Verify.
516 * Mailing List::                Mailing list minor mode.
517
518 Summary Buffer Format
519
520 * Summary Buffer Lines::        You can specify how summary lines should look.
521 * To From Newsgroups::          How to not display your own name.
522 * Summary Buffer Mode Line::    You can say how the mode line should look.
523 * Summary Highlighting::        Making the summary buffer all pretty and nice.
524
525 Choosing Articles
526
527 * Choosing Commands::           Commands for choosing articles.
528 * Choosing Variables::          Variables that influence these commands.
529
530 Reply, Followup and Post
531
532 * Summary Mail Commands::       Sending mail.
533 * Summary Post Commands::       Sending news.
534 * Summary Message Commands::    Other Message-related commands.
535 * Canceling and Superseding::
536
537 Marking Articles
538
539 * Unread Articles::             Marks for unread articles.
540 * Read Articles::               Marks for read articles.
541 * Other Marks::                 Marks that do not affect readedness.
542 * Setting Marks::               How to set and remove marks.
543 * Generic Marking Commands::    How to customize the marking.
544 * Setting Process Marks::       How to mark articles for later processing.
545
546 Threading
547
548 * Customizing Threading::       Variables you can change to affect the threading.
549 * Thread Commands::             Thread based commands in the summary buffer.
550
551 Customizing Threading
552
553 * Loose Threads::               How Gnus gathers loose threads into bigger threads.
554 * Filling In Threads::          Making the threads displayed look fuller.
555 * More Threading::              Even more variables for fiddling with threads.
556 * Low-Level Threading::         You thought it was over@dots{} but you were wrong!
557
558 Decoding Articles
559
560 * Uuencoded Articles::          Uudecode articles.
561 * Shell Archives::              Unshar articles.
562 * PostScript Files::            Split PostScript.
563 * Other Files::                 Plain save and binhex.
564 * Decoding Variables::          Variables for a happy decoding.
565 * Viewing Files::               You want to look at the result of the decoding?
566
567 Decoding Variables
568
569 * Rule Variables::              Variables that say how a file is to be viewed.
570 * Other Decode Variables::      Other decode variables.
571 * Uuencoding and Posting::      Variables for customizing uuencoding.
572
573 Article Treatment
574
575 * Article Highlighting::        You want to make the article look like fruit salad.
576 * Article Fontisizing::         Making emphasized text look nice.
577 * Article Hiding::              You also want to make certain info go away.
578 * Article Washing::             Lots of way-neat functions to make life better.
579 * Article Header::              Doing various header transformations.
580 * Article Buttons::             Click on URLs, Message-IDs, addresses and the like.
581 * Article Button Levels::       Controlling appearance of buttons.
582 * Article Date::                Grumble, UT!
583 * Article Display::             Display various stuff---X-Face, Picons, Smileys
584 * Article Signature::           What is a signature?
585 * Article Miscellanea::         Various other stuff.
586
587 Alternative Approaches
588
589 * Pick and Read::               First mark articles and then read them.
590 * Binary Groups::               Auto-decode all articles.
591
592 Various Summary Stuff
593
594 * Summary Group Information::   Information oriented commands.
595 * Searching for Articles::      Multiple article commands.
596 * Summary Generation Commands::
597 * Really Various Summary Commands::  Those pesky non-conformant commands.
598
599 Article Buffer
600
601 * Hiding Headers::              Deciding what headers should be displayed.
602 * Using MIME::                  Pushing articles through @acronym{MIME} before reading them.
603 * Customizing Articles::        Tailoring the look of the articles.
604 * Article Keymap::              Keystrokes available in the article buffer.
605 * Misc Article::                Other stuff.
606
607 Composing Messages
608
609 * Mail::                        Mailing and replying.
610 * Posting Server::              What server should you post and mail via?
611 * POP before SMTP::             You cannot send a mail unless you read a mail.
612 * Mail and Post::               Mailing and posting at the same time.
613 * Archived Messages::           Where Gnus stores the messages you've sent.
614 * Posting Styles::              An easier way to specify who you are.
615 * Drafts::                      Postponing messages and rejected messages.
616 * Rejected Articles::           What happens if the server doesn't like your article?
617 * Signing and encrypting::      How to compose secure messages.
618
619 Select Methods
620
621 * Server Buffer::               Making and editing virtual servers.
622 * Getting News::                Reading USENET news with Gnus.
623 * Getting Mail::                Reading your personal mail with Gnus.
624 * Browsing the Web::            Getting messages from a plethora of Web sources.
625 * IMAP::                        Using Gnus as a @acronym{IMAP} client.
626 * Other Sources::               Reading directories, files, SOUP packets.
627 * Combined Groups::             Combining groups into one group.
628 * Email Based Diary::           Using mails to manage diary events in Gnus.
629 * Gnus Unplugged::              Reading news and mail offline.
630
631 Server Buffer
632
633 * Server Buffer Format::        You can customize the look of this buffer.
634 * Server Commands::             Commands to manipulate servers.
635 * Example Methods::             Examples server specifications.
636 * Creating a Virtual Server::   An example session.
637 * Server Variables::            Which variables to set.
638 * Servers and Methods::         You can use server names as select methods.
639 * Unavailable Servers::         Some servers you try to contact may be down.
640
641 Getting News
642
643 * NNTP::                        Reading news from an @acronym{NNTP} server.
644 * News Spool::                  Reading news from the local spool.
645
646 @acronym{NNTP}
647
648 * Direct Functions::            Connecting directly to the server.
649 * Indirect Functions::          Connecting indirectly to the server.
650 * Common Variables::            Understood by several connection functions.
651 * NNTP marks::                  Storing marks for @acronym{NNTP} servers.
652
653 Getting Mail
654
655 * Mail in a Newsreader::        Important introductory notes.
656 * Getting Started Reading Mail::  A simple cookbook example.
657 * Splitting Mail::              How to create mail groups.
658 * Mail Sources::                How to tell Gnus where to get mail from.
659 * Mail Back End Variables::     Variables for customizing mail handling.
660 * Fancy Mail Splitting::        Gnus can do hairy splitting of incoming mail.
661 * Group Mail Splitting::        Use group customize to drive mail splitting.
662 * Incorporating Old Mail::      What about the old mail you have?
663 * Expiring Mail::               Getting rid of unwanted mail.
664 * Washing Mail::                Removing cruft from the mail you get.
665 * Duplicates::                  Dealing with duplicated mail.
666 * Not Reading Mail::            Using mail back ends for reading other files.
667 * Choosing a Mail Back End::    Gnus can read a variety of mail formats.
668
669 Mail Sources
670
671 * Mail Source Specifiers::      How to specify what a mail source is.
672 * Mail Source Customization::   Some variables that influence things.
673 * Fetching Mail::               Using the mail source specifiers.
674
675 Choosing a Mail Back End
676
677 * Unix Mail Box::               Using the (quite) standard Un*x mbox.
678 * Rmail Babyl::                 Emacs programs use the Rmail Babyl format.
679 * Mail Spool::                  Store your mail in a private spool?
680 * MH Spool::                    An mhspool-like back end.
681 * Maildir::                     Another one-file-per-message format.
682 * Mail Folders::                Having one file for each group.
683 * Comparing Mail Back Ends::    An in-depth looks at pros and cons.
684
685 Browsing the Web
686
687 * Archiving Mail::
688 * Web Searches::                Creating groups from articles that match a string.
689 * Slashdot::                    Reading the Slashdot comments.
690 * Ultimate::                    The Ultimate Bulletin Board systems.
691 * Web Archive::                 Reading mailing list archived on web.
692 * RSS::                         Reading RDF site summary.
693 * Customizing W3::              Doing stuff to Emacs/W3 from Gnus.
694
695 @acronym{IMAP}
696
697 * Splitting in IMAP::           Splitting mail with nnimap.
698 * Expiring in IMAP::            Expiring mail with nnimap.
699 * Editing IMAP ACLs::           Limiting/enabling other users access to a mailbox.
700 * Expunging mailboxes::         Equivalent of a ``compress mailbox'' button.
701 * A note on namespaces::        How to (not) use @acronym{IMAP} namespace in Gnus.
702 * Debugging IMAP::              What to do when things don't work.
703
704 Other Sources
705
706 * Directory Groups::            You can read a directory as if it was a newsgroup.
707 * Anything Groups::             Dired?  Who needs dired?
708 * Document Groups::             Single files can be the basis of a group.
709 * SOUP::                        Reading @sc{soup} packets ``offline''.
710 * Mail-To-News Gateways::       Posting articles via mail-to-news gateways.
711
712 Document Groups
713
714 * Document Server Internals::   How to add your own document types.
715
716 SOUP
717
718 * SOUP Commands::               Commands for creating and sending @sc{soup} packets
719 * SOUP Groups::                 A back end for reading @sc{soup} packets.
720 * SOUP Replies::                How to enable @code{nnsoup} to take over mail and news.
721
722 Combined Groups
723
724 * Virtual Groups::              Combining articles from many groups.
725 * Kibozed Groups::              Looking through parts of the newsfeed for articles.
726
727 Email Based Diary
728
729 * The NNDiary Back End::        Basic setup and usage.
730 * The Gnus Diary Library::      Utility toolkit on top of nndiary.
731 * Sending or Not Sending::      A final note on sending diary messages.
732
733 The NNDiary Back End
734
735 * Diary Messages::              What makes a message valid for nndiary.
736 * Running NNDiary::             NNDiary has two modes of operation.
737 * Customizing NNDiary::         Bells and whistles.
738
739 The Gnus Diary Library
740
741 * Diary Summary Line Format::           A nicer summary buffer line format.
742 * Diary Articles Sorting::              A nicer way to sort messages.
743 * Diary Headers Generation::            Not doing it manually.
744 * Diary Group Parameters::              Not handling them manually.
745
746 Gnus Unplugged
747
748 * Agent Basics::                How it all is supposed to work.
749 * Agent Categories::            How to tell the Gnus Agent what to download.
750 * Agent Commands::              New commands for all the buffers.
751 * Agent Visuals::               Ways that the agent may effect your summary buffer.
752 * Agent as Cache::              The Agent is a big cache too.
753 * Agent Expiry::                How to make old articles go away.
754 * Agent Regeneration::          How to recover from lost connections and other accidents.
755 * Agent and flags::             How the Agent maintains flags.
756 * Agent and IMAP::              How to use the Agent with @acronym{IMAP}.
757 * Outgoing Messages::           What happens when you post/mail something?
758 * Agent Variables::             Customizing is fun.
759 * Example Setup::               An example @file{~/.gnus.el} file for offline people.
760 * Batching Agents::             How to fetch news from a @code{cron} job.
761 * Agent Caveats::               What you think it'll do and what it does.
762
763 Agent Categories
764
765 * Category Syntax::             What a category looks like.
766 * Category Buffer::             A buffer for maintaining categories.
767 * Category Variables::          Customize'r'Us.
768
769 Agent Commands
770
771 * Group Agent Commands::        Configure groups and fetch their contents.
772 * Summary Agent Commands::      Manually select then fetch specific articles.
773 * Server Agent Commands::       Select the servers that are supported by the agent.
774
775 Scoring
776
777 * Summary Score Commands::      Adding score entries for the current group.
778 * Group Score Commands::        General score commands.
779 * Score Variables::             Customize your scoring.  (My, what terminology).
780 * Score File Format::           What a score file may contain.
781 * Score File Editing::          You can edit score files by hand as well.
782 * Adaptive Scoring::            Big Sister Gnus knows what you read.
783 * Home Score File::             How to say where new score entries are to go.
784 * Followups To Yourself::       Having Gnus notice when people answer you.
785 * Scoring On Other Headers::    Scoring on non-standard headers.
786 * Scoring Tips::                How to score effectively.
787 * Reverse Scoring::             That problem child of old is not problem.
788 * Global Score Files::          Earth-spanning, ear-splitting score files.
789 * Kill Files::                  They are still here, but they can be ignored.
790 * Converting Kill Files::       Translating kill files to score files.
791 * Advanced Scoring::            Using logical expressions to build score rules.
792 * Score Decays::                It can be useful to let scores wither away.
793
794 Advanced Scoring
795
796 * Advanced Scoring Syntax::     A definition.
797 * Advanced Scoring Examples::   What they look like.
798 * Advanced Scoring Tips::       Getting the most out of it.
799
800 Various
801
802 * Process/Prefix::              A convention used by many treatment commands.
803 * Interactive::                 Making Gnus ask you many questions.
804 * Symbolic Prefixes::           How to supply some Gnus functions with options.
805 * Formatting Variables::        You can specify what buffers should look like.
806 * Window Layout::               Configuring the Gnus buffer windows.
807 * Faces and Fonts::             How to change how faces look.
808 * Compilation::                 How to speed Gnus up.
809 * Mode Lines::                  Displaying information in the mode lines.
810 * Highlighting and Menus::      Making buffers look all nice and cozy.
811 * Buttons::                     Get tendinitis in ten easy steps!
812 * Daemons::                     Gnus can do things behind your back.
813 * NoCeM::                       How to avoid spam and other fatty foods.
814 * Undo::                        Some actions can be undone.
815 * Predicate Specifiers::        Specifying predicates.
816 * Moderation::                  What to do if you're a moderator.
817 * Image Enhancements::          Modern versions of Emacs/XEmacs can display images.
818 * Fuzzy Matching::              What's the big fuzz?
819 * Thwarting Email Spam::        A how-to on avoiding unsolicited commercial email.
820 * Other modes::                 Interaction with other modes.
821 * Various Various::             Things that are really various.
822
823 Formatting Variables
824
825 * Formatting Basics::           A formatting variable is basically a format string.
826 * Mode Line Formatting::        Some rules about mode line formatting variables.
827 * Advanced Formatting::         Modifying output in various ways.
828 * User-Defined Specs::          Having Gnus call your own functions.
829 * Formatting Fonts::            Making the formatting look colorful and nice.
830 * Positioning Point::           Moving point to a position after an operation.
831 * Tabulation::                  Tabulating your output.
832 * Wide Characters::             Dealing with wide characters.
833
834 Image Enhancements
835
836 * X-Face::                      Display a funky, teensy black-and-white image.
837 * Face::                        Display a funkier, teensier colored image.
838 * Smileys::                     Show all those happy faces the way they were meant to be shown.
839 * Picons::                      How to display pictures of what you're reading.
840 * XVarious::                    Other XEmacsy Gnusey variables.
841
842 Thwarting Email Spam
843
844 * The problem of spam::         Some background, and some solutions
845 * Anti-Spam Basics::            Simple steps to reduce the amount of spam.
846 * SpamAssassin::                How to use external anti-spam tools.
847 * Hashcash::                    Reduce spam by burning CPU time.
848 * Filtering Spam Using The Spam ELisp Package::
849 * Filtering Spam Using Statistics with spam-stat::
850
851 Filtering Spam Using The Spam ELisp Package
852
853 * Spam ELisp Package Sequence of Events::
854 * Spam ELisp Package Filtering of Incoming Mail::
855 * Spam ELisp Package Global Variables::
856 * Spam ELisp Package Configuration Examples::
857 * Blacklists and Whitelists::
858 * BBDB Whitelists::
859 * Gmane Spam Reporting::
860 * Anti-spam Hashcash Payments::
861 * Blackholes::
862 * Regular Expressions Header Matching::
863 * Bogofilter::
864 * SpamAssassin back end::
865 * ifile spam filtering::
866 * spam-stat spam filtering::
867 * SpamOracle::
868 * Extending the Spam ELisp package::
869
870 Filtering Spam Using Statistics with spam-stat
871
872 * Creating a spam-stat dictionary::
873 * Splitting mail using spam-stat::
874 * Low-level interface to the spam-stat dictionary::
875
876 Appendices
877
878 * XEmacs::                      Requirements for installing under XEmacs.
879 * History::                     How Gnus got where it is today.
880 * On Writing Manuals::          Why this is not a beginner's guide.
881 * Terminology::                 We use really difficult, like, words here.
882 * Customization::               Tailoring Gnus to your needs.
883 * Troubleshooting::             What you might try if things do not work.
884 * Gnus Reference Guide::        Rilly, rilly technical stuff.
885 * Emacs for Heathens::          A short introduction to Emacsian terms.
886 * Frequently Asked Questions::  The Gnus FAQ
887
888 History
889
890 * Gnus Versions::               What Gnus versions have been released.
891 * Other Gnus Versions::         Other Gnus versions that also have been released.
892 * Why?::                        What's the point of Gnus?
893 * Compatibility::               Just how compatible is Gnus with @sc{gnus}?
894 * Conformity::                  Gnus tries to conform to all standards.
895 * Emacsen::                     Gnus can be run on a few modern Emacsen.
896 * Gnus Development::            How Gnus is developed.
897 * Contributors::                Oodles of people.
898 * New Features::                Pointers to some of the new stuff in Gnus.
899
900 New Features
901
902 * ding Gnus::                   New things in Gnus 5.0/5.1, the first new Gnus.
903 * September Gnus::              The Thing Formally Known As Gnus 5.2/5.3.
904 * Red Gnus::                    Third time best---Gnus 5.4/5.5.
905 * Quassia Gnus::                Two times two is four, or Gnus 5.6/5.7.
906 * Pterodactyl Gnus::            Pentad also starts with P, AKA Gnus 5.8/5.9.
907 * Oort Gnus::                   It's big.  It's far out.  Gnus 5.10/5.11.
908 * No Gnus::                     Very punny.
909
910 Customization
911
912 * Slow/Expensive Connection::   You run a local Emacs and get the news elsewhere.
913 * Slow Terminal Connection::    You run a remote Emacs.
914 * Little Disk Space::           You feel that having large setup files is icky.
915 * Slow Machine::                You feel like buying a faster machine.
916
917 Gnus Reference Guide
918
919 * Gnus Utility Functions::      Common functions and variable to use.
920 * Back End Interface::          How Gnus communicates with the servers.
921 * Score File Syntax::           A BNF definition of the score file standard.
922 * Headers::                     How Gnus stores headers internally.
923 * Ranges::                      A handy format for storing mucho numbers.
924 * Group Info::                  The group info format.
925 * Extended Interactive::        Symbolic prefixes and stuff.
926 * Emacs/XEmacs Code::           Gnus can be run under all modern Emacsen.
927 * Various File Formats::        Formats of files that Gnus use.
928
929 Back End Interface
930
931 * Required Back End Functions::  Functions that must be implemented.
932 * Optional Back End Functions::  Functions that need not be implemented.
933 * Error Messaging::             How to get messages and report errors.
934 * Writing New Back Ends::       Extending old back ends.
935 * Hooking New Back Ends Into Gnus::  What has to be done on the Gnus end.
936 * Mail-like Back Ends::         Some tips on mail back ends.
937
938 Various File Formats
939
940 * Active File Format::          Information on articles and groups available.
941 * Newsgroups File Format::      Group descriptions.
942
943 Emacs for Heathens
944
945 * Keystrokes::                  Entering text and executing commands.
946 * Emacs Lisp::                  The built-in Emacs programming language.
947
948 @end detailmenu
949 @end menu
950
951 @node Starting Up
952 @chapter Starting Gnus
953 @cindex starting up
954
955 @kindex M-x gnus
956 @findex gnus
957 If your system administrator has set things up properly, starting Gnus
958 and reading news is extremely easy---you just type @kbd{M-x gnus} in
959 your Emacs.
960
961 @findex gnus-other-frame
962 @kindex M-x gnus-other-frame
963 If you want to start Gnus in a different frame, you can use the command
964 @kbd{M-x gnus-other-frame} instead.
965
966 If things do not go smoothly at startup, you have to twiddle some
967 variables in your @file{~/.gnus.el} file.  This file is similar to
968 @file{~/.emacs}, but is read when Gnus starts.
969
970 If you puzzle at any terms used in this manual, please refer to the
971 terminology section (@pxref{Terminology}).
972
973 @menu
974 * Finding the News::      Choosing a method for getting news.
975 * The First Time::        What does Gnus do the first time you start it?
976 * The Server is Down::    How can I read my mail then?
977 * Slave Gnusae::          You can have more than one Gnus active at a time.
978 * New Groups::            What is Gnus supposed to do with new groups?
979 * Changing Servers::      You may want to move from one server to another.
980 * Startup Files::         Those pesky startup files---@file{.newsrc}.
981 * Auto Save::             Recovering from a crash.
982 * The Active File::       Reading the active file over a slow line Takes Time.
983 * Startup Variables::     Other variables you might change.
984 @end menu
985
986
987 @node Finding the News
988 @section Finding the News
989 @cindex finding news
990
991 @vindex gnus-select-method
992 @c @head
993 The @code{gnus-select-method} variable says where Gnus should look for
994 news.  This variable should be a list where the first element says
995 @dfn{how} and the second element says @dfn{where}.  This method is your
996 native method.  All groups not fetched with this method are
997 foreign groups.
998
999 For instance, if the @samp{news.somewhere.edu} @acronym{NNTP} server is where
1000 you want to get your daily dosage of news from, you'd say:
1001
1002 @lisp
1003 (setq gnus-select-method '(nntp "news.somewhere.edu"))
1004 @end lisp
1005
1006 If you want to read directly from the local spool, say:
1007
1008 @lisp
1009 (setq gnus-select-method '(nnspool ""))
1010 @end lisp
1011
1012 If you can use a local spool, you probably should, as it will almost
1013 certainly be much faster.  But do not use the local spool if your
1014 server is running Leafnode (which is a simple, standalone private news
1015 server); in this case, use @code{(nntp "localhost")}.
1016
1017 @vindex gnus-nntpserver-file
1018 @cindex NNTPSERVER
1019 @cindex @acronym{NNTP} server
1020 If this variable is not set, Gnus will take a look at the
1021 @env{NNTPSERVER} environment variable.  If that variable isn't set,
1022 Gnus will see whether @code{gnus-nntpserver-file}
1023 (@file{/etc/nntpserver} by default) has any opinions on the matter.
1024 If that fails as well, Gnus will try to use the machine running Emacs
1025 as an @acronym{NNTP} server.  That's a long shot, though.
1026
1027 @vindex gnus-nntp-server
1028 If @code{gnus-nntp-server} is set, this variable will override
1029 @code{gnus-select-method}.  You should therefore set
1030 @code{gnus-nntp-server} to @code{nil}, which is what it is by default.
1031
1032 @vindex gnus-secondary-servers
1033 @vindex gnus-nntp-server
1034 You can also make Gnus prompt you interactively for the name of an
1035 @acronym{NNTP} server.  If you give a non-numerical prefix to @code{gnus}
1036 (i.e., @kbd{C-u M-x gnus}), Gnus will let you choose between the servers
1037 in the @code{gnus-secondary-servers} list (if any).  You can also just
1038 type in the name of any server you feel like visiting.  (Note that this
1039 will set @code{gnus-nntp-server}, which means that if you then @kbd{M-x
1040 gnus} later in the same Emacs session, Gnus will contact the same
1041 server.)
1042
1043 @findex gnus-group-browse-foreign-server
1044 @kindex B (Group)
1045 However, if you use one @acronym{NNTP} server regularly and are just
1046 interested in a couple of groups from a different server, you would be
1047 better served by using the @kbd{B} command in the group buffer.  It will
1048 let you have a look at what groups are available, and you can subscribe
1049 to any of the groups you want to.  This also makes @file{.newsrc}
1050 maintenance much tidier.  @xref{Foreign Groups}.
1051
1052 @vindex gnus-secondary-select-methods
1053 @c @head
1054 A slightly different approach to foreign groups is to set the
1055 @code{gnus-secondary-select-methods} variable.  The select methods
1056 listed in this variable are in many ways just as native as the
1057 @code{gnus-select-method} server.  They will also be queried for active
1058 files during startup (if that's required), and new newsgroups that
1059 appear on these servers will be subscribed (or not) just as native
1060 groups are.
1061
1062 For instance, if you use the @code{nnmbox} back end to read your mail,
1063 you would typically set this variable to
1064
1065 @lisp
1066 (setq gnus-secondary-select-methods '((nnmbox "")))
1067 @end lisp
1068
1069 Note: the @acronym{NNTP} back end stores marks in marks files
1070 (@pxref{NNTP marks}).  This feature makes it easy to share marks between
1071 several Gnus installations, but may slow down things a bit when fetching
1072 new articles.  @xref{NNTP marks}, for more information.
1073
1074
1075 @node The First Time
1076 @section The First Time
1077 @cindex first time usage
1078
1079 If no startup files exist (@pxref{Startup Files}), Gnus will try to
1080 determine what groups should be subscribed by default.
1081
1082 @vindex gnus-default-subscribed-newsgroups
1083 If the variable @code{gnus-default-subscribed-newsgroups} is set, Gnus
1084 will subscribe you to just those groups in that list, leaving the rest
1085 killed.  Your system administrator should have set this variable to
1086 something useful.
1087
1088 Since she hasn't, Gnus will just subscribe you to a few arbitrarily
1089 picked groups (i.e., @samp{*.newusers}).  (@dfn{Arbitrary} is defined
1090 here as @dfn{whatever Lars thinks you should read}.)
1091
1092 You'll also be subscribed to the Gnus documentation group, which should
1093 help you with most common problems.
1094
1095 If @code{gnus-default-subscribed-newsgroups} is @code{t}, Gnus will just
1096 use the normal functions for handling new groups, and not do anything
1097 special.
1098
1099
1100 @node The Server is Down
1101 @section The Server is Down
1102 @cindex server errors
1103
1104 If the default server is down, Gnus will understandably have some
1105 problems starting.  However, if you have some mail groups in addition to
1106 the news groups, you may want to start Gnus anyway.
1107
1108 Gnus, being the trusting sort of program, will ask whether to proceed
1109 without a native select method if that server can't be contacted.  This
1110 will happen whether the server doesn't actually exist (i.e., you have
1111 given the wrong address) or the server has just momentarily taken ill
1112 for some reason or other.  If you decide to continue and have no foreign
1113 groups, you'll find it difficult to actually do anything in the group
1114 buffer.  But, hey, that's your problem.  Blllrph!
1115
1116 @findex gnus-no-server
1117 @kindex M-x gnus-no-server
1118 @c @head
1119 If you know that the server is definitely down, or you just want to read
1120 your mail without bothering with the server at all, you can use the
1121 @code{gnus-no-server} command to start Gnus.  That might come in handy
1122 if you're in a hurry as well.  This command will not attempt to contact
1123 your primary server---instead, it will just activate all groups on level
1124 1 and 2.  (You should preferably keep no native groups on those two
1125 levels.) Also @pxref{Group Levels}.
1126
1127
1128 @node Slave Gnusae
1129 @section Slave Gnusae
1130 @cindex slave
1131
1132 You might want to run more than one Emacs with more than one Gnus at the
1133 same time.  If you are using different @file{.newsrc} files (e.g., if you
1134 are using the two different Gnusae to read from two different servers),
1135 that is no problem whatsoever.  You just do it.
1136
1137 The problem appears when you want to run two Gnusae that use the same
1138 @file{.newsrc} file.
1139
1140 To work around that problem some, we here at the Think-Tank at the Gnus
1141 Towers have come up with a new concept: @dfn{Masters} and
1142 @dfn{slaves}.  (We have applied for a patent on this concept, and have
1143 taken out a copyright on those words.  If you wish to use those words in
1144 conjunction with each other, you have to send $1 per usage instance to
1145 me.  Usage of the patent (@dfn{Master/Slave Relationships In Computer
1146 Applications}) will be much more expensive, of course.)
1147
1148 @findex gnus-slave
1149 Anyway, you start one Gnus up the normal way with @kbd{M-x gnus} (or
1150 however you do it).  Each subsequent slave Gnusae should be started with
1151 @kbd{M-x gnus-slave}.  These slaves won't save normal @file{.newsrc}
1152 files, but instead save @dfn{slave files} that contain information only
1153 on what groups have been read in the slave session.  When a master Gnus
1154 starts, it will read (and delete) these slave files, incorporating all
1155 information from them.  (The slave files will be read in the sequence
1156 they were created, so the latest changes will have precedence.)
1157
1158 Information from the slave files has, of course, precedence over the
1159 information in the normal (i.e., master) @file{.newsrc} file.
1160
1161 If the @file{.newsrc*} files have not been saved in the master when the
1162 slave starts, you may be prompted as to whether to read an auto-save
1163 file.  If you answer ``yes'', the unsaved changes to the master will be
1164 incorporated into the slave.  If you answer ``no'', the slave may see some
1165 messages as unread that have been read in the master.
1166
1167
1168
1169 @node New Groups
1170 @section New Groups
1171 @cindex new groups
1172 @cindex subscription
1173
1174 @vindex gnus-check-new-newsgroups
1175 If you are satisfied that you really never want to see any new groups,
1176 you can set @code{gnus-check-new-newsgroups} to @code{nil}.  This will
1177 also save you some time at startup.  Even if this variable is
1178 @code{nil}, you can always subscribe to the new groups just by pressing
1179 @kbd{U} in the group buffer (@pxref{Group Maintenance}).  This variable
1180 is @code{ask-server} by default.  If you set this variable to
1181 @code{always}, then Gnus will query the back ends for new groups even
1182 when you do the @kbd{g} command (@pxref{Scanning New Messages}).
1183
1184 @menu
1185 * Checking New Groups::         Determining what groups are new.
1186 * Subscription Methods::        What Gnus should do with new groups.
1187 * Filtering New Groups::        Making Gnus ignore certain new groups.
1188 @end menu
1189
1190
1191 @node Checking New Groups
1192 @subsection Checking New Groups
1193
1194 Gnus normally determines whether a group is new or not by comparing the
1195 list of groups from the active file(s) with the lists of subscribed and
1196 dead groups.  This isn't a particularly fast method.  If
1197 @code{gnus-check-new-newsgroups} is @code{ask-server}, Gnus will ask the
1198 server for new groups since the last time.  This is both faster and
1199 cheaper.  This also means that you can get rid of the list of killed
1200 groups altogether, so you may set @code{gnus-save-killed-list} to
1201 @code{nil}, which will save time both at startup, at exit, and all over.
1202 Saves disk space, too.  Why isn't this the default, then?
1203 Unfortunately, not all servers support this command.
1204
1205 I bet I know what you're thinking now: How do I find out whether my
1206 server supports @code{ask-server}?  No?  Good, because I don't have a
1207 fail-safe answer.  I would suggest just setting this variable to
1208 @code{ask-server} and see whether any new groups appear within the next
1209 few days.  If any do, then it works.  If none do, then it doesn't
1210 work.  I could write a function to make Gnus guess whether the server
1211 supports @code{ask-server}, but it would just be a guess.  So I won't.
1212 You could @code{telnet} to the server and say @code{HELP} and see
1213 whether it lists @samp{NEWGROUPS} among the commands it understands.  If
1214 it does, then it might work.  (But there are servers that lists
1215 @samp{NEWGROUPS} without supporting the function properly.)
1216
1217 This variable can also be a list of select methods.  If so, Gnus will
1218 issue an @code{ask-server} command to each of the select methods, and
1219 subscribe them (or not) using the normal methods.  This might be handy
1220 if you are monitoring a few servers for new groups.  A side effect is
1221 that startup will take much longer, so you can meditate while waiting.
1222 Use the mantra ``dingnusdingnusdingnus'' to achieve permanent bliss.
1223
1224
1225 @node Subscription Methods
1226 @subsection Subscription Methods
1227
1228 @vindex gnus-subscribe-newsgroup-method
1229 What Gnus does when it encounters a new group is determined by the
1230 @code{gnus-subscribe-newsgroup-method} variable.
1231
1232 This variable should contain a function.  This function will be called
1233 with the name of the new group as the only parameter.
1234
1235 Some handy pre-fab functions are:
1236
1237 @table @code
1238
1239 @item gnus-subscribe-zombies
1240 @vindex gnus-subscribe-zombies
1241 Make all new groups zombies.  This is the default.  You can browse the
1242 zombies later (with @kbd{A z}) and either kill them all off properly
1243 (with @kbd{S z}), or subscribe to them (with @kbd{u}).
1244
1245 @item gnus-subscribe-randomly
1246 @vindex gnus-subscribe-randomly
1247 Subscribe all new groups in arbitrary order.  This really means that all
1248 new groups will be added at ``the top'' of the group buffer.
1249
1250 @item gnus-subscribe-alphabetically
1251 @vindex gnus-subscribe-alphabetically
1252 Subscribe all new groups in alphabetical order.
1253
1254 @item gnus-subscribe-hierarchically
1255 @vindex gnus-subscribe-hierarchically
1256 Subscribe all new groups hierarchically.  The difference between this
1257 function and @code{gnus-subscribe-alphabetically} is slight.
1258 @code{gnus-subscribe-alphabetically} will subscribe new groups in a strictly
1259 alphabetical fashion, while this function will enter groups into its
1260 hierarchy.  So if you want to have the @samp{rec} hierarchy before the
1261 @samp{comp} hierarchy, this function will not mess that configuration
1262 up.  Or something like that.
1263
1264 @item gnus-subscribe-interactively
1265 @vindex gnus-subscribe-interactively
1266 Subscribe new groups interactively.  This means that Gnus will ask
1267 you about @strong{all} new groups.  The groups you choose to subscribe
1268 to will be subscribed hierarchically.
1269
1270 @item gnus-subscribe-killed
1271 @vindex gnus-subscribe-killed
1272 Kill all new groups.
1273
1274 @item gnus-subscribe-topics
1275 @vindex gnus-subscribe-topics
1276 Put the groups into the topic that has a matching @code{subscribe} topic
1277 parameter (@pxref{Topic Parameters}).  For instance, a @code{subscribe}
1278 topic parameter that looks like
1279
1280 @example
1281 "nnslashdot"
1282 @end example
1283
1284 will mean that all groups that match that regex will be subscribed under
1285 that topic.
1286
1287 If no topics match the groups, the groups will be subscribed in the
1288 top-level topic.
1289
1290 @end table
1291
1292 @vindex gnus-subscribe-hierarchical-interactive
1293 A closely related variable is
1294 @code{gnus-subscribe-hierarchical-interactive}.  (That's quite a
1295 mouthful.)  If this variable is non-@code{nil}, Gnus will ask you in a
1296 hierarchical fashion whether to subscribe to new groups or not.  Gnus
1297 will ask you for each sub-hierarchy whether you want to descend the
1298 hierarchy or not.
1299
1300 One common mistake is to set the variable a few paragraphs above
1301 (@code{gnus-subscribe-newsgroup-method}) to
1302 @code{gnus-subscribe-hierarchical-interactive}.  This is an error.  This
1303 will not work.  This is ga-ga.  So don't do it.
1304
1305
1306 @node Filtering New Groups
1307 @subsection Filtering New Groups
1308
1309 A nice and portable way to control which new newsgroups should be
1310 subscribed (or ignored) is to put an @dfn{options} line at the start of
1311 the @file{.newsrc} file.  Here's an example:
1312
1313 @example
1314 options -n !alt.all !rec.all sci.all
1315 @end example
1316
1317 @vindex gnus-subscribe-options-newsgroup-method
1318 This line obviously belongs to a serious-minded intellectual scientific
1319 person (or she may just be plain old boring), because it says that all
1320 groups that have names beginning with @samp{alt} and @samp{rec} should
1321 be ignored, and all groups with names beginning with @samp{sci} should
1322 be subscribed.  Gnus will not use the normal subscription method for
1323 subscribing these groups.
1324 @code{gnus-subscribe-options-newsgroup-method} is used instead.  This
1325 variable defaults to @code{gnus-subscribe-alphabetically}.
1326
1327 @vindex gnus-options-not-subscribe
1328 @vindex gnus-options-subscribe
1329 If you don't want to mess with your @file{.newsrc} file, you can just
1330 set the two variables @code{gnus-options-subscribe} and
1331 @code{gnus-options-not-subscribe}.  These two variables do exactly the
1332 same as the @file{.newsrc} @samp{options -n} trick.  Both are regexps,
1333 and if the new group matches the former, it will be unconditionally
1334 subscribed, and if it matches the latter, it will be ignored.
1335
1336 @vindex gnus-auto-subscribed-groups
1337 Yet another variable that meddles here is
1338 @code{gnus-auto-subscribed-groups}.  It works exactly like
1339 @code{gnus-options-subscribe}, and is therefore really superfluous,
1340 but I thought it would be nice to have two of these.  This variable is
1341 more meant for setting some ground rules, while the other variable is
1342 used more for user fiddling.  By default this variable makes all new
1343 groups that come from mail back ends (@code{nnml}, @code{nnbabyl},
1344 @code{nnfolder}, @code{nnmbox}, @code{nnmh}, and @code{nnmaildir})
1345 subscribed.  If you don't like that, just set this variable to
1346 @code{nil}.
1347
1348 New groups that match this regexp are subscribed using
1349 @code{gnus-subscribe-options-newsgroup-method}.
1350
1351
1352 @node Changing Servers
1353 @section Changing Servers
1354 @cindex changing servers
1355
1356 Sometimes it is necessary to move from one @acronym{NNTP} server to another.
1357 This happens very rarely, but perhaps you change jobs, or one server is
1358 very flaky and you want to use another.
1359
1360 Changing the server is pretty easy, right?  You just change
1361 @code{gnus-select-method} to point to the new server?
1362
1363 @emph{Wrong!}
1364
1365 Article numbers are not (in any way) kept synchronized between different
1366 @acronym{NNTP} servers, and the only way Gnus keeps track of what articles
1367 you have read is by keeping track of article numbers.  So when you
1368 change @code{gnus-select-method}, your @file{.newsrc} file becomes
1369 worthless.
1370
1371 Gnus provides a few functions to attempt to translate a @file{.newsrc}
1372 file from one server to another.  They all have one thing in
1373 common---they take a looong time to run.  You don't want to use these
1374 functions more than absolutely necessary.
1375
1376 @kindex M-x gnus-change-server
1377 @findex gnus-change-server
1378 If you have access to both servers, Gnus can request the headers for all
1379 the articles you have read and compare @code{Message-ID}s and map the
1380 article numbers of the read articles and article marks.  The @kbd{M-x
1381 gnus-change-server} command will do this for all your native groups.  It
1382 will prompt for the method you want to move to.
1383
1384 @kindex M-x gnus-group-move-group-to-server
1385 @findex gnus-group-move-group-to-server
1386 You can also move individual groups with the @kbd{M-x
1387 gnus-group-move-group-to-server} command.  This is useful if you want to
1388 move a (foreign) group from one server to another.
1389
1390 @kindex M-x gnus-group-clear-data-on-native-groups
1391 @findex gnus-group-clear-data-on-native-groups
1392 If you don't have access to both the old and new server, all your marks
1393 and read ranges have become worthless.  You can use the @kbd{M-x
1394 gnus-group-clear-data-on-native-groups} command to clear out all data
1395 that you have on your native groups.  Use with caution.
1396
1397 @kindex M-x gnus-group-clear-data
1398 @findex gnus-group-clear-data
1399 Clear the data from the current group only---nix out marks and the
1400 list of read articles (@code{gnus-group-clear-data}).
1401
1402 After changing servers, you @strong{must} move the cache hierarchy away,
1403 since the cached articles will have wrong article numbers, which will
1404 affect which articles Gnus thinks are read.
1405 @code{gnus-group-clear-data-on-native-groups} will ask you if you want
1406 to have it done automatically; for @code{gnus-group-clear-data}, you
1407 can use @kbd{M-x gnus-cache-move-cache} (but beware, it will move the
1408 cache for all groups).
1409
1410
1411 @node Startup Files
1412 @section Startup Files
1413 @cindex startup files
1414 @cindex .newsrc
1415 @cindex .newsrc.el
1416 @cindex .newsrc.eld
1417
1418 Most common Unix news readers use a shared startup file called
1419 @file{.newsrc}.  This file contains all the information about what
1420 groups are subscribed, and which articles in these groups have been
1421 read.
1422
1423 Things got a bit more complicated with @sc{gnus}.  In addition to
1424 keeping the @file{.newsrc} file updated, it also used a file called
1425 @file{.newsrc.el} for storing all the information that didn't fit into
1426 the @file{.newsrc} file.  (Actually, it also duplicated everything in
1427 the @file{.newsrc} file.)  @sc{gnus} would read whichever one of these
1428 files was the most recently saved, which enabled people to swap between
1429 @sc{gnus} and other newsreaders.
1430
1431 That was kinda silly, so Gnus went one better: In addition to the
1432 @file{.newsrc} and @file{.newsrc.el} files, Gnus also has a file called
1433 @file{.newsrc.eld}.  It will read whichever of these files that are most
1434 recent, but it will never write a @file{.newsrc.el} file.  You should
1435 never delete the @file{.newsrc.eld} file---it contains much information
1436 not stored in the @file{.newsrc} file.
1437
1438 @vindex gnus-save-newsrc-file
1439 @vindex gnus-read-newsrc-file
1440 You can turn off writing the @file{.newsrc} file by setting
1441 @code{gnus-save-newsrc-file} to @code{nil}, which means you can delete
1442 the file and save some space, as well as exiting from Gnus faster.
1443 However, this will make it impossible to use other newsreaders than
1444 Gnus.  But hey, who would want to, right?  Similarly, setting
1445 @code{gnus-read-newsrc-file} to @code{nil} makes Gnus ignore the
1446 @file{.newsrc} file and any @file{.newsrc-SERVER} files, which can be
1447 convenient if you use a different news reader occasionally, and you
1448 want to read a different subset of the available groups with that
1449 news reader.
1450
1451 @vindex gnus-save-killed-list
1452 If @code{gnus-save-killed-list} (default @code{t}) is @code{nil}, Gnus
1453 will not save the list of killed groups to the startup file.  This will
1454 save both time (when starting and quitting) and space (on disk).  It
1455 will also mean that Gnus has no record of what groups are new or old,
1456 so the automatic new groups subscription methods become meaningless.
1457 You should always set @code{gnus-check-new-newsgroups} to @code{nil} or
1458 @code{ask-server} if you set this variable to @code{nil} (@pxref{New
1459 Groups}).  This variable can also be a regular expression.  If that's
1460 the case, remove all groups that do not match this regexp before
1461 saving.  This can be useful in certain obscure situations that involve
1462 several servers where not all servers support @code{ask-server}.
1463
1464 @vindex gnus-startup-file
1465 @vindex gnus-backup-startup-file
1466 @vindex version-control
1467 The @code{gnus-startup-file} variable says where the startup files are.
1468 The default value is @file{~/.newsrc}, with the Gnus (El Dingo) startup
1469 file being whatever that one is, with a @samp{.eld} appended.
1470 If you want version control for this file, set
1471 @code{gnus-backup-startup-file}.  It respects the same values as the
1472 @code{version-control} variable.
1473
1474 @vindex gnus-save-newsrc-hook
1475 @vindex gnus-save-quick-newsrc-hook
1476 @vindex gnus-save-standard-newsrc-hook
1477 @code{gnus-save-newsrc-hook} is called before saving any of the newsrc
1478 files, while @code{gnus-save-quick-newsrc-hook} is called just before
1479 saving the @file{.newsrc.eld} file, and
1480 @code{gnus-save-standard-newsrc-hook} is called just before saving the
1481 @file{.newsrc} file.  The latter two are commonly used to turn version
1482 control on or off.  Version control is on by default when saving the
1483 startup files.  If you want to turn backup creation off, say something like:
1484
1485 @lisp
1486 (defun turn-off-backup ()
1487   (set (make-local-variable 'backup-inhibited) t))
1488
1489 (add-hook 'gnus-save-quick-newsrc-hook 'turn-off-backup)
1490 (add-hook 'gnus-save-standard-newsrc-hook 'turn-off-backup)
1491 @end lisp
1492
1493 @vindex gnus-init-file
1494 @vindex gnus-site-init-file
1495 When Gnus starts, it will read the @code{gnus-site-init-file}
1496 (@file{.../site-lisp/gnus-init} by default) and @code{gnus-init-file}
1497 (@file{~/.gnus} by default) files.  These are normal Emacs Lisp files
1498 and can be used to avoid cluttering your @file{~/.emacs} and
1499 @file{site-init} files with Gnus stuff.  Gnus will also check for files
1500 with the same names as these, but with @file{.elc} and @file{.el}
1501 suffixes.  In other words, if you have set @code{gnus-init-file} to
1502 @file{~/.gnus}, it will look for @file{~/.gnus.elc}, @file{~/.gnus.el},
1503 and finally @file{~/.gnus} (in this order).  If Emacs was invoked with
1504 the @option{-q} or @option{--no-init-file} options (@pxref{Initial
1505 Options, ,Initial Options, emacs, The Emacs Manual}), Gnus doesn't read
1506 @code{gnus-init-file}.
1507
1508
1509 @node Auto Save
1510 @section Auto Save
1511 @cindex dribble file
1512 @cindex auto-save
1513
1514 Whenever you do something that changes the Gnus data (reading articles,
1515 catching up, killing/subscribing groups), the change is added to a
1516 special @dfn{dribble buffer}.  This buffer is auto-saved the normal
1517 Emacs way.  If your Emacs should crash before you have saved the
1518 @file{.newsrc} files, all changes you have made can be recovered from
1519 this file.
1520
1521 If Gnus detects this file at startup, it will ask the user whether to
1522 read it.  The auto save file is deleted whenever the real startup file is
1523 saved.
1524
1525 @vindex gnus-use-dribble-file
1526 If @code{gnus-use-dribble-file} is @code{nil}, Gnus won't create and
1527 maintain a dribble buffer.  The default is @code{t}.
1528
1529 @vindex gnus-dribble-directory
1530 Gnus will put the dribble file(s) in @code{gnus-dribble-directory}.  If
1531 this variable is @code{nil}, which it is by default, Gnus will dribble
1532 into the directory where the @file{.newsrc} file is located.  (This is
1533 normally the user's home directory.)  The dribble file will get the same
1534 file permissions as the @file{.newsrc} file.
1535
1536 @vindex gnus-always-read-dribble-file
1537 If @code{gnus-always-read-dribble-file} is non-@code{nil}, Gnus will
1538 read the dribble file on startup without querying the user.
1539
1540
1541 @node The Active File
1542 @section The Active File
1543 @cindex active file
1544 @cindex ignored groups
1545
1546 When Gnus starts, or indeed whenever it tries to determine whether new
1547 articles have arrived, it reads the active file.  This is a very large
1548 file that lists all the active groups and articles on the server.
1549
1550 @vindex gnus-ignored-newsgroups
1551 Before examining the active file, Gnus deletes all lines that match the
1552 regexp @code{gnus-ignored-newsgroups}.  This is done primarily to reject
1553 any groups with bogus names, but you can use this variable to make Gnus
1554 ignore hierarchies you aren't ever interested in.  However, this is not
1555 recommended.  In fact, it's highly discouraged.  Instead, @pxref{New
1556 Groups} for an overview of other variables that can be used instead.
1557
1558 @c This variable is
1559 @c @code{nil} by default, and will slow down active file handling somewhat
1560 @c if you set it to anything else.
1561
1562 @vindex gnus-read-active-file
1563 @c @head
1564 The active file can be rather Huge, so if you have a slow network, you
1565 can set @code{gnus-read-active-file} to @code{nil} to prevent Gnus from
1566 reading the active file.  This variable is @code{some} by default.
1567
1568 Gnus will try to make do by getting information just on the groups that
1569 you actually subscribe to.
1570
1571 Note that if you subscribe to lots and lots of groups, setting this
1572 variable to @code{nil} will probably make Gnus slower, not faster.  At
1573 present, having this variable @code{nil} will slow Gnus down
1574 considerably, unless you read news over a 2400 baud modem.
1575
1576 This variable can also have the value @code{some}.  Gnus will then
1577 attempt to read active info only on the subscribed groups.  On some
1578 servers this is quite fast (on sparkling, brand new INN servers that
1579 support the @code{LIST ACTIVE group} command), on others this isn't fast
1580 at all.  In any case, @code{some} should be faster than @code{nil}, and
1581 is certainly faster than @code{t} over slow lines.
1582
1583 Some news servers (old versions of Leafnode and old versions of INN, for
1584 instance) do not support the @code{LIST ACTIVE group}.  For these
1585 servers, @code{nil} is probably the most efficient value for this
1586 variable.
1587
1588 If this variable is @code{nil}, Gnus will ask for group info in total
1589 lock-step, which isn't very fast.  If it is @code{some} and you use an
1590 @acronym{NNTP} server, Gnus will pump out commands as fast as it can, and
1591 read all the replies in one swoop.  This will normally result in better
1592 performance, but if the server does not support the aforementioned
1593 @code{LIST ACTIVE group} command, this isn't very nice to the server.
1594
1595 If you think that starting up Gnus takes too long, try all the three
1596 different values for this variable and see what works best for you.
1597
1598 In any case, if you use @code{some} or @code{nil}, you should definitely
1599 kill all groups that you aren't interested in to speed things up.
1600
1601 Note that this variable also affects active file retrieval from
1602 secondary select methods.
1603
1604
1605 @node Startup Variables
1606 @section Startup Variables
1607
1608 @table @code
1609
1610 @item gnus-load-hook
1611 @vindex gnus-load-hook
1612 A hook run while Gnus is being loaded.  Note that this hook will
1613 normally be run just once in each Emacs session, no matter how many
1614 times you start Gnus.
1615
1616 @item gnus-before-startup-hook
1617 @vindex gnus-before-startup-hook
1618 A hook run after starting up Gnus successfully.
1619
1620 @item gnus-startup-hook
1621 @vindex gnus-startup-hook
1622 A hook run as the very last thing after starting up Gnus
1623
1624 @item gnus-started-hook
1625 @vindex gnus-started-hook
1626 A hook that is run as the very last thing after starting up Gnus
1627 successfully.
1628
1629 @item gnus-setup-news-hook
1630 @vindex gnus-setup-news-hook
1631 A hook that is run after reading the @file{.newsrc} file(s), but before
1632 generating the group buffer.
1633
1634 @item gnus-check-bogus-newsgroups
1635 @vindex gnus-check-bogus-newsgroups
1636 If non-@code{nil}, Gnus will check for and delete all bogus groups at
1637 startup.  A @dfn{bogus group} is a group that you have in your
1638 @file{.newsrc} file, but doesn't exist on the news server.  Checking for
1639 bogus groups can take quite a while, so to save time and resources it's
1640 best to leave this option off, and do the checking for bogus groups once
1641 in a while from the group buffer instead (@pxref{Group Maintenance}).
1642
1643 @item gnus-inhibit-startup-message
1644 @vindex gnus-inhibit-startup-message
1645 If non-@code{nil}, the startup message won't be displayed.  That way,
1646 your boss might not notice as easily that you are reading news instead
1647 of doing your job.  Note that this variable is used before
1648 @file{~/.gnus.el} is loaded, so it should be set in @file{.emacs} instead.
1649
1650 @item gnus-no-groups-message
1651 @vindex gnus-no-groups-message
1652 Message displayed by Gnus when no groups are available.
1653
1654 @item gnus-play-startup-jingle
1655 @vindex gnus-play-startup-jingle
1656 If non-@code{nil}, play the Gnus jingle at startup.
1657
1658 @item gnus-startup-jingle
1659 @vindex gnus-startup-jingle
1660 Jingle to be played if the above variable is non-@code{nil}.  The
1661 default is @samp{Tuxedomoon.Jingle4.au}.
1662
1663 @end table
1664
1665
1666 @node Group Buffer
1667 @chapter Group Buffer
1668 @cindex group buffer
1669
1670 @c Alex Schroeder suggests to rearrange this as follows:
1671 @c
1672 @c <kensanata> ok, just save it for reference.  I'll go to bed in a minute.
1673 @c   1. Selecting a Group, 2. (new) Finding a Group, 3. Group Levels,
1674 @c   4. Subscription Commands, 5. Group Maneuvering, 6. Group Data,
1675 @c   7. Group Score, 8. Group Buffer Format
1676 @c <kensanata> Group Levels should have more information on levels 5 to 9.  I
1677 @c   suggest to split the 4th paragraph ("Gnus considers groups...") as follows:
1678 @c <kensanata> First, "Gnus considers groups... (default 9)."
1679 @c <kensanata> New, a table summarizing what levels 1 to 9 mean.
1680 @c <kensanata> Third, "Gnus treats subscribed ... reasons of efficiency"
1681 @c <kensanata> Then expand the next paragraph or add some more to it.
1682 @c    This short one sentence explains levels 1 and 2, therefore I understand
1683 @c    that I should keep important news at 3 and boring news at 4.
1684 @c    Say so!  Then go on to explain why I should bother with levels 6 to 9.
1685 @c    Maybe keep those that you don't want to read temporarily at 6,
1686 @c    those that you never want to read at 8, those that offend your
1687 @c    human rights at 9...
1688
1689
1690 The @dfn{group buffer} lists all (or parts) of the available groups.  It
1691 is the first buffer shown when Gnus starts, and will never be killed as
1692 long as Gnus is active.
1693
1694 @iftex
1695 @iflatex
1696 \gnusfigure{The Group Buffer}{320}{
1697 \put(75,50){\epsfig{figure=ps/group,height=9cm}}
1698 \put(120,37){\makebox(0,0)[t]{Buffer name}}
1699 \put(120,38){\vector(1,2){10}}
1700 \put(40,60){\makebox(0,0)[r]{Mode line}}
1701 \put(40,58){\vector(1,0){30}}
1702 \put(200,28){\makebox(0,0)[t]{Native select method}}
1703 \put(200,26){\vector(-1,2){15}}
1704 }
1705 @end iflatex
1706 @end iftex
1707
1708 @menu
1709 * Group Buffer Format::         Information listed and how you can change it.
1710 * Group Maneuvering::           Commands for moving in the group buffer.
1711 * Selecting a Group::           Actually reading news.
1712 * Subscription Commands::       Unsubscribing, killing, subscribing.
1713 * Group Data::                  Changing the info for a group.
1714 * Group Levels::                Levels? What are those, then?
1715 * Group Score::                 A mechanism for finding out what groups you like.
1716 * Marking Groups::              You can mark groups for later processing.
1717 * Foreign Groups::              Creating and editing groups.
1718 * Group Parameters::            Each group may have different parameters set.
1719 * Listing Groups::              Gnus can list various subsets of the groups.
1720 * Sorting Groups::              Re-arrange the group order.
1721 * Group Maintenance::           Maintaining a tidy @file{.newsrc} file.
1722 * Browse Foreign Server::       You can browse a server.  See what it has to offer.
1723 * Exiting Gnus::                Stop reading news and get some work done.
1724 * Group Topics::                A folding group mode divided into topics.
1725 * Misc Group Stuff::            Other stuff that you can to do.
1726 @end menu
1727
1728
1729 @node Group Buffer Format
1730 @section Group Buffer Format
1731
1732 @menu
1733 * Group Line Specification::    Deciding how the group buffer is to look.
1734 * Group Mode Line Specification::  The group buffer mode line.
1735 * Group Highlighting::          Having nice colors in the group buffer.
1736 @end menu
1737
1738
1739 @node Group Line Specification
1740 @subsection Group Line Specification
1741 @cindex group buffer format
1742
1743 The default format of the group buffer is nice and dull, but you can
1744 make it as exciting and ugly as you feel like.
1745
1746 Here's a couple of example group lines:
1747
1748 @example
1749      25: news.announce.newusers
1750  *    0: alt.fan.andrea-dworkin
1751 @end example
1752
1753 Quite simple, huh?
1754
1755 You can see that there are 25 unread articles in
1756 @samp{news.announce.newusers}.  There are no unread articles, but some
1757 ticked articles, in @samp{alt.fan.andrea-dworkin} (see that little
1758 asterisk at the beginning of the line?).
1759
1760 @vindex gnus-group-line-format
1761 You can change that format to whatever you want by fiddling with the
1762 @code{gnus-group-line-format} variable.  This variable works along the
1763 lines of a @code{format} specification, which is pretty much the same as
1764 a @code{printf} specifications, for those of you who use (feh!) C.
1765 @xref{Formatting Variables}.
1766
1767 @samp{%M%S%5y:%B%(%g%)\n} is the value that produced those lines above.
1768
1769 There should always be a colon on the line; the cursor always moves to
1770 the colon after performing an operation.  @xref{Positioning
1771 Point}.  Nothing else is required---not even the group name.  All
1772 displayed text is just window dressing, and is never examined by Gnus.
1773 Gnus stores all real information it needs using text properties.
1774
1775 (Note that if you make a really strange, wonderful, spreadsheet-like
1776 layout, everybody will believe you are hard at work with the accounting
1777 instead of wasting time reading news.)
1778
1779 Here's a list of all available format characters:
1780
1781 @table @samp
1782
1783 @item M
1784 An asterisk if the group only has marked articles.
1785
1786 @item S
1787 Whether the group is subscribed.
1788
1789 @item L
1790 Level of subscribedness.
1791
1792 @item N
1793 Number of unread articles.
1794
1795 @item I
1796 Number of dormant articles.
1797
1798 @item T
1799 Number of ticked articles.
1800
1801 @item R
1802 Number of read articles.
1803
1804 @item U
1805 Number of unseen articles.
1806
1807 @item t
1808 Estimated total number of articles.  (This is really @var{max-number}
1809 minus @var{min-number} plus 1.)
1810
1811 Gnus uses this estimation because the @acronym{NNTP} protocol provides
1812 efficient access to @var{max-number} and @var{min-number} but getting
1813 the true unread message count is not possible efficiently.  For
1814 hysterical raisins, even the mail back ends, where the true number of
1815 unread messages might be available efficiently, use the same limited
1816 interface.  To remove this restriction from Gnus means that the back
1817 end interface has to be changed, which is not an easy job.  If you
1818 want to work on this, please contact the Gnus mailing list.
1819
1820 @item y
1821 Number of unread, unticked, non-dormant articles.
1822
1823 @item i
1824 Number of ticked and dormant articles.
1825
1826 @item g
1827 Full group name.
1828
1829 @item G
1830 Group name.
1831
1832 @item C
1833 Group comment (@pxref{Group Parameters}) or group name if there is no
1834 comment element in the group parameters.
1835
1836 @item D
1837 Newsgroup description.  You need to read the group descriptions
1838 before these will appear, and to do that, you either have to set
1839 @code{gnus-read-active-file} or use the group buffer @kbd{M-d}
1840 command.
1841
1842 @item o
1843 @samp{m} if moderated.
1844
1845 @item O
1846 @samp{(m)} if moderated.
1847
1848 @item s
1849 Select method.
1850
1851 @item B
1852 If the summary buffer for the group is open or not.
1853
1854 @item n
1855 Select from where.
1856
1857 @item z
1858 A string that looks like @samp{<%s:%n>} if a foreign select method is
1859 used.
1860
1861 @item P
1862 Indentation based on the level of the topic (@pxref{Group Topics}).
1863
1864 @item c
1865 @vindex gnus-group-uncollapsed-levels
1866 Short (collapsed) group name.  The @code{gnus-group-uncollapsed-levels}
1867 variable says how many levels to leave at the end of the group name.
1868 The default is 1---this will mean that group names like
1869 @samp{gnu.emacs.gnus} will be shortened to @samp{g.e.gnus}.
1870
1871 @item m
1872 @vindex gnus-new-mail-mark
1873 @cindex %
1874 @samp{%} (@code{gnus-new-mail-mark}) if there has arrived new mail to
1875 the group lately.
1876
1877 @item p
1878 @samp{#} (@code{gnus-process-mark}) if the group is process marked.
1879
1880 @item d
1881 A string that says when you last read the group (@pxref{Group
1882 Timestamp}).
1883
1884 @item F
1885 The disk space used by the articles fetched by both the cache and
1886 agent.  The value is automatically scaled to bytes(B), kilobytes(K),
1887 megabytes(M), or gigabytes(G) to minimize the column width.  A format
1888 of %7F is sufficient for a fixed-width column.
1889
1890 @item u
1891 User defined specifier.  The next character in the format string should
1892 be a letter.  Gnus will call the function
1893 @code{gnus-user-format-function-}@samp{X}, where @samp{X} is the letter
1894 following @samp{%u}.  The function will be passed a single dummy
1895 parameter as argument.  The function should return a string, which will
1896 be inserted into the buffer just like information from any other
1897 specifier.
1898 @end table
1899
1900 @cindex *
1901 All the ``number-of'' specs will be filled with an asterisk (@samp{*})
1902 if no info is available---for instance, if it is a non-activated foreign
1903 group, or a bogus native group.
1904
1905
1906 @node Group Mode Line Specification
1907 @subsection Group Mode Line Specification
1908 @cindex group mode line
1909
1910 @vindex gnus-group-mode-line-format
1911 The mode line can be changed by setting
1912 @code{gnus-group-mode-line-format} (@pxref{Mode Line Formatting}).  It
1913 doesn't understand that many format specifiers:
1914
1915 @table @samp
1916 @item S
1917 The native news server.
1918 @item M
1919 The native select method.
1920 @end table
1921
1922
1923 @node Group Highlighting
1924 @subsection Group Highlighting
1925 @cindex highlighting
1926 @cindex group highlighting
1927
1928 @vindex gnus-group-highlight
1929 Highlighting in the group buffer is controlled by the
1930 @code{gnus-group-highlight} variable.  This is an alist with elements
1931 that look like @code{(@var{form} . @var{face})}.  If @var{form} evaluates to
1932 something non-@code{nil}, the @var{face} will be used on the line.
1933
1934 Here's an example value for this variable that might look nice if the
1935 background is dark:
1936
1937 @lisp
1938 (cond (window-system
1939        (setq custom-background-mode 'light)
1940        (defface my-group-face-1
1941          '((t (:foreground "Red" :bold t))) "First group face")
1942        (defface my-group-face-2
1943          '((t (:foreground "DarkSeaGreen4" :bold t)))
1944          "Second group face")
1945        (defface my-group-face-3
1946          '((t (:foreground "Green4" :bold t))) "Third group face")
1947        (defface my-group-face-4
1948          '((t (:foreground "SteelBlue" :bold t))) "Fourth group face")
1949        (defface my-group-face-5
1950          '((t (:foreground "Blue" :bold t))) "Fifth group face")))
1951
1952 (setq gnus-group-highlight
1953       '(((> unread 200) . my-group-face-1)
1954         ((and (< level 3) (zerop unread)) . my-group-face-2)
1955         ((< level 3) . my-group-face-3)
1956         ((zerop unread) . my-group-face-4)
1957         (t . my-group-face-5)))
1958 @end lisp
1959
1960 Also @pxref{Faces and Fonts}.
1961
1962 Variables that are dynamically bound when the forms are evaluated
1963 include:
1964
1965 @table @code
1966 @item group
1967 The group name.
1968 @item unread
1969 The number of unread articles in the group.
1970 @item method
1971 The select method.
1972 @item mailp
1973 Whether the group is a mail group.
1974 @item level
1975 The level of the group.
1976 @item score
1977 The score of the group.
1978 @item ticked
1979 The number of ticked articles in the group.
1980 @item total
1981 The total number of articles in the group.  Or rather,
1982 @var{max-number} minus @var{min-number} plus one.
1983 @item topic
1984 When using the topic minor mode, this variable is bound to the current
1985 topic being inserted.
1986 @end table
1987
1988 When the forms are @code{eval}ed, point is at the beginning of the line
1989 of the group in question, so you can use many of the normal Gnus
1990 functions for snarfing info on the group.
1991
1992 @vindex gnus-group-update-hook
1993 @findex gnus-group-highlight-line
1994 @code{gnus-group-update-hook} is called when a group line is changed.
1995 It will not be called when @code{gnus-visual} is @code{nil}.  This hook
1996 calls @code{gnus-group-highlight-line} by default.
1997
1998
1999 @node Group Maneuvering
2000 @section Group Maneuvering
2001 @cindex group movement
2002
2003 All movement commands understand the numeric prefix and will behave as
2004 expected, hopefully.
2005
2006 @table @kbd
2007
2008 @item n
2009 @kindex n (Group)
2010 @findex gnus-group-next-unread-group
2011 Go to the next group that has unread articles
2012 (@code{gnus-group-next-unread-group}).
2013
2014 @item p
2015 @itemx DEL
2016 @kindex DEL (Group)
2017 @kindex p (Group)
2018 @findex gnus-group-prev-unread-group
2019 Go to the previous group that has unread articles
2020 (@code{gnus-group-prev-unread-group}).
2021
2022 @item N
2023 @kindex N (Group)
2024 @findex gnus-group-next-group
2025 Go to the next group (@code{gnus-group-next-group}).
2026
2027 @item P
2028 @kindex P (Group)
2029 @findex gnus-group-prev-group
2030 Go to the previous group (@code{gnus-group-prev-group}).
2031
2032 @item M-n
2033 @kindex M-n (Group)
2034 @findex gnus-group-next-unread-group-same-level
2035 Go to the next unread group on the same (or lower) level
2036 (@code{gnus-group-next-unread-group-same-level}).
2037
2038 @item M-p
2039 @kindex M-p (Group)
2040 @findex gnus-group-prev-unread-group-same-level
2041 Go to the previous unread group on the same (or lower) level
2042 (@code{gnus-group-prev-unread-group-same-level}).
2043 @end table
2044
2045 Three commands for jumping to groups:
2046
2047 @table @kbd
2048
2049 @item j
2050 @kindex j (Group)
2051 @findex gnus-group-jump-to-group
2052 Jump to a group (and make it visible if it isn't already)
2053 (@code{gnus-group-jump-to-group}).  Killed groups can be jumped to, just
2054 like living groups.
2055
2056 @item ,
2057 @kindex , (Group)
2058 @findex gnus-group-best-unread-group
2059 Jump to the unread group with the lowest level
2060 (@code{gnus-group-best-unread-group}).
2061
2062 @item .
2063 @kindex . (Group)
2064 @findex gnus-group-first-unread-group
2065 Jump to the first group with unread articles
2066 (@code{gnus-group-first-unread-group}).
2067 @end table
2068
2069 @vindex gnus-group-goto-unread
2070 If @code{gnus-group-goto-unread} is @code{nil}, all the movement
2071 commands will move to the next group, not the next unread group.  Even
2072 the commands that say they move to the next unread group.  The default
2073 is @code{t}.
2074
2075
2076 @node Selecting a Group
2077 @section Selecting a Group
2078 @cindex group selection
2079
2080 @table @kbd
2081
2082 @item SPACE
2083 @kindex SPACE (Group)
2084 @findex gnus-group-read-group
2085 Select the current group, switch to the summary buffer and display the
2086 first unread article (@code{gnus-group-read-group}).  If there are no
2087 unread articles in the group, or if you give a non-numerical prefix to
2088 this command, Gnus will offer to fetch all the old articles in this
2089 group from the server.  If you give a numerical prefix @var{n}, @var{n}
2090 determines the number of articles Gnus will fetch.  If @var{n} is
2091 positive, Gnus fetches the @var{n} newest articles, if @var{n} is
2092 negative, Gnus fetches the @code{abs(@var{n})} oldest articles.
2093
2094 Thus, @kbd{SPC} enters the group normally, @kbd{C-u SPC} offers old
2095 articles, @kbd{C-u 4 2 SPC} fetches the 42 newest articles, and @kbd{C-u
2096 - 4 2 SPC} fetches the 42 oldest ones.
2097
2098 When you are in the group (in the Summary buffer), you can type
2099 @kbd{M-g} to fetch new articles, or @kbd{C-u M-g} to also show the old
2100 ones.
2101
2102 @item RET
2103 @kindex RET (Group)
2104 @findex gnus-group-select-group
2105 Select the current group and switch to the summary buffer
2106 (@code{gnus-group-select-group}).  Takes the same arguments as
2107 @code{gnus-group-read-group}---the only difference is that this command
2108 does not display the first unread article automatically upon group
2109 entry.
2110
2111 @item M-RET
2112 @kindex M-RET (Group)
2113 @findex gnus-group-quick-select-group
2114 This does the same as the command above, but tries to do it with the
2115 minimum amount of fuzz (@code{gnus-group-quick-select-group}).  No
2116 scoring/killing will be performed, there will be no highlights and no
2117 expunging.  This might be useful if you're in a real hurry and have to
2118 enter some humongous group.  If you give a 0 prefix to this command
2119 (i.e., @kbd{0 M-RET}), Gnus won't even generate the summary buffer,
2120 which is useful if you want to toggle threading before generating the
2121 summary buffer (@pxref{Summary Generation Commands}).
2122
2123 @item M-SPACE
2124 @kindex M-SPACE (Group)
2125 @findex gnus-group-visible-select-group
2126 This is yet one more command that does the same as the @kbd{RET}
2127 command, but this one does it without expunging and hiding dormants
2128 (@code{gnus-group-visible-select-group}).
2129
2130 @item C-M-RET
2131 @kindex C-M-RET (Group)
2132 @findex gnus-group-select-group-ephemerally
2133 Finally, this command selects the current group ephemerally without
2134 doing any processing of its contents
2135 (@code{gnus-group-select-group-ephemerally}).  Even threading has been
2136 turned off.  Everything you do in the group after selecting it in this
2137 manner will have no permanent effects.
2138
2139 @end table
2140
2141 @vindex gnus-large-newsgroup
2142 The @code{gnus-large-newsgroup} variable says what Gnus should
2143 consider to be a big group.  If it is @code{nil}, no groups are
2144 considered big.  The default value is 200.  If the group has more
2145 (unread and/or ticked) articles than this, Gnus will query the user
2146 before entering the group.  The user can then specify how many
2147 articles should be fetched from the server.  If the user specifies a
2148 negative number (@var{-n}), the @var{n} oldest articles will be
2149 fetched.  If it is positive, the @var{n} articles that have arrived
2150 most recently will be fetched.
2151
2152 @vindex gnus-large-ephemeral-newsgroup
2153 @code{gnus-large-ephemeral-newsgroup} is the same as
2154 @code{gnus-large-newsgroup}, but is only used for ephemeral
2155 newsgroups.
2156
2157 @vindex gnus-select-group-hook
2158 @vindex gnus-auto-select-first
2159 @vindex gnus-auto-select-subject
2160 If @code{gnus-auto-select-first} is non-@code{nil}, select an article
2161 automatically when entering a group with the @kbd{SPACE} command.
2162 Which article this is is controlled by the
2163 @code{gnus-auto-select-subject} variable.  Valid values for this
2164 variable is:
2165
2166 @table @code
2167
2168 @item unread
2169 Place point on the subject line of the first unread article.
2170
2171 @item first
2172 Place point on the subject line of the first article.
2173
2174 @item unseen
2175 Place point on the subject line of the first unseen article.
2176
2177 @item unseen-or-unread
2178 Place point on the subject line of the first unseen article, and if
2179 there is no such article, place point on the subject line of the first
2180 unread article.
2181
2182 @item best
2183 Place point on the subject line of the highest-scored unread article.
2184
2185 @end table
2186
2187 This variable can also be a function.  In that case, that function
2188 will be called to place point on a subject line.
2189
2190 If you want to prevent automatic selection in some group (say, in a
2191 binary group with Huge articles) you can set the
2192 @code{gnus-auto-select-first} variable to @code{nil} in
2193 @code{gnus-select-group-hook}, which is called when a group is
2194 selected.
2195
2196
2197 @node Subscription Commands
2198 @section Subscription Commands
2199 @cindex subscription
2200
2201 @table @kbd
2202
2203 @item S t
2204 @itemx u
2205 @kindex S t (Group)
2206 @kindex u (Group)
2207 @findex gnus-group-unsubscribe-current-group
2208 @c @icon{gnus-group-unsubscribe}
2209 Toggle subscription to the current group
2210 (@code{gnus-group-unsubscribe-current-group}).
2211
2212 @item S s
2213 @itemx U
2214 @kindex S s (Group)
2215 @kindex U (Group)
2216 @findex gnus-group-unsubscribe-group
2217 Prompt for a group to subscribe, and then subscribe it.  If it was
2218 subscribed already, unsubscribe it instead
2219 (@code{gnus-group-unsubscribe-group}).
2220
2221 @item S k
2222 @itemx C-k
2223 @kindex S k (Group)
2224 @kindex C-k (Group)
2225 @findex gnus-group-kill-group
2226 @c @icon{gnus-group-kill-group}
2227 Kill the current group (@code{gnus-group-kill-group}).
2228
2229 @item S y
2230 @itemx C-y
2231 @kindex S y (Group)
2232 @kindex C-y (Group)
2233 @findex gnus-group-yank-group
2234 Yank the last killed group (@code{gnus-group-yank-group}).
2235
2236 @item C-x C-t
2237 @kindex C-x C-t (Group)
2238 @findex gnus-group-transpose-groups
2239 Transpose two groups (@code{gnus-group-transpose-groups}).  This isn't
2240 really a subscription command, but you can use it instead of a
2241 kill-and-yank sequence sometimes.
2242
2243 @item S w
2244 @itemx C-w
2245 @kindex S w (Group)
2246 @kindex C-w (Group)
2247 @findex gnus-group-kill-region
2248 Kill all groups in the region (@code{gnus-group-kill-region}).
2249
2250 @item S z
2251 @kindex S z (Group)
2252 @findex gnus-group-kill-all-zombies
2253 Kill all zombie groups (@code{gnus-group-kill-all-zombies}).
2254
2255 @item S C-k
2256 @kindex S C-k (Group)
2257 @findex gnus-group-kill-level
2258 Kill all groups on a certain level (@code{gnus-group-kill-level}).
2259 These groups can't be yanked back after killing, so this command should
2260 be used with some caution.  The only time where this command comes in
2261 really handy is when you have a @file{.newsrc} with lots of unsubscribed
2262 groups that you want to get rid off.  @kbd{S C-k} on level 7 will
2263 kill off all unsubscribed groups that do not have message numbers in the
2264 @file{.newsrc} file.
2265
2266 @end table
2267
2268 Also @pxref{Group Levels}.
2269
2270
2271 @node Group Data
2272 @section Group Data
2273
2274 @table @kbd
2275
2276 @item c
2277 @kindex c (Group)
2278 @findex gnus-group-catchup-current
2279 @vindex gnus-group-catchup-group-hook
2280 @c @icon{gnus-group-catchup-current}
2281 Mark all unticked articles in this group as read
2282 (@code{gnus-group-catchup-current}).
2283 @code{gnus-group-catchup-group-hook} is called when catching up a group from
2284 the group buffer.
2285
2286 @item C
2287 @kindex C (Group)
2288 @findex gnus-group-catchup-current-all
2289 Mark all articles in this group, even the ticked ones, as read
2290 (@code{gnus-group-catchup-current-all}).
2291
2292 @item M-c
2293 @kindex M-c (Group)
2294 @findex gnus-group-clear-data
2295 Clear the data from the current group---nix out marks and the list of
2296 read articles (@code{gnus-group-clear-data}).
2297
2298 @item M-x gnus-group-clear-data-on-native-groups
2299 @kindex M-x gnus-group-clear-data-on-native-groups
2300 @findex gnus-group-clear-data-on-native-groups
2301 If you have switched from one @acronym{NNTP} server to another, all your marks
2302 and read ranges have become worthless.  You can use this command to
2303 clear out all data that you have on your native groups.  Use with
2304 caution.
2305
2306 @end table
2307
2308
2309 @node Group Levels
2310 @section Group Levels
2311 @cindex group level
2312 @cindex level
2313
2314 All groups have a level of @dfn{subscribedness}.  For instance, if a
2315 group is on level 2, it is more subscribed than a group on level 5.  You
2316 can ask Gnus to just list groups on a given level or lower
2317 (@pxref{Listing Groups}), or to just check for new articles in groups on
2318 a given level or lower (@pxref{Scanning New Messages}).
2319
2320 Remember:  The higher the level of the group, the less important it is.
2321
2322 @table @kbd
2323
2324 @item S l
2325 @kindex S l (Group)
2326 @findex gnus-group-set-current-level
2327 Set the level of the current group.  If a numeric prefix is given, the
2328 next @var{n} groups will have their levels set.  The user will be
2329 prompted for a level.
2330 @end table
2331
2332 @vindex gnus-level-killed
2333 @vindex gnus-level-zombie
2334 @vindex gnus-level-unsubscribed
2335 @vindex gnus-level-subscribed
2336 Gnus considers groups from levels 1 to
2337 @code{gnus-level-subscribed} (inclusive) (default 5) to be subscribed,
2338 @code{gnus-level-subscribed} (exclusive) and
2339 @code{gnus-level-unsubscribed} (inclusive) (default 7) to be
2340 unsubscribed, @code{gnus-level-zombie} to be zombies (walking dead)
2341 (default 8) and @code{gnus-level-killed} to be killed (completely dead)
2342 (default 9).  Gnus treats subscribed and unsubscribed groups exactly the
2343 same, but zombie and killed groups have no information on what articles
2344 you have read, etc, stored.  This distinction between dead and living
2345 groups isn't done because it is nice or clever, it is done purely for
2346 reasons of efficiency.
2347
2348 It is recommended that you keep all your mail groups (if any) on quite
2349 low levels (e.g. 1 or 2).
2350
2351 Maybe the following description of the default behavior of Gnus helps to
2352 understand what these levels are all about.  By default, Gnus shows you
2353 subscribed nonempty groups, but by hitting @kbd{L} you can have it show
2354 empty subscribed groups and unsubscribed groups, too.  Type @kbd{l} to
2355 go back to showing nonempty subscribed groups again.  Thus, unsubscribed
2356 groups are hidden, in a way.
2357
2358 Zombie and killed groups are similar to unsubscribed groups in that they
2359 are hidden by default.  But they are different from subscribed and
2360 unsubscribed groups in that Gnus doesn't ask the news server for
2361 information (number of messages, number of unread messages) on zombie
2362 and killed groups.  Normally, you use @kbd{C-k} to kill the groups you
2363 aren't interested in.  If most groups are killed, Gnus is faster.
2364
2365 Why does Gnus distinguish between zombie and killed groups?  Well, when
2366 a new group arrives on the server, Gnus by default makes it a zombie
2367 group.  This means that you are normally not bothered with new groups,
2368 but you can type @kbd{A z} to get a list of all new groups.  Subscribe
2369 the ones you like and kill the ones you don't want.  (@kbd{A k} shows a
2370 list of killed groups.)
2371
2372 If you want to play with the level variables, you should show some care.
2373 Set them once, and don't touch them ever again.  Better yet, don't touch
2374 them at all unless you know exactly what you're doing.
2375
2376 @vindex gnus-level-default-unsubscribed
2377 @vindex gnus-level-default-subscribed
2378 Two closely related variables are @code{gnus-level-default-subscribed}
2379 (default 3) and @code{gnus-level-default-unsubscribed} (default 6),
2380 which are the levels that new groups will be put on if they are
2381 (un)subscribed.  These two variables should, of course, be inside the
2382 relevant valid ranges.
2383
2384 @vindex gnus-keep-same-level
2385 If @code{gnus-keep-same-level} is non-@code{nil}, some movement commands
2386 will only move to groups of the same level (or lower).  In
2387 particular, going from the last article in one group to the next group
2388 will go to the next group of the same level (or lower).  This might be
2389 handy if you want to read the most important groups before you read the
2390 rest.
2391
2392 If this variable is @code{best}, Gnus will make the next newsgroup the
2393 one with the best level.
2394
2395 @vindex gnus-group-default-list-level
2396 All groups with a level less than or equal to
2397 @code{gnus-group-default-list-level} will be listed in the group buffer
2398 by default.
2399
2400 @vindex gnus-group-list-inactive-groups
2401 If @code{gnus-group-list-inactive-groups} is non-@code{nil}, non-active
2402 groups will be listed along with the unread groups.  This variable is
2403 @code{t} by default.  If it is @code{nil}, inactive groups won't be
2404 listed.
2405
2406 @vindex gnus-group-use-permanent-levels
2407 If @code{gnus-group-use-permanent-levels} is non-@code{nil}, once you
2408 give a level prefix to @kbd{g} or @kbd{l}, all subsequent commands will
2409 use this level as the ``work'' level.
2410
2411 @vindex gnus-activate-level
2412 Gnus will normally just activate (i. e., query the server about) groups
2413 on level @code{gnus-activate-level} or less.  If you don't want to
2414 activate unsubscribed groups, for instance, you might set this variable
2415 to 5.  The default is 6.
2416
2417
2418 @node Group Score
2419 @section Group Score
2420 @cindex group score
2421 @cindex group rank
2422 @cindex rank
2423
2424 You would normally keep important groups on high levels, but that scheme
2425 is somewhat restrictive.  Don't you wish you could have Gnus sort the
2426 group buffer according to how often you read groups, perhaps?  Within
2427 reason?
2428
2429 This is what @dfn{group score} is for.  You can have Gnus assign a score
2430 to each group through the mechanism described below.  You can then sort
2431 the group buffer based on this score.  Alternatively, you can sort on
2432 score and then level.  (Taken together, the level and the score is
2433 called the @dfn{rank} of the group.  A group that is on level 4 and has
2434 a score of 1 has a higher rank than a group on level 5 that has a score
2435 of 300.  (The level is the most significant part and the score is the
2436 least significant part.))
2437
2438 @findex gnus-summary-bubble-group
2439 If you want groups you read often to get higher scores than groups you
2440 read seldom you can add the @code{gnus-summary-bubble-group} function to
2441 the @code{gnus-summary-exit-hook} hook.  This will result (after
2442 sorting) in a bubbling sort of action.  If you want to see that in
2443 action after each summary exit, you can add
2444 @code{gnus-group-sort-groups-by-rank} or
2445 @code{gnus-group-sort-groups-by-score} to the same hook, but that will
2446 slow things down somewhat.
2447
2448
2449 @node Marking Groups
2450 @section Marking Groups
2451 @cindex marking groups
2452
2453 If you want to perform some command on several groups, and they appear
2454 subsequently in the group buffer, you would normally just give a
2455 numerical prefix to the command.  Most group commands will then do your
2456 bidding on those groups.
2457
2458 However, if the groups are not in sequential order, you can still
2459 perform a command on several groups.  You simply mark the groups first
2460 with the process mark and then execute the command.
2461
2462 @table @kbd
2463
2464 @item #
2465 @kindex # (Group)
2466 @itemx M m
2467 @kindex M m (Group)
2468 @findex gnus-group-mark-group
2469 Set the mark on the current group (@code{gnus-group-mark-group}).
2470
2471 @item M-#
2472 @kindex M-# (Group)
2473 @itemx M u
2474 @kindex M u (Group)
2475 @findex gnus-group-unmark-group
2476 Remove the mark from the current group
2477 (@code{gnus-group-unmark-group}).
2478
2479 @item M U
2480 @kindex M U (Group)
2481 @findex gnus-group-unmark-all-groups
2482 Remove the mark from all groups (@code{gnus-group-unmark-all-groups}).
2483
2484 @item M w
2485 @kindex M w (Group)
2486 @findex gnus-group-mark-region
2487 Mark all groups between point and mark (@code{gnus-group-mark-region}).
2488
2489 @item M b
2490 @kindex M b (Group)
2491 @findex gnus-group-mark-buffer
2492 Mark all groups in the buffer (@code{gnus-group-mark-buffer}).
2493
2494 @item M r
2495 @kindex M r (Group)
2496 @findex gnus-group-mark-regexp
2497 Mark all groups that match some regular expression
2498 (@code{gnus-group-mark-regexp}).
2499 @end table
2500
2501 Also @pxref{Process/Prefix}.
2502
2503 @findex gnus-group-universal-argument
2504 If you want to execute some command on all groups that have been marked
2505 with the process mark, you can use the @kbd{M-&}
2506 (@code{gnus-group-universal-argument}) command.  It will prompt you for
2507 the command to be executed.
2508
2509
2510 @node Foreign Groups
2511 @section Foreign Groups
2512 @cindex foreign groups
2513
2514 Below are some group mode commands for making and editing general foreign
2515 groups, as well as commands to ease the creation of a few
2516 special-purpose groups.  All these commands insert the newly created
2517 groups under point---@code{gnus-subscribe-newsgroup-method} is not
2518 consulted.
2519
2520 @table @kbd
2521
2522 @item G m
2523 @kindex G m (Group)
2524 @findex gnus-group-make-group
2525 @cindex making groups
2526 Make a new group (@code{gnus-group-make-group}).  Gnus will prompt you
2527 for a name, a method and possibly an @dfn{address}.  For an easier way
2528 to subscribe to @acronym{NNTP} groups (@pxref{Browse Foreign Server}).
2529
2530 @item G M
2531 @kindex G M (Group)
2532 @findex gnus-group-read-ephemeral-group
2533 Make an ephemeral group (@code{gnus-group-read-ephemeral-group}).  Gnus
2534 will prompt you for a name, a method and an @dfn{address}.
2535
2536 @item G r
2537 @kindex G r (Group)
2538 @findex gnus-group-rename-group
2539 @cindex renaming groups
2540 Rename the current group to something else
2541 (@code{gnus-group-rename-group}).  This is valid only on some
2542 groups---mail groups mostly.  This command might very well be quite slow
2543 on some back ends.
2544
2545 @item G c
2546 @kindex G c (Group)
2547 @cindex customizing
2548 @findex gnus-group-customize
2549 Customize the group parameters (@code{gnus-group-customize}).
2550
2551 @item G e
2552 @kindex G e (Group)
2553 @findex gnus-group-edit-group-method
2554 @cindex renaming groups
2555 Enter a buffer where you can edit the select method of the current
2556 group (@code{gnus-group-edit-group-method}).
2557
2558 @item G p
2559 @kindex G p (Group)
2560 @findex gnus-group-edit-group-parameters
2561 Enter a buffer where you can edit the group parameters
2562 (@code{gnus-group-edit-group-parameters}).
2563
2564 @item G E
2565 @kindex G E (Group)
2566 @findex gnus-group-edit-group
2567 Enter a buffer where you can edit the group info
2568 (@code{gnus-group-edit-group}).
2569
2570 @item G d
2571 @kindex G d (Group)
2572 @findex gnus-group-make-directory-group
2573 @cindex nndir
2574 Make a directory group (@pxref{Directory Groups}).  You will be prompted
2575 for a directory name (@code{gnus-group-make-directory-group}).
2576
2577 @item G h
2578 @kindex G h (Group)
2579 @cindex help group
2580 @findex gnus-group-make-help-group
2581 Make the Gnus help group (@code{gnus-group-make-help-group}).
2582
2583 @item G a
2584 @kindex G a (Group)
2585 @cindex (ding) archive
2586 @cindex archive group
2587 @findex gnus-group-make-archive-group
2588 @vindex gnus-group-archive-directory
2589 @vindex gnus-group-recent-archive-directory
2590 Make a Gnus archive group (@code{gnus-group-make-archive-group}).  By
2591 default a group pointing to the most recent articles will be created
2592 (@code{gnus-group-recent-archive-directory}), but given a prefix, a full
2593 group will be created from @code{gnus-group-archive-directory}.
2594
2595 @item G k
2596 @kindex G k (Group)
2597 @findex gnus-group-make-kiboze-group
2598 @cindex nnkiboze
2599 Make a kiboze group.  You will be prompted for a name, for a regexp to
2600 match groups to be ``included'' in the kiboze group, and a series of
2601 strings to match on headers (@code{gnus-group-make-kiboze-group}).
2602 @xref{Kibozed Groups}.
2603
2604 @item G D
2605 @kindex G D (Group)
2606 @findex gnus-group-enter-directory
2607 @cindex nneething
2608 Read an arbitrary directory as if it were a newsgroup with the
2609 @code{nneething} back end (@code{gnus-group-enter-directory}).
2610 @xref{Anything Groups}.
2611
2612 @item G f
2613 @kindex G f (Group)
2614 @findex gnus-group-make-doc-group
2615 @cindex ClariNet Briefs
2616 @cindex nndoc
2617 Make a group based on some file or other
2618 (@code{gnus-group-make-doc-group}).  If you give a prefix to this
2619 command, you will be prompted for a file name and a file type.
2620 Currently supported types are @code{mbox}, @code{babyl},
2621 @code{digest}, @code{news}, @code{rnews}, @code{mmdf}, @code{forward},
2622 @code{rfc934}, @code{rfc822-forward}, @code{mime-parts},
2623 @code{standard-digest}, @code{slack-digest}, @code{clari-briefs},
2624 @code{nsmail}, @code{outlook}, @code{oe-dbx}, and @code{mailman}.  If
2625 you run this command without a prefix, Gnus will guess at the file
2626 type.  @xref{Document Groups}.
2627
2628 @item G u
2629 @kindex G u (Group)
2630 @vindex gnus-useful-groups
2631 @findex gnus-group-make-useful-group
2632 Create one of the groups mentioned in @code{gnus-useful-groups}
2633 (@code{gnus-group-make-useful-group}).
2634
2635 @item G w
2636 @kindex G w (Group)
2637 @findex gnus-group-make-web-group
2638 @cindex Google
2639 @cindex nnweb
2640 @cindex gmane
2641 Make an ephemeral group based on a web search
2642 (@code{gnus-group-make-web-group}).  If you give a prefix to this
2643 command, make a solid group instead.  You will be prompted for the
2644 search engine type and the search string.  Valid search engine types
2645 include @code{google}, @code{dejanews}, and @code{gmane}.
2646 @xref{Web Searches}.
2647
2648 If you use the @code{google} search engine, you can limit the search
2649 to a particular group by using a match string like
2650 @samp{shaving group:alt.sysadmin.recovery}.
2651
2652 @item G R
2653 @kindex G R (Group)
2654 @findex gnus-group-make-rss-group
2655 Make a group based on an @acronym{RSS} feed
2656 (@code{gnus-group-make-rss-group}).  You will be prompted for an URL.
2657 @xref{RSS}.
2658
2659 @item G DEL
2660 @kindex G DEL (Group)
2661 @findex gnus-group-delete-group
2662 This function will delete the current group
2663 (@code{gnus-group-delete-group}).  If given a prefix, this function will
2664 actually delete all the articles in the group, and forcibly remove the
2665 group itself from the face of the Earth.  Use a prefix only if you are
2666 absolutely sure of what you are doing.  This command can't be used on
2667 read-only groups (like @code{nntp} groups), though.
2668
2669 @item G V
2670 @kindex G V (Group)
2671 @findex gnus-group-make-empty-virtual
2672 Make a new, fresh, empty @code{nnvirtual} group
2673 (@code{gnus-group-make-empty-virtual}).  @xref{Virtual Groups}.
2674
2675 @item G v
2676 @kindex G v (Group)
2677 @findex gnus-group-add-to-virtual
2678 Add the current group to an @code{nnvirtual} group
2679 (@code{gnus-group-add-to-virtual}).  Uses the process/prefix convention.
2680 @end table
2681
2682 @xref{Select Methods}, for more information on the various select
2683 methods.
2684
2685 @vindex gnus-activate-foreign-newsgroups
2686 If @code{gnus-activate-foreign-newsgroups} is a positive number,
2687 Gnus will check all foreign groups with this level or lower at startup.
2688 This might take quite a while, especially if you subscribe to lots of
2689 groups from different @acronym{NNTP} servers.  Also @pxref{Group Levels};
2690 @code{gnus-activate-level} also affects activation of foreign
2691 newsgroups.
2692
2693
2694 @node Group Parameters
2695 @section Group Parameters
2696 @cindex group parameters
2697
2698 The group parameters store information local to a particular group.
2699 Here's an example group parameter list:
2700
2701 @example
2702 ((to-address . "ding@@gnus.org")
2703  (auto-expire . t))
2704 @end example
2705
2706 We see that each element consists of a ``dotted pair''---the thing before
2707 the dot is the key, while the thing after the dot is the value.  All the
2708 parameters have this form @emph{except} local variable specs, which are
2709 not dotted pairs, but proper lists.
2710
2711 Some parameters have correspondent customizable variables, each of which
2712 is an alist of regexps and values.
2713
2714 The following group parameters can be used:
2715
2716 @table @code
2717 @item to-address
2718 @cindex to-address
2719 Address used by when doing followups and new posts.
2720
2721 @example
2722 (to-address . "some@@where.com")
2723 @end example
2724
2725 This is primarily useful in mail groups that represent closed mailing
2726 lists---mailing lists where it's expected that everybody that writes to
2727 the mailing list is subscribed to it.  Since using this parameter
2728 ensures that the mail only goes to the mailing list itself, it means
2729 that members won't receive two copies of your followups.
2730
2731 Using @code{to-address} will actually work whether the group is foreign
2732 or not.  Let's say there's a group on the server that is called
2733 @samp{fa.4ad-l}.  This is a real newsgroup, but the server has gotten
2734 the articles from a mail-to-news gateway.  Posting directly to this
2735 group is therefore impossible---you have to send mail to the mailing
2736 list address instead.
2737
2738 See also @code{gnus-parameter-to-address-alist}.
2739
2740 @item to-list
2741 @cindex to-list
2742 Address used when doing @kbd{a} in that group.
2743
2744 @example
2745 (to-list . "some@@where.com")
2746 @end example
2747
2748 It is totally ignored
2749 when doing a followup---except that if it is present in a news group,
2750 you'll get mail group semantics when doing @kbd{f}.
2751
2752 If you do an @kbd{a} command in a mail group and you have neither a
2753 @code{to-list} group parameter nor a @code{to-address} group parameter,
2754 then a @code{to-list} group parameter will be added automatically upon
2755 sending the message if @code{gnus-add-to-list} is set to @code{t}.
2756 @vindex gnus-add-to-list
2757
2758 @findex gnus-mailing-list-mode
2759 @cindex mail list groups
2760 If this variable is set, @code{gnus-mailing-list-mode} is turned on when
2761 entering summary buffer.
2762
2763 See also @code{gnus-parameter-to-list-alist}.
2764
2765 @anchor{subscribed}
2766 @item subscribed
2767 @cindex subscribed
2768 @cindex Mail-Followup-To
2769 @findex gnus-find-subscribed-addresses
2770 If this parameter is set to @code{t}, Gnus will consider the
2771 to-address and to-list parameters for this group as addresses of
2772 mailing lists you are subscribed to.  Giving Gnus this information is
2773 (only) a first step in getting it to generate correct Mail-Followup-To
2774 headers for your posts to these lists.  The second step is to put the
2775 following in your @file{.gnus.el}
2776
2777 @lisp
2778 (setq message-subscribed-address-functions
2779       '(gnus-find-subscribed-addresses))
2780 @end lisp
2781
2782 @xref{Mailing Lists, ,Mailing Lists, message, The Message Manual}, for
2783 a complete treatment of available MFT support.
2784
2785 @item visible
2786 @cindex visible
2787 If the group parameter list has the element @code{(visible . t)},
2788 that group will always be visible in the Group buffer, regardless
2789 of whether it has any unread articles.
2790
2791 This parameter cannot be set via @code{gnus-parameters}. See
2792 @code{gnus-permanently-visible-groups} as an alternative.
2793
2794 @item broken-reply-to
2795 @cindex broken-reply-to
2796 Elements like @code{(broken-reply-to . t)} signals that @code{Reply-To}
2797 headers in this group are to be ignored, and for the header to be hidden
2798 if @code{reply-to} is part of @code{gnus-boring-article-headers}.  This
2799 can be useful if you're reading a mailing list group where the listserv
2800 has inserted @code{Reply-To} headers that point back to the listserv
2801 itself.  That is broken behavior.  So there!
2802
2803 @item to-group
2804 @cindex to-group
2805 Elements like @code{(to-group . "some.group.name")} means that all
2806 posts in that group will be sent to @code{some.group.name}.
2807
2808 @item newsgroup
2809 @cindex newsgroup
2810 If you have @code{(newsgroup . t)} in the group parameter list, Gnus
2811 will treat all responses as if they were responses to news articles.
2812 This can be useful if you have a mail group that's really a mirror of a
2813 news group.
2814
2815 @item gcc-self
2816 @cindex gcc-self
2817 If @code{(gcc-self . t)} is present in the group parameter list, newly
2818 composed messages will be @code{Gcc}'d to the current group.  If
2819 @code{(gcc-self . none)} is present, no @code{Gcc:} header will be
2820 generated, if @code{(gcc-self . "string")} is present, this string will
2821 be inserted literally as a @code{gcc} header.  This parameter takes
2822 precedence over any default @code{Gcc} rules as described later
2823 (@pxref{Archived Messages}).
2824
2825 @strong{Caveat}: Adding @code{(gcc-self . t)} to the parameter list of
2826 @code{nntp} groups (or the like) isn't valid.  An @code{nntp} server
2827 doesn't accept articles.
2828
2829 @item auto-expire
2830 @cindex auto-expire
2831 If the group parameter has an element that looks like @code{(auto-expire
2832 . t)}, all articles read will be marked as expirable.  For an
2833 alternative approach, @pxref{Expiring Mail}.
2834
2835 See also @code{gnus-auto-expirable-newsgroups}.
2836
2837 @item total-expire
2838 @cindex total-expire
2839 If the group parameter has an element that looks like
2840 @code{(total-expire . t)}, all read articles will be put through the
2841 expiry process, even if they are not marked as expirable.  Use with
2842 caution.  Unread, ticked and dormant articles are not eligible for
2843 expiry.
2844
2845 See also @code{gnus-total-expirable-newsgroups}.
2846
2847 @item expiry-wait
2848 @cindex expiry-wait
2849 @vindex nnmail-expiry-wait-function
2850 If the group parameter has an element that looks like
2851 @code{(expiry-wait . 10)}, this value will override any
2852 @code{nnmail-expiry-wait} and @code{nnmail-expiry-wait-function}
2853 (@pxref{Expiring Mail}) when expiring expirable messages.  The value
2854 can either be a number of days (not necessarily an integer) or the
2855 symbols @code{never} or @code{immediate}.
2856
2857 @item expiry-target
2858 @cindex expiry-target
2859 Where expired messages end up.  This parameter overrides
2860 @code{nnmail-expiry-target}.
2861
2862 @item score-file
2863 @cindex score file group parameter
2864 Elements that look like @code{(score-file . "file")} will make
2865 @file{file} into the current score file for the group in question.  All
2866 interactive score entries will be put into this file.
2867
2868 @item adapt-file
2869 @cindex adapt file group parameter
2870 Elements that look like @code{(adapt-file . "file")} will make
2871 @file{file} into the current adaptive file for the group in question.
2872 All adaptive score entries will be put into this file.
2873
2874 @item admin-address
2875 @cindex admin-address
2876 When unsubscribing from a mailing list you should never send the
2877 unsubscription notice to the mailing list itself.  Instead, you'd send
2878 messages to the administrative address.  This parameter allows you to
2879 put the admin address somewhere convenient.
2880
2881 @item display
2882 @cindex display
2883 Elements that look like @code{(display . MODE)} say which articles to
2884 display on entering the group.  Valid values are:
2885
2886 @table @code
2887 @item all
2888 Display all articles, both read and unread.
2889
2890 @item an integer
2891 Display the last @var{integer} articles in the group.  This is the same as
2892 entering the group with @kbd{C-u @var{integer}}.
2893
2894 @item default
2895 Display the default visible articles, which normally includes unread and
2896 ticked articles.
2897
2898 @item an array
2899 Display articles that satisfy a predicate.
2900
2901 Here are some examples:
2902
2903 @table @code
2904 @item [unread]
2905 Display only unread articles.
2906
2907 @item [not expire]
2908 Display everything except expirable articles.
2909
2910 @item [and (not reply) (not expire)]
2911 Display everything except expirable and articles you've already
2912 responded to.
2913 @end table
2914
2915 The available operators are @code{not}, @code{and} and @code{or}.
2916 Predicates include @code{tick}, @code{unsend}, @code{undownload},
2917 @code{unread}, @code{dormant}, @code{expire}, @code{reply},
2918 @code{killed}, @code{bookmark}, @code{score}, @code{save},
2919 @code{cache}, @code{forward}, @code{unseen} and @code{recent}.
2920
2921 @end table
2922
2923 The @code{display} parameter works by limiting the summary buffer to
2924 the subset specified.  You can pop the limit by using the @kbd{/ w}
2925 command (@pxref{Limiting}).
2926
2927 @item comment
2928 @cindex comment
2929 Elements that look like @code{(comment . "This is a comment")} are
2930 arbitrary comments on the group.  You can display comments in the
2931 group line (@pxref{Group Line Specification}).
2932
2933 @item charset
2934 @cindex charset
2935 Elements that look like @code{(charset . iso-8859-1)} will make
2936 @code{iso-8859-1} the default charset; that is, the charset that will be
2937 used for all articles that do not specify a charset.
2938
2939 See also @code{gnus-group-charset-alist}.
2940
2941 @item ignored-charsets
2942 @cindex ignored-charset
2943 Elements that look like @code{(ignored-charsets x-unknown iso-8859-1)}
2944 will make @code{iso-8859-1} and @code{x-unknown} ignored; that is, the
2945 default charset will be used for decoding articles.
2946
2947 See also @code{gnus-group-ignored-charsets-alist}.
2948
2949 @item posting-style
2950 @cindex posting-style
2951 You can store additional posting style information for this group
2952 here (@pxref{Posting Styles}).  The format is that of an entry in the
2953 @code{gnus-posting-styles} alist, except that there's no regexp matching
2954 the group name (of course).  Style elements in this group parameter will
2955 take precedence over the ones found in @code{gnus-posting-styles}.
2956
2957 For instance, if you want a funky name and signature in this group only,
2958 instead of hacking @code{gnus-posting-styles}, you could put something
2959 like this in the group parameters:
2960
2961 @example
2962 (posting-style
2963   (name "Funky Name")
2964   ("X-My-Header" "Funky Value")
2965   (signature "Funky Signature"))
2966 @end example
2967
2968 @item post-method
2969 @cindex post-method
2970 If it is set, the value is used as the method for posting message
2971 instead of @code{gnus-post-method}.
2972
2973 @item banner
2974 @cindex banner
2975 An item like @code{(banner . @var{regexp})} causes any part of an article
2976 that matches the regular expression @var{regexp} to be stripped.  Instead of
2977 @var{regexp}, you can also use the symbol @code{signature} which strips the
2978 last signature or any of the elements of the alist
2979 @code{gnus-article-banner-alist}.
2980
2981 @item sieve
2982 @cindex sieve
2983 This parameter contains a Sieve test that should match incoming mail
2984 that should be placed in this group.  From this group parameter, a
2985 Sieve @samp{IF} control structure is generated, having the test as the
2986 condition and @samp{fileinto "group.name";} as the body.
2987
2988 For example, if the @samp{INBOX.list.sieve} group has the @code{(sieve
2989 address "sender" "sieve-admin@@extundo.com")} group parameter, when
2990 translating the group parameter into a Sieve script (@pxref{Sieve
2991 Commands}) the following Sieve code is generated:
2992
2993 @example
2994 if address "sender" "sieve-admin@@extundo.com" @{
2995         fileinto "INBOX.list.sieve";
2996 @}
2997 @end example
2998
2999 To generate tests for multiple email-addresses use a group parameter
3000 like @code{(sieve address "sender" ("name@@one.org" else@@two.org"))}.
3001 When generating a sieve script (@pxref{Sieve Commands}) Sieve code
3002 like the following is generated:
3003
3004 @example
3005 if address "sender" ["name@@one.org", "else@@two.org"] @{
3006         fileinto "INBOX.list.sieve";
3007 @}
3008 @end example
3009
3010 See @pxref{Sieve Commands} for commands and variables that might be of
3011 interest in relation to the sieve parameter.
3012
3013 The Sieve language is described in RFC 3028.  @xref{Top, Emacs Sieve,
3014 Top, sieve, Emacs Sieve}.
3015
3016 @item (agent parameters)
3017 If the agent has been enabled, you can set any of the its parameters
3018 to control the behavior of the agent in individual groups. See Agent
3019 Parameters in @ref{Category Syntax}.  Most users will choose to set
3020 agent parameters in either an agent category or group topic to
3021 minimize the configuration effort.
3022
3023 @item (@var{variable} @var{form})
3024 You can use the group parameters to set variables local to the group you
3025 are entering.  If you want to turn threading off in @samp{news.answers},
3026 you could put @code{(gnus-show-threads nil)} in the group parameters of
3027 that group.  @code{gnus-show-threads} will be made into a local variable
3028 in the summary buffer you enter, and the form @code{nil} will be
3029 @code{eval}ed there.
3030
3031 Note that this feature sets the variable locally to the summary buffer.
3032 But some variables are evaluated in the article buffer, or in the
3033 message buffer (of a reply or followup or otherwise newly created
3034 message).  As a workaround, it might help to add the variable in
3035 question to @code{gnus-newsgroup-variables}.  @xref{Various Summary
3036 Stuff}.  So if you want to set @code{message-from-style} via the group
3037 parameters, then you may need the following statement elsewhere in your
3038 @file{~/.gnus} file:
3039
3040 @lisp
3041 (add-to-list 'gnus-newsgroup-variables 'message-from-style)
3042 @end lisp
3043
3044 @vindex gnus-list-identifiers
3045 A use for this feature is to remove a mailing list identifier tag in
3046 the subject fields of articles.  E.g. if the news group
3047
3048 @example
3049 nntp+news.gnus.org:gmane.text.docbook.apps
3050 @end example
3051
3052 has the tag @samp{DOC-BOOK-APPS:} in the subject of all articles, this
3053 tag can be removed from the article subjects in the summary buffer for
3054 the group by putting @code{(gnus-list-identifiers "DOCBOOK-APPS:")}
3055 into the group parameters for the group.
3056
3057 This can also be used as a group-specific hook function.  If you want to
3058 hear a beep when you enter a group, you could put something like
3059 @code{(dummy-variable (ding))} in the parameters of that group.
3060 @code{dummy-variable} will be set to the (meaningless) result of the
3061 @code{(ding)} form.
3062
3063 Alternatively, since the VARIABLE becomes local to the group, this
3064 pattern can be used to temporarily change a hook.  For example, if the
3065 following is added to a group parameter
3066
3067 @lisp
3068 (gnus-summary-prepared-hook
3069   '(lambda nil (local-set-key "d" (local-key-binding "n"))))
3070 @end lisp
3071
3072 when the group is entered, the 'd' key will not mark the article as
3073 expired.
3074
3075 @end table
3076
3077 Use the @kbd{G p} or the @kbd{G c} command to edit group parameters of a
3078 group.  (@kbd{G p} presents you with a Lisp-based interface, @kbd{G c}
3079 presents you with a Customize-like interface.  The latter helps avoid
3080 silly Lisp errors.)  You might also be interested in reading about topic
3081 parameters (@pxref{Topic Parameters}).
3082
3083 @vindex gnus-parameters
3084 Group parameters can be set via the @code{gnus-parameters} variable too.
3085 But some variables, such as @code{visible}, have no effect (For this
3086 case see @code{gnus-permanently-visible-groups} as an alternative.).
3087 For example:
3088
3089 @lisp
3090 (setq gnus-parameters
3091       '(("mail\\..*"
3092          (gnus-show-threads nil)
3093          (gnus-use-scoring nil)
3094          (gnus-summary-line-format
3095           "%U%R%z%I%(%[%d:%ub%-23,23f%]%) %s\n")
3096          (gcc-self . t)
3097          (display . all))
3098
3099         ("^nnimap:\\(foo.bar\\)$"
3100          (to-group . "\\1"))
3101
3102         ("mail\\.me"
3103          (gnus-use-scoring  t))
3104
3105         ("list\\..*"
3106          (total-expire . t)
3107          (broken-reply-to . t))))
3108 @end lisp
3109
3110 String value of parameters will be subjected to regexp substitution, as
3111 the @code{to-group} example shows.
3112
3113 @vindex gnus-parameters-case-fold-search
3114 By default, whether comparing the group name and one of those regexps
3115 specified in @code{gnus-parameters} is done in a case-sensitive manner
3116 or a case-insensitive manner depends on the value of
3117 @code{case-fold-search} at the time when the comparison is done.  The
3118 value of @code{case-fold-search} is typically @code{t}; it means, for
3119 example, the element @code{("INBOX\\.FOO" (total-expire . t))} might be
3120 applied to both the @samp{INBOX.FOO} group and the @samp{INBOX.foo}
3121 group.  If you want to make those regexps always case-sensitive, set the
3122 value of the @code{gnus-parameters-case-fold-search} variable to
3123 @code{nil}.  Otherwise, set it to @code{t} if you want to compare them
3124 always in a case-insensitive manner.
3125
3126 You can define different sorting to different groups via
3127 @code{gnus-parameters}.  Here is an example to sort an @acronym{NNTP}
3128 group by reverse date to see the latest news at the top and an
3129 @acronym{RSS} group by subject.  In this example, the first group is the
3130 Debian daily news group @code{gmane.linux.debian.user.news} from
3131 news.gmane.org.  The @acronym{RSS} group corresponds to the Debian
3132 weekly news RSS feed
3133 @url{http://packages.debian.org/unstable/newpkg_main.en.rdf},
3134 @xref{RSS}.
3135
3136 @lisp
3137 (setq
3138  gnus-parameters
3139  '(("nntp.*gmane\\.debian\\.user\\.news"
3140     (gnus-show-threads nil)
3141     (gnus-article-sort-functions '((not gnus-article-sort-by-date)))
3142     (gnus-use-adaptive-scoring nil)
3143     (gnus-use-scoring nil))
3144    ("nnrss.*debian"
3145     (gnus-show-threads nil)
3146     (gnus-article-sort-functions 'gnus-article-sort-by-subject)
3147     (gnus-use-adaptive-scoring nil)
3148     (gnus-use-scoring t)
3149     (gnus-score-find-score-files-function 'gnus-score-find-single)
3150     (gnus-summary-line-format "%U%R%z%d %I%(%[ %s %]%)\n"))))
3151 @end lisp
3152
3153
3154 @node Listing Groups
3155 @section Listing Groups
3156 @cindex group listing
3157
3158 These commands all list various slices of the groups available.
3159
3160 @table @kbd
3161
3162 @item l
3163 @itemx A s
3164 @kindex A s (Group)
3165 @kindex l (Group)
3166 @findex gnus-group-list-groups
3167 List all groups that have unread articles
3168 (@code{gnus-group-list-groups}).  If the numeric prefix is used, this
3169 command will list only groups of level ARG and lower.  By default, it
3170 only lists groups of level five (i.e.,
3171 @code{gnus-group-default-list-level}) or lower (i.e., just subscribed
3172 groups).
3173
3174 @item L
3175 @itemx A u
3176 @kindex A u (Group)
3177 @kindex L (Group)
3178 @findex gnus-group-list-all-groups
3179 List all groups, whether they have unread articles or not
3180 (@code{gnus-group-list-all-groups}).  If the numeric prefix is used,
3181 this command will list only groups of level ARG and lower.  By default,
3182 it lists groups of level seven or lower (i.e., just subscribed and
3183 unsubscribed groups).
3184
3185 @item A l
3186 @kindex A l (Group)
3187 @findex gnus-group-list-level
3188 List all unread groups on a specific level
3189 (@code{gnus-group-list-level}).  If given a prefix, also list the groups
3190 with no unread articles.
3191
3192 @item A k
3193 @kindex A k (Group)
3194 @findex gnus-group-list-killed
3195 List all killed groups (@code{gnus-group-list-killed}).  If given a
3196 prefix argument, really list all groups that are available, but aren't
3197 currently (un)subscribed.  This could entail reading the active file
3198 from the server.
3199
3200 @item A z
3201 @kindex A z (Group)
3202 @findex gnus-group-list-zombies
3203 List all zombie groups (@code{gnus-group-list-zombies}).
3204
3205 @item A m
3206 @kindex A m (Group)
3207 @findex gnus-group-list-matching
3208 List all unread, subscribed groups with names that match a regexp
3209 (@code{gnus-group-list-matching}).
3210
3211 @item A M
3212 @kindex A M (Group)
3213 @findex gnus-group-list-all-matching
3214 List groups that match a regexp (@code{gnus-group-list-all-matching}).
3215
3216 @item A A
3217 @kindex A A (Group)
3218 @findex gnus-group-list-active
3219 List absolutely all groups in the active file(s) of the
3220 server(s) you are connected to (@code{gnus-group-list-active}).  This
3221 might very well take quite a while.  It might actually be a better idea
3222 to do a @kbd{A M} to list all matching, and just give @samp{.} as the
3223 thing to match on.  Also note that this command may list groups that
3224 don't exist (yet)---these will be listed as if they were killed groups.
3225 Take the output with some grains of salt.
3226
3227 @item A a
3228 @kindex A a (Group)
3229 @findex gnus-group-apropos
3230 List all groups that have names that match a regexp
3231 (@code{gnus-group-apropos}).
3232
3233 @item A d
3234 @kindex A d (Group)
3235 @findex gnus-group-description-apropos
3236 List all groups that have names or descriptions that match a regexp
3237 (@code{gnus-group-description-apropos}).
3238
3239 @item A c
3240 @kindex A c (Group)
3241 @findex gnus-group-list-cached
3242 List all groups with cached articles (@code{gnus-group-list-cached}).
3243
3244 @item A ?
3245 @kindex A ? (Group)
3246 @findex gnus-group-list-dormant
3247 List all groups with dormant articles (@code{gnus-group-list-dormant}).
3248
3249 @item A /
3250 @kindex A / (Group)
3251 @findex gnus-group-list-limit
3252 List groups limited within the current selection
3253 (@code{gnus-group-list-limit}).
3254
3255 @item A f
3256 @kindex A f (Group)
3257 @findex gnus-group-list-flush
3258 Flush groups from the current selection (@code{gnus-group-list-flush}).
3259
3260 @item A p
3261 @kindex A p (Group)
3262 @findex gnus-group-list-plus
3263 List groups plus the current selection (@code{gnus-group-list-plus}).
3264
3265 @end table
3266
3267 @vindex gnus-permanently-visible-groups
3268 @cindex visible group parameter
3269 Groups that match the @code{gnus-permanently-visible-groups} regexp will
3270 always be shown, whether they have unread articles or not.  You can also
3271 add the @code{visible} element to the group parameters in question to
3272 get the same effect.
3273
3274 @vindex gnus-list-groups-with-ticked-articles
3275 Groups that have just ticked articles in it are normally listed in the
3276 group buffer.  If @code{gnus-list-groups-with-ticked-articles} is
3277 @code{nil}, these groups will be treated just like totally empty
3278 groups.  It is @code{t} by default.
3279
3280
3281 @node Sorting Groups
3282 @section Sorting Groups
3283 @cindex sorting groups
3284
3285 @kindex C-c C-s (Group)
3286 @findex gnus-group-sort-groups
3287 @vindex gnus-group-sort-function
3288 The @kbd{C-c C-s} (@code{gnus-group-sort-groups}) command sorts the
3289 group buffer according to the function(s) given by the
3290 @code{gnus-group-sort-function} variable.  Available sorting functions
3291 include:
3292
3293 @table @code
3294
3295 @item gnus-group-sort-by-alphabet
3296 @findex gnus-group-sort-by-alphabet
3297 Sort the group names alphabetically.  This is the default.
3298
3299 @item gnus-group-sort-by-real-name
3300 @findex gnus-group-sort-by-real-name
3301 Sort the group alphabetically on the real (unprefixed) group names.
3302
3303 @item gnus-group-sort-by-level
3304 @findex gnus-group-sort-by-level
3305 Sort by group level.
3306
3307 @item gnus-group-sort-by-score
3308 @findex gnus-group-sort-by-score
3309 Sort by group score.  @xref{Group Score}.
3310
3311 @item gnus-group-sort-by-rank
3312 @findex gnus-group-sort-by-rank
3313 Sort by group score and then the group level.  The level and the score
3314 are, when taken together, the group's @dfn{rank}.  @xref{Group Score}.
3315
3316 @item gnus-group-sort-by-unread
3317 @findex gnus-group-sort-by-unread
3318 Sort by number of unread articles.
3319
3320 @item gnus-group-sort-by-method
3321 @findex gnus-group-sort-by-method
3322 Sort alphabetically on the select method.
3323
3324 @item gnus-group-sort-by-server
3325 @findex gnus-group-sort-by-server
3326 Sort alphabetically on the Gnus server name.
3327
3328
3329 @end table
3330
3331 @code{gnus-group-sort-function} can also be a list of sorting
3332 functions.  In that case, the most significant sort key function must be
3333 the last one.
3334
3335
3336 There are also a number of commands for sorting directly according to
3337 some sorting criteria:
3338
3339 @table @kbd
3340 @item G S a
3341 @kindex G S a (Group)
3342 @findex gnus-group-sort-groups-by-alphabet
3343 Sort the group buffer alphabetically by group name
3344 (@code{gnus-group-sort-groups-by-alphabet}).
3345
3346 @item G S u
3347 @kindex G S u (Group)
3348 @findex gnus-group-sort-groups-by-unread
3349 Sort the group buffer by the number of unread articles
3350 (@code{gnus-group-sort-groups-by-unread}).
3351
3352 @item G S l
3353 @kindex G S l (Group)
3354 @findex gnus-group-sort-groups-by-level
3355 Sort the group buffer by group level
3356 (@code{gnus-group-sort-groups-by-level}).
3357
3358 @item G S v
3359 @kindex G S v (Group)
3360 @findex gnus-group-sort-groups-by-score
3361 Sort the group buffer by group score
3362 (@code{gnus-group-sort-groups-by-score}).  @xref{Group Score}.
3363
3364 @item G S r
3365 @kindex G S r (Group)
3366 @findex gnus-group-sort-groups-by-rank
3367 Sort the group buffer by group rank
3368 (@code{gnus-group-sort-groups-by-rank}).  @xref{Group Score}.
3369
3370 @item G S m
3371 @kindex G S m (Group)
3372 @findex gnus-group-sort-groups-by-method
3373 Sort the group buffer alphabetically by back end name@*
3374 (@code{gnus-group-sort-groups-by-method}).
3375
3376 @item G S n
3377 @kindex G S n (Group)
3378 @findex gnus-group-sort-groups-by-real-name
3379 Sort the group buffer alphabetically by real (unprefixed) group name
3380 (@code{gnus-group-sort-groups-by-real-name}).
3381
3382 @end table
3383
3384 All the commands below obey the process/prefix convention
3385 (@pxref{Process/Prefix}).
3386
3387 When given a symbolic prefix (@pxref{Symbolic Prefixes}), all these
3388 commands will sort in reverse order.
3389
3390 You can also sort a subset of the groups:
3391
3392 @table @kbd
3393 @item G P a
3394 @kindex G P a (Group)
3395 @findex gnus-group-sort-selected-groups-by-alphabet
3396 Sort the groups alphabetically by group name
3397 (@code{gnus-group-sort-selected-groups-by-alphabet}).
3398
3399 @item G P u
3400 @kindex G P u (Group)
3401 @findex gnus-group-sort-selected-groups-by-unread
3402 Sort the groups by the number of unread articles
3403 (@code{gnus-group-sort-selected-groups-by-unread}).
3404
3405 @item G P l
3406 @kindex G P l (Group)
3407 @findex gnus-group-sort-selected-groups-by-level
3408 Sort the groups by group level
3409 (@code{gnus-group-sort-selected-groups-by-level}).
3410
3411 @item G P v
3412 @kindex G P v (Group)
3413 @findex gnus-group-sort-selected-groups-by-score
3414 Sort the groups by group score
3415 (@code{gnus-group-sort-selected-groups-by-score}).  @xref{Group Score}.
3416
3417 @item G P r
3418 @kindex G P r (Group)
3419 @findex gnus-group-sort-selected-groups-by-rank
3420 Sort the groups by group rank
3421 (@code{gnus-group-sort-selected-groups-by-rank}).  @xref{Group Score}.
3422
3423 @item G P m
3424 @kindex G P m (Group)
3425 @findex gnus-group-sort-selected-groups-by-method
3426 Sort the groups alphabetically by back end name@*
3427 (@code{gnus-group-sort-selected-groups-by-method}).
3428
3429 @item G P n
3430 @kindex G P n (Group)
3431 @findex gnus-group-sort-selected-groups-by-real-name
3432 Sort the groups alphabetically by real (unprefixed) group name
3433 (@code{gnus-group-sort-selected-groups-by-real-name}).
3434
3435 @item G P s
3436 @kindex G P s (Group)
3437 @findex gnus-group-sort-selected-groups
3438 Sort the groups according to @code{gnus-group-sort-function}.
3439
3440 @end table
3441
3442 And finally, note that you can use @kbd{C-k} and @kbd{C-y} to manually
3443 move groups around.
3444
3445
3446 @node Group Maintenance
3447 @section Group Maintenance
3448 @cindex bogus groups
3449
3450 @table @kbd
3451 @item b
3452 @kindex b (Group)
3453 @findex gnus-group-check-bogus-groups
3454 Find bogus groups and delete them
3455 (@code{gnus-group-check-bogus-groups}).
3456
3457 @item F
3458 @kindex F (Group)
3459 @findex gnus-group-find-new-groups
3460 Find new groups and process them (@code{gnus-group-find-new-groups}).
3461 With 1 @kbd{C-u}, use the @code{ask-server} method to query the server
3462 for new groups.  With 2 @kbd{C-u}'s, use most complete method possible
3463 to query the server for new groups, and subscribe the new groups as
3464 zombies.
3465
3466 @item C-c C-x
3467 @kindex C-c C-x (Group)
3468 @findex gnus-group-expire-articles
3469 Run all expirable articles in the current group through the expiry
3470 process (if any) (@code{gnus-group-expire-articles}).  That is, delete
3471 all expirable articles in the group that have been around for a while.
3472 (@pxref{Expiring Mail}).
3473
3474 @item C-c C-M-x
3475 @kindex C-c C-M-x (Group)
3476 @findex gnus-group-expire-all-groups
3477 Run all expirable articles in all groups through the expiry process
3478 (@code{gnus-group-expire-all-groups}).
3479
3480 @end table
3481
3482
3483 @node Browse Foreign Server
3484 @section Browse Foreign Server
3485 @cindex foreign servers
3486 @cindex browsing servers
3487
3488 @table @kbd
3489 @item B
3490 @kindex B (Group)
3491 @findex gnus-group-browse-foreign-server
3492 You will be queried for a select method and a server name.  Gnus will
3493 then attempt to contact this server and let you browse the groups there
3494 (@code{gnus-group-browse-foreign-server}).
3495 @end table
3496
3497 @findex gnus-browse-mode
3498 A new buffer with a list of available groups will appear.  This buffer
3499 will use the @code{gnus-browse-mode}.  This buffer looks a bit (well,
3500 a lot) like a normal group buffer.
3501
3502 Here's a list of keystrokes available in the browse mode:
3503
3504 @table @kbd
3505 @item n
3506 @kindex n (Browse)
3507 @findex gnus-group-next-group
3508 Go to the next group (@code{gnus-group-next-group}).
3509
3510 @item p
3511 @kindex p (Browse)
3512 @findex gnus-group-prev-group
3513 Go to the previous group (@code{gnus-group-prev-group}).
3514
3515 @item SPACE
3516 @kindex SPACE (Browse)
3517 @findex gnus-browse-read-group
3518 Enter the current group and display the first article
3519 (@code{gnus-browse-read-group}).
3520
3521 @item RET
3522 @kindex RET (Browse)
3523 @findex gnus-browse-select-group
3524 Enter the current group (@code{gnus-browse-select-group}).
3525
3526 @item u
3527 @kindex u (Browse)
3528 @findex gnus-browse-unsubscribe-current-group
3529 Unsubscribe to the current group, or, as will be the case here,
3530 subscribe to it (@code{gnus-browse-unsubscribe-current-group}).
3531
3532 @item l
3533 @itemx q
3534 @kindex q (Browse)
3535 @kindex l (Browse)
3536 @findex gnus-browse-exit
3537 Exit browse mode (@code{gnus-browse-exit}).
3538
3539 @item d
3540 @kindex d (Browse)
3541 @findex gnus-browse-describe-group
3542 Describe the current group (@code{gnus-browse-describe-group}).
3543
3544 @item ?
3545 @kindex ? (Browse)
3546 @findex gnus-browse-describe-briefly
3547 Describe browse mode briefly (well, there's not much to describe, is
3548 there) (@code{gnus-browse-describe-briefly}).
3549 @end table
3550
3551
3552 @node Exiting Gnus
3553 @section Exiting Gnus
3554 @cindex exiting Gnus
3555
3556 Yes, Gnus is ex(c)iting.
3557
3558 @table @kbd
3559 @item z
3560 @kindex z (Group)
3561 @findex gnus-group-suspend
3562 Suspend Gnus (@code{gnus-group-suspend}).  This doesn't really exit Gnus,
3563 but it kills all buffers except the Group buffer.  I'm not sure why this
3564 is a gain, but then who am I to judge?
3565
3566 @item q
3567 @kindex q (Group)
3568 @findex gnus-group-exit
3569 @c @icon{gnus-group-exit}
3570 Quit Gnus (@code{gnus-group-exit}).
3571
3572 @item Q
3573 @kindex Q (Group)
3574 @findex gnus-group-quit
3575 Quit Gnus without saving the @file{.newsrc} files (@code{gnus-group-quit}).
3576 The dribble file will be saved, though (@pxref{Auto Save}).
3577 @end table
3578
3579 @vindex gnus-exit-gnus-hook
3580 @vindex gnus-suspend-gnus-hook
3581 @vindex gnus-after-exiting-gnus-hook
3582 @code{gnus-suspend-gnus-hook} is called when you suspend Gnus and
3583 @code{gnus-exit-gnus-hook} is called when you quit Gnus, while
3584 @code{gnus-after-exiting-gnus-hook} is called as the final item when
3585 exiting Gnus.
3586
3587 Note:
3588
3589 @quotation
3590 Miss Lisa Cannifax, while sitting in English class, felt her feet go
3591 numbly heavy and herself fall into a hazy trance as the boy sitting
3592 behind her drew repeated lines with his pencil across the back of her
3593 plastic chair.
3594 @end quotation
3595
3596
3597 @node Group Topics
3598 @section Group Topics
3599 @cindex topics
3600
3601 If you read lots and lots of groups, it might be convenient to group
3602 them hierarchically according to topics.  You put your Emacs groups over
3603 here, your sex groups over there, and the rest (what, two groups or so?)
3604 you put in some misc section that you never bother with anyway.  You can
3605 even group the Emacs sex groups as a sub-topic to either the Emacs
3606 groups or the sex groups---or both!  Go wild!
3607
3608 @iftex
3609 @iflatex
3610 \gnusfigure{Group Topics}{400}{
3611 \put(75,50){\epsfig{figure=ps/group-topic,height=9cm}}
3612 }
3613 @end iflatex
3614 @end iftex
3615
3616 Here's an example:
3617
3618 @example
3619 Gnus
3620   Emacs -- I wuw it!
3621      3: comp.emacs
3622      2: alt.religion.emacs
3623     Naughty Emacs
3624      452: alt.sex.emacs
3625        0: comp.talk.emacs.recovery
3626   Misc
3627      8: comp.binaries.fractals
3628     13: comp.sources.unix
3629 @end example
3630
3631 @findex gnus-topic-mode
3632 @kindex t (Group)
3633 To get this @emph{fab} functionality you simply turn on (ooh!) the
3634 @code{gnus-topic} minor mode---type @kbd{t} in the group buffer.  (This
3635 is a toggling command.)
3636
3637 Go ahead, just try it.  I'll still be here when you get back.  La de
3638 dum@dots{} Nice tune, that@dots{} la la la@dots{} What, you're back?
3639 Yes, and now press @kbd{l}.  There.  All your groups are now listed
3640 under @samp{misc}.  Doesn't that make you feel all warm and fuzzy?
3641 Hot and bothered?
3642
3643 If you want this permanently enabled, you should add that minor mode to
3644 the hook for the group mode.  Put the following line in your
3645 @file{~/.gnus.el} file:
3646
3647 @lisp
3648 (add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
3649 @end lisp
3650
3651 @menu
3652 * Topic Commands::              Interactive E-Z commands.
3653 * Topic Variables::             How to customize the topics the Lisp Way.
3654 * Topic Sorting::               Sorting each topic individually.
3655 * Topic Topology::              A map of the world.
3656 * Topic Parameters::            Parameters that apply to all groups in a topic.
3657 @end menu
3658
3659
3660 @node Topic Commands
3661 @subsection Topic Commands
3662 @cindex topic commands
3663
3664 When the topic minor mode is turned on, a new @kbd{T} submap will be
3665 available.  In addition, a few of the standard keys change their
3666 definitions slightly.
3667
3668 In general, the following kinds of operations are possible on topics.
3669 First of all, you want to create topics.  Secondly, you want to put
3670 groups in topics and to move them around until you have an order you
3671 like.  The third kind of operation is to show/hide parts of the whole
3672 shebang.  You might want to hide a topic including its subtopics and
3673 groups, to get a better overview of the other groups.
3674
3675 Here is a list of the basic keys that you might need to set up topics
3676 the way you like.
3677
3678 @table @kbd
3679
3680 @item T n
3681 @kindex T n (Topic)
3682 @findex gnus-topic-create-topic
3683 Prompt for a new topic name and create it
3684 (@code{gnus-topic-create-topic}).
3685
3686 @item T TAB
3687 @itemx TAB
3688 @kindex T TAB (Topic)
3689 @kindex TAB (Topic)
3690 @findex gnus-topic-indent
3691 ``Indent'' the current topic so that it becomes a sub-topic of the
3692 previous topic (@code{gnus-topic-indent}).  If given a prefix,
3693 ``un-indent'' the topic instead.
3694
3695 @item M-TAB
3696 @kindex M-TAB (Topic)
3697 @findex gnus-topic-unindent
3698 ``Un-indent'' the current topic so that it becomes a sub-topic of the
3699 parent of its current parent (@code{gnus-topic-unindent}).
3700
3701 @end table
3702
3703 The following two keys can be used to move groups and topics around.
3704 They work like the well-known cut and paste.  @kbd{C-k} is like cut and
3705 @kbd{C-y} is like paste.  Of course, this being Emacs, we use the terms
3706 kill and yank rather than cut and paste.
3707
3708 @table @kbd
3709
3710 @item C-k
3711 @kindex C-k (Topic)
3712 @findex gnus-topic-kill-group
3713 Kill a group or topic (@code{gnus-topic-kill-group}).  All groups in the
3714 topic will be removed along with the topic.
3715
3716 @item C-y
3717 @kindex C-y (Topic)
3718 @findex gnus-topic-yank-group
3719 Yank the previously killed group or topic
3720 (@code{gnus-topic-yank-group}).  Note that all topics will be yanked
3721 before all groups.
3722
3723 So, to move a topic to the beginning of the list of topics, just hit
3724 @kbd{C-k} on it.  This is like the ``cut'' part of cut and paste.  Then,
3725 move the cursor to the beginning of the buffer (just below the ``Gnus''
3726 topic) and hit @kbd{C-y}.  This is like the ``paste'' part of cut and
3727 paste.  Like I said -- E-Z.
3728
3729 You can use @kbd{C-k} and @kbd{C-y} on groups as well as on topics.  So
3730 you can move topics around as well as groups.
3731
3732 @end table
3733
3734 After setting up the topics the way you like them, you might wish to
3735 hide a topic, or to show it again.  That's why we have the following
3736 key.
3737
3738 @table @kbd
3739
3740 @item RET
3741 @kindex RET (Topic)
3742 @findex gnus-topic-select-group
3743 @itemx SPACE
3744 Either select a group or fold a topic (@code{gnus-topic-select-group}).
3745 When you perform this command on a group, you'll enter the group, as
3746 usual.  When done on a topic line, the topic will be folded (if it was
3747 visible) or unfolded (if it was folded already).  So it's basically a
3748 toggling command on topics.  In addition, if you give a numerical
3749 prefix, group on that level (and lower) will be displayed.
3750
3751 @end table
3752
3753 Now for a list of other commands, in no particular order.
3754
3755 @table @kbd
3756
3757 @item T m
3758 @kindex T m (Topic)
3759 @findex gnus-topic-move-group
3760 Move the current group to some other topic
3761 (@code{gnus-topic-move-group}).  This command uses the process/prefix
3762 convention (@pxref{Process/Prefix}).
3763
3764 @item T j
3765 @kindex T j (Topic)
3766 @findex gnus-topic-jump-to-topic
3767 Go to a topic (@code{gnus-topic-jump-to-topic}).
3768
3769 @item T c
3770 @kindex T c (Topic)
3771 @findex gnus-topic-copy-group
3772 Copy the current group to some other topic
3773 (@code{gnus-topic-copy-group}).  This command uses the process/prefix
3774 convention (@pxref{Process/Prefix}).
3775
3776 @item T h
3777 @kindex T h (Topic)
3778 @findex gnus-topic-hide-topic
3779 Hide the current topic (@code{gnus-topic-hide-topic}).  If given
3780 a prefix, hide the topic permanently.
3781
3782 @item T s
3783 @kindex T s (Topic)
3784 @findex gnus-topic-show-topic
3785 Show the current topic (@code{gnus-topic-show-topic}).  If given
3786 a prefix, show the topic permanently.
3787
3788 @item T D
3789 @kindex T D (Topic)
3790 @findex gnus-topic-remove-group
3791 Remove a group from the current topic (@code{gnus-topic-remove-group}).
3792 This command is mainly useful if you have the same group in several
3793 topics and wish to remove it from one of the topics.  You may also
3794 remove a group from all topics, but in that case, Gnus will add it to
3795 the root topic the next time you start Gnus.  In fact, all new groups
3796 (which, naturally, don't belong to any topic) will show up in the root
3797 topic.
3798
3799 This command uses the process/prefix convention
3800 (@pxref{Process/Prefix}).
3801
3802 @item T M
3803 @kindex T M (Topic)
3804 @findex gnus-topic-move-matching
3805 Move all groups that match some regular expression to a topic
3806 (@code{gnus-topic-move-matching}).
3807
3808 @item T C
3809 @kindex T C (Topic)
3810 @findex gnus-topic-copy-matching
3811 Copy all groups that match some regular expression to a topic
3812 (@code{gnus-topic-copy-matching}).
3813
3814 @item T H
3815 @kindex T H (Topic)
3816 @findex gnus-topic-toggle-display-empty-topics
3817 Toggle hiding empty topics
3818 (@code{gnus-topic-toggle-display-empty-topics}).
3819
3820 @item T #
3821 @kindex T # (Topic)
3822 @findex gnus-topic-mark-topic
3823 Mark all groups in the current topic with the process mark
3824 (@code{gnus-topic-mark-topic}).  This command works recursively on
3825 sub-topics unless given a prefix.
3826
3827 @item T M-#
3828 @kindex T M-# (Topic)
3829 @findex gnus-topic-unmark-topic
3830 Remove the process mark from all groups in the current topic
3831 (@code{gnus-topic-unmark-topic}).  This command works recursively on
3832 sub-topics unless given a prefix.
3833
3834 @item C-c C-x
3835 @kindex C-c C-x (Topic)
3836 @findex gnus-topic-expire-articles
3837 Run all expirable articles in the current group or topic through the
3838 expiry process (if any)
3839 (@code{gnus-topic-expire-articles}).  (@pxref{Expiring Mail}).
3840
3841 @item T r
3842 @kindex T r (Topic)
3843 @findex gnus-topic-rename
3844 Rename a topic (@code{gnus-topic-rename}).
3845
3846 @item T DEL
3847 @kindex T DEL (Topic)
3848 @findex gnus-topic-delete
3849 Delete an empty topic (@code{gnus-topic-delete}).
3850
3851 @item A T
3852 @kindex A T (Topic)
3853 @findex gnus-topic-list-active
3854 List all groups that Gnus knows about in a topics-ified way
3855 (@code{gnus-topic-list-active}).
3856
3857 @item T M-n
3858 @kindex T M-n (Topic)
3859 @findex gnus-topic-goto-next-topic
3860 Go to the next topic (@code{gnus-topic-goto-next-topic}).
3861
3862 @item T M-p
3863 @kindex T M-p (Topic)
3864 @findex gnus-topic-goto-previous-topic
3865 Go to the previous topic (@code{gnus-topic-goto-previous-topic}).
3866
3867 @item G p
3868 @kindex G p (Topic)
3869 @findex gnus-topic-edit-parameters
3870 @cindex group parameters
3871 @cindex topic parameters
3872 @cindex parameters
3873 Edit the topic parameters (@code{gnus-topic-edit-parameters}).
3874 @xref{Topic Parameters}.
3875
3876 @end table
3877
3878
3879 @node Topic Variables
3880 @subsection Topic Variables
3881 @cindex topic variables
3882
3883 The previous section told you how to tell Gnus which topics to display.
3884 This section explains how to tell Gnus what to display about each topic.
3885
3886 @vindex gnus-topic-line-format
3887 The topic lines themselves are created according to the
3888 @code{gnus-topic-line-format} variable (@pxref{Formatting Variables}).
3889 Valid elements are:
3890
3891 @table @samp
3892 @item i
3893 Indentation.
3894 @item n
3895 Topic name.
3896 @item v
3897 Visibility.
3898 @item l
3899 Level.
3900 @item g
3901 Number of groups in the topic.
3902 @item a
3903 Number of unread articles in the topic.
3904 @item A
3905 Number of unread articles in the topic and all its subtopics.
3906 @end table
3907
3908 @vindex gnus-topic-indent-level
3909 Each sub-topic (and the groups in the sub-topics) will be indented with
3910 @code{gnus-topic-indent-level} times the topic level number of spaces.
3911 The default is 2.
3912
3913 @vindex gnus-topic-mode-hook
3914 @code{gnus-topic-mode-hook} is called in topic minor mode buffers.
3915
3916 @vindex gnus-topic-display-empty-topics
3917 The @code{gnus-topic-display-empty-topics} says whether to display even
3918 topics that have no unread articles in them.  The default is @code{t}.
3919
3920
3921 @node Topic Sorting
3922 @subsection Topic Sorting
3923 @cindex topic sorting
3924
3925 You can sort the groups in each topic individually with the following
3926 commands:
3927
3928
3929 @table @kbd
3930 @item T S a
3931 @kindex T S a (Topic)
3932 @findex gnus-topic-sort-groups-by-alphabet
3933 Sort the current topic alphabetically by group name
3934 (@code{gnus-topic-sort-groups-by-alphabet}).
3935
3936 @item T S u
3937 @kindex T S u (Topic)
3938 @findex gnus-topic-sort-groups-by-unread
3939 Sort the current topic by the number of unread articles
3940 (@code{gnus-topic-sort-groups-by-unread}).
3941
3942 @item T S l
3943 @kindex T S l (Topic)
3944 @findex gnus-topic-sort-groups-by-level
3945 Sort the current topic by group level
3946 (@code{gnus-topic-sort-groups-by-level}).
3947
3948 @item T S v
3949 @kindex T S v (Topic)
3950 @findex gnus-topic-sort-groups-by-score
3951 Sort the current topic by group score
3952 (@code{gnus-topic-sort-groups-by-score}).  @xref{Group Score}.
3953
3954 @item T S r
3955 @kindex T S r (Topic)
3956 @findex gnus-topic-sort-groups-by-rank
3957 Sort the current topic by group rank
3958 (@code{gnus-topic-sort-groups-by-rank}).  @xref{Group Score}.
3959
3960 @item T S m
3961 @kindex T S m (Topic)
3962 @findex gnus-topic-sort-groups-by-method
3963 Sort the current topic alphabetically by back end name
3964 (@code{gnus-topic-sort-groups-by-method}).
3965
3966 @item T S e
3967 @kindex T S e (Topic)
3968 @findex gnus-topic-sort-groups-by-server
3969 Sort the current topic alphabetically by server name
3970 (@code{gnus-topic-sort-groups-by-server}).
3971
3972 @item T S s
3973 @kindex T S s (Topic)
3974 @findex gnus-topic-sort-groups
3975 Sort the current topic according to the function(s) given by the
3976 @code{gnus-group-sort-function} variable
3977 (@code{gnus-topic-sort-groups}).
3978
3979 @end table
3980
3981 When given a prefix argument, all these commands will sort in reverse
3982 order.  @xref{Sorting Groups}, for more information about group
3983 sorting.
3984
3985
3986 @node Topic Topology
3987 @subsection Topic Topology
3988 @cindex topic topology
3989 @cindex topology
3990
3991 So, let's have a look at an example group buffer:
3992
3993 @example
3994 @group
3995 Gnus
3996   Emacs -- I wuw it!
3997      3: comp.emacs
3998      2: alt.religion.emacs
3999     Naughty Emacs
4000      452: alt.sex.emacs
4001        0: comp.talk.emacs.recovery
4002   Misc
4003      8: comp.binaries.fractals
4004     13: comp.sources.unix
4005 @end group
4006 @end example
4007
4008 So, here we have one top-level topic (@samp{Gnus}), two topics under
4009 that, and one sub-topic under one of the sub-topics.  (There is always
4010 just one (1) top-level topic).  This topology can be expressed as
4011 follows:
4012
4013 @lisp
4014 (("Gnus" visible)
4015  (("Emacs -- I wuw it!" visible)
4016   (("Naughty Emacs" visible)))
4017  (("Misc" visible)))
4018 @end lisp
4019
4020 @vindex gnus-topic-topology
4021 This is in fact how the variable @code{gnus-topic-topology} would look
4022 for the display above.  That variable is saved in the @file{.newsrc.eld}
4023 file, and shouldn't be messed with manually---unless you really want
4024 to.  Since this variable is read from the @file{.newsrc.eld} file,
4025 setting it in any other startup files will have no effect.
4026
4027 This topology shows what topics are sub-topics of what topics (right),
4028 and which topics are visible.  Two settings are currently
4029 allowed---@code{visible} and @code{invisible}.
4030
4031
4032 @node Topic Parameters
4033 @subsection Topic Parameters
4034 @cindex topic parameters
4035
4036 All groups in a topic will inherit group parameters from the parent
4037 (and ancestor) topic parameters.  All valid group parameters are valid
4038 topic parameters (@pxref{Group Parameters}).  When the agent is
4039 enabled, all agent parameters (See Agent Parameters in @ref{Category
4040 Syntax}) are also valid topic parameters.
4041
4042 In addition, the following parameters are only valid as topic
4043 parameters:
4044
4045 @table @code
4046 @item subscribe
4047 When subscribing new groups by topic (@pxref{Subscription Methods}), the
4048 @code{subscribe} topic parameter says what groups go in what topic.  Its
4049 value should be a regexp to match the groups that should go in that
4050 topic.
4051
4052 @item subscribe-level
4053 When subscribing new groups by topic (see the @code{subscribe} parameter),
4054 the group will be subscribed with the level specified in the
4055 @code{subscribe-level} instead of @code{gnus-level-default-subscribed}.
4056
4057 @end table
4058
4059 Group parameters (of course) override topic parameters, and topic
4060 parameters in sub-topics override topic parameters in super-topics.  You
4061 know.  Normal inheritance rules.  (@dfn{Rules} is here a noun, not a
4062 verb, although you may feel free to disagree with me here.)
4063
4064 @example
4065 @group
4066 Gnus
4067   Emacs
4068      3: comp.emacs
4069      2: alt.religion.emacs
4070    452: alt.sex.emacs
4071     Relief
4072      452: alt.sex.emacs
4073        0: comp.talk.emacs.recovery
4074   Misc
4075      8: comp.binaries.fractals
4076     13: comp.sources.unix
4077    452: alt.sex.emacs
4078 @end group
4079 @end example
4080
4081 The @samp{Emacs} topic has the topic parameter @code{(score-file
4082 . "emacs.SCORE")}; the @samp{Relief} topic has the topic parameter
4083 @code{(score-file . "relief.SCORE")}; and the @samp{Misc} topic has the
4084 topic parameter @code{(score-file . "emacs.SCORE")}.  In addition,
4085 @* @samp{alt.religion.emacs} has the group parameter @code{(score-file
4086 . "religion.SCORE")}.
4087
4088 Now, when you enter @samp{alt.sex.emacs} in the @samp{Relief} topic, you
4089 will get the @file{relief.SCORE} home score file.  If you enter the same
4090 group in the @samp{Emacs} topic, you'll get the @file{emacs.SCORE} home
4091 score file.  If you enter the group @samp{alt.religion.emacs}, you'll
4092 get the @file{religion.SCORE} home score file.
4093
4094 This seems rather simple and self-evident, doesn't it?  Well, yes.  But
4095 there are some problems, especially with the @code{total-expiry}
4096 parameter.  Say you have a mail group in two topics; one with
4097 @code{total-expiry} and one without.  What happens when you do @kbd{M-x
4098 gnus-expire-all-expirable-groups}?  Gnus has no way of telling which one
4099 of these topics you mean to expire articles from, so anything may
4100 happen.  In fact, I hereby declare that it is @dfn{undefined} what
4101 happens.  You just have to be careful if you do stuff like that.
4102
4103
4104 @node Misc Group Stuff
4105 @section Misc Group Stuff
4106
4107 @menu
4108 * Scanning New Messages::       Asking Gnus to see whether new messages have arrived.
4109 * Group Information::           Information and help on groups and Gnus.
4110 * Group Timestamp::             Making Gnus keep track of when you last read a group.
4111 * File Commands::               Reading and writing the Gnus files.
4112 * Sieve Commands::              Managing Sieve scripts.
4113 @end menu
4114
4115 @table @kbd
4116
4117 @item v
4118 @kindex v (Group)
4119 @cindex keys, reserved for users (Group)
4120 The key @kbd{v} is reserved for users.  You can bind it key to some
4121 function or better use it as a prefix key.  For example:
4122
4123 @lisp
4124 (define-key gnus-group-mode-map (kbd "v j d")
4125   (lambda ()
4126     (interactive)
4127     (gnus-group-jump-to-group "nndraft:drafts")))
4128 @end lisp
4129
4130 On keys reserved for users in Emacs and on keybindings in general
4131 @xref{Keymaps, Keymaps, , emacs, The Emacs Editor}.
4132
4133 @item ^
4134 @kindex ^ (Group)
4135 @findex gnus-group-enter-server-mode
4136 Enter the server buffer (@code{gnus-group-enter-server-mode}).
4137 @xref{Server Buffer}.
4138
4139 @item a
4140 @kindex a (Group)
4141 @findex gnus-group-post-news
4142 Start composing a message (a news by default)
4143 (@code{gnus-group-post-news}).  If given a prefix, post to the group
4144 under the point.  If the prefix is 1, prompt for a group to post to.
4145 Contrary to what the name of this function suggests, the prepared
4146 article might be a mail instead of a news, if a mail group is specified
4147 with the prefix argument.  @xref{Composing Messages}.
4148
4149 @item m
4150 @kindex m (Group)
4151 @findex gnus-group-mail
4152 Mail a message somewhere (@code{gnus-group-mail}).  If given a prefix,
4153 use the posting style of the group under the point.  If the prefix is 1,
4154 prompt for a group name to find the posting style.
4155 @xref{Composing Messages}.
4156
4157 @item i
4158 @kindex i (Group)
4159 @findex gnus-group-news
4160 Start composing a news (@code{gnus-group-news}).  If given a prefix,
4161 post to the group under the point.  If the prefix is 1, prompt
4162 for group to post to.  @xref{Composing Messages}.
4163
4164 This function actually prepares a news even when using mail groups.
4165 This is useful for ``posting'' messages to mail groups without actually
4166 sending them over the network: they're just saved directly to the group
4167 in question.  The corresponding back end must have a request-post method
4168 for this to work though.
4169
4170 @end table
4171
4172 Variables for the group buffer:
4173
4174 @table @code
4175
4176 @item gnus-group-mode-hook
4177 @vindex gnus-group-mode-hook
4178 is called after the group buffer has been
4179 created.
4180
4181 @item gnus-group-prepare-hook
4182 @vindex gnus-group-prepare-hook
4183 is called after the group buffer is
4184 generated.  It may be used to modify the buffer in some strange,
4185 unnatural way.
4186
4187 @item gnus-group-prepared-hook
4188 @vindex gnus-group-prepare-hook
4189 is called as the very last thing after the group buffer has been
4190 generated.  It may be used to move point around, for instance.
4191
4192 @item gnus-permanently-visible-groups
4193 @vindex gnus-permanently-visible-groups
4194 Groups matching this regexp will always be listed in the group buffer,
4195 whether they are empty or not.
4196
4197 @item gnus-group-name-charset-method-alist
4198 @vindex gnus-group-name-charset-method-alist
4199 An alist of method and the charset for group names.  It is used to show
4200 non-@acronym{ASCII} group names.
4201
4202 For example:
4203 @lisp
4204 (setq gnus-group-name-charset-method-alist
4205     '(((nntp "news.com.cn") . cn-gb-2312)))
4206 @end lisp
4207
4208 @item gnus-group-name-charset-group-alist
4209 @cindex UTF-8 group names
4210 @vindex gnus-group-name-charset-group-alist
4211 An alist of regexp of group name and the charset for group names.  It
4212 is used to show non-@acronym{ASCII} group names.  @code{((".*"
4213 utf-8))} is the default value if UTF-8 is supported, otherwise the
4214 default is @code{nil}.
4215
4216 For example:
4217 @lisp
4218 (setq gnus-group-name-charset-group-alist
4219     '(("\\.com\\.cn:" . cn-gb-2312)))
4220 @end lisp
4221
4222 @end table
4223
4224 @node Scanning New Messages
4225 @subsection Scanning New Messages
4226 @cindex new messages
4227 @cindex scanning new news
4228
4229 @table @kbd
4230
4231 @item g
4232 @kindex g (Group)
4233 @findex gnus-group-get-new-news
4234 @c @icon{gnus-group-get-new-news}
4235 Check the server(s) for new articles.  If the numerical prefix is used,
4236 this command will check only groups of level @var{arg} and lower
4237 (@code{gnus-group-get-new-news}).  If given a non-numerical prefix, this
4238 command will force a total re-reading of the active file(s) from the
4239 back end(s).
4240
4241 @item M-g
4242 @kindex M-g (Group)
4243 @findex gnus-group-get-new-news-this-group
4244 @vindex gnus-goto-next-group-when-activating
4245 @c @icon{gnus-group-get-new-news-this-group}
4246 Check whether new articles have arrived in the current group
4247 (@code{gnus-group-get-new-news-this-group}).
4248 @code{gnus-goto-next-group-when-activating} says whether this command is
4249 to move point to the next group or not.  It is @code{t} by default.
4250
4251 @findex gnus-activate-all-groups
4252 @cindex activating groups
4253 @item C-c M-g
4254 @kindex C-c M-g (Group)
4255 Activate absolutely all groups (@code{gnus-activate-all-groups}).
4256
4257 @item R
4258 @kindex R (Group)
4259 @cindex restarting
4260 @findex gnus-group-restart
4261 Restart Gnus (@code{gnus-group-restart}).  This saves the @file{.newsrc}
4262 file(s), closes the connection to all servers, clears up all run-time
4263 Gnus variables, and then starts Gnus all over again.
4264
4265 @end table
4266
4267 @vindex gnus-get-new-news-hook
4268 @code{gnus-get-new-news-hook} is run just before checking for new news.
4269
4270 @vindex gnus-after-getting-new-news-hook
4271 @code{gnus-after-getting-new-news-hook} is run after checking for new
4272 news.
4273
4274
4275 @node Group Information
4276 @subsection Group Information
4277 @cindex group information
4278 @cindex information on groups
4279
4280 @table @kbd
4281
4282
4283 @item H f
4284 @kindex H f (Group)
4285 @findex gnus-group-fetch-faq
4286 @vindex gnus-group-faq-directory
4287 @cindex FAQ
4288 @cindex ange-ftp
4289 Try to fetch the @acronym{FAQ} for the current group
4290 (@code{gnus-group-fetch-faq}).  Gnus will try to get the @acronym{FAQ}
4291 from @code{gnus-group-faq-directory}, which is usually a directory on
4292 a remote machine.  This variable can also be a list of directories.
4293 In that case, giving a prefix to this command will allow you to choose
4294 between the various sites.  @code{ange-ftp} (or @code{efs}) will be
4295 used for fetching the file.
4296
4297 If fetching from the first site is unsuccessful, Gnus will attempt to go
4298 through @code{gnus-group-faq-directory} and try to open them one by one.
4299
4300 @item H c
4301 @kindex H c (Group)
4302 @findex gnus-group-fetch-charter
4303 @vindex gnus-group-charter-alist
4304 @cindex charter
4305 Try to open the charter for the current group in a web browser
4306 (@code{gnus-group-fetch-charter}).  Query for a group if given a
4307 prefix argument.
4308
4309 Gnus will use @code{gnus-group-charter-alist} to find the location of
4310 the charter.  If no location is known, Gnus will fetch the control
4311 messages for the group, which in some cases includes the charter.
4312
4313 @item H C
4314 @kindex H C (Group)
4315 @findex gnus-group-fetch-control
4316 @vindex gnus-group-fetch-control-use-browse-url
4317 @cindex control message
4318 Fetch the control messages for the group from the archive at
4319 @code{ftp.isc.org} (@code{gnus-group-fetch-control}).  Query for a
4320 group if given a prefix argument.
4321
4322 If @code{gnus-group-fetch-control-use-browse-url} is non-@code{nil},
4323 Gnus will open the control messages in a browser using
4324 @code{browse-url}.  Otherwise they are fetched using @code{ange-ftp}
4325 and displayed in an ephemeral group.
4326
4327 Note that the control messages are compressed.  To use this command
4328 you need to turn on @code{auto-compression-mode} (@pxref{Compressed
4329 Files, ,Compressed Files, emacs, The Emacs Manual}).
4330
4331 @item H d
4332 @itemx C-c C-d
4333 @c @icon{gnus-group-describe-group}
4334 @kindex H d (Group)
4335 @kindex C-c C-d (Group)
4336 @cindex describing groups
4337 @cindex group description
4338 @findex gnus-group-describe-group
4339 Describe the current group (@code{gnus-group-describe-group}).  If given
4340 a prefix, force Gnus to re-read the description from the server.
4341
4342 @item M-d
4343 @kindex M-d (Group)
4344 @findex gnus-group-describe-all-groups
4345 Describe all groups (@code{gnus-group-describe-all-groups}).  If given a
4346 prefix, force Gnus to re-read the description file from the server.
4347
4348 @item H v
4349 @itemx V
4350 @kindex V (Group)
4351 @kindex H v (Group)
4352 @cindex version
4353 @findex gnus-version
4354 Display current Gnus version numbers (@code{gnus-version}).
4355
4356 @item ?
4357 @kindex ? (Group)
4358 @findex gnus-group-describe-briefly
4359 Give a very short help message (@code{gnus-group-describe-briefly}).
4360
4361 @item C-c C-i
4362 @kindex C-c C-i (Group)
4363 @cindex info
4364 @cindex manual
4365 @findex gnus-info-find-node
4366 Go to the Gnus info node (@code{gnus-info-find-node}).
4367 @end table
4368
4369
4370 @node Group Timestamp
4371 @subsection Group Timestamp
4372 @cindex timestamps
4373 @cindex group timestamps
4374
4375 It can be convenient to let Gnus keep track of when you last read a
4376 group.  To set the ball rolling, you should add
4377 @code{gnus-group-set-timestamp} to @code{gnus-select-group-hook}:
4378
4379 @lisp
4380 (add-hook 'gnus-select-group-hook 'gnus-group-set-timestamp)
4381 @end lisp
4382
4383 After doing this, each time you enter a group, it'll be recorded.
4384
4385 This information can be displayed in various ways---the easiest is to
4386 use the @samp{%d} spec in the group line format:
4387
4388 @lisp
4389 (setq gnus-group-line-format
4390       "%M\%S\%p\%P\%5y: %(%-40,40g%) %d\n")
4391 @end lisp
4392
4393 This will result in lines looking like:
4394
4395 @example
4396 *        0: mail.ding                                19961002T012943
4397          0: custom                                   19961002T012713
4398 @end example
4399
4400 As you can see, the date is displayed in compact ISO 8601 format.  This
4401 may be a bit too much, so to just display the date, you could say
4402 something like:
4403
4404 @lisp
4405 (setq gnus-group-line-format
4406       "%M\%S\%p\%P\%5y: %(%-40,40g%) %6,6~(cut 2)d\n")
4407 @end lisp
4408
4409 If you would like greater control of the time format, you can use a
4410 user-defined format spec.  Something like the following should do the
4411 trick:
4412
4413 @lisp
4414 (setq gnus-group-line-format
4415       "%M\%S\%p\%P\%5y: %(%-40,40g%) %ud\n")
4416 (defun gnus-user-format-function-d (headers)
4417   (let ((time (gnus-group-timestamp gnus-tmp-group)))
4418     (if time
4419         (format-time-string "%b %d  %H:%M" time)
4420       "")))
4421 @end lisp
4422
4423
4424 @node File Commands
4425 @subsection File Commands
4426 @cindex file commands
4427
4428 @table @kbd
4429
4430 @item r
4431 @kindex r (Group)
4432 @findex gnus-group-read-init-file
4433 @vindex gnus-init-file
4434 @cindex reading init file
4435 Re-read the init file (@code{gnus-init-file}, which defaults to
4436 @file{~/.gnus.el}) (@code{gnus-group-read-init-file}).
4437
4438 @item s
4439 @kindex s (Group)
4440 @findex gnus-group-save-newsrc
4441 @cindex saving .newsrc
4442 Save the @file{.newsrc.eld} file (and @file{.newsrc} if wanted)
4443 (@code{gnus-group-save-newsrc}).  If given a prefix, force saving the
4444 file(s) whether Gnus thinks it is necessary or not.
4445
4446 @c @item Z
4447 @c @kindex Z (Group)
4448 @c @findex gnus-group-clear-dribble
4449 @c Clear the dribble buffer (@code{gnus-group-clear-dribble}).
4450
4451 @end table
4452
4453
4454 @node Sieve Commands
4455 @subsection Sieve Commands
4456 @cindex group sieve commands
4457
4458 Sieve is a server-side mail filtering language.  In Gnus you can use
4459 the @code{sieve} group parameter (@pxref{Group Parameters}) to specify
4460 sieve rules that should apply to each group.  Gnus provides two
4461 commands to translate all these group parameters into a proper Sieve
4462 script that can be transfered to the server somehow.
4463
4464 @vindex gnus-sieve-file
4465 @vindex gnus-sieve-region-start
4466 @vindex gnus-sieve-region-end
4467 The generated Sieve script is placed in @code{gnus-sieve-file} (by
4468 default @file{~/.sieve}).  The Sieve code that Gnus generate is placed
4469 between two delimiters, @code{gnus-sieve-region-start} and
4470 @code{gnus-sieve-region-end}, so you may write additional Sieve code
4471 outside these delimiters that will not be removed the next time you
4472 regenerate the Sieve script.
4473
4474 @vindex gnus-sieve-crosspost
4475 The variable @code{gnus-sieve-crosspost} controls how the Sieve script
4476 is generated.  If it is non-@code{nil} (the default) articles is
4477 placed in all groups that have matching rules, otherwise the article
4478 is only placed in the group with the first matching rule.  For
4479 example, the group parameter @samp{(sieve address "sender"
4480 "owner-ding@@hpc.uh.edu")} will generate the following piece of Sieve
4481 code if @code{gnus-sieve-crosspost} is @code{nil}.  (When
4482 @code{gnus-sieve-crosspost} is non-@code{nil}, it looks the same
4483 except that the line containing the call to @code{stop} is removed.)
4484
4485 @example
4486 if address "sender" "owner-ding@@hpc.uh.edu" @{
4487         fileinto "INBOX.ding";
4488         stop;
4489 @}
4490 @end example
4491
4492 @xref{Top, Emacs Sieve, Top, sieve, Emacs Sieve}.
4493
4494 @table @kbd
4495
4496 @item D g
4497 @kindex D g (Group)
4498 @findex gnus-sieve-generate
4499 @vindex gnus-sieve-file
4500 @cindex generating sieve script
4501 Regenerate a Sieve script from the @code{sieve} group parameters and
4502 put you into the @code{gnus-sieve-file} without saving it.
4503
4504 @item D u
4505 @kindex D u (Group)
4506 @findex gnus-sieve-update
4507 @vindex gnus-sieve-file
4508 @cindex updating sieve script
4509 Regenerates the Gnus managed part of @code{gnus-sieve-file} using the
4510 @code{sieve} group parameters, save the file and upload it to the
4511 server using the @code{sieveshell} program.
4512
4513 @end table
4514
4515
4516 @node Summary Buffer
4517 @chapter Summary Buffer
4518 @cindex summary buffer
4519
4520 A line for each article is displayed in the summary buffer.  You can
4521 move around, read articles, post articles and reply to articles.
4522
4523 The most common way to a summary buffer is to select a group from the
4524 group buffer (@pxref{Selecting a Group}).
4525
4526 You can have as many summary buffers open as you wish.
4527
4528 @kindex v (Summary)
4529 @cindex keys, reserved for users (Summary)
4530 The key @kbd{v} is reserved for users.  You can bind it key to some
4531 function or better use it as a prefix key.  For example:
4532 @lisp
4533 (define-key gnus-summary-mode-map (kbd "v -") "LrS") ;; lower subthread
4534 @end lisp
4535
4536 @menu
4537 * Summary Buffer Format::       Deciding how the summary buffer is to look.
4538 * Summary Maneuvering::         Moving around the summary buffer.
4539 * Choosing Articles::           Reading articles.
4540 * Paging the Article::          Scrolling the current article.
4541 * Reply Followup and Post::     Posting articles.
4542 * Delayed Articles::            Send articles at a later time.
4543 * Marking Articles::            Marking articles as read, expirable, etc.
4544 * Limiting::                    You can limit the summary buffer.
4545 * Threading::                   How threads are made.
4546 * Sorting the Summary Buffer::  How articles and threads are sorted.
4547 * Asynchronous Fetching::       Gnus might be able to pre-fetch articles.
4548 * Article Caching::             You may store articles in a cache.
4549 * Persistent Articles::         Making articles expiry-resistant.
4550 * Article Backlog::             Having already read articles hang around.
4551 * Saving Articles::             Ways of customizing article saving.
4552 * Decoding Articles::           Gnus can treat series of (uu)encoded articles.
4553 * Article Treatment::           The article buffer can be mangled at will.
4554 * MIME Commands::               Doing MIMEy things with the articles.
4555 * Charsets::                    Character set issues.
4556 * Article Commands::            Doing various things with the article buffer.
4557 * Summary Sorting::             Sorting the summary buffer in various ways.
4558 * Finding the Parent::          No child support? Get the parent.
4559 * Alternative Approaches::      Reading using non-default summaries.
4560 * Tree Display::                A more visual display of threads.
4561 * Mail Group Commands::         Some commands can only be used in mail groups.
4562 * Various Summary Stuff::       What didn't fit anywhere else.
4563 * Exiting the Summary Buffer::  Returning to the Group buffer,
4564                                 or reselecting the current group.
4565 * Crosspost Handling::          How crossposted articles are dealt with.
4566 * Duplicate Suppression::       An alternative when crosspost handling fails.
4567 * Security::                    Decrypt and Verify.
4568 * Mailing List::                Mailing list minor mode.
4569 @end menu
4570
4571
4572 @node Summary Buffer Format
4573 @section Summary Buffer Format
4574 @cindex summary buffer format
4575
4576 @iftex
4577 @iflatex
4578 \gnusfigure{The Summary Buffer}{180}{
4579 \put(0,0){\epsfig{figure=ps/summary,width=7.5cm}}
4580 \put(445,0){\makebox(0,0)[br]{\epsfig{figure=ps/summary-article,width=7.5cm}}}
4581 }
4582 @end iflatex
4583 @end iftex
4584
4585 @menu
4586 * Summary Buffer Lines::        You can specify how summary lines should look.
4587 * To From Newsgroups::          How to not display your own name.
4588 * Summary Buffer Mode Line::    You can say how the mode line should look.
4589 * Summary Highlighting::        Making the summary buffer all pretty and nice.
4590 @end menu
4591
4592 @findex mail-extract-address-components
4593 @findex gnus-extract-address-components
4594 @vindex gnus-extract-address-components
4595 Gnus will use the value of the @code{gnus-extract-address-components}
4596 variable as a function for getting the name and address parts of a
4597 @code{From} header.  Two pre-defined functions exist:
4598 @code{gnus-extract-address-components}, which is the default, quite
4599 fast, and too simplistic solution; and
4600 @code{mail-extract-address-components}, which works very nicely, but is
4601 slower.  The default function will return the wrong answer in 5% of the
4602 cases.  If this is unacceptable to you, use the other function instead:
4603
4604 @lisp
4605 (setq gnus-extract-address-components
4606       'mail-extract-address-components)
4607 @end lisp
4608
4609 @vindex gnus-summary-same-subject
4610 @code{gnus-summary-same-subject} is a string indicating that the current
4611 article has the same subject as the previous.  This string will be used
4612 with those specs that require it.  The default is @code{""}.
4613
4614
4615 @node Summary Buffer Lines
4616 @subsection Summary Buffer Lines
4617
4618 @vindex gnus-summary-line-format
4619 You can change the format of the lines in the summary buffer by changing
4620 the @code{gnus-summary-line-format} variable.  It works along the same
4621 lines as a normal @code{format} string, with some extensions
4622 (@pxref{Formatting Variables}).
4623
4624 There should always be a colon or a point position marker on the line;
4625 the cursor always moves to the point position marker or the colon after
4626 performing an operation.  (Of course, Gnus wouldn't be Gnus if it wasn't
4627 possible to change this.  Just write a new function
4628 @code{gnus-goto-colon} which does whatever you like with the cursor.)
4629 @xref{Positioning Point}.
4630
4631 The default string is @samp{%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n}.
4632
4633 The following format specification characters and extended format
4634 specification(s) are understood:
4635
4636 @table @samp
4637 @item N
4638 Article number.
4639 @item S
4640 Subject string.  List identifiers stripped,
4641 @code{gnus-list-identifies}.  @xref{Article Hiding}.
4642 @item s
4643 Subject if the article is the root of the thread or the previous article
4644 had a different subject, @code{gnus-summary-same-subject} otherwise.
4645 (@code{gnus-summary-same-subject} defaults to @code{""}.)
4646 @item F
4647 Full @code{From} header.
4648 @item n
4649 The name (from the @code{From} header).
4650 @item f
4651 The name, @code{To} header or the @code{Newsgroups} header (@pxref{To
4652 From Newsgroups}).
4653 @item a
4654 The name (from the @code{From} header).  This differs from the @code{n}
4655 spec in that it uses the function designated by the
4656 @code{gnus-extract-address-components} variable, which is slower, but
4657 may be more thorough.
4658 @item A
4659 The address (from the @code{From} header).  This works the same way as
4660 the @code{a} spec.
4661 @item L
4662 Number of lines in the article.
4663 @item c
4664 Number of characters in the article.  This specifier is not supported
4665 in some methods (like nnfolder).
4666 @item k
4667 Pretty-printed version of the number of characters in the article;
4668 for example, @samp{1.2k} or @samp{0.4M}.
4669 @item I
4670 Indentation based on thread level (@pxref{Customizing Threading}).
4671 @item B
4672 A complex trn-style thread tree, showing response-connecting trace
4673 lines.  A thread could be drawn like this:
4674
4675 @example
4676 >
4677 +->
4678 | +->
4679 | | \->
4680 | |   \->
4681 | \->
4682 +->
4683 \->
4684 @end example
4685
4686 You can customize the appearance with the following options.  Note
4687 that it is possible to make the thread display look really neat by
4688 replacing the default @acronym{ASCII} characters with graphic
4689 line-drawing glyphs.
4690 @table @code
4691 @item gnus-sum-thread-tree-root
4692 @vindex gnus-sum-thread-tree-root
4693 Used for the root of a thread.  If @code{nil}, use subject
4694 instead.  The default is @samp{> }.
4695
4696 @item gnus-sum-thread-tree-false-root
4697 @vindex gnus-sum-thread-tree-false-root
4698 Used for the false root of a thread (@pxref{Loose Threads}).  If
4699 @code{nil}, use subject instead.  The default is @samp{> }.
4700
4701 @item gnus-sum-thread-tree-single-indent
4702 @vindex gnus-sum-thread-tree-single-indent
4703 Used for a thread with just one message.  If @code{nil}, use subject
4704 instead.  The default is @samp{}.
4705
4706 @item gnus-sum-thread-tree-vertical
4707 @vindex gnus-sum-thread-tree-vertical
4708 Used for drawing a vertical line.  The default is @samp{| }.
4709
4710 @item gnus-sum-thread-tree-indent
4711 @vindex gnus-sum-thread-tree-indent
4712 Used for indenting.  The default is @samp{  }.
4713
4714 @item gnus-sum-thread-tree-leaf-with-other
4715 @vindex gnus-sum-thread-tree-leaf-with-other
4716 Used for a leaf with brothers.  The default is @samp{+-> }.
4717
4718 @item gnus-sum-thread-tree-single-leaf
4719 @vindex gnus-sum-thread-tree-single-leaf
4720 Used for a leaf without brothers.  The default is @samp{\-> }
4721
4722 @end table
4723
4724 @item T
4725 Nothing if the article is a root and lots of spaces if it isn't (it
4726 pushes everything after it off the screen).
4727 @item [
4728 Opening bracket, which is normally @samp{[}, but can also be @samp{<}
4729 for adopted articles (@pxref{Customizing Threading}).
4730 @item ]
4731 Closing bracket, which is normally @samp{]}, but can also be @samp{>}
4732 for adopted articles.
4733 @item >
4734 One space for each thread level.
4735 @item <
4736 Twenty minus thread level spaces.
4737 @item U
4738 Unread.  @xref{Read Articles}.
4739
4740 @item R
4741 This misleadingly named specifier is the @dfn{secondary mark}.  This
4742 mark will say whether the article has been replied to, has been cached,
4743 or has been saved.  @xref{Other Marks}.
4744
4745 @item i
4746 Score as a number (@pxref{Scoring}).
4747 @item z
4748 @vindex gnus-summary-zcore-fuzz
4749 Zcore, @samp{+} if above the default level and @samp{-} if below the
4750 default level.  If the difference between
4751 @code{gnus-summary-default-score} and the score is less than
4752 @code{gnus-summary-zcore-fuzz}, this spec will not be used.
4753 @item V
4754 Total thread score.
4755 @item x
4756 @code{Xref}.
4757 @item D
4758 @code{Date}.
4759 @item d
4760 The @code{Date} in @code{DD-MMM} format.
4761 @item o
4762 The @code{Date} in @var{YYYYMMDD}@code{T}@var{HHMMSS} format.
4763 @item M
4764 @code{Message-ID}.
4765 @item r
4766 @code{References}.
4767 @item t
4768 Number of articles in the current sub-thread.  Using this spec will slow
4769 down summary buffer generation somewhat.
4770 @item e
4771 An @samp{=} (@code{gnus-not-empty-thread-mark}) will be displayed if the
4772 article has any children.
4773 @item P
4774 The line number.
4775 @item O
4776 Download mark.
4777 @item *
4778 Desired cursor position (instead of after first colon).
4779 @item &user-date;
4780 Age sensitive date format.  Various date format is defined in
4781 @code{gnus-user-date-format-alist}.
4782 @item u
4783 User defined specifier.  The next character in the format string should
4784 be a letter.  Gnus will call the function
4785 @code{gnus-user-format-function-@var{x}}, where @var{x} is the letter
4786 following @samp{%u}.  The function will be passed the current header as
4787 argument.  The function should return a string, which will be inserted
4788 into the summary just like information from any other summary specifier.
4789 @end table
4790
4791 Text between @samp{%(} and @samp{%)} will be highlighted with
4792 @code{gnus-mouse-face} when the mouse point is placed inside the area.
4793 There can only be one such area.
4794
4795 The @samp{%U} (status), @samp{%R} (replied) and @samp{%z} (zcore) specs
4796 have to be handled with care.  For reasons of efficiency, Gnus will
4797 compute what column these characters will end up in, and ``hard-code''
4798 that.  This means that it is invalid to have these specs after a
4799 variable-length spec.  Well, you might not be arrested, but your summary
4800 buffer will look strange, which is bad enough.
4801
4802 The smart choice is to have these specs as far to the left as possible.
4803 (Isn't that the case with everything, though?  But I digress.)
4804
4805 This restriction may disappear in later versions of Gnus.
4806
4807
4808 @node To From Newsgroups
4809 @subsection To From Newsgroups
4810 @cindex To
4811 @cindex Newsgroups
4812
4813 In some groups (particularly in archive groups), the @code{From} header
4814 isn't very interesting, since all the articles there are written by
4815 you.  To display the information in the @code{To} or @code{Newsgroups}
4816 headers instead, you need to decide three things: What information to
4817 gather; where to display it; and when to display it.
4818
4819 @enumerate
4820 @item
4821 @vindex gnus-extra-headers
4822 The reading of extra header information is controlled by the
4823 @code{gnus-extra-headers}.  This is a list of header symbols.  For
4824 instance:
4825
4826 @lisp
4827 (setq gnus-extra-headers
4828       '(To Newsgroups X-Newsreader))
4829 @end lisp
4830
4831 This will result in Gnus trying to obtain these three headers, and
4832 storing it in header structures for later easy retrieval.
4833
4834 @item
4835 @findex gnus-extra-header
4836 The value of these extra headers can be accessed via the
4837 @code{gnus-extra-header} function.  Here's a format line spec that will
4838 access the @code{X-Newsreader} header:
4839
4840 @example
4841 "%~(form (gnus-extra-header 'X-Newsreader))@@"
4842 @end example
4843
4844 @item
4845 @vindex gnus-ignored-from-addresses
4846 The @code{gnus-ignored-from-addresses} variable says when the @samp{%f}
4847 summary line spec returns the @code{To}, @code{Newsreader} or
4848 @code{From} header.  If this regexp matches the contents of the
4849 @code{From} header, the value of the @code{To} or @code{Newsreader}
4850 headers are used instead.
4851
4852 To distinguish regular articles from those where the @code{From} field
4853 has been swapped, a string is prefixed to the @code{To} or
4854 @code{Newsgroups} header in the summary line.  By default the string is
4855 @samp{-> } for @code{To} and @samp{=> } for @code{Newsgroups}, you can
4856 customize these strings with @code{gnus-summary-to-prefix} and
4857 @code{gnus-summary-newsgroup-prefix}.
4858
4859 @end enumerate
4860
4861 @vindex nnmail-extra-headers
4862 A related variable is @code{nnmail-extra-headers}, which controls when
4863 to include extra headers when generating overview (@acronym{NOV}) files.
4864 If you have old overview files, you should regenerate them after
4865 changing this variable, by entering the server buffer using @kbd{^},
4866 and then @kbd{g} on the appropriate mail server (e.g. nnml) to cause
4867 regeneration.
4868
4869 @vindex gnus-summary-line-format
4870 You also have to instruct Gnus to display the data by changing the
4871 @code{%n} spec to the @code{%f} spec in the
4872 @code{gnus-summary-line-format} variable.
4873
4874 In summary, you'd typically put something like the following in
4875 @file{~/.gnus.el}:
4876
4877 @lisp
4878 (setq gnus-extra-headers
4879       '(To Newsgroups))
4880 (setq nnmail-extra-headers gnus-extra-headers)
4881 (setq gnus-summary-line-format
4882       "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n")
4883 (setq gnus-ignored-from-addresses
4884       "Your Name Here")
4885 @end lisp
4886
4887 (The values listed above are the default values in Gnus.  Alter them
4888 to fit your needs.)
4889
4890 A note for news server administrators, or for users who wish to try to
4891 convince their news server administrator to provide some additional
4892 support:
4893
4894 The above is mostly useful for mail groups, where you have control over
4895 the @acronym{NOV} files that are created.  However, if you can persuade your
4896 nntp admin to add (in the usual implementation, notably INN):
4897
4898 @example
4899 Newsgroups:full
4900 @end example
4901
4902 to the end of her @file{overview.fmt} file, then you can use that just
4903 as you would the extra headers from the mail groups.
4904
4905
4906 @node Summary Buffer Mode Line
4907 @subsection Summary Buffer Mode Line
4908
4909 @vindex gnus-summary-mode-line-format
4910 You can also change the format of the summary mode bar (@pxref{Mode Line
4911 Formatting}).  Set @code{gnus-summary-mode-line-format} to whatever you
4912 like.  The default is @samp{Gnus: %%b [%A] %Z}.
4913
4914 Here are the elements you can play with:
4915
4916 @table @samp
4917 @item G
4918 Group name.
4919 @item p
4920 Unprefixed group name.
4921 @item A
4922 Current article number.
4923 @item z
4924 Current article score.
4925 @item V
4926 Gnus version.
4927 @item U
4928 Number of unread articles in this group.
4929 @item e
4930 Number of unread articles in this group that aren't displayed in the
4931 summary buffer.
4932 @item Z
4933 A string with the number of unread and unselected articles represented
4934 either as @samp{<%U(+%e) more>} if there are both unread and unselected
4935 articles, and just as @samp{<%U more>} if there are just unread articles
4936 and no unselected ones.
4937 @item g
4938 Shortish group name.  For instance, @samp{rec.arts.anime} will be
4939 shortened to @samp{r.a.anime}.
4940 @item S
4941 Subject of the current article.
4942 @item u
4943 User-defined spec (@pxref{User-Defined Specs}).
4944 @item s
4945 Name of the current score file (@pxref{Scoring}).
4946 @item d
4947 Number of dormant articles (@pxref{Unread Articles}).
4948 @item t
4949 Number of ticked articles (@pxref{Unread Articles}).
4950 @item r
4951 Number of articles that have been marked as read in this session.
4952 @item E
4953 Number of articles expunged by the score files.
4954 @end table
4955
4956
4957 @node Summary Highlighting
4958 @subsection Summary Highlighting
4959
4960 @table @code
4961
4962 @item gnus-visual-mark-article-hook
4963 @vindex gnus-visual-mark-article-hook
4964 This hook is run after selecting an article.  It is meant to be used for
4965 highlighting the article in some way.  It is not run if
4966 @code{gnus-visual} is @code{nil}.
4967
4968 @item gnus-summary-update-hook
4969 @vindex gnus-summary-update-hook
4970 This hook is called when a summary line is changed.  It is not run if
4971 @code{gnus-visual} is @code{nil}.
4972
4973 @item gnus-summary-selected-face
4974 @vindex gnus-summary-selected-face
4975 This is the face (or @dfn{font} as some people call it) used to
4976 highlight the current article in the summary buffer.
4977
4978 @item gnus-summary-highlight
4979 @vindex gnus-summary-highlight
4980 Summary lines are highlighted according to this variable, which is a
4981 list where the elements are of the format @code{(@var{form}
4982 . @var{face})}.  If you would, for instance, like ticked articles to be
4983 italic and high-scored articles to be bold, you could set this variable
4984 to something like
4985 @lisp
4986 (((eq mark gnus-ticked-mark) . italic)
4987  ((> score default) . bold))
4988 @end lisp
4989 As you may have guessed, if @var{form} returns a non-@code{nil} value,
4990 @var{face} will be applied to the line.
4991 @end table
4992
4993
4994 @node Summary Maneuvering
4995 @section Summary Maneuvering
4996 @cindex summary movement
4997
4998 All the straight movement commands understand the numeric prefix and
4999 behave pretty much as you'd expect.
5000
5001 None of these commands select articles.
5002
5003 @table @kbd
5004 @item G M-n
5005 @itemx M-n
5006 @kindex M-n (Summary)
5007 @kindex G M-n (Summary)
5008 @findex gnus-summary-next-unread-subject
5009 Go to the next summary line of an unread article
5010 (@code{gnus-summary-next-unread-subject}).
5011
5012 @item G M-p
5013 @itemx M-p
5014 @kindex M-p (Summary)
5015 @kindex G M-p (Summary)
5016 @findex gnus-summary-prev-unread-subject
5017 Go to the previous summary line of an unread article
5018 (@code{gnus-summary-prev-unread-subject}).
5019
5020 @item G g
5021 @kindex G g (Summary)
5022 @findex gnus-summary-goto-subject
5023 Ask for an article number and then go to the summary line of that article
5024 without displaying the article (@code{gnus-summary-goto-subject}).
5025 @end table
5026
5027 If Gnus asks you to press a key to confirm going to the next group, you
5028 can use the @kbd{C-n} and @kbd{C-p} keys to move around the group
5029 buffer, searching for the next group to read without actually returning
5030 to the group buffer.
5031
5032 Variables related to summary movement:
5033
5034 @table @code
5035
5036 @vindex gnus-auto-select-next
5037 @item gnus-auto-select-next
5038 If you issue one of the movement commands (like @kbd{n}) and there are
5039 no more unread articles after the current one, Gnus will offer to go to
5040 the next group.  If this variable is @code{t} and the next group is
5041 empty, Gnus will exit summary mode and return to the group buffer.  If
5042 this variable is neither @code{t} nor @code{nil}, Gnus will select the
5043 next group with unread articles.  As a special case, if this variable
5044 is @code{quietly}, Gnus will select the next group without asking for
5045 confirmation.  If this variable is @code{almost-quietly}, the same
5046 will happen only if you are located on the last article in the group.
5047 Finally, if this variable is @code{slightly-quietly}, the @kbd{Z n}
5048 command will go to the next group without confirmation.  Also
5049 @pxref{Group Levels}.
5050
5051 @item gnus-auto-select-same
5052 @vindex gnus-auto-select-same
5053 If non-@code{nil}, all the movement commands will try to go to the next
5054 article with the same subject as the current.  (@dfn{Same} here might
5055 mean @dfn{roughly equal}.  See @code{gnus-summary-gather-subject-limit}
5056 for details (@pxref{Customizing Threading}).)  If there are no more
5057 articles with the same subject, go to the first unread article.
5058
5059 This variable is not particularly useful if you use a threaded display.
5060
5061 @item gnus-summary-check-current
5062 @vindex gnus-summary-check-current
5063 If non-@code{nil}, all the ``unread'' movement commands will not proceed
5064 to the next (or previous) article if the current article is unread.
5065 Instead, they will choose the current article.
5066
5067 @item gnus-auto-center-summary
5068 @vindex gnus-auto-center-summary
5069 If non-@code{nil}, Gnus will keep the point in the summary buffer
5070 centered at all times.  This makes things quite tidy, but if you have a
5071 slow network connection, or simply do not like this un-Emacsism, you can
5072 set this variable to @code{nil} to get the normal Emacs scrolling
5073 action.  This will also inhibit horizontal re-centering of the summary
5074 buffer, which might make it more inconvenient to read extremely long
5075 threads.
5076
5077 This variable can also be a number.  In that case, center the window at
5078 the given number of lines from the top.
5079
5080 @end table
5081
5082
5083 @node Choosing Articles
5084 @section Choosing Articles
5085 @cindex selecting articles
5086
5087 @menu
5088 * Choosing Commands::           Commands for choosing articles.
5089 * Choosing Variables::          Variables that influence these commands.
5090 @end menu
5091
5092
5093 @node Choosing Commands
5094 @subsection Choosing Commands
5095
5096 None of the following movement commands understand the numeric prefix,
5097 and they all select and display an article.
5098
5099 If you want to fetch new articles or redisplay the group, see
5100 @ref{Exiting the Summary Buffer}.
5101
5102 @table @kbd
5103 @item SPACE
5104 @kindex SPACE (Summary)
5105 @findex gnus-summary-next-page
5106 Select the current article, or, if that one's read already, the next
5107 unread article (@code{gnus-summary-next-page}).
5108
5109 If you have an article window open already and you press @kbd{SPACE}
5110 again, the article will be scrolled.  This lets you conveniently
5111 @kbd{SPACE} through an entire newsgroup.  @xref{Paging the Article}.
5112
5113 @item G n
5114 @itemx n
5115 @kindex n (Summary)
5116 @kindex G n (Summary)
5117 @findex gnus-summary-next-unread-article
5118 @c @icon{gnus-summary-next-unread}
5119 Go to next unread article (@code{gnus-summary-next-unread-article}).
5120
5121 @item G p
5122 @itemx p
5123 @kindex p (Summary)
5124 @findex gnus-summary-prev-unread-article
5125 @c @icon{gnus-summary-prev-unread}
5126 Go to previous unread article (@code{gnus-summary-prev-unread-article}).
5127
5128 @item G N
5129 @itemx N
5130 @kindex N (Summary)
5131 @kindex G N (Summary)
5132 @findex gnus-summary-next-article
5133 Go to the next article (@code{gnus-summary-next-article}).
5134
5135 @item G P
5136 @itemx P
5137 @kindex P (Summary)
5138 @kindex G P (Summary)
5139 @findex gnus-summary-prev-article
5140 Go to the previous article (@code{gnus-summary-prev-article}).
5141
5142 @item G C-n
5143 @kindex G C-n (Summary)
5144 @findex gnus-summary-next-same-subject
5145 Go to the next article with the same subject
5146 (@code{gnus-summary-next-same-subject}).
5147
5148 @item G C-p
5149 @kindex G C-p (Summary)
5150 @findex gnus-summary-prev-same-subject
5151 Go to the previous article with the same subject
5152 (@code{gnus-summary-prev-same-subject}).
5153
5154 @item G f
5155 @itemx .
5156 @kindex G f  (Summary)
5157 @kindex .  (Summary)
5158 @findex gnus-summary-first-unread-article
5159 Go to the first unread article
5160 (@code{gnus-summary-first-unread-article}).
5161
5162 @item G b
5163 @itemx ,
5164 @kindex G b (Summary)
5165 @kindex , (Summary)
5166 @findex gnus-summary-best-unread-article
5167 Go to the unread article with the highest score
5168 (@code{gnus-summary-best-unread-article}).  If given a prefix argument,
5169 go to the first unread article that has a score over the default score.
5170
5171 @item G l
5172 @itemx l
5173 @kindex l (Summary)
5174 @kindex G l (Summary)
5175 @findex gnus-summary-goto-last-article
5176 Go to the previous article read (@code{gnus-summary-goto-last-article}).
5177
5178 @item G o
5179 @kindex G o (Summary)
5180 @findex gnus-summary-pop-article
5181 @cindex history
5182 @cindex article history
5183 Pop an article off the summary history and go to this article
5184 (@code{gnus-summary-pop-article}).  This command differs from the
5185 command above in that you can pop as many previous articles off the
5186 history as you like, while @kbd{l} toggles the two last read articles.
5187 For a somewhat related issue (if you use these commands a lot),
5188 @pxref{Article Backlog}.
5189
5190 @item G j
5191 @itemx j
5192 @kindex j (Summary)
5193 @kindex G j (Summary)
5194 @findex gnus-summary-goto-article
5195 Ask for an article number or @code{Message-ID}, and then go to that
5196 article (@code{gnus-summary-goto-article}).
5197
5198 @end table
5199
5200
5201 @node Choosing Variables
5202 @subsection Choosing Variables
5203
5204 Some variables relevant for moving and selecting articles:
5205
5206 @table @code
5207 @item gnus-auto-extend-newsgroup
5208 @vindex gnus-auto-extend-newsgroup
5209 All the movement commands will try to go to the previous (or next)
5210 article, even if that article isn't displayed in the Summary buffer if
5211 this variable is non-@code{nil}.  Gnus will then fetch the article from
5212 the server and display it in the article buffer.
5213
5214 @item gnus-select-article-hook
5215 @vindex gnus-select-article-hook
5216 This hook is called whenever an article is selected.  The default is
5217 @code{nil}.  If you would like each article to be saved in the Agent as
5218 you read it, putting @code{gnus-agent-fetch-selected-article} on this
5219 hook will do so.
5220
5221 @item gnus-mark-article-hook
5222 @vindex gnus-mark-article-hook
5223 @findex gnus-summary-mark-unread-as-read
5224 @findex gnus-summary-mark-read-and-unread-as-read
5225 @findex gnus-unread-mark
5226 This hook is called whenever an article is selected.  It is intended to
5227 be used for marking articles as read.  The default value is
5228 @code{gnus-summary-mark-read-and-unread-as-read}, and will change the
5229 mark of almost any article you read to @code{gnus-read-mark}.  The only
5230 articles not affected by this function are ticked, dormant, and
5231 expirable articles.  If you'd instead like to just have unread articles
5232 marked as read, you can use @code{gnus-summary-mark-unread-as-read}
5233 instead.  It will leave marks like @code{gnus-low-score-mark},
5234 @code{gnus-del-mark} (and so on) alone.
5235
5236 @end table
5237
5238
5239 @node Paging the Article
5240 @section Scrolling the Article
5241 @cindex article scrolling
5242
5243 @table @kbd
5244
5245 @item SPACE
5246 @kindex SPACE (Summary)
5247 @findex gnus-summary-next-page
5248 Pressing @kbd{SPACE} will scroll the current article forward one page,
5249 or, if you have come to the end of the current article, will choose the
5250 next article (@code{gnus-summary-next-page}).
5251
5252 @vindex gnus-article-boring-faces
5253 @vindex gnus-article-skip-boring
5254 If @code{gnus-article-skip-boring} is non-@code{nil} and the rest of
5255 the article consists only of citations and signature, then it will be
5256 skipped; the next article will be shown instead.  You can customize
5257 what is considered uninteresting with
5258 @code{gnus-article-boring-faces}.  You can manually view the article's
5259 pages, no matter how boring, using @kbd{C-M-v}.
5260
5261 @item DEL
5262 @kindex DEL (Summary)
5263 @findex gnus-summary-prev-page
5264 Scroll the current article back one page (@code{gnus-summary-prev-page}).
5265
5266 @item RET
5267 @kindex RET (Summary)
5268 @findex gnus-summary-scroll-up
5269 Scroll the current article one line forward
5270 (@code{gnus-summary-scroll-up}).
5271
5272 @item M-RET
5273 @kindex M-RET (Summary)
5274 @findex gnus-summary-scroll-down
5275 Scroll the current article one line backward
5276 (@code{gnus-summary-scroll-down}).
5277
5278 @item A g
5279 @itemx g
5280 @kindex A g (Summary)
5281 @kindex g (Summary)
5282 @findex gnus-summary-show-article
5283 @vindex gnus-summary-show-article-charset-alist
5284 (Re)fetch the current article (@code{gnus-summary-show-article}).  If
5285 given a prefix, fetch the current article, but don't run any of the
5286 article treatment functions.  This will give you a ``raw'' article, just
5287 the way it came from the server.
5288
5289 If given a numerical prefix, you can do semi-manual charset stuff.
5290 @kbd{C-u 0 g cn-gb-2312 RET} will decode the message as if it were
5291 encoded in the @code{cn-gb-2312} charset.  If you have
5292
5293 @lisp
5294 (setq gnus-summary-show-article-charset-alist
5295       '((1 . cn-gb-2312)
5296         (2 . big5)))
5297 @end lisp
5298
5299 then you can say @kbd{C-u 1 g} to get the same effect.
5300
5301 @item A <
5302 @itemx <
5303 @kindex < (Summary)
5304 @kindex A < (Summary)
5305 @findex gnus-summary-beginning-of-article
5306 Scroll to the beginning of the article
5307 (@code{gnus-summary-beginning-of-article}).
5308
5309 @item A >
5310 @itemx >
5311 @kindex > (Summary)
5312 @kindex A > (Summary)
5313 @findex gnus-summary-end-of-article
5314 Scroll to the end of the article (@code{gnus-summary-end-of-article}).
5315
5316 @item A s
5317 @itemx s
5318 @kindex A s (Summary)
5319 @kindex s (Summary)
5320 @findex gnus-summary-isearch-article
5321 Perform an isearch in the article buffer
5322 (@code{gnus-summary-isearch-article}).
5323
5324 @item h
5325 @kindex h (Summary)
5326 @findex gnus-summary-select-article-buffer
5327 Select the article buffer (@code{gnus-summary-select-article-buffer}).
5328
5329 @end table
5330
5331
5332 @node Reply Followup and Post
5333 @section Reply, Followup and Post
5334
5335 @menu
5336 * Summary Mail Commands::       Sending mail.
5337 * Summary Post Commands::       Sending news.
5338 * Summary Message Commands::    Other Message-related commands.
5339 * Canceling and Superseding::
5340 @end menu
5341
5342
5343 @node Summary Mail Commands
5344 @subsection Summary Mail Commands
5345 @cindex mail
5346 @cindex composing mail
5347
5348 Commands for composing a mail message:
5349
5350 @table @kbd
5351
5352 @item S r
5353 @itemx r
5354 @kindex S r (Summary)
5355 @kindex r (Summary)
5356 @findex gnus-summary-reply
5357 @c @icon{gnus-summary-mail-reply}
5358 @c @icon{gnus-summary-reply}
5359 Mail a reply to the author of the current article
5360 (@code{gnus-summary-reply}).
5361
5362 @item S R
5363 @itemx R
5364 @kindex R (Summary)
5365 @kindex S R (Summary)
5366 @findex gnus-summary-reply-with-original
5367 @c @icon{gnus-summary-reply-with-original}
5368 Mail a reply to the author of the current article and include the
5369 original message (@code{gnus-summary-reply-with-original}).  This
5370 command uses the process/prefix convention.
5371
5372 @item S w
5373 @kindex S w (Summary)
5374 @findex gnus-summary-wide-reply
5375 Mail a wide reply to the author of the current article
5376 (@code{gnus-summary-wide-reply}).  A @dfn{wide reply} is a reply that
5377 goes out to all people listed in the @code{To}, @code{From} (or
5378 @code{Reply-to}) and @code{Cc} headers.  If @code{Mail-Followup-To} is
5379 present, that's used instead.
5380
5381 @item S W
5382 @kindex S W (Summary)
5383 @findex gnus-summary-wide-reply-with-original
5384 Mail a wide reply to the current article and include the original
5385 message (@code{gnus-summary-wide-reply-with-original}).  This command uses
5386 the process/prefix convention.
5387
5388 @item S v
5389 @kindex S v (Summary)
5390 @findex gnus-summary-very-wide-reply
5391 Mail a very wide reply to the author of the current article
5392 (@code{gnus-summary-wide-reply}).  A @dfn{very wide reply} is a reply
5393 that goes out to all people listed in the @code{To}, @code{From} (or
5394 @code{Reply-to}) and @code{Cc} headers in all the process/prefixed
5395 articles.  This command uses the process/prefix convention.
5396
5397 @item S V
5398 @kindex S V (Summary)
5399 @findex gnus-summary-very-wide-reply-with-original
5400 Mail a very wide reply to the author of the current article and include the
5401 original message (@code{gnus-summary-very-wide-reply-with-original}).  This
5402 command uses the process/prefix convention.
5403
5404 @item S B r
5405 @kindex S B r (Summary)
5406 @findex gnus-summary-reply-broken-reply-to
5407 Mail a reply to the author of the current article but ignore the
5408 @code{Reply-To} field (@code{gnus-summary-reply-broken-reply-to}).
5409 If you need this because a mailing list incorrectly sets a
5410 @code{Reply-To} header pointing to the list, you probably want to set
5411 the @code{broken-reply-to} group parameter instead, so things will work
5412 correctly.  @xref{Group Parameters}.
5413
5414 @item S B R
5415 @kindex S B R (Summary)
5416 @findex gnus-summary-reply-broken-reply-to-with-original
5417 Mail a reply to the author of the current article and include the
5418 original message but ignore the @code{Reply-To} field
5419 (@code{gnus-summary-reply-broken-reply-to-with-original}).
5420
5421 @item S o m
5422 @itemx C-c C-f
5423 @kindex S o m (Summary)
5424 @kindex C-c C-f (Summary)
5425 @findex gnus-summary-mail-forward
5426 @c @icon{gnus-summary-mail-forward}
5427 Forward the current article to some other person
5428 (@code{gnus-summary-mail-forward}).  If no prefix is given, the message
5429 is forwarded according to the value of (@code{message-forward-as-mime})
5430 and (@code{message-forward-show-mml}); if the prefix is 1, decode the
5431 message and forward directly inline; if the prefix is 2, forward message
5432 as an rfc822 @acronym{MIME} section; if the prefix is 3, decode message and
5433 forward as an rfc822 @acronym{MIME} section; if the prefix is 4, forward message
5434 directly inline; otherwise, the message is forwarded as no prefix given
5435 but use the flipped value of (@code{message-forward-as-mime}).  By
5436 default, the message is decoded and forwarded as an rfc822 @acronym{MIME}
5437 section.
5438
5439 @item S m
5440 @itemx m
5441 @kindex m (Summary)
5442 @kindex S m (Summary)
5443 @findex gnus-summary-mail-other-window
5444 @c @icon{gnus-summary-mail-originate}
5445 Prepare a mail (@code{gnus-summary-mail-other-window}).  By default, use
5446 the posting style of the current group.  If given a prefix, disable that.
5447 If the prefix is 1, prompt for a group name to find the posting style.
5448
5449 @item S i
5450 @itemx i
5451 @kindex i (Summary)
5452 @kindex S i (Summary)
5453 @findex gnus-summary-news-other-window
5454 Prepare a news (@code{gnus-summary-news-other-window}).  By default,
5455 post to the current group.  If given a prefix, disable that.  If the
5456 prefix is 1, prompt for a group to post to.
5457
5458 This function actually prepares a news even when using mail groups.
5459 This is useful for ``posting'' messages to mail groups without actually
5460 sending them over the network: they're just saved directly to the group
5461 in question.  The corresponding back end must have a request-post method
5462 for this to work though.
5463
5464 @item S D b
5465 @kindex S D b (Summary)
5466 @findex gnus-summary-resend-bounced-mail
5467 @cindex bouncing mail
5468 If you have sent a mail, but the mail was bounced back to you for some
5469 reason (wrong address, transient failure), you can use this command to
5470 resend that bounced mail (@code{gnus-summary-resend-bounced-mail}).  You
5471 will be popped into a mail buffer where you can edit the headers before
5472 sending the mail off again.  If you give a prefix to this command, and
5473 the bounced mail is a reply to some other mail, Gnus will try to fetch
5474 that mail and display it for easy perusal of its headers.  This might
5475 very well fail, though.
5476
5477 @item S D r
5478 @kindex S D r (Summary)
5479 @findex gnus-summary-resend-message
5480 Not to be confused with the previous command,
5481 @code{gnus-summary-resend-message} will prompt you for an address to
5482 send the current message off to, and then send it to that place.  The
5483 headers of the message won't be altered---but lots of headers that say
5484 @code{Resent-To}, @code{Resent-From} and so on will be added.  This
5485 means that you actually send a mail to someone that has a @code{To}
5486 header that (probably) points to yourself.  This will confuse people.
5487 So, natcherly you'll only do that if you're really eVIl.
5488
5489 This command is mainly used if you have several accounts and want to
5490 ship a mail to a different account of yours.  (If you're both
5491 @code{root} and @code{postmaster} and get a mail for @code{postmaster}
5492 to the @code{root} account, you may want to resend it to
5493 @code{postmaster}.  Ordnung muss sein!
5494
5495 This command understands the process/prefix convention
5496 (@pxref{Process/Prefix}).
5497
5498 @item S D e
5499 @kindex S D e (Summary)
5500 @findex gnus-summary-resend-message-edit
5501
5502 Like the previous command, but will allow you to edit the message as
5503 if it were a new message before resending.
5504
5505 @item S O m
5506 @kindex S O m (Summary)
5507 @findex gnus-uu-digest-mail-forward
5508 Digest the current series (@pxref{Decoding Articles}) and forward the
5509 result using mail (@code{gnus-uu-digest-mail-forward}).  This command
5510 uses the process/prefix convention (@pxref{Process/Prefix}).
5511
5512 @item S M-c
5513 @kindex S M-c (Summary)
5514 @findex gnus-summary-mail-crosspost-complaint
5515 @cindex crossposting
5516 @cindex excessive crossposting
5517 Send a complaint about excessive crossposting to the author of the
5518 current article (@code{gnus-summary-mail-crosspost-complaint}).
5519
5520 @findex gnus-crosspost-complaint
5521 This command is provided as a way to fight back against the current
5522 crossposting pandemic that's sweeping Usenet.  It will compose a reply
5523 using the @code{gnus-crosspost-complaint} variable as a preamble.  This
5524 command understands the process/prefix convention
5525 (@pxref{Process/Prefix}) and will prompt you before sending each mail.
5526
5527 @end table
5528
5529 Also @xref{Header Commands, ,Header Commands, message, The Message
5530 Manual}, for more information.
5531
5532
5533 @node Summary Post Commands
5534 @subsection Summary Post Commands
5535 @cindex post
5536 @cindex composing news
5537
5538 Commands for posting a news article:
5539
5540 @table @kbd
5541 @item S p
5542 @itemx a
5543 @kindex a (Summary)
5544 @kindex S p (Summary)
5545 @findex gnus-summary-post-news
5546 @c @icon{gnus-summary-post-news}
5547 Prepare for posting an article (@code{gnus-summary-post-news}).  By
5548 default, post to the current group.  If given a prefix, disable that.
5549 If the prefix is 1, prompt for another group instead.
5550
5551 @item S f
5552 @itemx f
5553 @kindex f (Summary)
5554 @kindex S f (Summary)
5555 @findex gnus-summary-followup
5556 @c @icon{gnus-summary-followup}
5557 Post a followup to the current article (@code{gnus-summary-followup}).
5558
5559 @item S F
5560 @itemx F
5561 @kindex S F (Summary)
5562 @kindex F (Summary)
5563 @c @icon{gnus-summary-followup-with-original}
5564 @findex gnus-summary-followup-with-original
5565 Post a followup to the current article and include the original message
5566 (@code{gnus-summary-followup-with-original}).  This command uses the
5567 process/prefix convention.
5568
5569 @item S n
5570 @kindex S n (Summary)
5571 @findex gnus-summary-followup-to-mail
5572 Post a followup to the current article via news, even if you got the
5573 message through mail (@code{gnus-summary-followup-to-mail}).
5574
5575 @item S N
5576 @kindex S N (Summary)
5577 @findex gnus-summary-followup-to-mail-with-original
5578 Post a followup to the current article via news, even if you got the
5579 message through mail and include the original message
5580 (@code{gnus-summary-followup-to-mail-with-original}).  This command uses
5581 the process/prefix convention.
5582
5583 @item S o p
5584 @kindex S o p (Summary)
5585 @findex gnus-summary-post-forward
5586 Forward the current article to a newsgroup
5587 (@code{gnus-summary-post-forward}).
5588  If no prefix is given, the message is forwarded according to the value
5589 of (@code{message-forward-as-mime}) and
5590 (@code{message-forward-show-mml}); if the prefix is 1, decode the
5591 message and forward directly inline; if the prefix is 2, forward message
5592 as an rfc822 @acronym{MIME} section; if the prefix is 3, decode message and
5593 forward as an rfc822 @acronym{MIME} section; if the prefix is 4, forward message
5594 directly inline; otherwise, the message is forwarded as no prefix given
5595 but use the flipped value of (@code{message-forward-as-mime}).  By
5596 default, the message is decoded and forwarded as an rfc822 @acronym{MIME} section.
5597
5598 @item S O p
5599 @kindex S O p (Summary)
5600 @findex gnus-uu-digest-post-forward
5601 @cindex digests
5602 @cindex making digests
5603 Digest the current series and forward the result to a newsgroup
5604 (@code{gnus-uu-digest-post-forward}).  This command uses the
5605 process/prefix convention.
5606
5607 @item S u
5608 @kindex S u (Summary)
5609 @findex gnus-uu-post-news
5610 @c @icon{gnus-uu-post-news}
5611 Uuencode a file, split it into parts, and post it as a series
5612 (@code{gnus-uu-post-news}).  (@pxref{Uuencoding and Posting}).
5613 @end table
5614
5615 Also @xref{Header Commands, ,Header Commands, message, The Message
5616 Manual}, for more information.
5617
5618
5619 @node Summary Message Commands
5620 @subsection Summary Message Commands
5621
5622 @table @kbd
5623 @item S y
5624 @kindex S y (Summary)
5625 @findex gnus-summary-yank-message
5626 Yank the current article into an already existing Message composition
5627 buffer (@code{gnus-summary-yank-message}).  This command prompts for
5628 what message buffer you want to yank into, and understands the
5629 process/prefix convention (@pxref{Process/Prefix}).
5630
5631 @end table
5632
5633
5634 @node Canceling and Superseding
5635 @subsection Canceling Articles
5636 @cindex canceling articles
5637 @cindex superseding articles
5638
5639 Have you ever written something, and then decided that you really,
5640 really, really wish you hadn't posted that?
5641
5642 Well, you can't cancel mail, but you can cancel posts.
5643
5644 @findex gnus-summary-cancel-article
5645 @kindex C (Summary)
5646 @c @icon{gnus-summary-cancel-article}
5647 Find the article you wish to cancel (you can only cancel your own
5648 articles, so don't try any funny stuff).  Then press @kbd{C} or @kbd{S
5649 c} (@code{gnus-summary-cancel-article}).  Your article will be
5650 canceled---machines all over the world will be deleting your article.
5651 This command uses the process/prefix convention (@pxref{Process/Prefix}).
5652
5653 Be aware, however, that not all sites honor cancels, so your article may
5654 live on here and there, while most sites will delete the article in
5655 question.
5656
5657 Gnus will use the ``current'' select method when canceling.  If you
5658 want to use the standard posting method, use the @samp{a} symbolic
5659 prefix (@pxref{Symbolic Prefixes}).
5660
5661 Gnus ensures that only you can cancel your own messages using a
5662 @code{Cancel-Lock} header (@pxref{Canceling News, Canceling News, ,
5663 message, Message Manual}).
5664
5665 If you discover that you have made some mistakes and want to do some
5666 corrections, you can post a @dfn{superseding} article that will replace
5667 your original article.
5668
5669 @findex gnus-summary-supersede-article
5670 @kindex S (Summary)
5671 Go to the original article and press @kbd{S s}
5672 (@code{gnus-summary-supersede-article}).  You will be put in a buffer
5673 where you can edit the article all you want before sending it off the
5674 usual way.
5675
5676 The same goes for superseding as for canceling, only more so: Some
5677 sites do not honor superseding.  On those sites, it will appear that you
5678 have posted almost the same article twice.
5679
5680 If you have just posted the article, and change your mind right away,
5681 there is a trick you can use to cancel/supersede the article without
5682 waiting for the article to appear on your site first.  You simply return
5683 to the post buffer (which is called @code{*sent ...*}).  There you will
5684 find the article you just posted, with all the headers intact.  Change
5685 the @code{Message-ID} header to a @code{Cancel} or @code{Supersedes}
5686 header by substituting one of those words for the word
5687 @code{Message-ID}.  Then just press @kbd{C-c C-c} to send the article as
5688 you would do normally.  The previous article will be
5689 canceled/superseded.
5690
5691 Just remember, kids: There is no 'c' in 'supersede'.
5692
5693 @node Delayed Articles
5694 @section Delayed Articles
5695 @cindex delayed sending
5696 @cindex send delayed
5697
5698 Sometimes, you might wish to delay the sending of a message.  For
5699 example, you might wish to arrange for a message to turn up just in time
5700 to remind your about the birthday of your Significant Other.  For this,
5701 there is the @code{gnus-delay} package.  Setup is simple:
5702
5703 @lisp
5704 (gnus-delay-initialize)
5705 @end lisp
5706
5707 @findex gnus-delay-article
5708 Normally, to send a message you use the @kbd{C-c C-c} command from
5709 Message mode.  To delay a message, use @kbd{C-c C-j}
5710 (@code{gnus-delay-article}) instead.  This will ask you for how long the
5711 message should be delayed.  Possible answers are:
5712
5713 @itemize @bullet
5714 @item
5715 A time span.  Consists of an integer and a letter.  For example,
5716 @code{42d} means to delay for 42 days.  Available letters are @code{m}
5717 (minutes), @code{h} (hours), @code{d} (days), @code{w} (weeks), @code{M}
5718 (months) and @code{Y} (years).
5719
5720 @item
5721 A specific date.  Looks like @code{YYYY-MM-DD}.  The message will be
5722 delayed until that day, at a specific time (eight o'clock by default).
5723 See also @code{gnus-delay-default-hour}.
5724
5725 @item
5726 A specific time of day.  Given in @code{hh:mm} format, 24h, no am/pm
5727 stuff.  The deadline will be at that time today, except if that time has
5728 already passed, then it's at the given time tomorrow.  So if it's ten
5729 o'clock in the morning and you specify @code{11:15}, then the deadline
5730 is one hour and fifteen minutes hence.  But if you specify @code{9:20},
5731 that means a time tomorrow.
5732 @end itemize
5733
5734 The action of the @code{gnus-delay-article} command is influenced by a
5735 couple of variables:
5736
5737 @table @code
5738 @item gnus-delay-default-hour
5739 @vindex gnus-delay-default-hour
5740 When you specify a specific date, the message will be due on that hour
5741 on the given date.  Possible values are integers 0 through 23.
5742
5743 @item gnus-delay-default-delay
5744 @vindex gnus-delay-default-delay
5745 This is a string and gives the default delay.  It can be of any of the
5746 formats described above.
5747
5748 @item gnus-delay-group
5749 @vindex gnus-delay-group
5750 Delayed articles will be kept in this group on the drafts server until
5751 they are due.  You probably don't need to change this.  The default
5752 value is @code{"delayed"}.
5753
5754 @item gnus-delay-header
5755 @vindex gnus-delay-header
5756 The deadline for each article will be stored in a header.  This variable
5757 is a string and gives the header name.  You probably don't need to
5758 change this.  The default value is @code{"X-Gnus-Delayed"}.
5759 @end table
5760
5761 The way delaying works is like this: when you use the
5762 @code{gnus-delay-article} command, you give a certain delay.  Gnus
5763 calculates the deadline of the message and stores it in the
5764 @code{X-Gnus-Delayed} header and puts the message in the
5765 @code{nndraft:delayed} group.
5766
5767 @findex gnus-delay-send-queue
5768 And whenever you get new news, Gnus looks through the group for articles
5769 which are due and sends them.  It uses the @code{gnus-delay-send-queue}
5770 function for this.  By default, this function is added to the hook
5771 @code{gnus-get-new-news-hook}.  But of course, you can change this.
5772 Maybe you want to use the demon to send drafts?  Just tell the demon to
5773 execute the @code{gnus-delay-send-queue} function.
5774
5775 @table @code
5776 @item gnus-delay-initialize
5777 @findex gnus-delay-initialize
5778 By default, this function installs @code{gnus-delay-send-queue} in
5779 @code{gnus-get-new-news-hook}.  But it accepts the optional second
5780 argument @code{no-check}.  If it is non-@code{nil},
5781 @code{gnus-get-new-news-hook} is not changed.  The optional first
5782 argument is ignored.
5783
5784 For example, @code{(gnus-delay-initialize nil t)} means to do nothing.
5785 Presumably, you want to use the demon for sending due delayed articles.
5786 Just don't forget to set that up :-)
5787 @end table
5788
5789
5790 @node Marking Articles
5791 @section Marking Articles
5792 @cindex article marking
5793 @cindex article ticking
5794 @cindex marks
5795
5796 There are several marks you can set on an article.
5797
5798 You have marks that decide the @dfn{readedness} (whoo, neato-keano
5799 neologism ohoy!) of the article.  Alphabetic marks generally mean
5800 @dfn{read}, while non-alphabetic characters generally mean @dfn{unread}.
5801
5802 In addition, you also have marks that do not affect readedness.
5803
5804 @ifinfo
5805 There's a plethora of commands for manipulating these marks.
5806 @end ifinfo
5807
5808 @menu
5809 * Unread Articles::             Marks for unread articles.
5810 * Read Articles::               Marks for read articles.
5811 * Other Marks::                 Marks that do not affect readedness.
5812 * Setting Marks::               How to set and remove marks.
5813 * Generic Marking Commands::    How to customize the marking.
5814 * Setting Process Marks::       How to mark articles for later processing.
5815 @end menu
5816
5817
5818 @node Unread Articles
5819 @subsection Unread Articles
5820
5821 The following marks mark articles as (kinda) unread, in one form or
5822 other.
5823
5824 @table @samp
5825 @item !
5826 @vindex gnus-ticked-mark
5827 Marked as ticked (@code{gnus-ticked-mark}).
5828
5829 @dfn{Ticked articles} are articles that will remain visible always.  If
5830 you see an article that you find interesting, or you want to put off
5831 reading it, or replying to it, until sometime later, you'd typically
5832 tick it.  However, articles can be expired (from news servers by the
5833 news server software, Gnus itself never expires ticked messages), so if
5834 you want to keep an article forever, you'll have to make it persistent
5835 (@pxref{Persistent Articles}).
5836
5837 @item ?
5838 @vindex gnus-dormant-mark
5839 Marked as dormant (@code{gnus-dormant-mark}).
5840
5841 @dfn{Dormant articles} will only appear in the summary buffer if there
5842 are followups to it.  If you want to see them even if they don't have
5843 followups, you can use the @kbd{/ D} command (@pxref{Limiting}).
5844 Otherwise (except for the visibility issue), they are just like ticked
5845 messages.
5846
5847 @item SPACE
5848 @vindex gnus-unread-mark
5849 Marked as unread (@code{gnus-unread-mark}).
5850
5851 @dfn{Unread articles} are articles that haven't been read at all yet.
5852 @end table
5853
5854
5855 @node Read Articles
5856 @subsection Read Articles
5857 @cindex expirable mark
5858
5859 All the following marks mark articles as read.
5860
5861 @table @samp
5862
5863 @item r
5864 @vindex gnus-del-mark
5865 These are articles that the user has marked as read with the @kbd{d}
5866 command manually, more or less (@code{gnus-del-mark}).
5867
5868 @item R
5869 @vindex gnus-read-mark
5870 Articles that have actually been read (@code{gnus-read-mark}).
5871
5872 @item O
5873 @vindex gnus-ancient-mark
5874 Articles that were marked as read in previous sessions and are now
5875 @dfn{old} (@code{gnus-ancient-mark}).
5876
5877 @item K
5878 @vindex gnus-killed-mark
5879 Marked as killed (@code{gnus-killed-mark}).
5880
5881 @item X
5882 @vindex gnus-kill-file-mark
5883 Marked as killed by kill files (@code{gnus-kill-file-mark}).
5884
5885 @item Y
5886 @vindex gnus-low-score-mark
5887 Marked as read by having too low a score (@code{gnus-low-score-mark}).
5888
5889 @item C
5890 @vindex gnus-catchup-mark
5891 Marked as read by a catchup (@code{gnus-catchup-mark}).
5892
5893 @item G
5894 @vindex gnus-canceled-mark
5895 Canceled article (@code{gnus-canceled-mark})
5896
5897 @item F
5898 @vindex gnus-souped-mark
5899 @sc{soup}ed article (@code{gnus-souped-mark}).  @xref{SOUP}.
5900
5901 @item Q
5902 @vindex gnus-sparse-mark
5903 Sparsely reffed article (@code{gnus-sparse-mark}).  @xref{Customizing
5904 Threading}.
5905
5906 @item M
5907 @vindex gnus-duplicate-mark
5908 Article marked as read by duplicate suppression
5909 (@code{gnus-duplicate-mark}).  @xref{Duplicate Suppression}.
5910
5911 @end table
5912
5913 All these marks just mean that the article is marked as read, really.
5914 They are interpreted differently when doing adaptive scoring, though.
5915
5916 One more special mark, though:
5917
5918 @table @samp
5919 @item E
5920 @vindex gnus-expirable-mark
5921 Marked as expirable (@code{gnus-expirable-mark}).
5922
5923 Marking articles as @dfn{expirable} (or have them marked as such
5924 automatically) doesn't make much sense in normal groups---a user doesn't
5925 control expiring of news articles, but in mail groups, for instance,
5926 articles marked as @dfn{expirable} can be deleted by Gnus at
5927 any time.
5928 @end table
5929
5930
5931 @node Other Marks
5932 @subsection Other Marks
5933 @cindex process mark
5934 @cindex bookmarks
5935
5936 There are some marks that have nothing to do with whether the article is
5937 read or not.
5938
5939 @itemize @bullet
5940
5941 @item
5942 You can set a bookmark in the current article.  Say you are reading a
5943 long thesis on cats' urinary tracts, and have to go home for dinner
5944 before you've finished reading the thesis.  You can then set a bookmark
5945 in the article, and Gnus will jump to this bookmark the next time it
5946 encounters the article.  @xref{Setting Marks}.
5947
5948 @item
5949 @vindex gnus-replied-mark
5950 All articles that you have replied to or made a followup to (i.e., have
5951 answered) will be marked with an @samp{A} in the second column
5952 (@code{gnus-replied-mark}).
5953
5954 @item
5955 @vindex gnus-forwarded-mark
5956 All articles that you have forwarded will be marked with an @samp{F} in
5957 the second column (@code{gnus-forwarded-mark}).
5958
5959 @item
5960 @vindex gnus-cached-mark
5961 Articles stored in the article cache will be marked with an @samp{*} in
5962 the second column (@code{gnus-cached-mark}).  @xref{Article Caching}.
5963
5964 @item
5965 @vindex gnus-saved-mark
5966 Articles ``saved'' (in some manner or other; not necessarily
5967 religiously) are marked with an @samp{S} in the second column
5968 (@code{gnus-saved-mark}).
5969
5970 @item
5971 @vindex gnus-recent-mark
5972 Articles that according to the server haven't been shown to the user
5973 before are marked with a @samp{N} in the second column
5974 (@code{gnus-recent-mark}).  Note that not all servers support this
5975 mark, in which case it simply never appears.  Compare with
5976 @code{gnus-unseen-mark}.
5977
5978 @item
5979 @vindex gnus-unseen-mark
5980 Articles that haven't been seen before in Gnus by the user are marked
5981 with a @samp{.} in the second column (@code{gnus-unseen-mark}).
5982 Compare with @code{gnus-recent-mark}.
5983
5984 @item
5985 @vindex gnus-downloaded-mark
5986 When using the Gnus agent (@pxref{Agent Basics}), articles may be
5987 downloaded for unplugged (offline) viewing.  If you are using the
5988 @samp{%O} spec, these articles get the @samp{+} mark in that spec.
5989 (The variable @code{gnus-downloaded-mark} controls which character to
5990 use.)
5991
5992 @item
5993 @vindex gnus-undownloaded-mark
5994 When using the Gnus agent (@pxref{Agent Basics}), some articles might
5995 not have been downloaded.  Such articles cannot be viewed while you
5996 are unplugged (offline).  If you are using the @samp{%O} spec, these
5997 articles get the @samp{-} mark in that spec.  (The variable
5998 @code{gnus-undownloaded-mark} controls which character to use.)
5999
6000 @item
6001 @vindex gnus-downloadable-mark
6002 The Gnus agent (@pxref{Agent Basics}) downloads some articles
6003 automatically, but it is also possible to explicitly mark articles for
6004 download, even if they would not be downloaded automatically.  Such
6005 explicitly-marked articles get the @samp{%} mark in the first column.
6006 (The variable @code{gnus-downloadable-mark} controls which character to
6007 use.)
6008
6009 @item
6010 @vindex gnus-not-empty-thread-mark
6011 @vindex gnus-empty-thread-mark
6012 If the @samp{%e} spec is used, the presence of threads or not will be
6013 marked with @code{gnus-not-empty-thread-mark} and
6014 @code{gnus-empty-thread-mark} in the third column, respectively.
6015
6016 @item
6017 @vindex gnus-process-mark
6018 Finally we have the @dfn{process mark} (@code{gnus-process-mark}).  A
6019 variety of commands react to the presence of the process mark.  For
6020 instance, @kbd{X u} (@code{gnus-uu-decode-uu}) will uudecode and view
6021 all articles that have been marked with the process mark.  Articles
6022 marked with the process mark have a @samp{#} in the second column.
6023
6024 @end itemize
6025
6026 You might have noticed that most of these ``non-readedness'' marks
6027 appear in the second column by default.  So if you have a cached, saved,
6028 replied article that you have process-marked, what will that look like?
6029
6030 Nothing much.  The precedence rules go as follows: process -> cache ->
6031 replied -> saved.  So if the article is in the cache and is replied,
6032 you'll only see the cache mark and not the replied mark.
6033
6034
6035 @node Setting Marks
6036 @subsection Setting Marks
6037 @cindex setting marks
6038
6039 All the marking commands understand the numeric prefix.
6040
6041 @table @kbd
6042 @item M c
6043 @itemx M-u
6044 @kindex M c (Summary)
6045 @kindex M-u (Summary)
6046 @findex gnus-summary-clear-mark-forward
6047 @cindex mark as unread
6048 Clear all readedness-marks from the current article
6049 (@code{gnus-summary-clear-mark-forward}).  In other words, mark the
6050 article as unread.
6051
6052 @item M t
6053 @itemx !
6054 @kindex ! (Summary)
6055 @kindex M t (Summary)
6056 @findex gnus-summary-tick-article-forward
6057 Tick the current article (@code{gnus-summary-tick-article-forward}).
6058 @xref{Article Caching}.
6059
6060 @item M ?
6061 @itemx ?
6062 @kindex ? (Summary)
6063 @kindex M ? (Summary)
6064 @findex gnus-summary-mark-as-dormant
6065 Mark the current article as dormant
6066 (@code{gnus-summary-mark-as-dormant}).  @xref{Article Caching}.
6067
6068 @item M d
6069 @itemx d
6070 @kindex M d (Summary)
6071 @kindex d (Summary)
6072 @findex gnus-summary-mark-as-read-forward
6073 Mark the current article as read
6074 (@code{gnus-summary-mark-as-read-forward}).
6075
6076 @item D
6077 @kindex D (Summary)
6078 @findex gnus-summary-mark-as-read-backward
6079 Mark the current article as read and move point to the previous line
6080 (@code{gnus-summary-mark-as-read-backward}).
6081
6082 @item M k
6083 @itemx k
6084 @kindex k (Summary)
6085 @kindex M k (Summary)
6086 @findex gnus-summary-kill-same-subject-and-select
6087 Mark all articles that have the same subject as the current one as read,
6088 and then select the next unread article
6089 (@code{gnus-summary-kill-same-subject-and-select}).
6090
6091 @item M K
6092 @itemx C-k
6093 @kindex M K (Summary)
6094 @kindex C-k (Summary)
6095 @findex gnus-summary-kill-same-subject
6096 Mark all articles that have the same subject as the current one as read
6097 (@code{gnus-summary-kill-same-subject}).
6098
6099 @item M C
6100 @kindex M C (Summary)
6101 @findex gnus-summary-catchup
6102 @c @icon{gnus-summary-catchup}
6103 Mark all unread articles as read (@code{gnus-summary-catchup}).
6104
6105 @item M C-c
6106 @kindex M C-c (Summary)
6107 @findex gnus-summary-catchup-all
6108 Mark all articles in the group as read---even the ticked and dormant
6109 articles (@code{gnus-summary-catchup-all}).
6110
6111 @item M H
6112 @kindex M H (Summary)
6113 @findex gnus-summary-catchup-to-here
6114 Catchup the current group to point (before the point)
6115 (@code{gnus-summary-catchup-to-here}).
6116
6117 @item M h
6118 @kindex M h (Summary)
6119 @findex gnus-summary-catchup-from-here
6120 Catchup the current group from point (after the point)
6121 (@code{gnus-summary-catchup-from-here}).
6122
6123 @item C-w
6124 @kindex C-w (Summary)
6125 @findex gnus-summary-mark-region-as-read
6126 Mark all articles between point and mark as read
6127 (@code{gnus-summary-mark-region-as-read}).
6128
6129 @item M V k
6130 @kindex M V k (Summary)
6131 @findex gnus-summary-kill-below
6132 Kill all articles with scores below the default score (or below the
6133 numeric prefix) (@code{gnus-summary-kill-below}).
6134
6135 @item M e
6136 @itemx E
6137 @kindex M e (Summary)
6138 @kindex E (Summary)
6139 @findex gnus-summary-mark-as-expirable
6140 Mark the current article as expirable
6141 (@code{gnus-summary-mark-as-expirable}).
6142
6143 @item M b
6144 @kindex M b (Summary)
6145 @findex gnus-summary-set-bookmark
6146 Set a bookmark in the current article
6147 (@code{gnus-summary-set-bookmark}).
6148
6149 @item M B
6150 @kindex M B (Summary)
6151 @findex gnus-summary-remove-bookmark
6152 Remove the bookmark from the current article
6153 (@code{gnus-summary-remove-bookmark}).
6154
6155 @item M V c
6156 @kindex M V c (Summary)
6157 @findex gnus-summary-clear-above
6158 Clear all marks from articles with scores over the default score (or
6159 over the numeric prefix) (@code{gnus-summary-clear-above}).
6160
6161 @item M V u
6162 @kindex M V u (Summary)
6163 @findex gnus-summary-tick-above
6164 Tick all articles with scores over the default score (or over the
6165 numeric prefix) (@code{gnus-summary-tick-above}).
6166
6167 @item M V m
6168 @kindex M V m (Summary)
6169 @findex gnus-summary-mark-above
6170 Prompt for a mark, and mark all articles with scores over the default
6171 score (or over the numeric prefix) with this mark
6172 (@code{gnus-summary-clear-above}).
6173 @end table
6174
6175 @vindex gnus-summary-goto-unread
6176 The @code{gnus-summary-goto-unread} variable controls what action should
6177 be taken after setting a mark.  If non-@code{nil}, point will move to
6178 the next/previous unread article.  If @code{nil}, point will just move
6179 one line up or down.  As a special case, if this variable is
6180 @code{never}, all the marking commands as well as other commands (like
6181 @kbd{SPACE}) will move to the next article, whether it is unread or not.
6182 The default is @code{t}.
6183
6184
6185 @node Generic Marking Commands
6186 @subsection Generic Marking Commands
6187
6188 Some people would like the command that ticks an article (@kbd{!}) go to
6189 the next article.  Others would like it to go to the next unread
6190 article.  Yet others would like it to stay on the current article.  And
6191 even though I haven't heard of anybody wanting it to go to the
6192 previous (unread) article, I'm sure there are people that want that as
6193 well.
6194
6195 Multiply these five behaviors with five different marking commands, and
6196 you get a potentially complex set of variable to control what each
6197 command should do.
6198
6199 To sidestep that mess, Gnus provides commands that do all these
6200 different things.  They can be found on the @kbd{M M} map in the summary
6201 buffer.  Type @kbd{M M C-h} to see them all---there are too many of them
6202 to list in this manual.
6203
6204 While you can use these commands directly, most users would prefer
6205 altering the summary mode keymap.  For instance, if you would like the
6206 @kbd{!} command to go to the next article instead of the next unread
6207 article, you could say something like:
6208
6209 @lisp
6210 @group
6211 (add-hook 'gnus-summary-mode-hook 'my-alter-summary-map)
6212 (defun my-alter-summary-map ()
6213   (local-set-key "!" 'gnus-summary-put-mark-as-ticked-next))
6214 @end group
6215 @end lisp
6216
6217 @noindent
6218 or
6219
6220 @lisp
6221 (defun my-alter-summary-map ()
6222   (local-set-key "!" "MM!n"))
6223 @end lisp
6224
6225
6226 @node Setting Process Marks
6227 @subsection Setting Process Marks
6228 @cindex setting process marks
6229
6230 Process marks are displayed as @code{#} in the summary buffer, and are
6231 used for marking articles in such a way that other commands will
6232 process these articles.  For instance, if you process mark four
6233 articles and then use the @kbd{*} command, Gnus will enter these four
6234 commands into the cache.  For more information,
6235 @pxref{Process/Prefix}.
6236
6237 @table @kbd
6238
6239 @item M P p
6240 @itemx #
6241 @kindex # (Summary)
6242 @kindex M P p (Summary)
6243 @findex gnus-summary-mark-as-processable
6244 Mark the current article with the process mark
6245 (@code{gnus-summary-mark-as-processable}).
6246 @findex gnus-summary-unmark-as-processable
6247
6248 @item M P u
6249 @itemx M-#
6250 @kindex M P u (Summary)
6251 @kindex M-# (Summary)
6252 Remove the process mark, if any, from the current article
6253 (@code{gnus-summary-unmark-as-processable}).
6254
6255 @item M P U
6256 @kindex M P U (Summary)
6257 @findex gnus-summary-unmark-all-processable
6258 Remove the process mark from all articles
6259 (@code{gnus-summary-unmark-all-processable}).
6260
6261 @item M P i
6262 @kindex M P i (Summary)
6263 @findex gnus-uu-invert-processable
6264 Invert the list of process marked articles
6265 (@code{gnus-uu-invert-processable}).
6266
6267 @item M P R
6268 @kindex M P R (Summary)
6269 @findex gnus-uu-mark-by-regexp
6270 Mark articles that have a @code{Subject} header that matches a regular
6271 expression (@code{gnus-uu-mark-by-regexp}).
6272
6273 @item M P G
6274 @kindex M P G (Summary)
6275 @findex gnus-uu-unmark-by-regexp
6276 Unmark articles that have a @code{Subject} header that matches a regular
6277 expression (@code{gnus-uu-unmark-by-regexp}).
6278
6279 @item M P r
6280 @kindex M P r (Summary)
6281 @findex gnus-uu-mark-region
6282 Mark articles in region (@code{gnus-uu-mark-region}).
6283
6284 @item M P g
6285 @kindex M P g (Summary)
6286 @findex gnus-uu-unmark-region
6287 Unmark articles in region (@code{gnus-uu-unmark-region}).
6288
6289 @item M P t
6290 @kindex M P t (Summary)
6291 @findex gnus-uu-mark-thread
6292 Mark all articles in the current (sub)thread
6293 (@code{gnus-uu-mark-thread}).
6294
6295 @item M P T
6296 @kindex M P T (Summary)
6297 @findex gnus-uu-unmark-thread
6298 Unmark all articles in the current (sub)thread
6299 (@code{gnus-uu-unmark-thread}).
6300
6301 @item M P v
6302 @kindex M P v (Summary)
6303 @findex gnus-uu-mark-over
6304 Mark all articles that have a score above the prefix argument
6305 (@code{gnus-uu-mark-over}).
6306
6307 @item M P s
6308 @kindex M P s (Summary)
6309 @findex gnus-uu-mark-series
6310 Mark all articles in the current series (@code{gnus-uu-mark-series}).
6311
6312 @item M P S
6313 @kindex M P S (Summary)
6314 @findex gnus-uu-mark-sparse
6315 Mark all series that have already had some articles marked
6316 (@code{gnus-uu-mark-sparse}).
6317
6318 @item M P a
6319 @kindex M P a (Summary)
6320 @findex gnus-uu-mark-all
6321 Mark all articles in series order (@code{gnus-uu-mark-all}).
6322
6323 @item M P b
6324 @kindex M P b (Summary)
6325 @findex gnus-uu-mark-buffer
6326 Mark all articles in the buffer in the order they appear
6327 (@code{gnus-uu-mark-buffer}).
6328
6329 @item M P k
6330 @kindex M P k (Summary)
6331 @findex gnus-summary-kill-process-mark
6332 Push the current process mark set onto the stack and unmark all articles
6333 (@code{gnus-summary-kill-process-mark}).
6334
6335 @item M P y
6336 @kindex M P y (Summary)
6337 @findex gnus-summary-yank-process-mark
6338 Pop the previous process mark set from the stack and restore it
6339 (@code{gnus-summary-yank-process-mark}).
6340
6341 @item M P w
6342 @kindex M P w (Summary)
6343 @findex gnus-summary-save-process-mark
6344 Push the current process mark set onto the stack
6345 (@code{gnus-summary-save-process-mark}).
6346
6347 @end table
6348
6349 Also see the @kbd{&} command in @ref{Searching for Articles}, for how to
6350 set process marks based on article body contents.
6351
6352
6353 @node Limiting
6354 @section Limiting
6355 @cindex limiting
6356
6357 It can be convenient to limit the summary buffer to just show some
6358 subset of the articles currently in the group.  The effect most limit
6359 commands have is to remove a few (or many) articles from the summary
6360 buffer.
6361
6362 All limiting commands work on subsets of the articles already fetched
6363 from the servers.  None of these commands query the server for
6364 additional articles.
6365
6366 @table @kbd
6367
6368 @item / /
6369 @itemx / s
6370 @kindex / / (Summary)
6371 @findex gnus-summary-limit-to-subject
6372 Limit the summary buffer to articles that match some subject
6373 (@code{gnus-summary-limit-to-subject}).  If given a prefix, exclude
6374 matching articles.
6375
6376 @item / a
6377 @kindex / a (Summary)
6378 @findex gnus-summary-limit-to-author
6379 Limit the summary buffer to articles that match some author
6380 (@code{gnus-summary-limit-to-author}).  If given a prefix, exclude
6381 matching articles.
6382
6383 @item / R
6384 @kindex / R (Summary)
6385 @findex gnus-summary-limit-to-recipient
6386 Limit the summary buffer to articles that match some recipient
6387 (@code{gnus-summary-limit-to-recipient}).  If given a prefix, exclude
6388 matching articles.
6389
6390 @item / x
6391 @kindex / x (Summary)
6392 @findex gnus-summary-limit-to-extra
6393 Limit the summary buffer to articles that match one of the ``extra''
6394 headers (@pxref{To From Newsgroups})
6395 (@code{gnus-summary-limit-to-extra}).  If given a prefix, exclude
6396 matching articles.
6397
6398 @item / u
6399 @itemx x
6400 @kindex / u (Summary)
6401 @kindex x (Summary)
6402 @findex gnus-summary-limit-to-unread
6403 Limit the summary buffer to articles not marked as read
6404 (@code{gnus-summary-limit-to-unread}).  If given a prefix, limit the
6405 buffer to articles strictly unread.  This means that ticked and
6406 dormant articles will also be excluded.
6407
6408 @item / m
6409 @kindex / m (Summary)
6410 @findex gnus-summary-limit-to-marks
6411 Ask for a mark and then limit to all articles that have been marked
6412 with that mark (@code{gnus-summary-limit-to-marks}).
6413
6414 @item / t
6415 @kindex / t (Summary)
6416 @findex gnus-summary-limit-to-age
6417 Ask for a number and then limit the summary buffer to articles older than (or equal to) that number of days
6418 (@code{gnus-summary-limit-to-age}).  If given a prefix, limit to
6419 articles younger than that number of days.
6420
6421 @item / n
6422 @kindex / n (Summary)
6423 @findex gnus-summary-limit-to-articles
6424 Limit the summary buffer to the current article
6425 (@code{gnus-summary-limit-to-articles}).  Uses the process/prefix
6426 convention (@pxref{Process/Prefix}).
6427
6428 @item / w
6429 @kindex / w (Summary)
6430 @findex gnus-summary-pop-limit
6431 Pop the previous limit off the stack and restore it
6432 (@code{gnus-summary-pop-limit}).  If given a prefix, pop all limits off
6433 the stack.
6434
6435 @item / .
6436 @kindex / . (Summary)
6437 @findex gnus-summary-limit-to-unseen
6438 Limit the summary buffer to the unseen articles
6439 (@code{gnus-summary-limit-to-unseen}).
6440
6441 @item / v
6442 @kindex / v (Summary)
6443 @findex gnus-summary-limit-to-score
6444 Limit the summary buffer to articles that have a score at or above some
6445 score (@code{gnus-summary-limit-to-score}).
6446
6447 @item / p
6448 @kindex / p (Summary)
6449 @findex gnus-summary-limit-to-display-predicate
6450 Limit the summary buffer to articles that satisfy the @code{display}
6451 group parameter predicate
6452 (@code{gnus-summary-limit-to-display-predicate}).  @xref{Group
6453 Parameters}, for more on this predicate.
6454
6455 @item / r
6456 @kindex / r (Summary)
6457 @findex gnus-summary-limit-to-replied
6458 Limit the summary buffer to replied articles
6459 (@code{gnus-summary-limit-to-replied}).  If given a prefix, exclude
6460 replied articles.
6461
6462 @item / E
6463 @itemx M S
6464 @kindex M S (Summary)
6465 @kindex / E (Summary)
6466 @findex gnus-summary-limit-include-expunged
6467 Include all expunged articles in the limit
6468 (@code{gnus-summary-limit-include-expunged}).
6469
6470 @item / D
6471 @kindex / D (Summary)
6472 @findex gnus-summary-limit-include-dormant
6473 Include all dormant articles in the limit
6474 (@code{gnus-summary-limit-include-dormant}).
6475
6476 @item / *
6477 @kindex / * (Summary)
6478 @findex gnus-summary-limit-include-cached
6479 Include all cached articles in the limit
6480 (@code{gnus-summary-limit-include-cached}).
6481
6482 @item / d
6483 @kindex / d (Summary)
6484 @findex gnus-summary-limit-exclude-dormant
6485 Exclude all dormant articles from the limit
6486 (@code{gnus-summary-limit-exclude-dormant}).
6487
6488 @item / M
6489 @kindex / M (Summary)
6490 @findex gnus-summary-limit-exclude-marks
6491 Exclude all marked articles (@code{gnus-summary-limit-exclude-marks}).
6492
6493 @item / T
6494 @kindex / T (Summary)
6495 @findex gnus-summary-limit-include-thread
6496 Include all the articles in the current thread in the limit.
6497
6498 @item / c
6499 @kindex / c (Summary)
6500 @findex gnus-summary-limit-exclude-childless-dormant
6501 Exclude all dormant articles that have no children from the limit@*
6502 (@code{gnus-summary-limit-exclude-childless-dormant}).
6503
6504 @item / C
6505 @kindex / C (Summary)
6506 @findex gnus-summary-limit-mark-excluded-as-read
6507 Mark all excluded unread articles as read
6508 (@code{gnus-summary-limit-mark-excluded-as-read}).  If given a prefix,
6509 also mark excluded ticked and dormant articles as read.
6510
6511 @item / N
6512 @kindex / N (Summary)
6513 @findex gnus-summary-insert-new-articles
6514 Insert all new articles in the summary buffer.  It scans for new emails
6515 if @var{back-end}@code{-get-new-mail} is non-@code{nil}.
6516
6517 @item / o
6518 @kindex / o (Summary)
6519 @findex gnus-summary-insert-old-articles
6520 Insert all old articles in the summary buffer.  If given a numbered
6521 prefix, fetch this number of articles.
6522
6523 @item / b
6524 @kindex / b (Summary)
6525 @findex gnus-summary-limit-to-bodies
6526 Limit the summary buffer to articles that have bodies that match a
6527 certain regexp (@code{gnus-summary-limit-to-bodies}).  If given a
6528 prefix, reverse the limit.  This command is quite slow since it
6529 requires selecting each article to find the matches.
6530
6531 @end table
6532
6533
6534 @node Threading
6535 @section Threading
6536 @cindex threading
6537 @cindex article threading
6538
6539 Gnus threads articles by default.  @dfn{To thread} is to put responses
6540 to articles directly after the articles they respond to---in a
6541 hierarchical fashion.
6542
6543 Threading is done by looking at the @code{References} headers of the
6544 articles.  In a perfect world, this would be enough to build pretty
6545 trees, but unfortunately, the @code{References} header is often broken
6546 or simply missing.  Weird news propagation exacerbates the problem,
6547 so one has to employ other heuristics to get pleasing results.  A
6548 plethora of approaches exists, as detailed in horrible detail in
6549 @ref{Customizing Threading}.
6550
6551 First, a quick overview of the concepts:
6552
6553 @table @dfn
6554 @item root
6555 The top-most article in a thread; the first article in the thread.
6556
6557 @item thread
6558 A tree-like article structure.
6559
6560 @item sub-thread
6561 A small(er) section of this tree-like structure.
6562
6563 @item loose threads
6564 Threads often lose their roots due to article expiry, or due to the root
6565 already having been read in a previous session, and not displayed in the
6566 summary buffer.  We then typically have many sub-threads that really
6567 belong to one thread, but are without connecting roots.  These are
6568 called loose threads.
6569
6570 @item thread gathering
6571 An attempt to gather loose threads into bigger threads.
6572
6573 @item sparse threads
6574 A thread where the missing articles have been ``guessed'' at, and are
6575 displayed as empty lines in the summary buffer.
6576
6577 @end table
6578
6579
6580 @menu
6581 * Customizing Threading::       Variables you can change to affect the threading.
6582 * Thread Commands::             Thread based commands in the summary buffer.
6583 @end menu
6584
6585
6586 @node Customizing Threading
6587 @subsection Customizing Threading
6588 @cindex customizing threading
6589
6590 @menu
6591 * Loose Threads::               How Gnus gathers loose threads into bigger threads.
6592 * Filling In Threads::          Making the threads displayed look fuller.
6593 * More Threading::              Even more variables for fiddling with threads.
6594 * Low-Level Threading::         You thought it was over@dots{} but you were wrong!
6595 @end menu
6596
6597
6598 @node Loose Threads
6599 @subsubsection Loose Threads
6600 @cindex <
6601 @cindex >
6602 @cindex loose threads
6603
6604 @table @code
6605 @item gnus-summary-make-false-root
6606 @vindex gnus-summary-make-false-root
6607 If non-@code{nil}, Gnus will gather all loose subtrees into one big tree
6608 and create a dummy root at the top.  (Wait a minute.  Root at the top?
6609 Yup.)  Loose subtrees occur when the real root has expired, or you've
6610 read or killed the root in a previous session.
6611
6612 When there is no real root of a thread, Gnus will have to fudge
6613 something.  This variable says what fudging method Gnus should use.
6614 There are four possible values:
6615
6616 @iftex
6617 @iflatex
6618 \gnusfigure{The Summary Buffer}{390}{
6619 \put(0,0){\epsfig{figure=ps/summary-adopt,width=7.5cm}}
6620 \put(445,0){\makebox(0,0)[br]{\epsfig{figure=ps/summary-empty,width=7.5cm}}}
6621 \put(0,400){\makebox(0,0)[tl]{\epsfig{figure=ps/summary-none,width=7.5cm}}}
6622 \put(445,400){\makebox(0,0)[tr]{\epsfig{figure=ps/summary-dummy,width=7.5cm}}}
6623 }
6624 @end iflatex
6625 @end iftex
6626
6627 @cindex adopting articles
6628
6629 @table @code
6630
6631 @item adopt
6632 Gnus will make the first of the orphaned articles the parent.  This
6633 parent will adopt all the other articles.  The adopted articles will be
6634 marked as such by pointy brackets (@samp{<>}) instead of the standard
6635 square brackets (@samp{[]}).  This is the default method.
6636
6637 @item dummy
6638 @vindex gnus-summary-dummy-line-format
6639 @vindex gnus-summary-make-false-root-always
6640 Gnus will create a dummy summary line that will pretend to be the
6641 parent.  This dummy line does not correspond to any real article, so
6642 selecting it will just select the first real article after the dummy
6643 article.  @code{gnus-summary-dummy-line-format} is used to specify the
6644 format of the dummy roots.  It accepts only one format spec:  @samp{S},
6645 which is the subject of the article.  @xref{Formatting Variables}.
6646 If you want all threads to have a dummy root, even the non-gathered
6647 ones, set @code{gnus-summary-make-false-root-always} to @code{t}.
6648
6649 @item empty
6650 Gnus won't actually make any article the parent, but simply leave the
6651 subject field of all orphans except the first empty.  (Actually, it will
6652 use @code{gnus-summary-same-subject} as the subject (@pxref{Summary
6653 Buffer Format}).)
6654
6655 @item none
6656 Don't make any article parent at all.  Just gather the threads and
6657 display them after one another.
6658
6659 @item nil
6660 Don't gather loose threads.
6661 @end table
6662
6663 @item gnus-summary-gather-subject-limit
6664 @vindex gnus-summary-gather-subject-limit
6665 Loose threads are gathered by comparing subjects of articles.  If this
6666 variable is @code{nil}, Gnus requires an exact match between the
6667 subjects of the loose threads before gathering them into one big
6668 super-thread.  This might be too strict a requirement, what with the
6669 presence of stupid newsreaders that chop off long subject lines.  If
6670 you think so, set this variable to, say, 20 to require that only the
6671 first 20 characters of the subjects have to match.  If you set this
6672 variable to a really low number, you'll find that Gnus will gather
6673 everything in sight into one thread, which isn't very helpful.
6674
6675 @cindex fuzzy article gathering
6676 If you set this variable to the special value @code{fuzzy}, Gnus will
6677 use a fuzzy string comparison algorithm on the subjects (@pxref{Fuzzy
6678 Matching}).
6679
6680 @item gnus-simplify-subject-fuzzy-regexp
6681 @vindex gnus-simplify-subject-fuzzy-regexp
6682 This can either be a regular expression or list of regular expressions
6683 that match strings that will be removed from subjects if fuzzy subject
6684 simplification is used.
6685
6686 @item gnus-simplify-ignored-prefixes
6687 @vindex gnus-simplify-ignored-prefixes
6688 If you set @code{gnus-summary-gather-subject-limit} to something as low
6689 as 10, you might consider setting this variable to something sensible:
6690
6691 @c Written by Michael Ernst <mernst@cs.rice.edu>
6692 @lisp
6693 (setq gnus-simplify-ignored-prefixes
6694       (concat
6695        "\\`\\[?\\("
6696        (mapconcat
6697         'identity
6698         '("looking"
6699           "wanted" "followup" "summary\\( of\\)?"
6700           "help" "query" "problem" "question"
6701           "answer" "reference" "announce"
6702           "How can I" "How to" "Comparison of"
6703           ;; ...
6704           )
6705         "\\|")
6706        "\\)\\s *\\("
6707        (mapconcat 'identity
6708                   '("for" "for reference" "with" "about")
6709                   "\\|")
6710        "\\)?\\]?:?[ \t]*"))
6711 @end lisp
6712
6713 All words that match this regexp will be removed before comparing two
6714 subjects.
6715
6716 @item gnus-simplify-subject-functions
6717 @vindex gnus-simplify-subject-functions
6718 If non-@code{nil}, this variable overrides
6719 @code{gnus-summary-gather-subject-limit}.  This variable should be a
6720 list of functions to apply to the @code{Subject} string iteratively to
6721 arrive at the simplified version of the string.
6722
6723 Useful functions to put in this list include:
6724
6725 @table @code
6726 @item gnus-simplify-subject-re
6727 @findex gnus-simplify-subject-re
6728 Strip the leading @samp{Re:}.
6729
6730 @item gnus-simplify-subject-fuzzy
6731 @findex gnus-simplify-subject-fuzzy
6732 Simplify fuzzily.
6733
6734 @item gnus-simplify-whitespace
6735 @findex gnus-simplify-whitespace
6736 Remove excessive whitespace.
6737
6738 @item gnus-simplify-all-whitespace
6739 @findex gnus-simplify-all-whitespace
6740 Remove all whitespace.
6741 @end table
6742
6743 You may also write your own functions, of course.
6744
6745
6746 @item gnus-summary-gather-exclude-subject
6747 @vindex gnus-summary-gather-exclude-subject
6748 Since loose thread gathering is done on subjects only, that might lead
6749 to many false hits, especially with certain common subjects like
6750 @samp{} and @samp{(none)}.  To make the situation slightly better,
6751 you can use the regexp @code{gnus-summary-gather-exclude-subject} to say
6752 what subjects should be excluded from the gathering process.@*
6753 The default is @samp{^ *$\\|^(none)$}.
6754
6755 @item gnus-summary-thread-gathering-function
6756 @vindex gnus-summary-thread-gathering-function
6757 Gnus gathers threads by looking at @code{Subject} headers.  This means
6758 that totally unrelated articles may end up in the same ``thread'', which
6759 is confusing.  An alternate approach is to look at all the
6760 @code{Message-ID}s in all the @code{References} headers to find matches.
6761 This will ensure that no gathered threads ever include unrelated
6762 articles, but it also means that people who have posted with broken
6763 newsreaders won't be gathered properly.  The choice is yours---plague or
6764 cholera:
6765
6766 @table @code
6767 @item gnus-gather-threads-by-subject
6768 @findex gnus-gather-threads-by-subject
6769 This function is the default gathering function and looks at
6770 @code{Subject}s exclusively.
6771
6772 @item gnus-gather-threads-by-references
6773 @findex gnus-gather-threads-by-references
6774 This function looks at @code{References} headers exclusively.
6775 @end table
6776
6777 If you want to test gathering by @code{References}, you could say
6778 something like:
6779
6780 @lisp
6781 (setq gnus-summary-thread-gathering-function
6782       'gnus-gather-threads-by-references)
6783 @end lisp
6784
6785 @end table
6786
6787
6788 @node Filling In Threads
6789 @subsubsection Filling In Threads
6790
6791 @table @code
6792 @item gnus-fetch-old-headers
6793 @vindex gnus-fetch-old-headers
6794 If non-@code{nil}, Gnus will attempt to build old threads by fetching
6795 more old headers---headers to articles marked as read.  If you would
6796 like to display as few summary lines as possible, but still connect as
6797 many loose threads as possible, you should set this variable to
6798 @code{some} or a number.  If you set it to a number, no more than that
6799 number of extra old headers will be fetched.  In either case, fetching
6800 old headers only works if the back end you are using carries overview
6801 files---this would normally be @code{nntp}, @code{nnspool},
6802 @code{nnml}, and @code{nnmaildir}.  Also remember that if the root of
6803 the thread has been expired by the server, there's not much Gnus can
6804 do about that.
6805
6806 This variable can also be set to @code{invisible}.  This won't have any
6807 visible effects, but is useful if you use the @kbd{A T} command a lot
6808 (@pxref{Finding the Parent}).
6809
6810 @item gnus-fetch-old-ephemeral-headers
6811 @vindex gnus-fetch-old-ephemeral-headers
6812 Same as @code{gnus-fetch-old-headers}, but only used for ephemeral
6813 newsgroups.
6814
6815 @item gnus-build-sparse-threads
6816 @vindex gnus-build-sparse-threads
6817 Fetching old headers can be slow.  A low-rent similar effect can be
6818 gotten by setting this variable to @code{some}.  Gnus will then look at
6819 the complete @code{References} headers of all articles and try to string
6820 together articles that belong in the same thread.  This will leave
6821 @dfn{gaps} in the threading display where Gnus guesses that an article
6822 is missing from the thread.  (These gaps appear like normal summary
6823 lines.  If you select a gap, Gnus will try to fetch the article in
6824 question.)  If this variable is @code{t}, Gnus will display all these
6825 ``gaps'' without regard for whether they are useful for completing the
6826 thread or not.  Finally, if this variable is @code{more}, Gnus won't cut
6827 off sparse leaf nodes that don't lead anywhere.  This variable is
6828 @code{nil} by default.
6829
6830 @item gnus-read-all-available-headers
6831 @vindex gnus-read-all-available-headers
6832 This is a rather obscure variable that few will find useful.  It's
6833 intended for those non-news newsgroups where the back end has to fetch
6834 quite a lot to present the summary buffer, and where it's impossible to
6835 go back to parents of articles.  This is mostly the case in the
6836 web-based groups, like the @code{nnultimate} groups.
6837
6838 If you don't use those, then it's safe to leave this as the default
6839 @code{nil}.  If you want to use this variable, it should be a regexp
6840 that matches the group name, or @code{t} for all groups.
6841
6842 @end table
6843
6844
6845 @node More Threading
6846 @subsubsection More Threading
6847
6848 @table @code
6849 @item gnus-show-threads
6850 @vindex gnus-show-threads
6851 If this variable is @code{nil}, no threading will be done, and all of
6852 the rest of the variables here will have no effect.  Turning threading
6853 off will speed group selection up a bit, but it is sure to make reading
6854 slower and more awkward.
6855
6856 @item gnus-thread-hide-subtree
6857 @vindex gnus-thread-hide-subtree
6858 If non-@code{nil}, all threads will be hidden when the summary buffer is
6859 generated.
6860
6861 This can also be a predicate specifier (@pxref{Predicate Specifiers}).
6862 Available predicates are @code{gnus-article-unread-p} and
6863 @code{gnus-article-unseen-p}.
6864
6865 Here's an example:
6866
6867 @lisp
6868 (setq gnus-thread-hide-subtree
6869       '(or gnus-article-unread-p
6870            gnus-article-unseen-p))
6871 @end lisp
6872
6873 (It's a pretty nonsensical example, since all unseen articles are also
6874 unread, but you get my drift.)
6875
6876
6877 @item gnus-thread-expunge-below
6878 @vindex gnus-thread-expunge-below
6879 All threads that have a total score (as defined by
6880 @code{gnus-thread-score-function}) less than this number will be
6881 expunged.  This variable is @code{nil} by default, which means that no
6882 threads are expunged.
6883
6884 @item gnus-thread-hide-killed
6885 @vindex gnus-thread-hide-killed
6886 if you kill a thread and this variable is non-@code{nil}, the subtree
6887 will be hidden.
6888
6889 @item gnus-thread-ignore-subject
6890 @vindex gnus-thread-ignore-subject
6891 Sometimes somebody changes the subject in the middle of a thread.  If
6892 this variable is non-@code{nil}, which is the default, the subject
6893 change is ignored.  If it is @code{nil}, a change in the subject will
6894 result in a new thread.
6895
6896 @item gnus-thread-indent-level
6897 @vindex gnus-thread-indent-level
6898 This is a number that says how much each sub-thread should be indented.
6899 The default is 4.
6900
6901 @item gnus-sort-gathered-threads-function
6902 @vindex gnus-sort-gathered-threads-function
6903 Sometimes, particularly with mailing lists, the order in which mails
6904 arrive locally is not necessarily the same as the order in which they
6905 arrived on the mailing list.  Consequently, when sorting sub-threads
6906 using the default @code{gnus-thread-sort-by-number}, responses can end
6907 up appearing before the article to which they are responding to.
6908 Setting this variable to an alternate value
6909 (e.g. @code{gnus-thread-sort-by-date}), in a group's parameters or in an
6910 appropriate hook (e.g. @code{gnus-summary-generate-hook}) can produce a
6911 more logical sub-thread ordering in such instances.
6912
6913 @end table
6914
6915
6916 @node Low-Level Threading
6917 @subsubsection Low-Level Threading
6918
6919 @table @code
6920
6921 @item gnus-parse-headers-hook
6922 @vindex gnus-parse-headers-hook
6923 Hook run before parsing any headers.
6924
6925 @item gnus-alter-header-function
6926 @vindex gnus-alter-header-function
6927 If non-@code{nil}, this function will be called to allow alteration of
6928 article header structures.  The function is called with one parameter,
6929 the article header vector, which it may alter in any way.  For instance,
6930 if you have a mail-to-news gateway which alters the @code{Message-ID}s
6931 in systematic ways (by adding prefixes and such), you can use this
6932 variable to un-scramble the @code{Message-ID}s so that they are more
6933 meaningful.  Here's one example:
6934
6935 @lisp
6936 (setq gnus-alter-header-function 'my-alter-message-id)
6937
6938 (defun my-alter-message-id (header)
6939   (let ((id (mail-header-id header)))
6940     (when (string-match
6941            "\\(<[^<>@@]*\\)\\.?cygnus\\..*@@\\([^<>@@]*>\\)" id)
6942       (mail-header-set-id
6943        (concat (match-string 1 id) "@@" (match-string 2 id))
6944        header))))
6945 @end lisp
6946
6947 @end table
6948
6949
6950 @node Thread Commands
6951 @subsection Thread Commands
6952 @cindex thread commands
6953
6954 @table @kbd
6955
6956 @item T k
6957 @itemx C-M-k
6958 @kindex T k (Summary)
6959 @kindex C-M-k (Summary)
6960 @findex gnus-summary-kill-thread
6961 Mark all articles in the current (sub-)thread as read
6962 (@code{gnus-summary-kill-thread}).  If the prefix argument is positive,
6963 remove all marks instead.  If the prefix argument is negative, tick
6964 articles instead.
6965
6966 @item T l
6967 @itemx C-M-l
6968 @kindex T l (Summary)
6969 @kindex C-M-l (Summary)
6970 @findex gnus-summary-lower-thread
6971 Lower the score of the current (sub-)thread
6972 (@code{gnus-summary-lower-thread}).
6973
6974 @item T i
6975 @kindex T i (Summary)
6976 @findex gnus-summary-raise-thread
6977 Increase the score of the current (sub-)thread
6978 (@code{gnus-summary-raise-thread}).
6979
6980 @item T #
6981 @kindex T # (Summary)
6982 @findex gnus-uu-mark-thread
6983 Set the process mark on the current (sub-)thread
6984 (@code{gnus-uu-mark-thread}).
6985
6986 @item T M-#
6987 @kindex T M-# (Summary)
6988 @findex gnus-uu-unmark-thread
6989 Remove the process mark from the current (sub-)thread
6990 (@code{gnus-uu-unmark-thread}).
6991
6992 @item T T
6993 @kindex T T (Summary)
6994 @findex gnus-summary-toggle-threads
6995 Toggle threading (@code{gnus-summary-toggle-threads}).
6996
6997 @item T s
6998 @kindex T s (Summary)
6999 @findex gnus-summary-show-thread
7000 Expose the (sub-)thread hidden under the current article, if any@*
7001 (@code{gnus-summary-show-thread}).
7002
7003 @item T h
7004 @kindex T h (Summary)
7005 @findex gnus-summary-hide-thread
7006 Hide the current (sub-)thread (@code{gnus-summary-hide-thread}).
7007
7008 @item T S
7009 @kindex T S (Summary)
7010 @findex gnus-summary-show-all-threads
7011 Expose all hidden threads (@code{gnus-summary-show-all-threads}).
7012
7013 @item T H
7014 @kindex T H (Summary)
7015 @findex gnus-summary-hide-all-threads
7016 Hide all threads (@code{gnus-summary-hide-all-threads}).
7017
7018 @item T t
7019 @kindex T t (Summary)
7020 @findex gnus-summary-rethread-current
7021 Re-thread the current article's thread
7022 (@code{gnus-summary-rethread-current}).  This works even when the
7023 summary buffer is otherwise unthreaded.
7024
7025 @item T ^
7026 @kindex T ^ (Summary)
7027 @findex gnus-summary-reparent-thread
7028 Make the current article the child of the marked (or previous) article
7029 (@code{gnus-summary-reparent-thread}).
7030
7031 @item T M-^
7032 @kindex T M-^ (Summary)
7033 @findex gnus-summary-reparent-children
7034 Make the current article the parent of the marked articles
7035 (@code{gnus-summary-reparent-children}).
7036
7037 @end table
7038
7039 The following commands are thread movement commands.  They all
7040 understand the numeric prefix.
7041
7042 @table @kbd
7043
7044 @item T n
7045 @kindex T n (Summary)
7046 @itemx C-M-f
7047 @kindex C-M-n (Summary)
7048 @itemx M-down
7049 @kindex M-down (Summary)
7050 @findex gnus-summary-next-thread
7051 Go to the next thread (@code{gnus-summary-next-thread}).
7052
7053 @item T p
7054 @kindex T p (Summary)
7055 @itemx C-M-b
7056 @kindex C-M-p (Summary)
7057 @itemx M-up
7058 @kindex M-up (Summary)
7059 @findex gnus-summary-prev-thread
7060 Go to the previous thread (@code{gnus-summary-prev-thread}).
7061
7062 @item T d
7063 @kindex T d (Summary)
7064 @findex gnus-summary-down-thread
7065 Descend the thread (@code{gnus-summary-down-thread}).
7066
7067 @item T u
7068 @kindex T u (Summary)
7069 @findex gnus-summary-up-thread
7070 Ascend the thread (@code{gnus-summary-up-thread}).
7071
7072 @item T o
7073 @kindex T o (Summary)
7074 @findex gnus-summary-top-thread
7075 Go to the top of the thread (@code{gnus-summary-top-thread}).
7076 @end table
7077
7078 @vindex gnus-thread-operation-ignore-subject
7079 If you ignore subject while threading, you'll naturally end up with
7080 threads that have several different subjects in them.  If you then issue
7081 a command like @kbd{T k} (@code{gnus-summary-kill-thread}) you might not
7082 wish to kill the entire thread, but just those parts of the thread that
7083 have the same subject as the current article.  If you like this idea,
7084 you can fiddle with @code{gnus-thread-operation-ignore-subject}.  If it
7085 is non-@code{nil} (which it is by default), subjects will be ignored
7086 when doing thread commands.  If this variable is @code{nil}, articles in
7087 the same thread with different subjects will not be included in the
7088 operation in question.  If this variable is @code{fuzzy}, only articles
7089 that have subjects fuzzily equal will be included (@pxref{Fuzzy
7090 Matching}).
7091
7092
7093 @node Sorting the Summary Buffer
7094 @section Sorting the Summary Buffer
7095
7096 @findex gnus-thread-sort-by-total-score
7097 @findex gnus-thread-sort-by-date
7098 @findex gnus-thread-sort-by-date-reverse
7099 @findex gnus-thread-sort-by-score
7100 @findex gnus-thread-sort-by-subject
7101 @findex gnus-thread-sort-by-author
7102 @findex gnus-thread-sort-by-recipient
7103 @findex gnus-thread-sort-by-number
7104 @findex gnus-thread-sort-by-random
7105 @vindex gnus-thread-sort-functions
7106 @findex gnus-thread-sort-by-most-recent-number
7107 @findex gnus-thread-sort-by-most-recent-date
7108 If you are using a threaded summary display, you can sort the threads by
7109 setting @code{gnus-thread-sort-functions}, which can be either a single
7110 function, a list of functions, or a list containing functions and
7111 @code{(not some-function)} elements.
7112
7113 By default, sorting is done on article numbers.  Ready-made sorting
7114 predicate functions include @code{gnus-thread-sort-by-number},
7115 @code{gnus-thread-sort-by-author}, @code{gnus-thread-sort-by-recipient},
7116 @code{gnus-thread-sort-by-subject},
7117 @code{gnus-thread-sort-by-date}, @code{gnus-thread-sort-by-date-reverse},
7118 @code{gnus-thread-sort-by-score},
7119 @code{gnus-thread-sort-by-most-recent-number},
7120 @code{gnus-thread-sort-by-most-recent-date},
7121 @code{gnus-thread-sort-by-random} and
7122 @code{gnus-thread-sort-by-total-score}.
7123
7124 Each function takes two threads and returns non-@code{nil} if the first
7125 thread should be sorted before the other.  Note that sorting really is
7126 normally done by looking only at the roots of each thread.
7127
7128 If you use more than one function, the primary sort key should be the
7129 last function in the list.  You should probably always include
7130 @code{gnus-thread-sort-by-number} in the list of sorting
7131 functions---preferably first.  This will ensure that threads that are
7132 equal with respect to the other sort criteria will be displayed in
7133 ascending article order.
7134
7135 If you would like to sort by reverse score, then by subject, and finally
7136 by number, you could do something like:
7137
7138 @lisp
7139 (setq gnus-thread-sort-functions
7140       '(gnus-thread-sort-by-number
7141         gnus-thread-sort-by-subject
7142         (not gnus-thread-sort-by-total-score)))
7143 @end lisp
7144
7145 The threads that have highest score will be displayed first in the
7146 summary buffer.  When threads have the same score, they will be sorted
7147 alphabetically.  The threads that have the same score and the same
7148 subject will be sorted by number, which is (normally) the sequence in
7149 which the articles arrived.
7150
7151 If you want to sort by score and then reverse arrival order, you could
7152 say something like:
7153
7154 @lisp
7155 (setq gnus-thread-sort-functions
7156       '((not gnus-thread-sort-by-number)
7157         gnus-thread-sort-by-score))
7158 @end lisp
7159
7160 @vindex gnus-thread-score-function
7161 The function in the @code{gnus-thread-score-function} variable (default
7162 @code{+}) is used for calculating the total score of a thread.  Useful
7163 functions might be @code{max}, @code{min}, or squared means, or whatever
7164 tickles your fancy.
7165
7166 @findex gnus-article-sort-functions
7167 @findex gnus-article-sort-by-date
7168 @findex gnus-article-sort-by-score
7169 @findex gnus-article-sort-by-subject
7170 @findex gnus-article-sort-by-author
7171 @findex gnus-article-sort-by-random
7172 @findex gnus-article-sort-by-number
7173 If you are using an unthreaded display for some strange reason or
7174 other, you have to fiddle with the @code{gnus-article-sort-functions}
7175 variable.  It is very similar to the
7176 @code{gnus-thread-sort-functions}, except that it uses slightly
7177 different functions for article comparison.  Available sorting
7178 predicate functions are @code{gnus-article-sort-by-number},
7179 @code{gnus-article-sort-by-author},
7180 @code{gnus-article-sort-by-subject}, @code{gnus-article-sort-by-date},
7181 @code{gnus-article-sort-by-random}, and
7182 @code{gnus-article-sort-by-score}.
7183
7184 If you want to sort an unthreaded summary display by subject, you could
7185 say something like:
7186
7187 @lisp
7188 (setq gnus-article-sort-functions
7189       '(gnus-article-sort-by-number
7190         gnus-article-sort-by-subject))
7191 @end lisp
7192
7193 You can define group specific sorting via @code{gnus-parameters},
7194 @xref{Group Parameters}.
7195
7196
7197 @node Asynchronous Fetching
7198 @section Asynchronous Article Fetching
7199 @cindex asynchronous article fetching
7200 @cindex article pre-fetch
7201 @cindex pre-fetch
7202
7203 If you read your news from an @acronym{NNTP} server that's far away, the
7204 network latencies may make reading articles a chore.  You have to wait
7205 for a while after pressing @kbd{n} to go to the next article before the
7206 article appears.  Why can't Gnus just go ahead and fetch the article
7207 while you are reading the previous one?  Why not, indeed.
7208
7209 First, some caveats.  There are some pitfalls to using asynchronous
7210 article fetching, especially the way Gnus does it.
7211
7212 Let's say you are reading article 1, which is short, and article 2 is
7213 quite long, and you are not interested in reading that.  Gnus does not
7214 know this, so it goes ahead and fetches article 2.  You decide to read
7215 article 3, but since Gnus is in the process of fetching article 2, the
7216 connection is blocked.
7217
7218 To avoid these situations, Gnus will open two (count 'em two)
7219 connections to the server.  Some people may think this isn't a very nice
7220 thing to do, but I don't see any real alternatives.  Setting up that
7221 extra connection takes some time, so Gnus startup will be slower.
7222
7223 Gnus will fetch more articles than you will read.  This will mean that
7224 the link between your machine and the @acronym{NNTP} server will become more
7225 loaded than if you didn't use article pre-fetch.  The server itself will
7226 also become more loaded---both with the extra article requests, and the
7227 extra connection.
7228
7229 Ok, so now you know that you shouldn't really use this thing@dots{} unless
7230 you really want to.
7231
7232 @vindex gnus-asynchronous
7233 Here's how:  Set @code{gnus-asynchronous} to @code{t}.  The rest should
7234 happen automatically.
7235
7236 @vindex gnus-use-article-prefetch
7237 You can control how many articles are to be pre-fetched by setting
7238 @code{gnus-use-article-prefetch}.  This is 30 by default, which means
7239 that when you read an article in the group, the back end will pre-fetch
7240 the next 30 articles.  If this variable is @code{t}, the back end will
7241 pre-fetch all the articles it can without bound.  If it is
7242 @code{nil}, no pre-fetching will be done.
7243
7244 @vindex gnus-async-prefetch-article-p
7245 @findex gnus-async-read-p
7246 There are probably some articles that you don't want to pre-fetch---read
7247 articles, for instance.  The @code{gnus-async-prefetch-article-p}
7248 variable controls whether an article is to be pre-fetched.  This
7249 function should return non-@code{nil} when the article in question is
7250 to be pre-fetched.  The default is @code{gnus-async-read-p}, which
7251 returns @code{nil} on read articles.  The function is called with an
7252 article data structure as the only parameter.
7253
7254 If, for instance, you wish to pre-fetch only unread articles shorter
7255 than 100 lines, you could say something like:
7256
7257 @lisp
7258 (defun my-async-short-unread-p (data)
7259   "Return non-nil for short, unread articles."
7260   (and (gnus-data-unread-p data)
7261        (< (mail-header-lines (gnus-data-header data))
7262           100)))
7263
7264 (setq gnus-async-prefetch-article-p 'my-async-short-unread-p)
7265 @end lisp
7266
7267 These functions will be called many, many times, so they should
7268 preferably be short and sweet to avoid slowing down Gnus too much.
7269 It's probably a good idea to byte-compile things like this.
7270
7271 @vindex gnus-prefetched-article-deletion-strategy
7272 Articles have to be removed from the asynch buffer sooner or later.  The
7273 @code{gnus-prefetched-article-deletion-strategy} says when to remove
7274 articles.  This is a list that may contain the following elements:
7275
7276 @table @code
7277 @item read
7278 Remove articles when they are read.
7279
7280 @item exit
7281 Remove articles when exiting the group.
7282 @end table
7283
7284 The default value is @code{(read exit)}.
7285
7286 @c @vindex gnus-use-header-prefetch
7287 @c If @code{gnus-use-header-prefetch} is non-@code{nil}, prefetch articles
7288 @c from the next group.
7289
7290
7291 @node Article Caching
7292 @section Article Caching
7293 @cindex article caching
7294 @cindex caching
7295
7296 If you have an @emph{extremely} slow @acronym{NNTP} connection, you may
7297 consider turning article caching on.  Each article will then be stored
7298 locally under your home directory.  As you may surmise, this could
7299 potentially use @emph{huge} amounts of disk space, as well as eat up all
7300 your inodes so fast it will make your head swim.  In vodka.
7301
7302 Used carefully, though, it could be just an easier way to save articles.
7303
7304 @vindex gnus-use-long-file-name
7305 @vindex gnus-cache-directory
7306 @vindex gnus-use-cache
7307 To turn caching on, set @code{gnus-use-cache} to @code{t}.  By default,
7308 all articles ticked or marked as dormant will then be copied
7309 over to your local cache (@code{gnus-cache-directory}).  Whether this
7310 cache is flat or hierarchical is controlled by the
7311 @code{gnus-use-long-file-name} variable, as usual.
7312
7313 When re-selecting a ticked or dormant article, it will be fetched from the
7314 cache instead of from the server.  As articles in your cache will never
7315 expire, this might serve as a method of saving articles while still
7316 keeping them where they belong.  Just mark all articles you want to save
7317 as dormant, and don't worry.
7318
7319 When an article is marked as read, is it removed from the cache.
7320
7321 @vindex gnus-cache-remove-articles
7322 @vindex gnus-cache-enter-articles
7323 The entering/removal of articles from the cache is controlled by the
7324 @code{gnus-cache-enter-articles} and @code{gnus-cache-remove-articles}
7325 variables.  Both are lists of symbols.  The first is @code{(ticked
7326 dormant)} by default, meaning that ticked and dormant articles will be
7327 put in the cache.  The latter is @code{(read)} by default, meaning that
7328 articles marked as read are removed from the cache.  Possibly
7329 symbols in these two lists are @code{ticked}, @code{dormant},
7330 @code{unread} and @code{read}.
7331
7332 @findex gnus-jog-cache
7333 So where does the massive article-fetching and storing come into the
7334 picture?  The @code{gnus-jog-cache} command will go through all
7335 subscribed newsgroups, request all unread articles, score them, and
7336 store them in the cache.  You should only ever, ever ever ever, use this
7337 command if 1) your connection to the @acronym{NNTP} server is really, really,
7338 really slow and 2) you have a really, really, really huge disk.
7339 Seriously.  One way to cut down on the number of articles downloaded is
7340 to score unwanted articles down and have them marked as read.  They will
7341 not then be downloaded by this command.
7342
7343 @vindex gnus-uncacheable-groups
7344 @vindex gnus-cacheable-groups
7345 It is likely that you do not want caching on all groups.  For instance,
7346 if your @code{nnml} mail is located under your home directory, it makes no
7347 sense to cache it somewhere else under your home directory.  Unless you
7348 feel that it's neat to use twice as much space.
7349
7350 To limit the caching, you could set @code{gnus-cacheable-groups} to a
7351 regexp of groups to cache, @samp{^nntp} for instance, or set the
7352 @code{gnus-uncacheable-groups} regexp to @samp{^nnml}, for instance.
7353 Both variables are @code{nil} by default.  If a group matches both
7354 variables, the group is not cached.
7355
7356 @findex gnus-cache-generate-nov-databases
7357 @findex gnus-cache-generate-active
7358 @vindex gnus-cache-active-file
7359 The cache stores information on what articles it contains in its active
7360 file (@code{gnus-cache-active-file}).  If this file (or any other parts
7361 of the cache) becomes all messed up for some reason or other, Gnus
7362 offers two functions that will try to set things right.  @kbd{M-x
7363 gnus-cache-generate-nov-databases} will (re)build all the @acronym{NOV}
7364 files, and @kbd{gnus-cache-generate-active} will (re)generate the active
7365 file.
7366
7367 @findex gnus-cache-move-cache
7368 @code{gnus-cache-move-cache} will move your whole
7369 @code{gnus-cache-directory} to some other location.  You get asked to
7370 where, isn't that cool?
7371
7372 @node Persistent Articles
7373 @section Persistent Articles
7374 @cindex persistent articles
7375
7376 Closely related to article caching, we have @dfn{persistent articles}.
7377 In fact, it's just a different way of looking at caching, and much more
7378 useful in my opinion.
7379
7380 Say you're reading a newsgroup, and you happen on to some valuable gem
7381 that you want to keep and treasure forever.  You'd normally just save it
7382 (using one of the many saving commands) in some file.  The problem with
7383 that is that it's just, well, yucky.  Ideally you'd prefer just having
7384 the article remain in the group where you found it forever; untouched by
7385 the expiry going on at the news server.
7386
7387 This is what a @dfn{persistent article} is---an article that just won't
7388 be deleted.  It's implemented using the normal cache functions, but
7389 you use two explicit commands for managing persistent articles:
7390
7391 @table @kbd
7392
7393 @item *
7394 @kindex * (Summary)
7395 @findex gnus-cache-enter-article
7396 Make the current article persistent (@code{gnus-cache-enter-article}).
7397
7398 @item M-*
7399 @kindex M-* (Summary)
7400 @findex gnus-cache-remove-article
7401 Remove the current article from the persistent articles
7402 (@code{gnus-cache-remove-article}).  This will normally delete the
7403 article.
7404 @end table
7405
7406 Both these commands understand the process/prefix convention.
7407
7408 To avoid having all ticked articles (and stuff) entered into the cache,
7409 you should set @code{gnus-use-cache} to @code{passive} if you're just
7410 interested in persistent articles:
7411
7412 @lisp
7413 (setq gnus-use-cache 'passive)
7414 @end lisp
7415
7416
7417 @node Article Backlog
7418 @section Article Backlog
7419 @cindex backlog
7420 @cindex article backlog
7421
7422 If you have a slow connection, but the idea of using caching seems
7423 unappealing to you (and it is, really), you can help the situation some
7424 by switching on the @dfn{backlog}.  This is where Gnus will buffer
7425 already read articles so that it doesn't have to re-fetch articles
7426 you've already read.  This only helps if you are in the habit of
7427 re-selecting articles you've recently read, of course.  If you never do
7428 that, turning the backlog on will slow Gnus down a little bit, and
7429 increase memory usage some.
7430
7431 @vindex gnus-keep-backlog
7432 If you set @code{gnus-keep-backlog} to a number @var{n}, Gnus will store
7433 at most @var{n} old articles in a buffer for later re-fetching.  If this
7434 variable is non-@code{nil} and is not a number, Gnus will store
7435 @emph{all} read articles, which means that your Emacs will grow without
7436 bound before exploding and taking your machine down with you.  I put
7437 that in there just to keep y'all on your toes.
7438
7439 The default value is 20.
7440
7441
7442 @node Saving Articles
7443 @section Saving Articles
7444 @cindex saving articles
7445
7446 Gnus can save articles in a number of ways.  Below is the documentation
7447 for saving articles in a fairly straight-forward fashion (i.e., little
7448 processing of the article is done before it is saved).  For a different
7449 approach (uudecoding, unsharing) you should use @code{gnus-uu}
7450 (@pxref{Decoding Articles}).
7451
7452 For the commands listed here, the target is a file.  If you want to
7453 save to a group, see the @kbd{B c} (@code{gnus-summary-copy-article})
7454 command (@pxref{Mail Group Commands}).
7455
7456 @vindex gnus-save-all-headers
7457 If @code{gnus-save-all-headers} is non-@code{nil}, Gnus will not delete
7458 unwanted headers before saving the article.
7459
7460 @vindex gnus-saved-headers
7461 If the preceding variable is @code{nil}, all headers that match the
7462 @code{gnus-saved-headers} regexp will be kept, while the rest will be
7463 deleted before saving.
7464
7465 @table @kbd
7466
7467 @item O o
7468 @itemx o
7469 @kindex O o (Summary)
7470 @kindex o (Summary)
7471 @findex gnus-summary-save-article
7472 @c @icon{gnus-summary-save-article}
7473 Save the current article using the default article saver
7474 (@code{gnus-summary-save-article}).
7475
7476 @item O m
7477 @kindex O m (Summary)
7478 @findex gnus-summary-save-article-mail
7479 Save the current article in mail format
7480 (@code{gnus-summary-save-article-mail}).
7481
7482 @item O r
7483 @kindex O r (Summary)
7484 @findex gnus-summary-save-article-rmail
7485 Save the current article in Rmail format
7486 (@code{gnus-summary-save-article-rmail}).
7487
7488 @item O f
7489 @kindex O f (Summary)
7490 @findex gnus-summary-save-article-file
7491 @c @icon{gnus-summary-save-article-file}
7492 Save the current article in plain file format
7493 (@code{gnus-summary-save-article-file}).
7494
7495 @item O F
7496 @kindex O F (Summary)
7497 @findex gnus-summary-write-article-file
7498 Write the current article in plain file format, overwriting any previous
7499 file contents (@code{gnus-summary-write-article-file}).
7500
7501 @item O b
7502 @kindex O b (Summary)
7503 @findex gnus-summary-save-article-body-file
7504 Save the current article body in plain file format
7505 (@code{gnus-summary-save-article-body-file}).
7506
7507 @item O h
7508 @kindex O h (Summary)
7509 @findex gnus-summary-save-article-folder
7510 Save the current article in mh folder format
7511 (@code{gnus-summary-save-article-folder}).
7512
7513 @item O v
7514 @kindex O v (Summary)
7515 @findex gnus-summary-save-article-vm
7516 Save the current article in a VM folder
7517 (@code{gnus-summary-save-article-vm}).
7518
7519 @item O p
7520 @itemx |
7521 @kindex O p (Summary)
7522 @kindex | (Summary)
7523 @findex gnus-summary-pipe-output
7524 Save the current article in a pipe.  Uhm, like, what I mean is---Pipe
7525 the current article to a process (@code{gnus-summary-pipe-output}).
7526 If given a symbolic prefix (@pxref{Symbolic Prefixes}), include the
7527 complete headers in the piped output.
7528
7529 @item O P
7530 @kindex O P (Summary)
7531 @findex gnus-summary-muttprint
7532 @vindex gnus-summary-muttprint-program
7533 Save the current article into muttprint.  That is, print it using the
7534 external program @uref{http://muttprint.sourceforge.net/,
7535 Muttprint}.  The program name and options to use is controlled by the
7536 variable @code{gnus-summary-muttprint-program}.
7537 (@code{gnus-summary-muttprint}).
7538
7539 @end table
7540
7541 @vindex gnus-prompt-before-saving
7542 All these commands use the process/prefix convention
7543 (@pxref{Process/Prefix}).  If you save bunches of articles using these
7544 functions, you might get tired of being prompted for files to save each
7545 and every article in.  The prompting action is controlled by
7546 the @code{gnus-prompt-before-saving} variable, which is @code{always} by
7547 default, giving you that excessive prompting action you know and
7548 loathe.  If you set this variable to @code{t} instead, you'll be prompted
7549 just once for each series of articles you save.  If you like to really
7550 have Gnus do all your thinking for you, you can even set this variable
7551 to @code{nil}, which means that you will never be prompted for files to
7552 save articles in.  Gnus will simply save all the articles in the default
7553 files.
7554
7555
7556 @vindex gnus-default-article-saver
7557 You can customize the @code{gnus-default-article-saver} variable to make
7558 Gnus do what you want it to.  You can use any of the six ready-made
7559 functions below, or you can create your own.
7560
7561 @table @code
7562
7563 @item gnus-summary-save-in-rmail
7564 @findex gnus-summary-save-in-rmail
7565 @vindex gnus-rmail-save-name
7566 @findex gnus-plain-save-name
7567 This is the default format, @dfn{Babyl}.  Uses the function in the
7568 @code{gnus-rmail-save-name} variable to get a file name to save the
7569 article in.  The default is @code{gnus-plain-save-name}.
7570
7571 @item gnus-summary-save-in-mail
7572 @findex gnus-summary-save-in-mail
7573 @vindex gnus-mail-save-name
7574 Save in a Unix mail (mbox) file.  Uses the function in the
7575 @code{gnus-mail-save-name} variable to get a file name to save the
7576 article in.  The default is @code{gnus-plain-save-name}.
7577
7578 @item gnus-summary-save-in-file
7579 @findex gnus-summary-save-in-file
7580 @vindex gnus-file-save-name
7581 @findex gnus-numeric-save-name
7582 Append the article straight to an ordinary file.  Uses the function in
7583 the @code{gnus-file-save-name} variable to get a file name to save the
7584 article in.  The default is @code{gnus-numeric-save-name}.
7585
7586 @item gnus-summary-write-to-file
7587 @findex gnus-summary-write-to-file
7588 Write the article straight to an ordinary file.  The file is
7589 overwritten if it exists.  Uses the function in the
7590 @code{gnus-file-save-name} variable to get a file name to save the
7591 article in.  The default is @code{gnus-numeric-save-name}.
7592
7593 @item gnus-summary-save-body-in-file
7594 @findex gnus-summary-save-body-in-file
7595 Append the article body to an ordinary file.  Uses the function in the
7596 @code{gnus-file-save-name} variable to get a file name to save the
7597 article in.  The default is @code{gnus-numeric-save-name}.
7598
7599 @item gnus-summary-save-in-folder
7600 @findex gnus-summary-save-in-folder
7601 @findex gnus-folder-save-name
7602 @findex gnus-Folder-save-name
7603 @vindex gnus-folder-save-name
7604 @cindex rcvstore
7605 @cindex MH folders
7606 Save the article to an MH folder using @code{rcvstore} from the MH
7607 library.  Uses the function in the @code{gnus-folder-save-name} variable
7608 to get a file name to save the article in.  The default is
7609 @code{gnus-folder-save-name}, but you can also use
7610 @code{gnus-Folder-save-name}, which creates capitalized names.
7611
7612 @item gnus-summary-save-in-vm
7613 @findex gnus-summary-save-in-vm
7614 Save the article in a VM folder.  You have to have the VM mail
7615 reader to use this setting.
7616 @end table
7617
7618 @vindex gnus-article-save-directory
7619 All of these functions, except for the last one, will save the article
7620 in the @code{gnus-article-save-directory}, which is initialized from the
7621 @env{SAVEDIR} environment variable.  This is @file{~/News/} by
7622 default.
7623
7624 As you can see above, the functions use different functions to find a
7625 suitable name of a file to save the article in.  Below is a list of
7626 available functions that generate names:
7627
7628 @table @code
7629
7630 @item gnus-Numeric-save-name
7631 @findex gnus-Numeric-save-name
7632 File names like @file{~/News/Alt.andrea-dworkin/45}.
7633
7634 @item gnus-numeric-save-name
7635 @findex gnus-numeric-save-name
7636 File names like @file{~/News/alt.andrea-dworkin/45}.
7637
7638 @item gnus-Plain-save-name
7639 @findex gnus-Plain-save-name
7640 File names like @file{~/News/Alt.andrea-dworkin}.
7641
7642 @item gnus-plain-save-name
7643 @findex gnus-plain-save-name
7644 File names like @file{~/News/alt.andrea-dworkin}.
7645
7646 @item gnus-sender-save-name
7647 @findex gnus-sender-save-name
7648 File names like @file{~/News/larsi}.
7649 @end table
7650
7651 @vindex gnus-split-methods
7652 You can have Gnus suggest where to save articles by plonking a regexp into
7653 the @code{gnus-split-methods} alist.  For instance, if you would like to
7654 save articles related to Gnus in the file @file{gnus-stuff}, and articles
7655 related to VM in @file{vm-stuff}, you could set this variable to something
7656 like:
7657
7658 @lisp
7659 (("^Subject:.*gnus\\|^Newsgroups:.*gnus" "gnus-stuff")
7660  ("^Subject:.*vm\\|^Xref:.*vm" "vm-stuff")
7661  (my-choosing-function "../other-dir/my-stuff")
7662  ((equal gnus-newsgroup-name "mail.misc") "mail-stuff"))
7663 @end lisp
7664
7665 We see that this is a list where each element is a list that has two
7666 elements---the @dfn{match} and the @dfn{file}.  The match can either be
7667 a string (in which case it is used as a regexp to match on the article
7668 head); it can be a symbol (which will be called as a function with the
7669 group name as a parameter); or it can be a list (which will be
7670 @code{eval}ed).  If any of these actions have a non-@code{nil} result,
7671 the @dfn{file} will be used as a default prompt.  In addition, the
7672 result of the operation itself will be used if the function or form
7673 called returns a string or a list of strings.
7674
7675 You basically end up with a list of file names that might be used when
7676 saving the current article.  (All ``matches'' will be used.)  You will
7677 then be prompted for what you really want to use as a name, with file
7678 name completion over the results from applying this variable.
7679
7680 This variable is @code{((gnus-article-archive-name))} by default, which
7681 means that Gnus will look at the articles it saves for an
7682 @code{Archive-name} line and use that as a suggestion for the file
7683 name.
7684
7685 Here's an example function to clean up file names somewhat.  If you have
7686 lots of mail groups called things like
7687 @samp{nnml:mail.whatever}, you may want to chop off the beginning of
7688 these group names before creating the file name to save to.  The
7689 following will do just that:
7690
7691 @lisp
7692 (defun my-save-name (group)
7693   (when (string-match "^nnml:mail." group)
7694     (substring group (match-end 0))))
7695
7696 (setq gnus-split-methods
7697       '((gnus-article-archive-name)
7698         (my-save-name)))
7699 @end lisp
7700
7701
7702 @vindex gnus-use-long-file-name
7703 Finally, you have the @code{gnus-use-long-file-name} variable.  If it is
7704 @code{nil}, all the preceding functions will replace all periods
7705 (@samp{.}) in the group names with slashes (@samp{/})---which means that
7706 the functions will generate hierarchies of directories instead of having
7707 all the files in the top level directory
7708 (@file{~/News/alt/andrea-dworkin} instead of
7709 @file{~/News/alt.andrea-dworkin}.)  This variable is @code{t} by default
7710 on most systems.  However, for historical reasons, this is @code{nil} on
7711 Xenix and usg-unix-v machines by default.
7712
7713 This function also affects kill and score file names.  If this variable
7714 is a list, and the list contains the element @code{not-score}, long file
7715 names will not be used for score files, if it contains the element
7716 @code{not-save}, long file names will not be used for saving, and if it
7717 contains the element @code{not-kill}, long file names will not be used
7718 for kill files.
7719
7720 If you'd like to save articles in a hierarchy that looks something like
7721 a spool, you could
7722
7723 @lisp
7724 (setq gnus-use-long-file-name '(not-save)) ; @r{to get a hierarchy}
7725 (setq gnus-default-article-saver
7726       'gnus-summary-save-in-file)          ; @r{no encoding}
7727 @end lisp
7728
7729 Then just save with @kbd{o}.  You'd then read this hierarchy with
7730 ephemeral @code{nneething} groups---@kbd{G D} in the group buffer, and
7731 the top level directory as the argument (@file{~/News/}).  Then just walk
7732 around to the groups/directories with @code{nneething}.
7733
7734
7735 @node Decoding Articles
7736 @section Decoding Articles
7737 @cindex decoding articles
7738
7739 Sometime users post articles (or series of articles) that have been
7740 encoded in some way or other.  Gnus can decode them for you.
7741
7742 @menu
7743 * Uuencoded Articles::          Uudecode articles.
7744 * Shell Archives::              Unshar articles.
7745 * PostScript Files::            Split PostScript.
7746 * Other Files::                 Plain save and binhex.
7747 * Decoding Variables::          Variables for a happy decoding.
7748 * Viewing Files::               You want to look at the result of the decoding?
7749 @end menu
7750
7751 @cindex series
7752 @cindex article series
7753 All these functions use the process/prefix convention
7754 (@pxref{Process/Prefix}) for finding out what articles to work on, with
7755 the extension that a ``single article'' means ``a single series''.  Gnus
7756 can find out by itself what articles belong to a series, decode all the
7757 articles and unpack/view/save the resulting file(s).
7758
7759 Gnus guesses what articles are in the series according to the following
7760 simplish rule: The subjects must be (nearly) identical, except for the
7761 last two numbers of the line.  (Spaces are largely ignored, however.)
7762
7763 For example: If you choose a subject called @samp{cat.gif (2/3)}, Gnus
7764 will find all the articles that match the regexp @samp{^cat.gif
7765 ([0-9]+/[0-9]+).*$}.
7766
7767 Subjects that are non-standard, like @samp{cat.gif (2/3) Part 6 of a
7768 series}, will not be properly recognized by any of the automatic viewing
7769 commands, and you have to mark the articles manually with @kbd{#}.
7770
7771
7772 @node Uuencoded Articles
7773 @subsection Uuencoded Articles
7774 @cindex uudecode
7775 @cindex uuencoded articles
7776
7777 @table @kbd
7778
7779 @item X u
7780 @kindex X u (Summary)
7781 @findex gnus-uu-decode-uu
7782 @c @icon{gnus-uu-decode-uu}
7783 Uudecodes the current series (@code{gnus-uu-decode-uu}).
7784
7785 @item X U
7786 @kindex X U (Summary)
7787 @findex gnus-uu-decode-uu-and-save
7788 Uudecodes and saves the current series
7789 (@code{gnus-uu-decode-uu-and-save}).
7790
7791 @item X v u
7792 @kindex X v u (Summary)
7793 @findex gnus-uu-decode-uu-view
7794 Uudecodes and views the current series (@code{gnus-uu-decode-uu-view}).
7795
7796 @item X v U
7797 @kindex X v U (Summary)
7798 @findex gnus-uu-decode-uu-and-save-view
7799 Uudecodes, views and saves the current series
7800 (@code{gnus-uu-decode-uu-and-save-view}).
7801
7802 @end table
7803
7804 Remember that these all react to the presence of articles marked with
7805 the process mark.  If, for instance, you'd like to decode and save an
7806 entire newsgroup, you'd typically do @kbd{M P a}
7807 (@code{gnus-uu-mark-all}) and then @kbd{X U}
7808 (@code{gnus-uu-decode-uu-and-save}).
7809
7810 All this is very much different from how @code{gnus-uu} worked with
7811 @sc{gnus 4.1}, where you had explicit keystrokes for everything under
7812 the sun.  This version of @code{gnus-uu} generally assumes that you mark
7813 articles in some way (@pxref{Setting Process Marks}) and then press
7814 @kbd{X u}.
7815
7816 @vindex gnus-uu-notify-files
7817 Note: When trying to decode articles that have names matching
7818 @code{gnus-uu-notify-files}, which is hard-coded to
7819 @samp{[Cc][Ii][Nn][Dd][Yy][0-9]+.\\(gif\\|jpg\\)}, @code{gnus-uu} will
7820 automatically post an article on @samp{comp.unix.wizards} saying that
7821 you have just viewed the file in question.  This feature can't be turned
7822 off.
7823
7824
7825 @node Shell Archives
7826 @subsection Shell Archives
7827 @cindex unshar
7828 @cindex shell archives
7829 @cindex shared articles
7830
7831 Shell archives (``shar files'') used to be a popular way to distribute
7832 sources, but it isn't used all that much today.  In any case, we have
7833 some commands to deal with these:
7834
7835 @table @kbd
7836
7837 @item X s
7838 @kindex X s (Summary)
7839 @findex gnus-uu-decode-unshar
7840 Unshars the current series (@code{gnus-uu-decode-unshar}).
7841
7842 @item X S
7843 @kindex X S (Summary)
7844 @findex gnus-uu-decode-unshar-and-save
7845 Unshars and saves the current series (@code{gnus-uu-decode-unshar-and-save}).
7846
7847 @item X v s
7848 @kindex X v s (Summary)
7849 @findex gnus-uu-decode-unshar-view
7850 Unshars and views the current series (@code{gnus-uu-decode-unshar-view}).
7851
7852 @item X v S
7853 @kindex X v S (Summary)
7854 @findex gnus-uu-decode-unshar-and-save-view
7855 Unshars, views and saves the current series
7856 (@code{gnus-uu-decode-unshar-and-save-view}).
7857 @end table
7858
7859
7860 @node PostScript Files
7861 @subsection PostScript Files
7862 @cindex PostScript
7863
7864 @table @kbd
7865
7866 @item X p
7867 @kindex X p (Summary)
7868 @findex gnus-uu-decode-postscript
7869 Unpack the current PostScript series (@code{gnus-uu-decode-postscript}).
7870
7871 @item X P
7872 @kindex X P (Summary)
7873 @findex gnus-uu-decode-postscript-and-save
7874 Unpack and save the current PostScript series
7875 (@code{gnus-uu-decode-postscript-and-save}).
7876
7877 @item X v p
7878 @kindex X v p (Summary)
7879 @findex gnus-uu-decode-postscript-view
7880 View the current PostScript series
7881 (@code{gnus-uu-decode-postscript-view}).
7882
7883 @item X v P
7884 @kindex X v P (Summary)
7885 @findex gnus-uu-decode-postscript-and-save-view
7886 View and save the current PostScript series
7887 (@code{gnus-uu-decode-postscript-and-save-view}).
7888 @end table
7889
7890
7891 @node Other Files
7892 @subsection Other Files
7893
7894 @table @kbd
7895 @item X o
7896 @kindex X o (Summary)
7897 @findex gnus-uu-decode-save
7898 Save the current series
7899 (@code{gnus-uu-decode-save}).
7900
7901 @item X b
7902 @kindex X b (Summary)
7903 @findex gnus-uu-decode-binhex
7904 Unbinhex the current series (@code{gnus-uu-decode-binhex}).  This
7905 doesn't really work yet.
7906 @end table
7907
7908
7909 @node Decoding Variables
7910 @subsection Decoding Variables
7911
7912 Adjective, not verb.
7913
7914 @menu
7915 * Rule Variables::              Variables that say how a file is to be viewed.
7916 * Other Decode Variables::      Other decode variables.
7917 * Uuencoding and Posting::      Variables for customizing uuencoding.
7918 @end menu
7919
7920
7921 @node Rule Variables
7922 @subsubsection Rule Variables
7923 @cindex rule variables
7924
7925 Gnus uses @dfn{rule variables} to decide how to view a file.  All these
7926 variables are of the form
7927
7928 @lisp
7929       (list '(regexp1 command2)
7930             '(regexp2 command2)
7931             ...)
7932 @end lisp
7933
7934 @table @code
7935
7936 @item gnus-uu-user-view-rules
7937 @vindex gnus-uu-user-view-rules
7938 @cindex sox
7939 This variable is consulted first when viewing files.  If you wish to use,
7940 for instance, @code{sox} to convert an @file{.au} sound file, you could
7941 say something like:
7942 @lisp
7943 (setq gnus-uu-user-view-rules
7944       (list '("\\\\.au$" "sox %s -t .aiff > /dev/audio")))
7945 @end lisp
7946
7947 @item gnus-uu-user-view-rules-end
7948 @vindex gnus-uu-user-view-rules-end
7949 This variable is consulted if Gnus couldn't make any matches from the
7950 user and default view rules.
7951
7952 @item gnus-uu-user-archive-rules
7953 @vindex gnus-uu-user-archive-rules
7954 This variable can be used to say what commands should be used to unpack
7955 archives.
7956 @end table
7957
7958
7959 @node Other Decode Variables
7960 @subsubsection Other Decode Variables
7961
7962 @table @code
7963 @vindex gnus-uu-grabbed-file-functions
7964
7965 @item gnus-uu-grabbed-file-functions
7966 All functions in this list will be called right after each file has been
7967 successfully decoded---so that you can move or view files right away,
7968 and don't have to wait for all files to be decoded before you can do
7969 anything.  Ready-made functions you can put in this list are:
7970
7971 @table @code
7972
7973 @item gnus-uu-grab-view
7974 @findex gnus-uu-grab-view
7975 View the file.
7976
7977 @item gnus-uu-grab-move
7978 @findex gnus-uu-grab-move
7979 Move the file (if you're using a saving function.)
7980 @end table
7981
7982 @item gnus-uu-be-dangerous
7983 @vindex gnus-uu-be-dangerous
7984 Specifies what to do if unusual situations arise during decoding.  If
7985 @code{nil}, be as conservative as possible.  If @code{t}, ignore things
7986 that didn't work, and overwrite existing files.  Otherwise, ask each
7987 time.
7988
7989 @item gnus-uu-ignore-files-by-name
7990 @vindex gnus-uu-ignore-files-by-name
7991 Files with name matching this regular expression won't be viewed.
7992
7993 @item gnus-uu-ignore-files-by-type
7994 @vindex gnus-uu-ignore-files-by-type
7995 Files with a @acronym{MIME} type matching this variable won't be viewed.
7996 Note that Gnus tries to guess what type the file is based on the name.
7997 @code{gnus-uu} is not a @acronym{MIME} package (yet), so this is slightly
7998 kludgey.
7999
8000 @item gnus-uu-tmp-dir
8001 @vindex gnus-uu-tmp-dir
8002 Where @code{gnus-uu} does its work.
8003
8004 @item gnus-uu-do-not-unpack-archives
8005 @vindex gnus-uu-do-not-unpack-archives
8006 Non-@code{nil} means that @code{gnus-uu} won't peek inside archives
8007 looking for files to display.
8008
8009 @item gnus-uu-view-and-save
8010 @vindex gnus-uu-view-and-save
8011 Non-@code{nil} means that the user will always be asked to save a file
8012 after viewing it.
8013
8014 @item gnus-uu-ignore-default-view-rules
8015 @vindex gnus-uu-ignore-default-view-rules
8016 Non-@code{nil} means that @code{gnus-uu} will ignore the default viewing
8017 rules.
8018
8019 @item gnus-uu-ignore-default-archive-rules
8020 @vindex gnus-uu-ignore-default-archive-rules
8021 Non-@code{nil} means that @code{gnus-uu} will ignore the default archive
8022 unpacking commands.
8023
8024 @item gnus-uu-kill-carriage-return
8025 @vindex gnus-uu-kill-carriage-return
8026 Non-@code{nil} means that @code{gnus-uu} will strip all carriage returns
8027 from articles.
8028
8029 @item gnus-uu-unmark-articles-not-decoded
8030 @vindex gnus-uu-unmark-articles-not-decoded
8031 Non-@code{nil} means that @code{gnus-uu} will mark unsuccessfully
8032 decoded articles as unread.
8033
8034 @item gnus-uu-correct-stripped-uucode
8035 @vindex gnus-uu-correct-stripped-uucode
8036 Non-@code{nil} means that @code{gnus-uu} will @emph{try} to fix
8037 uuencoded files that have had trailing spaces deleted.
8038
8039 @item gnus-uu-pre-uudecode-hook
8040 @vindex gnus-uu-pre-uudecode-hook
8041 Hook run before sending a message to @code{uudecode}.
8042
8043 @item gnus-uu-view-with-metamail
8044 @vindex gnus-uu-view-with-metamail
8045 @cindex metamail
8046 Non-@code{nil} means that @code{gnus-uu} will ignore the viewing
8047 commands defined by the rule variables and just fudge a @acronym{MIME}
8048 content type based on the file name.  The result will be fed to
8049 @code{metamail} for viewing.
8050
8051 @item gnus-uu-save-in-digest
8052 @vindex gnus-uu-save-in-digest
8053 Non-@code{nil} means that @code{gnus-uu}, when asked to save without
8054 decoding, will save in digests.  If this variable is @code{nil},
8055 @code{gnus-uu} will just save everything in a file without any
8056 embellishments.  The digesting almost conforms to RFC 1153---no easy way
8057 to specify any meaningful volume and issue numbers were found, so I
8058 simply dropped them.
8059
8060 @end table
8061
8062
8063 @node Uuencoding and Posting
8064 @subsubsection Uuencoding and Posting
8065
8066 @table @code
8067
8068 @item gnus-uu-post-include-before-composing
8069 @vindex gnus-uu-post-include-before-composing
8070 Non-@code{nil} means that @code{gnus-uu} will ask for a file to encode
8071 before you compose the article.  If this variable is @code{t}, you can
8072 either include an encoded file with @kbd{C-c C-i} or have one included
8073 for you when you post the article.
8074
8075 @item gnus-uu-post-length
8076 @vindex gnus-uu-post-length
8077 Maximum length of an article.  The encoded file will be split into how
8078 many articles it takes to post the entire file.
8079
8080 @item gnus-uu-post-threaded
8081 @vindex gnus-uu-post-threaded
8082 Non-@code{nil} means that @code{gnus-uu} will post the encoded file in a
8083 thread.  This may not be smart, as no other decoder I have seen is able
8084 to follow threads when collecting uuencoded articles.  (Well, I have
8085 seen one package that does that---@code{gnus-uu}, but somehow, I don't
8086 think that counts@dots{}) Default is @code{nil}.
8087
8088 @item gnus-uu-post-separate-description
8089 @vindex gnus-uu-post-separate-description
8090 Non-@code{nil} means that the description will be posted in a separate
8091 article.  The first article will typically be numbered (0/x).  If this
8092 variable is @code{nil}, the description the user enters will be included
8093 at the beginning of the first article, which will be numbered (1/x).
8094 Default is @code{t}.
8095
8096 @end table
8097
8098
8099 @node Viewing Files
8100 @subsection Viewing Files
8101 @cindex viewing files
8102 @cindex pseudo-articles
8103
8104 After decoding, if the file is some sort of archive, Gnus will attempt
8105 to unpack the archive and see if any of the files in the archive can be
8106 viewed.  For instance, if you have a gzipped tar file @file{pics.tar.gz}
8107 containing the files @file{pic1.jpg} and @file{pic2.gif}, Gnus will
8108 uncompress and de-tar the main file, and then view the two pictures.
8109 This unpacking process is recursive, so if the archive contains archives
8110 of archives, it'll all be unpacked.
8111
8112 Finally, Gnus will normally insert a @dfn{pseudo-article} for each
8113 extracted file into the summary buffer.  If you go to these
8114 ``articles'', you will be prompted for a command to run (usually Gnus
8115 will make a suggestion), and then the command will be run.
8116
8117 @vindex gnus-view-pseudo-asynchronously
8118 If @code{gnus-view-pseudo-asynchronously} is @code{nil}, Emacs will wait
8119 until the viewing is done before proceeding.
8120
8121 @vindex gnus-view-pseudos
8122 If @code{gnus-view-pseudos} is @code{automatic}, Gnus will not insert
8123 the pseudo-articles into the summary buffer, but view them
8124 immediately.  If this variable is @code{not-confirm}, the user won't even
8125 be asked for a confirmation before viewing is done.
8126
8127 @vindex gnus-view-pseudos-separately
8128 If @code{gnus-view-pseudos-separately} is non-@code{nil}, one
8129 pseudo-article will be created for each file to be viewed.  If
8130 @code{nil}, all files that use the same viewing command will be given as
8131 a list of parameters to that command.
8132
8133 @vindex gnus-insert-pseudo-articles
8134 If @code{gnus-insert-pseudo-articles} is non-@code{nil}, insert
8135 pseudo-articles when decoding.  It is @code{t} by default.
8136
8137 So; there you are, reading your @emph{pseudo-articles} in your
8138 @emph{virtual newsgroup} from the @emph{virtual server}; and you think:
8139 Why isn't anything real anymore? How did we get here?
8140
8141
8142 @node Article Treatment
8143 @section Article Treatment
8144
8145 Reading through this huge manual, you may have quite forgotten that the
8146 object of newsreaders is to actually, like, read what people have
8147 written.  Reading articles.  Unfortunately, people are quite bad at
8148 writing, so there are tons of functions and variables to make reading
8149 these articles easier.
8150
8151 @menu
8152 * Article Highlighting::        You want to make the article look like fruit salad.
8153 * Article Fontisizing::         Making emphasized text look nice.
8154 * Article Hiding::              You also want to make certain info go away.
8155 * Article Washing::             Lots of way-neat functions to make life better.
8156 * Article Header::              Doing various header transformations.
8157 * Article Buttons::             Click on URLs, Message-IDs, addresses and the like.
8158 * Article Button Levels::       Controlling appearance of buttons.
8159 * Article Date::                Grumble, UT!
8160 * Article Display::             Display various stuff---X-Face, Picons, Smileys
8161 * Article Signature::           What is a signature?
8162 * Article Miscellanea::         Various other stuff.
8163 @end menu
8164
8165
8166 @node Article Highlighting
8167 @subsection Article Highlighting
8168 @cindex highlighting
8169
8170 Not only do you want your article buffer to look like fruit salad, but
8171 you want it to look like technicolor fruit salad.
8172
8173 @table @kbd
8174
8175 @item W H a
8176 @kindex W H a (Summary)
8177 @findex gnus-article-highlight
8178 @findex gnus-article-maybe-highlight
8179 Do much highlighting of the current article
8180 (@code{gnus-article-highlight}).  This function highlights header, cited
8181 text, the signature, and adds buttons to the body and the head.
8182
8183 @item W H h
8184 @kindex W H h (Summary)
8185 @findex gnus-article-highlight-headers
8186 @vindex gnus-header-face-alist
8187 Highlight the headers (@code{gnus-article-highlight-headers}).  The
8188 highlighting will be done according to the @code{gnus-header-face-alist}
8189 variable, which is a list where each element has the form
8190 @code{(@var{regexp} @var{name} @var{content})}.
8191 @var{regexp} is a regular expression for matching the
8192 header, @var{name} is the face used for highlighting the header name
8193 (@pxref{Faces and Fonts}) and @var{content} is the face for highlighting
8194 the header value.  The first match made will be used.  Note that
8195 @var{regexp} shouldn't have @samp{^} prepended---Gnus will add one.
8196
8197 @item W H c
8198 @kindex W H c (Summary)
8199 @findex gnus-article-highlight-citation
8200 Highlight cited text (@code{gnus-article-highlight-citation}).
8201
8202 Some variables to customize the citation highlights:
8203
8204 @table @code
8205 @vindex gnus-cite-parse-max-size
8206
8207 @item gnus-cite-parse-max-size
8208 If the article size if bigger than this variable (which is 25000 by
8209 default), no citation highlighting will be performed.
8210
8211 @item gnus-cite-max-prefix
8212 @vindex gnus-cite-max-prefix
8213 Maximum possible length for a citation prefix (default 20).
8214
8215 @item gnus-cite-face-list
8216 @vindex gnus-cite-face-list
8217 List of faces used for highlighting citations (@pxref{Faces and Fonts}).
8218 When there are citations from multiple articles in the same message,
8219 Gnus will try to give each citation from each article its own face.
8220 This should make it easier to see who wrote what.
8221
8222 @item gnus-supercite-regexp
8223 @vindex gnus-supercite-regexp
8224 Regexp matching normal Supercite attribution lines.
8225
8226 @item gnus-supercite-secondary-regexp
8227 @vindex gnus-supercite-secondary-regexp
8228 Regexp matching mangled Supercite attribution lines.
8229
8230 @item gnus-cite-minimum-match-count
8231 @vindex gnus-cite-minimum-match-count
8232 Minimum number of identical prefixes we have to see before we believe
8233 that it's a citation.
8234
8235 @item gnus-cite-attribution-prefix
8236 @vindex gnus-cite-attribution-prefix
8237 Regexp matching the beginning of an attribution line.
8238
8239 @item gnus-cite-attribution-suffix
8240 @vindex gnus-cite-attribution-suffix
8241 Regexp matching the end of an attribution line.
8242
8243 @item gnus-cite-attribution-face
8244 @vindex gnus-cite-attribution-face
8245 Face used for attribution lines.  It is merged with the face for the
8246 cited text belonging to the attribution.
8247
8248 @item gnus-cite-ignore-quoted-from
8249 @vindex gnus-cite-ignore-quoted-from
8250 If non-@code{nil}, no citation highlighting will be performed on lines
8251 beginning with @samp{>From }.  Those lines may have been quoted by MTAs
8252 in order not to mix up with the envelope From line.  The default value
8253 is @code{t}.
8254
8255 @end table
8256
8257
8258 @item W H s
8259 @kindex W H s (Summary)
8260 @vindex gnus-signature-separator
8261 @vindex gnus-signature-face
8262 @findex gnus-article-highlight-signature
8263 Highlight the signature (@code{gnus-article-highlight-signature}).
8264 Everything after @code{gnus-signature-separator} (@pxref{Article
8265 Signature}) in an article will be considered a signature and will be
8266 highlighted with @code{gnus-signature-face}, which is @code{italic} by
8267 default.
8268
8269 @end table
8270
8271 @xref{Customizing Articles}, for how to highlight articles automatically.
8272
8273
8274 @node Article Fontisizing
8275 @subsection Article Fontisizing
8276 @cindex emphasis
8277 @cindex article emphasis
8278
8279 @findex gnus-article-emphasize
8280 @kindex W e (Summary)
8281 People commonly add emphasis to words in news articles by writing things
8282 like @samp{_this_} or @samp{*this*} or @samp{/this/}.  Gnus can make
8283 this look nicer by running the article through the @kbd{W e}
8284 (@code{gnus-article-emphasize}) command.
8285
8286 @vindex gnus-emphasis-alist
8287 How the emphasis is computed is controlled by the
8288 @code{gnus-emphasis-alist} variable.  This is an alist where the first
8289 element is a regular expression to be matched.  The second is a number
8290 that says what regular expression grouping is used to find the entire
8291 emphasized word.  The third is a number that says what regexp grouping
8292 should be displayed and highlighted.  (The text between these two
8293 groupings will be hidden.)  The fourth is the face used for
8294 highlighting.
8295
8296 @lisp
8297 (setq gnus-emphasis-alist
8298       '(("_\\(\\w+\\)_" 0 1 gnus-emphasis-underline)
8299         ("\\*\\(\\w+\\)\\*" 0 1 gnus-emphasis-bold)))
8300 @end lisp
8301
8302 @cindex slash
8303 @cindex asterisk
8304 @cindex underline
8305 @cindex /
8306 @cindex *
8307
8308 @vindex gnus-emphasis-underline
8309 @vindex gnus-emphasis-bold
8310 @vindex gnus-emphasis-italic
8311 @vindex gnus-emphasis-underline-bold
8312 @vindex gnus-emphasis-underline-italic
8313 @vindex gnus-emphasis-bold-italic
8314 @vindex gnus-emphasis-underline-bold-italic
8315 By default, there are seven rules, and they use the following faces:
8316 @code{gnus-emphasis-bold}, @code{gnus-emphasis-italic},
8317 @code{gnus-emphasis-underline}, @code{gnus-emphasis-bold-italic},
8318 @code{gnus-emphasis-underline-italic},
8319 @code{gnus-emphasis-underline-bold}, and
8320 @code{gnus-emphasis-underline-bold-italic}.
8321
8322 If you want to change these faces, you can either use @kbd{M-x
8323 customize}, or you can use @code{copy-face}.  For instance, if you want
8324 to make @code{gnus-emphasis-italic} use a red face instead, you could
8325 say something like:
8326
8327 @lisp
8328 (copy-face 'red 'gnus-emphasis-italic)
8329 @end lisp
8330
8331 @vindex gnus-group-highlight-words-alist
8332
8333 If you want to highlight arbitrary words, you can use the
8334 @code{gnus-group-highlight-words-alist} variable, which uses the same
8335 syntax as @code{gnus-emphasis-alist}.  The @code{highlight-words} group
8336 parameter (@pxref{Group Parameters}) can also be used.
8337
8338 @xref{Customizing Articles}, for how to fontize articles automatically.
8339
8340
8341 @node Article Hiding
8342 @subsection Article Hiding
8343 @cindex article hiding
8344
8345 Or rather, hiding certain things in each article.  There usually is much
8346 too much cruft in most articles.
8347
8348 @table @kbd
8349
8350 @item W W a
8351 @kindex W W a (Summary)
8352 @findex gnus-article-hide
8353 Do quite a lot of hiding on the article buffer
8354 (@kbd{gnus-article-hide}).  In particular, this function will hide
8355 headers, @acronym{PGP}, cited text and the signature.
8356
8357 @item W W h
8358 @kindex W W h (Summary)
8359 @findex gnus-article-hide-headers
8360 Hide headers (@code{gnus-article-hide-headers}).  @xref{Hiding
8361 Headers}.
8362
8363 @item W W b
8364 @kindex W W b (Summary)
8365 @findex gnus-article-hide-boring-headers
8366 Hide headers that aren't particularly interesting
8367 (@code{gnus-article-hide-boring-headers}).  @xref{Hiding Headers}.
8368
8369 @item W W s
8370 @kindex W W s (Summary)
8371 @findex gnus-article-hide-signature
8372 Hide signature (@code{gnus-article-hide-signature}).  @xref{Article
8373 Signature}.
8374
8375 @item W W l
8376 @kindex W W l (Summary)
8377 @findex gnus-article-hide-list-identifiers
8378 @vindex gnus-list-identifiers
8379 Strip list identifiers specified in @code{gnus-list-identifiers}.  These
8380 are strings some mailing list servers add to the beginning of all
8381 @code{Subject} headers---for example, @samp{[zebra 4711]}.  Any leading
8382 @samp{Re: } is skipped before stripping.  @code{gnus-list-identifiers}
8383 may not contain @code{\\(..\\)}.
8384
8385 @table @code
8386
8387 @item gnus-list-identifiers
8388 @vindex gnus-list-identifiers
8389 A regular expression that matches list identifiers to be removed from
8390 subject.  This can also be a list of regular expressions.
8391
8392 @end table
8393
8394 @item W W P
8395 @kindex W W P (Summary)
8396 @findex gnus-article-hide-pem
8397 Hide @acronym{PEM} (privacy enhanced messages) cruft
8398 (@code{gnus-article-hide-pem}).
8399
8400 @item W W B
8401 @kindex W W B (Summary)
8402 @findex gnus-article-strip-banner
8403 @vindex gnus-article-banner-alist
8404 @vindex gnus-article-address-banner-alist
8405 @cindex banner
8406 @cindex OneList
8407 @cindex stripping advertisements
8408 @cindex advertisements
8409 Strip the banner specified by the @code{banner} group parameter
8410 (@code{gnus-article-strip-banner}).  This is mainly used to hide those
8411 annoying banners and/or signatures that some mailing lists and moderated
8412 groups adds to all the messages.  The way to use this function is to add
8413 the @code{banner} group parameter (@pxref{Group Parameters}) to the
8414 group you want banners stripped from.  The parameter either be a string,
8415 which will be interpreted as a regular expression matching text to be
8416 removed, or the symbol @code{signature}, meaning that the (last)
8417 signature should be removed, or other symbol, meaning that the
8418 corresponding regular expression in @code{gnus-article-banner-alist} is
8419 used.
8420
8421 Regardless of a group, you can hide things like advertisements only when
8422 the sender of an article has a certain mail address specified in
8423 @code{gnus-article-address-banner-alist}.
8424
8425 @table @code
8426
8427 @item gnus-article-address-banner-alist
8428 @vindex gnus-article-address-banner-alist
8429 Alist of mail addresses and banners.  Each element has the form
8430 @code{(@var{address} . @var{banner})}, where @var{address} is a regexp
8431 matching a mail address in the From header, @var{banner} is one of a
8432 symbol @code{signature}, an item in @code{gnus-article-banner-alist},
8433 a regexp and @code{nil}.  If @var{address} matches author's mail
8434 address, it will remove things like advertisements.  For example, if a
8435 sender has the mail address @samp{hail@@yoo-hoo.co.jp} and there is a
8436 banner something like @samp{Do You Yoo-hoo!?} in all articles he
8437 sends, you can use the following element to remove them:
8438
8439 @lisp
8440 ("@@yoo-hoo\\.co\\.jp\\'" .
8441  "\n_+\nDo You Yoo-hoo!\\?\n.*\n.*\n")
8442 @end lisp
8443
8444 @end table
8445
8446 @item W W c
8447 @kindex W W c (Summary)
8448 @findex gnus-article-hide-citation
8449 Hide citation (@code{gnus-article-hide-citation}).  Some variables for
8450 customizing the hiding:
8451
8452 @table @code
8453
8454 @item gnus-cited-opened-text-button-line-format
8455 @itemx gnus-cited-closed-text-button-line-format
8456 @vindex gnus-cited-closed-text-button-line-format
8457 @vindex gnus-cited-opened-text-button-line-format
8458 Gnus adds buttons to show where the cited text has been hidden, and to
8459 allow toggle hiding the text.  The format of the variable is specified
8460 by these format-like variable (@pxref{Formatting Variables}).  These
8461 specs are valid:
8462
8463 @table @samp
8464 @item b
8465 Starting point of the hidden text.
8466 @item e
8467 Ending point of the hidden text.
8468 @item l
8469 Number of characters in the hidden region.
8470 @item n
8471 Number of lines of hidden text.
8472 @end table
8473
8474 @item gnus-cited-lines-visible
8475 @vindex gnus-cited-lines-visible
8476 The number of lines at the beginning of the cited text to leave
8477 shown.  This can also be a cons cell with the number of lines at the top
8478 and bottom of the text, respectively, to remain visible.
8479
8480 @end table
8481
8482 @item W W C-c
8483 @kindex W W C-c (Summary)
8484 @findex gnus-article-hide-citation-maybe
8485
8486 Hide citation (@code{gnus-article-hide-citation-maybe}) depending on the
8487 following two variables:
8488
8489 @table @code
8490 @item gnus-cite-hide-percentage
8491 @vindex gnus-cite-hide-percentage
8492 If the cited text is of a bigger percentage than this variable (default
8493 50), hide the cited text.
8494
8495 @item gnus-cite-hide-absolute
8496 @vindex gnus-cite-hide-absolute
8497 The cited text must have at least this length (default 10) before it
8498 is hidden.
8499 @end table
8500
8501 @item W W C
8502 @kindex W W C (Summary)
8503 @findex gnus-article-hide-citation-in-followups
8504 Hide cited text in articles that aren't roots
8505 (@code{gnus-article-hide-citation-in-followups}).  This isn't very
8506 useful as an interactive command, but might be a handy function to stick
8507 have happen automatically (@pxref{Customizing Articles}).
8508
8509 @end table
8510
8511 All these ``hiding'' commands are toggles, but if you give a negative
8512 prefix to these commands, they will show what they have previously
8513 hidden.  If you give a positive prefix, they will always hide.
8514
8515 Also @pxref{Article Highlighting} for further variables for
8516 citation customization.
8517
8518 @xref{Customizing Articles}, for how to hide article elements
8519 automatically.
8520
8521
8522 @node Article Washing
8523 @subsection Article Washing
8524 @cindex washing
8525 @cindex article washing
8526
8527 We call this ``article washing'' for a really good reason.  Namely, the
8528 @kbd{A} key was taken, so we had to use the @kbd{W} key instead.
8529
8530 @dfn{Washing} is defined by us as ``changing something from something to
8531 something else'', but normally results in something looking better.
8532 Cleaner, perhaps.
8533
8534 @xref{Customizing Articles}, if you want to change how Gnus displays
8535 articles by default.
8536
8537 @table @kbd
8538
8539 @item C-u g
8540 This is not really washing, it's sort of the opposite of washing.  If
8541 you type this, you see the article exactly as it exists on disk or on
8542 the server.
8543
8544 @item g
8545 Force redisplaying of the current article
8546 (@code{gnus-summary-show-article}).  This is also not really washing.
8547 If you type this, you see the article without any previously applied
8548 interactive Washing functions but with all default treatments
8549 (@pxref{Customizing Articles}).
8550
8551 @item W l
8552 @kindex W l (Summary)
8553 @findex gnus-summary-stop-page-breaking
8554 Remove page breaks from the current article
8555 (@code{gnus-summary-stop-page-breaking}).  @xref{Misc Article}, for page
8556 delimiters.
8557
8558 @item W r
8559 @kindex W r (Summary)
8560 @findex gnus-summary-caesar-message
8561 @c @icon{gnus-summary-caesar-message}
8562 Do a Caesar rotate (rot13) on the article buffer
8563 (@code{gnus-summary-caesar-message}).
8564 Unreadable articles that tell you to read them with Caesar rotate or rot13.
8565 (Typically offensive jokes and such.)
8566
8567 It's commonly called ``rot13'' because each letter is rotated 13
8568 positions in the alphabet, e. g. @samp{B} (letter #2) -> @samp{O} (letter
8569 #15).  It is sometimes referred to as ``Caesar rotate'' because Caesar
8570 is rumored to have employed this form of, uh, somewhat weak encryption.
8571
8572 @item W m
8573 @kindex W m (Summary)
8574 @findex gnus-summary-morse-message
8575 Morse decode the article buffer (@code{gnus-summary-morse-message}).
8576
8577 @item W i
8578 @kindex W i (Summary)
8579 @findex gnus-summary-idna-message
8580 Decode IDNA encoded domain names in the current articles.  IDNA
8581 encoded domain names looks like @samp{xn--bar}.  If a string remain
8582 unencoded after running invoking this, it is likely an invalid IDNA
8583 string (@samp{xn--bar} is invalid).  You must have GNU Libidn
8584 (@url{http://www.gnu.org/software/libidn/}) installed for this command
8585 to work.
8586
8587 @item W t
8588 @item t
8589 @kindex W t (Summary)
8590 @kindex t (Summary)
8591 @findex gnus-summary-toggle-header
8592 Toggle whether to display all headers in the article buffer
8593 (@code{gnus-summary-toggle-header}).
8594
8595 @item W v
8596 @kindex W v (Summary)
8597 @findex gnus-summary-verbose-headers
8598 Toggle whether to display all headers in the article buffer permanently
8599 (@code{gnus-summary-verbose-headers}).
8600
8601 @item W o
8602 @kindex W o (Summary)
8603 @findex gnus-article-treat-overstrike
8604 Treat overstrike (@code{gnus-article-treat-overstrike}).
8605
8606 @item W d
8607 @kindex W d (Summary)
8608 @findex gnus-article-treat-dumbquotes
8609 @vindex gnus-article-dumbquotes-map
8610 @cindex Smartquotes
8611 @cindex M****s*** sm*rtq**t*s
8612 @cindex Latin 1
8613 Treat M****s*** sm*rtq**t*s according to
8614 @code{gnus-article-dumbquotes-map}
8615 (@code{gnus-article-treat-dumbquotes}).  Note that this function guesses
8616 whether a character is a sm*rtq**t* or not, so it should only be used
8617 interactively.
8618
8619 Sm*rtq**t*s are M****s***'s unilateral extension to the character map in
8620 an attempt to provide more quoting characters.  If you see something
8621 like @code{\222} or @code{\264} where you're expecting some kind of
8622 apostrophe or quotation mark, then try this wash.
8623
8624 @item W Y f
8625 @kindex W Y f (Summary)
8626 @findex gnus-article-outlook-deuglify-article
8627 @cindex Outlook Express
8628 Full deuglify of broken Outlook (Express) articles: Treat dumbquotes,
8629 unwrap lines, repair attribution and rearrange citation.
8630 (@code{gnus-article-outlook-deuglify-article}).
8631
8632 @item W Y u
8633 @kindex W Y u (Summary)
8634 @findex gnus-article-outlook-unwrap-lines
8635 @vindex gnus-outlook-deuglify-unwrap-min
8636 @vindex gnus-outlook-deuglify-unwrap-max
8637 Unwrap lines that appear to be wrapped citation lines.  You can control
8638 what lines will be unwrapped by frobbing
8639 @code{gnus-outlook-deuglify-unwrap-min} and
8640 @code{gnus-outlook-deuglify-unwrap-max}, indicating the minimum and
8641 maximum length of an unwrapped citation line.
8642 (@code{gnus-article-outlook-unwrap-lines}).
8643
8644 @item W Y a
8645 @kindex W Y a (Summary)
8646 @findex gnus-article-outlook-repair-attribution
8647 Repair a broken attribution line.@*
8648 (@code{gnus-article-outlook-repair-attribution}).
8649
8650 @item W Y c
8651 @kindex W Y c (Summary)
8652 @findex gnus-article-outlook-rearrange-citation
8653 Repair broken citations by rearranging the text.
8654 (@code{gnus-article-outlook-rearrange-citation}).
8655
8656 @item W w
8657 @kindex W w (Summary)
8658 @findex gnus-article-fill-cited-article
8659 Do word wrap (@code{gnus-article-fill-cited-article}).
8660
8661 You can give the command a numerical prefix to specify the width to use
8662 when filling.
8663
8664 @item W Q
8665 @kindex W Q (Summary)
8666 @findex gnus-article-fill-long-lines
8667 Fill long lines (@code{gnus-article-fill-long-lines}).
8668
8669 @item W C
8670 @kindex W C (Summary)
8671 @findex gnus-article-capitalize-sentences
8672 Capitalize the first word in each sentence
8673 (@code{gnus-article-capitalize-sentences}).
8674
8675 @item W c
8676 @kindex W c (Summary)
8677 @findex gnus-article-remove-cr
8678 Translate CRLF pairs (i. e., @samp{^M}s on the end of the lines) into LF
8679 (this takes care of DOS line endings), and then translate any remaining
8680 CRs into LF (this takes care of Mac line endings)
8681 (@code{gnus-article-remove-cr}).
8682
8683 @item W q
8684 @kindex W q (Summary)
8685 @findex gnus-article-de-quoted-unreadable
8686 Treat quoted-printable (@code{gnus-article-de-quoted-unreadable}).
8687 Quoted-Printable is one common @acronym{MIME} encoding employed when
8688 sending non-@acronym{ASCII} (i.e., 8-bit) articles.  It typically
8689 makes strings like @samp{d@'ej@`a vu} look like @samp{d=E9j=E0 vu},
8690 which doesn't look very readable to me.  Note that this is usually
8691 done automatically by Gnus if the message in question has a
8692 @code{Content-Transfer-Encoding} header that says that this encoding
8693 has been done.  If a prefix is given, a charset will be asked for.
8694
8695 @item W 6
8696 @kindex W 6 (Summary)
8697 @findex gnus-article-de-base64-unreadable
8698 Treat base64 (@code{gnus-article-de-base64-unreadable}).  Base64 is
8699 one common @acronym{MIME} encoding employed when sending
8700 non-@acronym{ASCII} (i.e., 8-bit) articles.  Note that this is
8701 usually done automatically by Gnus if the message in question has a
8702 @code{Content-Transfer-Encoding} header that says that this encoding
8703 has been done.  If a prefix is given, a charset will be asked for.
8704
8705 @item W Z
8706 @kindex W Z (Summary)
8707 @findex gnus-article-decode-HZ
8708 Treat HZ or HZP (@code{gnus-article-decode-HZ}).  HZ (or HZP) is one
8709 common encoding employed when sending Chinese articles.  It typically
8710 makes strings look like @samp{~@{<:Ky2;S@{#,NpJ)l6HK!#~@}}.
8711
8712 @item W A
8713 @kindex W A (Summary)
8714 @findex gnus-article-treat-ansi-sequences
8715 @cindex @acronym{ANSI} control sequences
8716 Translate @acronym{ANSI} SGR control sequences into overlays or
8717 extents (@code{gnus-article-treat-ansi-sequences}).  @acronym{ANSI}
8718 sequences are used in some Chinese hierarchies for highlighting.
8719
8720 @item W u
8721 @kindex W u (Summary)
8722 @findex gnus-article-unsplit-urls
8723 Remove newlines from within URLs.  Some mailers insert newlines into
8724 outgoing email messages to keep lines short.  This reformatting can
8725 split long URLs onto multiple lines.  Repair those URLs by removing
8726 the newlines (@code{gnus-article-unsplit-urls}).
8727
8728 @item W h
8729 @kindex W h (Summary)
8730 @findex gnus-article-wash-html
8731 Treat @acronym{HTML} (@code{gnus-article-wash-html}).  Note that this is
8732 usually done automatically by Gnus if the message in question has a
8733 @code{Content-Type} header that says that the message is @acronym{HTML}.
8734
8735 If a prefix is given, a charset will be asked for.  If it is a number,
8736 the charset defined in @code{gnus-summary-show-article-charset-alist}
8737 (@pxref{Paging the Article}) will be used.
8738
8739 @vindex gnus-article-wash-function
8740 The default is to use the function specified by
8741 @code{mm-text-html-renderer} (@pxref{Display Customization, ,Display
8742 Customization, emacs-mime, The Emacs MIME Manual}) to convert the
8743 @acronym{HTML}, but this is controlled by the
8744 @code{gnus-article-wash-function} variable.  Pre-defined functions you
8745 can use include:
8746
8747 @table @code
8748 @item w3
8749 Use Emacs/W3.
8750
8751 @item w3m
8752 Use @uref{http://emacs-w3m.namazu.org/, emacs-w3m}.
8753
8754 @item w3m-standalone
8755 Use @uref{http://w3m.sourceforge.net/, w3m}.
8756
8757 @item links
8758 Use @uref{http://links.sf.net/, Links}.
8759
8760 @item lynx
8761 Use @uref{http://lynx.isc.org/, Lynx}.
8762
8763 @item html2text
8764 Use html2text---a simple @acronym{HTML} converter included with Gnus.
8765
8766 @end table
8767
8768 @item W b
8769 @kindex W b (Summary)
8770 @findex gnus-article-add-buttons
8771 Add clickable buttons to the article (@code{gnus-article-add-buttons}).
8772 @xref{Article Buttons}.
8773
8774 @item W B
8775 @kindex W B (Summary)
8776 @findex gnus-article-add-buttons-to-head
8777 Add clickable buttons to the article headers
8778 (@code{gnus-article-add-buttons-to-head}).
8779
8780 @item W p
8781 @kindex W p (Summary)
8782 @findex gnus-article-verify-x-pgp-sig
8783 Verify a signed control message
8784 (@code{gnus-article-verify-x-pgp-sig}).  Control messages such as
8785 @code{newgroup} and @code{checkgroups} are usually signed by the
8786 hierarchy maintainer.  You need to add the @acronym{PGP} public key of
8787 the maintainer to your keyring to verify the
8788 message.@footnote{@acronym{PGP} keys for many hierarchies are
8789 available at @uref{ftp://ftp.isc.org/pub/pgpcontrol/README.html}}
8790
8791 @item W s
8792 @kindex W s (Summary)
8793 @findex gnus-summary-force-verify-and-decrypt
8794 Verify a signed (@acronym{PGP}, @acronym{PGP/MIME} or
8795 @acronym{S/MIME}) message
8796 (@code{gnus-summary-force-verify-and-decrypt}). @xref{Security}.
8797
8798 @item W a
8799 @kindex W a (Summary)
8800 @findex gnus-article-strip-headers-in-body
8801 Strip headers like the @code{X-No-Archive} header from the beginning of
8802 article bodies (@code{gnus-article-strip-headers-in-body}).
8803
8804 @item W E l
8805 @kindex W E l (Summary)
8806 @findex gnus-article-strip-leading-blank-lines
8807 Remove all blank lines from the beginning of the article
8808 (@code{gnus-article-strip-leading-blank-lines}).
8809
8810 @item W E m
8811 @kindex W E m (Summary)
8812 @findex gnus-article-strip-multiple-blank-lines
8813 Replace all blank lines with empty lines and then all multiple empty
8814 lines with a single empty line.
8815 (@code{gnus-article-strip-multiple-blank-lines}).
8816
8817 @item W E t
8818 @kindex W E t (Summary)
8819 @findex gnus-article-remove-trailing-blank-lines
8820 Remove all blank lines at the end of the article
8821 (@code{gnus-article-remove-trailing-blank-lines}).
8822
8823 @item W E a
8824 @kindex W E a (Summary)
8825 @findex gnus-article-strip-blank-lines
8826 Do all the three commands above
8827 (@code{gnus-article-strip-blank-lines}).
8828
8829 @item W E A
8830 @kindex W E A (Summary)
8831 @findex gnus-article-strip-all-blank-lines
8832 Remove all blank lines
8833 (@code{gnus-article-strip-all-blank-lines}).
8834
8835 @item W E s
8836 @kindex W E s (Summary)
8837 @findex gnus-article-strip-leading-space
8838 Remove all white space from the beginning of all lines of the article
8839 body (@code{gnus-article-strip-leading-space}).
8840
8841 @item W E e
8842 @kindex W E e (Summary)
8843 @findex gnus-article-strip-trailing-space
8844 Remove all white space from the end of all lines of the article
8845 body (@code{gnus-article-strip-trailing-space}).
8846
8847 @end table
8848
8849 @xref{Customizing Articles}, for how to wash articles automatically.
8850
8851
8852 @node Article Header
8853 @subsection Article Header
8854
8855 These commands perform various transformations of article header.
8856
8857 @table @kbd
8858
8859 @item W G u
8860 @kindex W G u (Summary)
8861 @findex gnus-article-treat-unfold-headers
8862 Unfold folded header lines (@code{gnus-article-treat-unfold-headers}).
8863
8864 @item W G n
8865 @kindex W G n (Summary)
8866 @findex gnus-article-treat-fold-newsgroups
8867 Fold the @code{Newsgroups} and @code{Followup-To} headers
8868 (@code{gnus-article-treat-fold-newsgroups}).
8869
8870 @item W G f
8871 @kindex W G f (Summary)
8872 @findex gnus-article-treat-fold-headers
8873 Fold all the message headers
8874 (@code{gnus-article-treat-fold-headers}).
8875
8876 @item W E w
8877 @kindex W E w (Summary)
8878 @findex gnus-article-remove-leading-whitespace
8879 Remove excessive whitespace from all headers
8880 (@code{gnus-article-remove-leading-whitespace}).
8881
8882 @end table
8883
8884
8885 @node Article Buttons
8886 @subsection Article Buttons
8887 @cindex buttons
8888
8889 People often include references to other stuff in articles, and it would
8890 be nice if Gnus could just fetch whatever it is that people talk about
8891 with the minimum of fuzz when you hit @kbd{RET} or use the middle mouse
8892 button on these references.
8893
8894 @vindex gnus-button-man-handler
8895 Gnus adds @dfn{buttons} to certain standard references by default:
8896 Well-formed URLs, mail addresses, Message-IDs, Info links, man pages and
8897 Emacs or Gnus related references.  This is controlled by two variables,
8898 one that handles article bodies and one that handles article heads:
8899
8900 @table @code
8901
8902 @item gnus-button-alist
8903 @vindex gnus-button-alist
8904 This is an alist where each entry has this form:
8905
8906 @lisp
8907 (@var{regexp} @var{button-par} @var{use-p} @var{function} @var{data-par})
8908 @end lisp
8909
8910 @table @var
8911
8912 @item regexp
8913 All text that match this regular expression (case insensitive) will be
8914 considered an external reference.  Here's a typical regexp that matches
8915 embedded URLs: @samp{<URL:\\([^\n\r>]*\\)>}.  This can also be a
8916 variable containing a regexp, useful variables to use include
8917 @code{gnus-button-url-regexp} and @code{gnus-button-mid-or-mail-regexp}.
8918
8919 @item button-par
8920 Gnus has to know which parts of the matches is to be highlighted.  This
8921 is a number that says what sub-expression of the regexp is to be
8922 highlighted.  If you want it all highlighted, you use 0 here.
8923
8924 @item use-p
8925 This form will be @code{eval}ed, and if the result is non-@code{nil},
8926 this is considered a match.  This is useful if you want extra sifting to
8927 avoid false matches.  Often variables named
8928 @code{gnus-button-@var{*}-level} are used here, @xref{Article Button
8929 Levels}, but any other form may be used too.
8930
8931 @c @code{use-p} is @code{eval}ed only if @code{regexp} matches.
8932
8933 @item function
8934 This function will be called when you click on this button.
8935
8936 @item data-par
8937 As with @var{button-par}, this is a sub-expression number, but this one
8938 says which part of the match is to be sent as data to @var{function}.
8939
8940 @end table
8941
8942 So the full entry for buttonizing URLs is then
8943
8944 @lisp
8945 ("<URL:\\([^\n\r>]*\\)>" 0 t gnus-button-url 1)
8946 @end lisp
8947
8948 @item gnus-header-button-alist
8949 @vindex gnus-header-button-alist
8950 This is just like the other alist, except that it is applied to the
8951 article head only, and that each entry has an additional element that is
8952 used to say what headers to apply the buttonize coding to:
8953
8954 @lisp
8955 (@var{header} @var{regexp} @var{button-par} @var{use-p} @var{function} @var{data-par})
8956 @end lisp
8957
8958 @var{header} is a regular expression.
8959 @end table
8960
8961 @subsubsection Related variables and functions
8962
8963 @table @code
8964 @item gnus-button-@var{*}-level
8965 @xref{Article Button Levels}.
8966
8967 @c Stuff related to gnus-button-browse-level
8968
8969 @item gnus-button-url-regexp
8970 @vindex gnus-button-url-regexp
8971 A regular expression that matches embedded URLs.  It is used in the
8972 default values of the variables above.
8973
8974 @c Stuff related to gnus-button-man-level
8975
8976 @item gnus-button-man-handler
8977 @vindex gnus-button-man-handler
8978 The function to use for displaying man pages.  It must take at least one
8979 argument with a string naming the man page.
8980
8981 @c Stuff related to gnus-button-message-level
8982
8983 @item gnus-button-mid-or-mail-regexp
8984 @vindex gnus-button-mid-or-mail-regexp
8985 Regular expression that matches a message ID or a mail address.
8986
8987 @item gnus-button-prefer-mid-or-mail
8988 @vindex gnus-button-prefer-mid-or-mail
8989 This variable determines what to do when the button on a string as
8990 @samp{foo123@@bar.invalid} is pushed.  Strings like this can be either a
8991 message ID or a mail address.  If it is one of the symbols @code{mid} or
8992 @code{mail}, Gnus will always assume that the string is a message ID or
8993 a mail address, respectively.  If this variable is set to the symbol
8994 @code{ask}, always query the user what do do.  If it is a function, this
8995 function will be called with the string as its only argument.  The
8996 function must return @code{mid}, @code{mail}, @code{invalid} or
8997 @code{ask}.  The default value is the function
8998 @code{gnus-button-mid-or-mail-heuristic}.
8999
9000 @item gnus-button-mid-or-mail-heuristic
9001 @findex gnus-button-mid-or-mail-heuristic
9002 Function that guesses whether its argument is a message ID or a mail
9003 address.  Returns @code{mid} if it's a message IDs, @code{mail} if
9004 it's a mail address, @code{ask} if unsure and @code{invalid} if the
9005 string is invalid.
9006
9007 @item gnus-button-mid-or-mail-heuristic-alist
9008 @vindex gnus-button-mid-or-mail-heuristic-alist
9009 An alist of @code{(RATE . REGEXP)} pairs used by the function
9010 @code{gnus-button-mid-or-mail-heuristic}.
9011
9012 @c Stuff related to gnus-button-tex-level
9013
9014 @item gnus-button-ctan-handler
9015 @findex gnus-button-ctan-handler
9016 The function to use for displaying CTAN links.  It must take one
9017 argument, the string naming the URL.
9018
9019 @item gnus-ctan-url
9020 @vindex gnus-ctan-url
9021 Top directory of a CTAN (Comprehensive TeX Archive Network) archive used
9022 by @code{gnus-button-ctan-handler}.
9023
9024 @c Misc stuff
9025
9026 @item gnus-article-button-face
9027 @vindex gnus-article-button-face
9028 Face used on buttons.
9029
9030 @item gnus-article-mouse-face
9031 @vindex gnus-article-mouse-face
9032 Face used when the mouse cursor is over a button.
9033
9034 @end table
9035
9036 @xref{Customizing Articles}, for how to buttonize articles automatically.
9037
9038
9039 @node Article Button Levels
9040 @subsection Article button levels
9041 @cindex button levels
9042 The higher the value of the variables @code{gnus-button-@var{*}-level},
9043 the more buttons will appear.  If the level is zero, no corresponding
9044 buttons are displayed.  With the default value (which is 5) you should
9045 already see quite a lot of buttons.  With higher levels, you will see
9046 more buttons, but you may also get more false positives.  To avoid them,
9047 you can set the variables @code{gnus-button-@var{*}-level} local to
9048 specific groups (@pxref{Group Parameters}).  Here's an example for the
9049 variable @code{gnus-parameters}:
9050
9051 @lisp
9052 ;; @r{increase @code{gnus-button-*-level} in some groups:}
9053 (setq gnus-parameters
9054       '(("\\<\\(emacs\\|gnus\\)\\>" (gnus-button-emacs-level 10))
9055         ("\\<unix\\>"               (gnus-button-man-level 10))
9056         ("\\<tex\\>"                (gnus-button-tex-level 10))))
9057 @end lisp
9058
9059 @table @code
9060
9061 @item gnus-button-browse-level
9062 @vindex gnus-button-browse-level
9063 Controls the display of references to message IDs, mail addresses and
9064 news URLs.  Related variables and functions include
9065 @code{gnus-button-url-regexp}, @code{browse-url}, and
9066 @code{browse-url-browser-function}.
9067
9068 @item gnus-button-emacs-level
9069 @vindex gnus-button-emacs-level
9070 Controls the display of Emacs or Gnus references.  Related functions are
9071 @code{gnus-button-handle-custom},
9072 @code{gnus-button-handle-describe-function},
9073 @code{gnus-button-handle-describe-variable},
9074 @code{gnus-button-handle-symbol},
9075 @code{gnus-button-handle-describe-key},
9076 @code{gnus-button-handle-apropos},
9077 @code{gnus-button-handle-apropos-command},
9078 @code{gnus-button-handle-apropos-variable},
9079 @code{gnus-button-handle-apropos-documentation}, and
9080 @code{gnus-button-handle-library}.
9081
9082 @item gnus-button-man-level
9083 @vindex gnus-button-man-level
9084 Controls the display of references to (Unix) man pages.
9085 See @code{gnus-button-man-handler}.
9086
9087 @item gnus-button-message-level
9088 @vindex gnus-button-message-level
9089 Controls the display of message IDs, mail addresses and news URLs.
9090 Related variables and functions include
9091 @code{gnus-button-mid-or-mail-regexp},
9092 @code{gnus-button-prefer-mid-or-mail},
9093 @code{gnus-button-mid-or-mail-heuristic}, and
9094 @code{gnus-button-mid-or-mail-heuristic-alist}.
9095
9096 @item gnus-button-tex-level
9097 @vindex gnus-button-tex-level
9098 Controls the display of references to @TeX{} or LaTeX stuff, e.g. for CTAN
9099 URLs.  See the variables @code{gnus-ctan-url},
9100 @code{gnus-button-ctan-handler},
9101 @code{gnus-button-ctan-directory-regexp}, and
9102 @code{gnus-button-handle-ctan-bogus-regexp}.
9103
9104 @end table
9105
9106
9107 @node Article Date
9108 @subsection Article Date
9109
9110 The date is most likely generated in some obscure timezone you've never
9111 heard of, so it's quite nice to be able to find out what the time was
9112 when the article was sent.
9113
9114 @table @kbd
9115
9116 @item W T u
9117 @kindex W T u (Summary)
9118 @findex gnus-article-date-ut
9119 Display the date in UT (aka. GMT, aka ZULU)
9120 (@code{gnus-article-date-ut}).
9121
9122 @item W T i
9123 @kindex W T i (Summary)
9124 @findex gnus-article-date-iso8601
9125 @cindex ISO 8601
9126 Display the date in international format, aka. ISO 8601
9127 (@code{gnus-article-date-iso8601}).
9128
9129 @item W T l
9130 @kindex W T l (Summary)
9131 @findex gnus-article-date-local
9132 Display the date in the local timezone (@code{gnus-article-date-local}).
9133
9134 @item W T p
9135 @kindex W T p (Summary)
9136 @findex gnus-article-date-english
9137 Display the date in a format that's easily pronounceable in English
9138 (@code{gnus-article-date-english}).
9139
9140 @item W T s
9141 @kindex W T s (Summary)
9142 @vindex gnus-article-time-format
9143 @findex gnus-article-date-user
9144 @findex format-time-string
9145 Display the date using a user-defined format
9146 (@code{gnus-article-date-user}).  The format is specified by the
9147 @code{gnus-article-time-format} variable, and is a string that's passed
9148 to @code{format-time-string}.  See the documentation of that variable
9149 for a list of possible format specs.
9150
9151 @item W T e
9152 @kindex W T e (Summary)
9153 @findex gnus-article-date-lapsed
9154 @findex gnus-start-date-timer
9155 @findex gnus-stop-date-timer
9156 Say how much time has elapsed between the article was posted and now
9157 (@code{gnus-article-date-lapsed}).  It looks something like:
9158
9159 @example
9160 X-Sent: 6 weeks, 4 days, 1 hour, 3 minutes, 8 seconds ago
9161 @end example
9162
9163 @vindex gnus-article-date-lapsed-new-header
9164 The value of @code{gnus-article-date-lapsed-new-header} determines
9165 whether this header will just be added below the old Date one, or will
9166 replace it.
9167
9168 An advantage of using Gnus to read mail is that it converts simple bugs
9169 into wonderful absurdities.
9170
9171 If you want to have this line updated continually, you can put
9172
9173 @lisp
9174 (gnus-start-date-timer)
9175 @end lisp
9176
9177 in your @file{~/.gnus.el} file, or you can run it off of some hook.  If
9178 you want to stop the timer, you can use the @code{gnus-stop-date-timer}
9179 command.
9180
9181 @item W T o
9182 @kindex W T o (Summary)
9183 @findex gnus-article-date-original
9184 Display the original date (@code{gnus-article-date-original}).  This can
9185 be useful if you normally use some other conversion function and are
9186 worried that it might be doing something totally wrong.  Say, claiming
9187 that the article was posted in 1854.  Although something like that is
9188 @emph{totally} impossible.  Don't you trust me? *titter*
9189
9190 @end table
9191
9192 @xref{Customizing Articles}, for how to display the date in your
9193 preferred format automatically.
9194
9195
9196 @node Article Display
9197 @subsection Article Display
9198 @cindex picons
9199 @cindex x-face
9200 @cindex smileys
9201
9202 These commands add various frivolous display gimmicks to the article
9203 buffer in Emacs versions that support them.
9204
9205 @code{X-Face} headers are small black-and-white images supplied by the
9206 message headers (@pxref{X-Face}).
9207
9208 @code{Face} headers are small colored images supplied by the message
9209 headers (@pxref{Face}).
9210
9211 Smileys are those little @samp{:-)} symbols that people like to litter
9212 their messages with (@pxref{Smileys}).
9213
9214 Picons, on the other hand, reside on your own system, and Gnus will
9215 try to match the headers to what you have (@pxref{Picons}).
9216
9217 All these functions are toggles---if the elements already exist,
9218 they'll be removed.
9219
9220 @table @kbd
9221 @item W D x
9222 @kindex W D x (Summary)
9223 @findex gnus-article-display-x-face
9224 Display an @code{X-Face} in the @code{From} header.
9225 (@code{gnus-article-display-x-face}).
9226
9227 @item W D d
9228 @kindex W D d (Summary)
9229 @findex gnus-article-display-face
9230 Display a @code{Face} in the @code{From} header.
9231 (@code{gnus-article-display-face}).
9232
9233 @item W D s
9234 @kindex W D s (Summary)
9235 @findex gnus-treat-smiley
9236 Display smileys (@code{gnus-treat-smiley}).
9237
9238 @item W D f
9239 @kindex W D f (Summary)
9240 @findex gnus-treat-from-picon
9241 Piconify the @code{From} header (@code{gnus-treat-from-picon}).
9242
9243 @item W D m
9244 @kindex W D m (Summary)
9245 @findex gnus-treat-mail-picon
9246 Piconify all mail headers (i. e., @code{Cc}, @code{To})
9247 (@code{gnus-treat-mail-picon}).
9248
9249 @item W D n
9250 @kindex W D n (Summary)
9251 @findex gnus-treat-newsgroups-picon
9252 Piconify all news headers (i. e., @code{Newsgroups} and
9253 @code{Followup-To}) (@code{gnus-treat-newsgroups-picon}).
9254
9255 @item W D D
9256 @kindex W D D (Summary)
9257 @findex gnus-article-remove-images
9258 Remove all images from the article buffer
9259 (@code{gnus-article-remove-images}).
9260
9261 @end table
9262
9263
9264
9265 @node Article Signature
9266 @subsection Article Signature
9267 @cindex signatures
9268 @cindex article signature
9269
9270 @vindex gnus-signature-separator
9271 Each article is divided into two parts---the head and the body.  The
9272 body can be divided into a signature part and a text part.  The variable
9273 that says what is to be considered a signature is
9274 @code{gnus-signature-separator}.  This is normally the standard
9275 @samp{^-- $} as mandated by son-of-RFC 1036.  However, many people use
9276 non-standard signature separators, so this variable can also be a list
9277 of regular expressions to be tested, one by one.  (Searches are done
9278 from the end of the body towards the beginning.)  One likely value is:
9279
9280 @lisp
9281 (setq gnus-signature-separator
9282       '("^-- $"         ; @r{The standard}
9283         "^-- *$"        ; @r{A common mangling}
9284         "^-------*$"    ; @r{Many people just use a looong}
9285                         ; @r{line of dashes.  Shame!}
9286         "^ *--------*$" ; @r{Double-shame!}
9287         "^________*$"   ; @r{Underscores are also popular}
9288         "^========*$")) ; @r{Pervert!}
9289 @end lisp
9290
9291 The more permissive you are, the more likely it is that you'll get false
9292 positives.
9293
9294 @vindex gnus-signature-limit
9295 @code{gnus-signature-limit} provides a limit to what is considered a
9296 signature when displaying articles.
9297
9298 @enumerate
9299 @item
9300 If it is an integer, no signature may be longer (in characters) than
9301 that integer.
9302 @item
9303 If it is a floating point number, no signature may be longer (in lines)
9304 than that number.
9305 @item
9306 If it is a function, the function will be called without any parameters,
9307 and if it returns @code{nil}, there is no signature in the buffer.
9308 @item
9309 If it is a string, it will be used as a regexp.  If it matches, the text
9310 in question is not a signature.
9311 @end enumerate
9312
9313 This variable can also be a list where the elements may be of the types
9314 listed above.  Here's an example:
9315
9316 @lisp
9317 (setq gnus-signature-limit
9318       '(200.0 "^---*Forwarded article"))
9319 @end lisp
9320
9321 This means that if there are more than 200 lines after the signature
9322 separator, or the text after the signature separator is matched by
9323 the regular expression @samp{^---*Forwarded article}, then it isn't a
9324 signature after all.
9325
9326
9327 @node Article Miscellanea
9328 @subsection Article Miscellanea
9329
9330 @table @kbd
9331 @item A t
9332 @kindex A t (Summary)
9333 @findex gnus-article-babel
9334 Translate the article from one language to another
9335 (@code{gnus-article-babel}).
9336
9337 @end table
9338
9339
9340 @node MIME Commands
9341 @section MIME Commands
9342 @cindex MIME decoding
9343 @cindex attachments
9344 @cindex viewing attachments
9345
9346 The following commands all understand the numerical prefix.  For
9347 instance, @kbd{3 K v} means ``view the third @acronym{MIME} part''.
9348
9349 @table @kbd
9350 @item b
9351 @itemx K v
9352 @kindex b (Summary)
9353 @kindex K v (Summary)
9354 View the @acronym{MIME} part.
9355
9356 @item K o
9357 @kindex K o (Summary)
9358 Save the @acronym{MIME} part.
9359
9360 @item K O
9361 @kindex K O (Summary)
9362 Prompt for a file name, then save the @acronym{MIME} part and strip it
9363 from the article.  The stripped @acronym{MIME} object will be referred
9364 via the message/external-body @acronym{MIME} type.
9365
9366 @item K r
9367 @kindex K r (Summary)
9368 Replace the @acronym{MIME} part with an external body.
9369
9370 @item K d
9371 @kindex K d (Summary)
9372 Delete the @acronym{MIME} part and add some information about the
9373 removed part.
9374
9375 @item K c
9376 @kindex K c (Summary)
9377 Copy the @acronym{MIME} part.
9378
9379 @item K e
9380 @kindex K e (Summary)
9381 View the @acronym{MIME} part externally.
9382
9383 @item K i
9384 @kindex K i (Summary)
9385 View the @acronym{MIME} part internally.
9386
9387 @item K |
9388 @kindex K | (Summary)
9389 Pipe the @acronym{MIME} part to an external command.
9390 @end table
9391
9392 The rest of these @acronym{MIME} commands do not use the numerical prefix in
9393 the same manner:
9394
9395 @table @kbd
9396 @item K b
9397 @kindex K b (Summary)
9398 Make all the @acronym{MIME} parts have buttons in front of them.  This is
9399 mostly useful if you wish to save (or perform other actions) on inlined
9400 parts.
9401
9402 @item K m
9403 @kindex K m (Summary)
9404 @findex gnus-summary-repair-multipart
9405 Some multipart messages are transmitted with missing or faulty headers.
9406 This command will attempt to ``repair'' these messages so that they can
9407 be viewed in a more pleasant manner
9408 (@code{gnus-summary-repair-multipart}).
9409
9410 @item X m
9411 @kindex X m (Summary)
9412 @findex gnus-summary-save-parts
9413 Save all parts matching a @acronym{MIME} type to a directory
9414 (@code{gnus-summary-save-parts}).  Understands the process/prefix
9415 convention (@pxref{Process/Prefix}).
9416
9417 @item M-t
9418 @kindex M-t (Summary)
9419 @findex gnus-summary-toggle-display-buttonized
9420 Toggle the buttonized display of the article buffer
9421 (@code{gnus-summary-toggle-display-buttonized}).
9422
9423 @item W M w
9424 @kindex W M w (Summary)
9425 @findex gnus-article-decode-mime-words
9426 Decode RFC 2047-encoded words in the article headers
9427 (@code{gnus-article-decode-mime-words}).
9428
9429 @item W M c
9430 @kindex W M c (Summary)
9431 @findex gnus-article-decode-charset
9432 Decode encoded article bodies as well as charsets
9433 (@code{gnus-article-decode-charset}).
9434
9435 This command looks in the @code{Content-Type} header to determine the
9436 charset.  If there is no such header in the article, you can give it a
9437 prefix, which will prompt for the charset to decode as.  In regional
9438 groups where people post using some common encoding (but do not
9439 include @acronym{MIME} headers), you can set the @code{charset} group/topic
9440 parameter to the required charset (@pxref{Group Parameters}).
9441
9442 @item W M v
9443 @kindex W M v (Summary)
9444 @findex gnus-mime-view-all-parts
9445 View all the @acronym{MIME} parts in the current article
9446 (@code{gnus-mime-view-all-parts}).
9447
9448 @end table
9449
9450 Relevant variables:
9451
9452 @table @code
9453 @item gnus-ignored-mime-types
9454 @vindex gnus-ignored-mime-types
9455 This is a list of regexps.  @acronym{MIME} types that match a regexp from
9456 this list will be completely ignored by Gnus.  The default value is
9457 @code{nil}.
9458
9459 To have all Vcards be ignored, you'd say something like this:
9460
9461 @lisp
9462 (setq gnus-ignored-mime-types
9463       '("text/x-vcard"))
9464 @end lisp
9465
9466 @item gnus-article-loose-mime
9467 @vindex gnus-article-loose-mime
9468 If non-@code{nil}, Gnus won't require the @samp{MIME-Version} header
9469 before interpreting the message as a @acronym{MIME} message.  This helps
9470 when reading messages from certain broken mail user agents.  The
9471 default is @code{nil}.
9472
9473 @item gnus-article-emulate-mime
9474 @vindex gnus-article-emulate-mime
9475 There are other, non-@acronym{MIME} encoding methods used.  The most common
9476 is @samp{uuencode}, but yEncode is also getting to be popular.  If
9477 this variable is non-@code{nil}, Gnus will look in message bodies to
9478 see if it finds these encodings, and if so, it'll run them through the
9479 Gnus @acronym{MIME} machinery.  The default is @code{t}.
9480
9481 @item gnus-unbuttonized-mime-types
9482 @vindex gnus-unbuttonized-mime-types
9483 This is a list of regexps.  @acronym{MIME} types that match a regexp from
9484 this list won't have @acronym{MIME} buttons inserted unless they aren't
9485 displayed or this variable is overridden by
9486 @code{gnus-buttonized-mime-types}.  The default value is
9487 @code{(".*/.*")}.  This variable is only used when
9488 @code{gnus-inhibit-mime-unbuttonizing} is @code{nil}.
9489
9490 @item gnus-buttonized-mime-types
9491 @vindex gnus-buttonized-mime-types
9492 This is a list of regexps.  @acronym{MIME} types that match a regexp from
9493 this list will have @acronym{MIME} buttons inserted unless they aren't
9494 displayed.  This variable overrides
9495 @code{gnus-unbuttonized-mime-types}.  The default value is @code{nil}.
9496 This variable is only used when @code{gnus-inhibit-mime-unbuttonizing}
9497 is @code{nil}.
9498
9499 To see e.g. security buttons but no other buttons, you could set this
9500 variable to @code{("multipart/signed")} and leave
9501 @code{gnus-unbuttonized-mime-types} at the default value.
9502
9503 You could also add @code{"multipart/alternative"} to this list to
9504 display radio buttons that allow you to choose one of two media types
9505 those mails include.  See also @code{mm-discouraged-alternatives}
9506 (@pxref{Display Customization, ,Display Customization, emacs-mime, The
9507 Emacs MIME Manual}).
9508
9509 @item gnus-inhibit-mime-unbuttonizing
9510 @vindex gnus-inhibit-mime-unbuttonizing
9511 If this is non-@code{nil}, then all @acronym{MIME} parts get buttons.  The
9512 default value is @code{nil}.
9513
9514 @item gnus-article-mime-part-function
9515 @vindex gnus-article-mime-part-function
9516 For each @acronym{MIME} part, this function will be called with the @acronym{MIME}
9517 handle as the parameter.  The function is meant to be used to allow
9518 users to gather information from the article (e. g., add Vcard info to
9519 the bbdb database) or to do actions based on parts (e. g., automatically
9520 save all jpegs into some directory).
9521
9522 Here's an example function the does the latter:
9523
9524 @lisp
9525 (defun my-save-all-jpeg-parts (handle)
9526   (when (equal (car (mm-handle-type handle)) "image/jpeg")
9527     (with-temp-buffer
9528       (insert (mm-get-part handle))
9529       (write-region (point-min) (point-max)
9530                     (read-file-name "Save jpeg to: ")))))
9531 (setq gnus-article-mime-part-function
9532       'my-save-all-jpeg-parts)
9533 @end lisp
9534
9535 @vindex gnus-mime-multipart-functions
9536 @item gnus-mime-multipart-functions
9537 Alist of @acronym{MIME} multipart types and functions to handle them.
9538
9539 @vindex gnus-mime-display-multipart-alternative-as-mixed
9540 @item gnus-mime-display-multipart-alternative-as-mixed
9541 Display "multipart/alternative" parts as "multipart/mixed".
9542
9543 @vindex gnus-mime-display-multipart-related-as-mixed
9544 @item gnus-mime-display-multipart-related-as-mixed
9545 Display "multipart/related" parts as "multipart/mixed".
9546
9547 If displaying "text/html" is discouraged, see
9548 @code{mm-discouraged-alternatives}, images or other material inside a
9549 "multipart/related" part might be overlooked when this variable is
9550 @code{nil}.  @ref{Display Customization, Display Customization, ,
9551 emacs-mime, Emacs-Mime Manual}.
9552
9553 @vindex gnus-mime-display-multipart-as-mixed
9554 @item gnus-mime-display-multipart-as-mixed
9555 Display "multipart" parts as "multipart/mixed".  If @code{t}, it
9556 overrides @code{nil} values of
9557 @code{gnus-mime-display-multipart-alternative-as-mixed} and
9558 @code{gnus-mime-display-multipart-related-as-mixed}.
9559
9560 @vindex mm-file-name-rewrite-functions
9561 @item mm-file-name-rewrite-functions
9562 List of functions used for rewriting file names of @acronym{MIME} parts.
9563 Each function takes a file name as input and returns a file name.
9564
9565 Ready-made functions include@*
9566 @code{mm-file-name-delete-whitespace},
9567 @code{mm-file-name-trim-whitespace},
9568 @code{mm-file-name-collapse-whitespace}, and
9569 @code{mm-file-name-replace-whitespace}.  The later uses the value of
9570 the variable @code{mm-file-name-replace-whitespace} to replace each
9571 whitespace character in a file name with that string; default value
9572 is @code{"_"} (a single underscore).
9573 @findex mm-file-name-delete-whitespace
9574 @findex mm-file-name-trim-whitespace
9575 @findex mm-file-name-collapse-whitespace
9576 @findex mm-file-name-replace-whitespace
9577 @vindex mm-file-name-replace-whitespace
9578
9579 The standard functions @code{capitalize}, @code{downcase},
9580 @code{upcase}, and @code{upcase-initials} may be useful, too.
9581
9582 Everybody knows that whitespace characters in file names are evil,
9583 except those who don't know.  If you receive lots of attachments from
9584 such unenlightened users, you can make live easier by adding
9585
9586 @lisp
9587 (setq mm-file-name-rewrite-functions
9588       '(mm-file-name-trim-whitespace
9589         mm-file-name-collapse-whitespace
9590         mm-file-name-replace-whitespace))
9591 @end lisp
9592
9593 @noindent
9594 to your @file{~/.gnus.el} file.
9595
9596 @end table
9597
9598
9599 @node Charsets
9600 @section Charsets
9601 @cindex charsets
9602
9603 People use different charsets, and we have @acronym{MIME} to let us know what
9604 charsets they use.  Or rather, we wish we had.  Many people use
9605 newsreaders and mailers that do not understand or use @acronym{MIME}, and
9606 just send out messages without saying what character sets they use.  To
9607 help a bit with this, some local news hierarchies have policies that say
9608 what character set is the default.  For instance, the @samp{fj}
9609 hierarchy uses @code{iso-2022-jp}.
9610
9611 @vindex gnus-group-charset-alist
9612 This knowledge is encoded in the @code{gnus-group-charset-alist}
9613 variable, which is an alist of regexps (use the first item to match full
9614 group names) and default charsets to be used when reading these groups.
9615
9616 @vindex gnus-newsgroup-ignored-charsets
9617 In addition, some people do use soi-disant @acronym{MIME}-aware agents that
9618 aren't.  These blithely mark messages as being in @code{iso-8859-1}
9619 even if they really are in @code{koi-8}.  To help here, the
9620 @code{gnus-newsgroup-ignored-charsets} variable can be used.  The
9621 charsets that are listed here will be ignored.  The variable can be
9622 set on a group-by-group basis using the group parameters (@pxref{Group
9623 Parameters}).  The default value is @code{(unknown-8bit x-unknown)},
9624 which includes values some agents insist on having in there.
9625
9626 @vindex gnus-group-posting-charset-alist
9627 When posting, @code{gnus-group-posting-charset-alist} is used to
9628 determine which charsets should not be encoded using the @acronym{MIME}
9629 encodings.  For instance, some hierarchies discourage using
9630 quoted-printable header encoding.
9631
9632 This variable is an alist of regexps and permitted unencoded charsets
9633 for posting.  Each element of the alist has the form @code{(}@var{test
9634 header body-list}@code{)}, where:
9635
9636 @table @var
9637 @item test
9638 is either a regular expression matching the newsgroup header or a
9639 variable to query,
9640 @item header
9641 is the charset which may be left unencoded in the header (@code{nil}
9642 means encode all charsets),
9643 @item body-list
9644 is a list of charsets which may be encoded using 8bit content-transfer
9645 encoding in the body, or one of the special values @code{nil} (always
9646 encode using quoted-printable) or @code{t} (always use 8bit).
9647 @end table
9648
9649 @cindex Russian
9650 @cindex koi8-r
9651 @cindex koi8-u
9652 @cindex iso-8859-5
9653 @cindex coding system aliases
9654 @cindex preferred charset
9655
9656 @xref{Encoding Customization, , Encoding Customization, emacs-mime,
9657 The Emacs MIME Manual}, for additional variables that control which
9658 MIME charsets are used when sending messages.
9659
9660 Other charset tricks that may be useful, although not Gnus-specific:
9661
9662 If there are several @acronym{MIME} charsets that encode the same Emacs
9663 charset, you can choose what charset to use by saying the following:
9664
9665 @lisp
9666 (put-charset-property 'cyrillic-iso8859-5
9667                       'preferred-coding-system 'koi8-r)
9668 @end lisp
9669
9670 This means that Russian will be encoded using @code{koi8-r} instead of
9671 the default @code{iso-8859-5} @acronym{MIME} charset.
9672
9673 If you want to read messages in @code{koi8-u}, you can cheat and say
9674
9675 @lisp
9676 (define-coding-system-alias 'koi8-u 'koi8-r)
9677 @end lisp
9678
9679 This will almost do the right thing.
9680
9681 And finally, to read charsets like @code{windows-1251}, you can say
9682 something like
9683
9684 @lisp
9685 (codepage-setup 1251)
9686 (define-coding-system-alias 'windows-1251 'cp1251)
9687 @end lisp
9688
9689
9690 @node Article Commands
9691 @section Article Commands
9692
9693 @table @kbd
9694
9695 @item A P
9696 @cindex PostScript
9697 @cindex printing
9698 @kindex A P (Summary)
9699 @vindex gnus-ps-print-hook
9700 @findex gnus-summary-print-article
9701 Generate and print a PostScript image of the article buffer
9702 (@code{gnus-summary-print-article}).  @code{gnus-ps-print-hook} will
9703 be run just before printing the buffer.  An alternative way to print
9704 article is to use Muttprint (@pxref{Saving Articles}).
9705
9706 @end table
9707
9708
9709 @node Summary Sorting
9710 @section Summary Sorting
9711 @cindex summary sorting
9712
9713 You can have the summary buffer sorted in various ways, even though I
9714 can't really see why you'd want that.
9715
9716 @table @kbd
9717
9718 @item C-c C-s C-n
9719 @kindex C-c C-s C-n (Summary)
9720 @findex gnus-summary-sort-by-number
9721 Sort by article number (@code{gnus-summary-sort-by-number}).
9722
9723 @item C-c C-s C-a
9724 @kindex C-c C-s C-a (Summary)
9725 @findex gnus-summary-sort-by-author
9726 Sort by author (@code{gnus-summary-sort-by-author}).
9727
9728 @item C-c C-s C-t
9729 @kindex C-c C-s C-t (Summary)
9730 @findex gnus-summary-sort-by-recipient
9731 Sort by recipient (@code{gnus-summary-sort-by-recipient}).
9732
9733 @item C-c C-s C-s
9734 @kindex C-c C-s C-s (Summary)
9735 @findex gnus-summary-sort-by-subject
9736 Sort by subject (@code{gnus-summary-sort-by-subject}).
9737
9738 @item C-c C-s C-d
9739 @kindex C-c C-s C-d (Summary)
9740 @findex gnus-summary-sort-by-date
9741 Sort by date (@code{gnus-summary-sort-by-date}).
9742
9743 @item C-c C-s C-l
9744 @kindex C-c C-s C-l (Summary)
9745 @findex gnus-summary-sort-by-lines
9746 Sort by lines (@code{gnus-summary-sort-by-lines}).
9747
9748 @item C-c C-s C-c
9749 @kindex C-c C-s C-c (Summary)
9750 @findex gnus-summary-sort-by-chars
9751 Sort by article length (@code{gnus-summary-sort-by-chars}).
9752
9753 @item C-c C-s C-i
9754 @kindex C-c C-s C-i (Summary)
9755 @findex gnus-summary-sort-by-score
9756 Sort by score (@code{gnus-summary-sort-by-score}).
9757
9758 @item C-c C-s C-r
9759 @kindex C-c C-s C-r (Summary)
9760 @findex gnus-summary-sort-by-random
9761 Randomize (@code{gnus-summary-sort-by-random}).
9762
9763 @item C-c C-s C-o
9764 @kindex C-c C-s C-o (Summary)
9765 @findex gnus-summary-sort-by-original
9766 Sort using the default sorting method
9767 (@code{gnus-summary-sort-by-original}).
9768 @end table
9769
9770 These functions will work both when you use threading and when you don't
9771 use threading.  In the latter case, all summary lines will be sorted,
9772 line by line.  In the former case, sorting will be done on a
9773 root-by-root basis, which might not be what you were looking for.  To
9774 toggle whether to use threading, type @kbd{T T} (@pxref{Thread
9775 Commands}).
9776
9777
9778 @node Finding the Parent
9779 @section Finding the Parent
9780 @cindex parent articles
9781 @cindex referring articles
9782
9783 @table @kbd
9784 @item ^
9785 @kindex ^ (Summary)
9786 @findex gnus-summary-refer-parent-article
9787 If you'd like to read the parent of the current article, and it is not
9788 displayed in the summary buffer, you might still be able to.  That is,
9789 if the current group is fetched by @acronym{NNTP}, the parent hasn't expired
9790 and the @code{References} in the current article are not mangled, you
9791 can just press @kbd{^} or @kbd{A r}
9792 (@code{gnus-summary-refer-parent-article}).  If everything goes well,
9793 you'll get the parent.  If the parent is already displayed in the
9794 summary buffer, point will just move to this article.
9795
9796 If given a positive numerical prefix, fetch that many articles back into
9797 the ancestry.  If given a negative numerical prefix, fetch just that
9798 ancestor.  So if you say @kbd{3 ^}, Gnus will fetch the parent, the
9799 grandparent and the grandgrandparent of the current article.  If you say
9800 @kbd{-3 ^}, Gnus will only fetch the grandgrandparent of the current
9801 article.
9802
9803 @item A R (Summary)
9804 @findex gnus-summary-refer-references
9805 @kindex A R (Summary)
9806 Fetch all articles mentioned in the @code{References} header of the
9807 article (@code{gnus-summary-refer-references}).
9808
9809 @item A T (Summary)
9810 @findex gnus-summary-refer-thread
9811 @kindex A T (Summary)
9812 Display the full thread where the current article appears
9813 (@code{gnus-summary-refer-thread}).  This command has to fetch all the
9814 headers in the current group to work, so it usually takes a while.  If
9815 you do it often, you may consider setting @code{gnus-fetch-old-headers}
9816 to @code{invisible} (@pxref{Filling In Threads}).  This won't have any
9817 visible effects normally, but it'll make this command work a whole lot
9818 faster.  Of course, it'll make group entry somewhat slow.
9819
9820 @vindex gnus-refer-thread-limit
9821 The @code{gnus-refer-thread-limit} variable says how many old (i. e.,
9822 articles before the first displayed in the current group) headers to
9823 fetch when doing this command.  The default is 200.  If @code{t}, all
9824 the available headers will be fetched.  This variable can be overridden
9825 by giving the @kbd{A T} command a numerical prefix.
9826
9827 @item M-^ (Summary)
9828 @findex gnus-summary-refer-article
9829 @kindex M-^ (Summary)
9830 @cindex Message-ID
9831 @cindex fetching by Message-ID
9832 You can also ask Gnus for an arbitrary article, no matter what group it
9833 belongs to.  @kbd{M-^} (@code{gnus-summary-refer-article}) will ask you
9834 for a @code{Message-ID}, which is one of those long, hard-to-read
9835 thingies that look something like @samp{<38o6up$6f2@@hymir.ifi.uio.no>}.
9836 You have to get it all exactly right.  No fuzzy searches, I'm afraid.
9837
9838 Gnus looks for the @code{Message-ID} in the headers that have already
9839 been fetched, but also tries all the select methods specified by
9840 @code{gnus-refer-article-method} if it is not found.
9841 @end table
9842
9843 @vindex gnus-refer-article-method
9844 If the group you are reading is located on a back end that does not
9845 support fetching by @code{Message-ID} very well (like @code{nnspool}),
9846 you can set @code{gnus-refer-article-method} to an @acronym{NNTP} method.  It
9847 would, perhaps, be best if the @acronym{NNTP} server you consult is the one
9848 updating the spool you are reading from, but that's not really
9849 necessary.
9850
9851 It can also be a list of select methods, as well as the special symbol
9852 @code{current}, which means to use the current select method.  If it
9853 is a list, Gnus will try all the methods in the list until it finds a
9854 match.
9855
9856 Here's an example setting that will first try the current method, and
9857 then ask Google if that fails:
9858
9859 @lisp
9860 (setq gnus-refer-article-method
9861       '(current
9862         (nnweb "google" (nnweb-type google))))
9863 @end lisp
9864
9865 Most of the mail back ends support fetching by @code{Message-ID}, but
9866 do not do a particularly excellent job at it.  That is, @code{nnmbox},
9867 @code{nnbabyl}, @code{nnmaildir}, @code{nnml}, are able to locate
9868 articles from any groups, while @code{nnfolder}, and @code{nnimap} are
9869 only able to locate articles that have been posted to the current
9870 group.  (Anything else would be too time consuming.)  @code{nnmh} does
9871 not support this at all.
9872
9873
9874 @node Alternative Approaches
9875 @section Alternative Approaches
9876
9877 Different people like to read news using different methods.  This being
9878 Gnus, we offer a small selection of minor modes for the summary buffers.
9879
9880 @menu
9881 * Pick and Read::               First mark articles and then read them.
9882 * Binary Groups::               Auto-decode all articles.
9883 @end menu
9884
9885
9886 @node Pick and Read
9887 @subsection Pick and Read
9888 @cindex pick and read
9889
9890 Some newsreaders (like @code{nn} and, uhm, @code{Netnews} on VM/CMS) use
9891 a two-phased reading interface.  The user first marks in a summary
9892 buffer the articles she wants to read.  Then she starts reading the
9893 articles with just an article buffer displayed.
9894
9895 @findex gnus-pick-mode
9896 @kindex M-x gnus-pick-mode
9897 Gnus provides a summary buffer minor mode that allows
9898 this---@code{gnus-pick-mode}.  This basically means that a few process
9899 mark commands become one-keystroke commands to allow easy marking, and
9900 it provides one additional command for switching to the summary buffer.
9901
9902 Here are the available keystrokes when using pick mode:
9903
9904 @table @kbd
9905 @item .
9906 @kindex . (Pick)
9907 @findex gnus-pick-article-or-thread
9908 Pick the article or thread on the current line
9909 (@code{gnus-pick-article-or-thread}).  If the variable
9910 @code{gnus-thread-hide-subtree} is true, then this key selects the
9911 entire thread when used at the first article of the thread.  Otherwise,
9912 it selects just the article.  If given a numerical prefix, go to that
9913 thread or article and pick it.  (The line number is normally displayed
9914 at the beginning of the summary pick lines.)
9915
9916 @item SPACE
9917 @kindex SPACE (Pick)
9918 @findex gnus-pick-next-page
9919 Scroll the summary buffer up one page (@code{gnus-pick-next-page}).  If
9920 at the end of the buffer, start reading the picked articles.
9921
9922 @item u
9923 @kindex u (Pick)
9924 @findex gnus-pick-unmark-article-or-thread.
9925 Unpick the thread or article
9926 (@code{gnus-pick-unmark-article-or-thread}).  If the variable
9927 @code{gnus-thread-hide-subtree} is true, then this key unpicks the
9928 thread if used at the first article of the thread.  Otherwise it unpicks
9929 just the article.  You can give this key a numerical prefix to unpick
9930 the thread or article at that line.
9931
9932 @item RET
9933 @kindex RET (Pick)
9934 @findex gnus-pick-start-reading
9935 @vindex gnus-pick-display-summary
9936 Start reading the picked articles (@code{gnus-pick-start-reading}).  If
9937 given a prefix, mark all unpicked articles as read first.  If
9938 @code{gnus-pick-display-summary} is non-@code{nil}, the summary buffer
9939 will still be visible when you are reading.
9940
9941 @end table
9942
9943 All the normal summary mode commands are still available in the
9944 pick-mode, with the exception of @kbd{u}.  However @kbd{!} is available
9945 which is mapped to the same function
9946 @code{gnus-summary-tick-article-forward}.
9947
9948 If this sounds like a good idea to you, you could say:
9949
9950 @lisp
9951 (add-hook 'gnus-summary-mode-hook 'gnus-pick-mode)
9952 @end lisp
9953
9954 @vindex gnus-pick-mode-hook
9955 @code{gnus-pick-mode-hook} is run in pick minor mode buffers.
9956
9957 @vindex gnus-mark-unpicked-articles-as-read
9958 If @code{gnus-mark-unpicked-articles-as-read} is non-@code{nil}, mark
9959 all unpicked articles as read.  The default is @code{nil}.
9960
9961 @vindex gnus-summary-pick-line-format
9962 The summary line format in pick mode is slightly different from the
9963 standard format.  At the beginning of each line the line number is
9964 displayed.  The pick mode line format is controlled by the
9965 @code{gnus-summary-pick-line-format} variable (@pxref{Formatting
9966 Variables}).  It accepts the same format specs that
9967 @code{gnus-summary-line-format} does (@pxref{Summary Buffer Lines}).
9968
9969
9970 @node Binary Groups
9971 @subsection Binary Groups
9972 @cindex binary groups
9973
9974 @findex gnus-binary-mode
9975 @kindex M-x gnus-binary-mode
9976 If you spend much time in binary groups, you may grow tired of hitting
9977 @kbd{X u}, @kbd{n}, @kbd{RET} all the time.  @kbd{M-x gnus-binary-mode}
9978 is a minor mode for summary buffers that makes all ordinary Gnus article
9979 selection functions uudecode series of articles and display the result
9980 instead of just displaying the articles the normal way.
9981
9982 @kindex g (Binary)
9983 @findex gnus-binary-show-article
9984 The only way, in fact, to see the actual articles is the @kbd{g}
9985 command, when you have turned on this mode
9986 (@code{gnus-binary-show-article}).
9987
9988 @vindex gnus-binary-mode-hook
9989 @code{gnus-binary-mode-hook} is called in binary minor mode buffers.
9990
9991
9992 @node Tree Display
9993 @section Tree Display
9994 @cindex trees
9995
9996 @vindex gnus-use-trees
9997 If you don't like the normal Gnus summary display, you might try setting
9998 @code{gnus-use-trees} to @code{t}.  This will create (by default) an
9999 additional @dfn{tree buffer}.  You can execute all summary mode commands
10000 in the tree buffer.
10001
10002 There are a few variables to customize the tree display, of course:
10003
10004 @table @code
10005 @item gnus-tree-mode-hook
10006 @vindex gnus-tree-mode-hook
10007 A hook called in all tree mode buffers.
10008
10009 @item gnus-tree-mode-line-format
10010 @vindex gnus-tree-mode-line-format
10011 A format string for the mode bar in the tree mode buffers (@pxref{Mode
10012 Line Formatting}).  The default is @samp{Gnus: %%b %S %Z}.  For a list
10013 of valid specs, @pxref{Summary Buffer Mode Line}.
10014
10015 @item gnus-selected-tree-face
10016 @vindex gnus-selected-tree-face
10017 Face used for highlighting the selected article in the tree buffer.  The
10018 default is @code{modeline}.
10019
10020 @item gnus-tree-line-format
10021 @vindex gnus-tree-line-format
10022 A format string for the tree nodes.  The name is a bit of a misnomer,
10023 though---it doesn't define a line, but just the node.  The default value
10024 is @samp{%(%[%3,3n%]%)}, which displays the first three characters of
10025 the name of the poster.  It is vital that all nodes are of the same
10026 length, so you @emph{must} use @samp{%4,4n}-like specifiers.
10027
10028 Valid specs are:
10029
10030 @table @samp
10031 @item n
10032 The name of the poster.
10033 @item f
10034 The @code{From} header.
10035 @item N
10036 The number of the article.
10037 @item [
10038 The opening bracket.
10039 @item ]
10040 The closing bracket.
10041 @item s
10042 The subject.
10043 @end table
10044
10045 @xref{Formatting Variables}.
10046
10047 Variables related to the display are:
10048
10049 @table @code
10050 @item gnus-tree-brackets
10051 @vindex gnus-tree-brackets
10052 This is used for differentiating between ``real'' articles and
10053 ``sparse'' articles.  The format is
10054 @example
10055 ((@var{real-open} . @var{real-close})
10056  (@var{sparse-open} . @var{sparse-close})
10057  (@var{dummy-open} . @var{dummy-close}))
10058 @end example
10059 and the default is @code{((?[ . ?]) (?( . ?)) (?@{ . ?@}) (?< . ?>))}.
10060
10061 @item gnus-tree-parent-child-edges
10062 @vindex gnus-tree-parent-child-edges
10063 This is a list that contains the characters used for connecting parent
10064 nodes to their children.  The default is @code{(?- ?\\ ?|)}.
10065
10066 @end table
10067
10068 @item gnus-tree-minimize-window
10069 @vindex gnus-tree-minimize-window
10070 If this variable is non-@code{nil}, Gnus will try to keep the tree
10071 buffer as small as possible to allow more room for the other Gnus
10072 windows.  If this variable is a number, the tree buffer will never be
10073 higher than that number.  The default is @code{t}.  Note that if you
10074 have several windows displayed side-by-side in a frame and the tree
10075 buffer is one of these, minimizing the tree window will also resize all
10076 other windows displayed next to it.
10077
10078 You may also wish to add the following hook to keep the window minimized
10079 at all times:
10080
10081 @lisp
10082 (add-hook 'gnus-configure-windows-hook
10083           'gnus-tree-perhaps-minimize)
10084 @end lisp
10085
10086 @item gnus-generate-tree-function
10087 @vindex gnus-generate-tree-function
10088 @findex gnus-generate-horizontal-tree
10089 @findex gnus-generate-vertical-tree
10090 The function that actually generates the thread tree.  Two predefined
10091 functions are available: @code{gnus-generate-horizontal-tree} and
10092 @code{gnus-generate-vertical-tree} (which is the default).
10093
10094 @end table
10095
10096 Here's an example from a horizontal tree buffer:
10097
10098 @example
10099 @{***@}-(***)-[odd]-[Gun]
10100      |      \[Jan]
10101      |      \[odd]-[Eri]
10102      |      \(***)-[Eri]
10103      |            \[odd]-[Paa]
10104      \[Bjo]
10105      \[Gun]
10106      \[Gun]-[Jor]
10107 @end example
10108
10109 Here's the same thread displayed in a vertical tree buffer:
10110
10111 @example
10112 @group
10113 @{***@}
10114   |--------------------------\-----\-----\
10115 (***)                         [Bjo] [Gun] [Gun]
10116   |--\-----\-----\                          |
10117 [odd] [Jan] [odd] (***)                   [Jor]
10118   |           |     |--\
10119 [Gun]       [Eri] [Eri] [odd]
10120                           |
10121                         [Paa]
10122 @end group
10123 @end example
10124
10125 If you're using horizontal trees, it might be nice to display the trees
10126 side-by-side with the summary buffer.  You could add something like the
10127 following to your @file{~/.gnus.el} file:
10128
10129 @lisp
10130 (setq gnus-use-trees t
10131       gnus-generate-tree-function 'gnus-generate-horizontal-tree
10132       gnus-tree-minimize-window nil)
10133 (gnus-add-configuration
10134  '(article
10135    (vertical 1.0
10136              (horizontal 0.25
10137                          (summary 0.75 point)
10138                          (tree 1.0))
10139              (article 1.0))))
10140 @end lisp
10141
10142 @xref{Window Layout}.
10143
10144
10145 @node Mail Group Commands
10146 @section Mail Group Commands
10147 @cindex mail group commands
10148
10149 Some commands only make sense in mail groups.  If these commands are
10150 invalid in the current group, they will raise a hell and let you know.
10151
10152 All these commands (except the expiry and edit commands) use the
10153 process/prefix convention (@pxref{Process/Prefix}).
10154
10155 @table @kbd
10156
10157 @item B e
10158 @kindex B e (Summary)
10159 @findex gnus-summary-expire-articles
10160 Run all expirable articles in the current group through the expiry
10161 process (@code{gnus-summary-expire-articles}).  That is, delete all
10162 expirable articles in the group that have been around for a while.
10163 (@pxref{Expiring Mail}).
10164
10165 @item B C-M-e
10166 @kindex B C-M-e (Summary)
10167 @findex gnus-summary-expire-articles-now
10168 Delete all the expirable articles in the group
10169 (@code{gnus-summary-expire-articles-now}).  This means that @strong{all}
10170 articles eligible for expiry in the current group will
10171 disappear forever into that big @file{/dev/null} in the sky.
10172
10173 @item B DEL
10174 @kindex B DEL (Summary)
10175 @findex gnus-summary-delete-article
10176 @c @icon{gnus-summary-mail-delete}
10177 Delete the mail article.  This is ``delete'' as in ``delete it from your
10178 disk forever and ever, never to return again.'' Use with caution.
10179 (@code{gnus-summary-delete-article}).
10180
10181 @item B m
10182 @kindex B m (Summary)
10183 @cindex move mail
10184 @findex gnus-summary-move-article
10185 @vindex gnus-preserve-marks
10186 Move the article from one mail group to another
10187 (@code{gnus-summary-move-article}).  Marks will be preserved if
10188 @code{gnus-preserve-marks} is non-@code{nil} (which is the default).
10189
10190 @item B c
10191 @kindex B c (Summary)
10192 @cindex copy mail
10193 @findex gnus-summary-copy-article
10194 @c @icon{gnus-summary-mail-copy}
10195 Copy the article from one group (mail group or not) to a mail group
10196 (@code{gnus-summary-copy-article}).  Marks will be preserved if
10197 @code{gnus-preserve-marks} is non-@code{nil} (which is the default).
10198
10199 @item B B
10200 @kindex B B (Summary)
10201 @cindex crosspost mail
10202 @findex gnus-summary-crosspost-article
10203 Crosspost the current article to some other group
10204 (@code{gnus-summary-crosspost-article}).  This will create a new copy of
10205 the article in the other group, and the Xref headers of the article will
10206 be properly updated.
10207
10208 @item B i
10209 @kindex B i (Summary)
10210 @findex gnus-summary-import-article
10211 Import an arbitrary file into the current mail newsgroup
10212 (@code{gnus-summary-import-article}).  You will be prompted for a file
10213 name, a @code{From} header and a @code{Subject} header.
10214
10215 @item B I
10216 @kindex B I (Summary)
10217 @findex gnus-summary-create-article
10218 Create an empty article in the current mail newsgroups
10219 (@code{gnus-summary-create-article}).  You will be prompted for a
10220 @code{From} header and a @code{Subject} header.
10221
10222 @item B r
10223 @kindex B r (Summary)
10224 @findex gnus-summary-respool-article
10225 @vindex gnus-summary-respool-default-method
10226 Respool the mail article (@code{gnus-summary-respool-article}).
10227 @code{gnus-summary-respool-default-method} will be used as the default
10228 select method when respooling.  This variable is @code{nil} by default,
10229 which means that the current group select method will be used instead.
10230 Marks will be preserved if @code{gnus-preserve-marks} is non-@code{nil}
10231 (which is the default).
10232
10233 @item B w
10234 @itemx e
10235 @kindex B w (Summary)
10236 @kindex e (Summary)
10237 @findex gnus-summary-edit-article
10238 @kindex C-c C-c (Article)
10239 @findex gnus-summary-edit-article-done
10240 Edit the current article (@code{gnus-summary-edit-article}).  To finish
10241 editing and make the changes permanent, type @kbd{C-c C-c}
10242 (@code{gnus-summary-edit-article-done}).  If you give a prefix to the
10243 @kbd{C-c C-c} command, Gnus won't re-highlight the article.
10244
10245 @item B q
10246 @kindex B q (Summary)
10247 @findex gnus-summary-respool-query
10248 If you want to re-spool an article, you might be curious as to what group
10249 the article will end up in before you do the re-spooling.  This command
10250 will tell you (@code{gnus-summary-respool-query}).
10251
10252 @item B t
10253 @kindex B t (Summary)
10254 @findex gnus-summary-respool-trace
10255 Similarly, this command will display all fancy splitting patterns used
10256 when respooling, if any (@code{gnus-summary-respool-trace}).
10257
10258 @item B p
10259 @kindex B p (Summary)
10260 @findex gnus-summary-article-posted-p
10261 Some people have a tendency to send you ``courtesy'' copies when they
10262 follow up to articles you have posted.  These usually have a
10263 @code{Newsgroups} header in them, but not always.  This command
10264 (@code{gnus-summary-article-posted-p}) will try to fetch the current
10265 article from your news server (or rather, from
10266 @code{gnus-refer-article-method} or @code{gnus-select-method}) and will
10267 report back whether it found the article or not.  Even if it says that
10268 it didn't find the article, it may have been posted anyway---mail
10269 propagation is much faster than news propagation, and the news copy may
10270 just not have arrived yet.
10271
10272 @item K E
10273 @kindex K E (Summary)
10274 @findex gnus-article-encrypt-body
10275 @vindex gnus-article-encrypt-protocol
10276 Encrypt the body of an article (@code{gnus-article-encrypt-body}).
10277 The body is encrypted with the encryption protocol specified by the
10278 variable @code{gnus-article-encrypt-protocol}.
10279
10280 @end table
10281
10282 @vindex gnus-move-split-methods
10283 @cindex moving articles
10284 If you move (or copy) articles regularly, you might wish to have Gnus
10285 suggest where to put the articles.  @code{gnus-move-split-methods} is a
10286 variable that uses the same syntax as @code{gnus-split-methods}
10287 (@pxref{Saving Articles}).  You may customize that variable to create
10288 suggestions you find reasonable.  (Note that
10289 @code{gnus-move-split-methods} uses group names where
10290 @code{gnus-split-methods} uses file names.)
10291
10292 @lisp
10293 (setq gnus-move-split-methods
10294       '(("^From:.*Lars Magne" "nnml:junk")
10295         ("^Subject:.*gnus" "nnfolder:important")
10296         (".*" "nnml:misc")))
10297 @end lisp
10298
10299
10300 @node Various Summary Stuff
10301 @section Various Summary Stuff
10302
10303 @menu
10304 * Summary Group Information::   Information oriented commands.
10305 * Searching for Articles::      Multiple article commands.
10306 * Summary Generation Commands::
10307 * Really Various Summary Commands::  Those pesky non-conformant commands.
10308 @end menu
10309
10310 @table @code
10311 @vindex gnus-summary-display-while-building
10312 @item gnus-summary-display-while-building
10313 If non-@code{nil}, show and update the summary buffer as it's being
10314 built.  If @code{t}, update the buffer after every line is inserted.
10315 If the value is an integer, @var{n}, update the display every @var{n}
10316 lines.  The default is @code{nil}.
10317
10318 @vindex gnus-summary-display-arrow
10319 @item gnus-summary-display-arrow
10320 If non-@code{nil}, display an arrow in the fringe to indicate the
10321 current article.
10322
10323 @vindex gnus-summary-mode-hook
10324 @item gnus-summary-mode-hook
10325 This hook is called when creating a summary mode buffer.
10326
10327 @vindex gnus-summary-generate-hook
10328 @item gnus-summary-generate-hook
10329 This is called as the last thing before doing the threading and the
10330 generation of the summary buffer.  It's quite convenient for customizing
10331 the threading variables based on what data the newsgroup has.  This hook
10332 is called from the summary buffer after most summary buffer variables
10333 have been set.
10334
10335 @vindex gnus-summary-prepare-hook
10336 @item gnus-summary-prepare-hook
10337 It is called after the summary buffer has been generated.  You might use
10338 it to, for instance, highlight lines or modify the look of the buffer in
10339 some other ungodly manner.  I don't care.
10340
10341 @vindex gnus-summary-prepared-hook
10342 @item gnus-summary-prepared-hook
10343 A hook called as the very last thing after the summary buffer has been
10344 generated.
10345
10346 @vindex gnus-summary-ignore-duplicates
10347 @item gnus-summary-ignore-duplicates
10348 When Gnus discovers two articles that have the same @code{Message-ID},
10349 it has to do something drastic.  No articles are allowed to have the
10350 same @code{Message-ID}, but this may happen when reading mail from some
10351 sources.  Gnus allows you to customize what happens with this variable.
10352 If it is @code{nil} (which is the default), Gnus will rename the
10353 @code{Message-ID} (for display purposes only) and display the article as
10354 any other article.  If this variable is @code{t}, it won't display the
10355 article---it'll be as if it never existed.
10356
10357 @vindex gnus-alter-articles-to-read-function
10358 @item gnus-alter-articles-to-read-function
10359 This function, which takes two parameters (the group name and the list
10360 of articles to be selected), is called to allow the user to alter the
10361 list of articles to be selected.
10362
10363 For instance, the following function adds the list of cached articles to
10364 the list in one particular group:
10365
10366 @lisp
10367 (defun my-add-cached-articles (group articles)
10368   (if (string= group "some.group")
10369       (append gnus-newsgroup-cached articles)
10370     articles))
10371 @end lisp
10372
10373 @vindex gnus-newsgroup-variables
10374 @item gnus-newsgroup-variables
10375 A list of newsgroup (summary buffer) local variables, or cons of
10376 variables and their default expressions to be evalled (when the default
10377 values are not @code{nil}), that should be made global while the summary
10378 buffer is active.
10379
10380 Note: The default expressions will be evaluated (using function
10381 @code{eval}) before assignment to the local variable rather than just
10382 assigned to it.  If the default expression is the symbol @code{global},
10383 that symbol will not be evaluated but the global value of the local
10384 variable will be used instead.
10385
10386 These variables can be used to set variables in the group parameters
10387 while still allowing them to affect operations done in other
10388 buffers.  For example:
10389
10390 @lisp
10391 (setq gnus-newsgroup-variables
10392       '(message-use-followup-to
10393         (gnus-visible-headers .
10394  "^From:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^To:")))
10395 @end lisp
10396
10397 Also @pxref{Group Parameters}.
10398 @end table
10399
10400
10401 @node Summary Group Information
10402 @subsection Summary Group Information
10403
10404 @table @kbd
10405
10406 @item H f
10407 @kindex H f (Summary)
10408 @findex gnus-summary-fetch-faq
10409 @vindex gnus-group-faq-directory
10410 Try to fetch the @acronym{FAQ} (list of frequently asked questions)
10411 for the current group (@code{gnus-summary-fetch-faq}).  Gnus will try
10412 to get the @acronym{FAQ} from @code{gnus-group-faq-directory}, which
10413 is usually a directory on a remote machine.  This variable can also be
10414 a list of directories.  In that case, giving a prefix to this command
10415 will allow you to choose between the various sites.  @code{ange-ftp}
10416 or @code{efs} will probably be used for fetching the file.
10417
10418 @item H d
10419 @kindex H d (Summary)
10420 @findex gnus-summary-describe-group
10421 Give a brief description of the current group
10422 (@code{gnus-summary-describe-group}).  If given a prefix, force
10423 rereading the description from the server.
10424
10425 @item H h
10426 @kindex H h (Summary)
10427 @findex gnus-summary-describe-briefly
10428 Give an extremely brief description of the most important summary
10429 keystrokes (@code{gnus-summary-describe-briefly}).
10430
10431 @item H i
10432 @kindex H i (Summary)
10433 @findex gnus-info-find-node
10434 Go to the Gnus info node (@code{gnus-info-find-node}).
10435 @end table
10436
10437
10438 @node Searching for Articles
10439 @subsection Searching for Articles
10440
10441 @table @kbd
10442
10443 @item M-s
10444 @kindex M-s (Summary)
10445 @findex gnus-summary-search-article-forward
10446 Search through all subsequent (raw) articles for a regexp
10447 (@code{gnus-summary-search-article-forward}).
10448
10449 @item M-r
10450 @kindex M-r (Summary)
10451 @findex gnus-summary-search-article-backward
10452 Search through all previous (raw) articles for a regexp
10453 (@code{gnus-summary-search-article-backward}).
10454
10455 @item M-S
10456 @kindex M-S (Summary)
10457 @findex gnus-summary-repeat-search-article-forward
10458 Repeat the previous search forwards
10459 (@code{gnus-summary-repeat-search-article-forward}).
10460
10461 @item M-R
10462 @kindex M-R (Summary)
10463 @findex gnus-summary-repeat-search-article-backward
10464 Repeat the previous search backwards
10465 (@code{gnus-summary-repeat-search-article-backward}).
10466
10467 @item &
10468 @kindex & (Summary)
10469 @findex gnus-summary-execute-command
10470 This command will prompt you for a header, a regular expression to match
10471 on this field, and a command to be executed if the match is made
10472 (@code{gnus-summary-execute-command}).  If the header is an empty
10473 string, the match is done on the entire article.  If given a prefix,
10474 search backward instead.
10475
10476 For instance, @kbd{& RET some.*string RET #} will put the process mark on
10477 all articles that have heads or bodies that match @samp{some.*string}.
10478
10479 @item M-&
10480 @kindex M-& (Summary)
10481 @findex gnus-summary-universal-argument
10482 Perform any operation on all articles that have been marked with
10483 the process mark (@code{gnus-summary-universal-argument}).
10484 @end table
10485
10486 @node Summary Generation Commands
10487 @subsection Summary Generation Commands
10488
10489 @table @kbd
10490
10491 @item Y g
10492 @kindex Y g (Summary)
10493 @findex gnus-summary-prepare
10494 Regenerate the current summary buffer (@code{gnus-summary-prepare}).
10495
10496 @item Y c
10497 @kindex Y c (Summary)
10498 @findex gnus-summary-insert-cached-articles
10499 Pull all cached articles (for the current group) into the summary buffer
10500 (@code{gnus-summary-insert-cached-articles}).
10501
10502 @item Y d
10503 @kindex Y d (Summary)
10504 @findex gnus-summary-insert-dormant-articles
10505 Pull all dormant articles (for the current group) into the summary buffer
10506 (@code{gnus-summary-insert-dormant-articles}).
10507
10508 @end table
10509
10510
10511 @node Really Various Summary Commands
10512 @subsection Really Various Summary Commands
10513
10514 @table @kbd
10515
10516 @item A D
10517 @itemx C-d
10518 @kindex C-d (Summary)
10519 @kindex A D (Summary)
10520 @findex gnus-summary-enter-digest-group
10521 If the current article is a collection of other articles (for instance,
10522 a digest), you might use this command to enter a group based on the that
10523 article (@code{gnus-summary-enter-digest-group}).  Gnus will try to
10524 guess what article type is currently displayed unless you give a prefix
10525 to this command, which forces a ``digest'' interpretation.  Basically,
10526 whenever you see a message that is a collection of other messages of
10527 some format, you @kbd{C-d} and read these messages in a more convenient
10528 fashion.
10529
10530 @item C-M-d
10531 @kindex C-M-d (Summary)
10532 @findex gnus-summary-read-document
10533 This command is very similar to the one above, but lets you gather
10534 several documents into one biiig group
10535 (@code{gnus-summary-read-document}).  It does this by opening several
10536 @code{nndoc} groups for each document, and then opening an
10537 @code{nnvirtual} group on top of these @code{nndoc} groups.  This
10538 command understands the process/prefix convention
10539 (@pxref{Process/Prefix}).
10540
10541 @item C-t
10542 @kindex C-t (Summary)
10543 @findex gnus-summary-toggle-truncation
10544 Toggle truncation of summary lines
10545 (@code{gnus-summary-toggle-truncation}).  This will probably confuse the
10546 line centering function in the summary buffer, so it's not a good idea
10547 to have truncation switched off while reading articles.
10548
10549 @item =
10550 @kindex = (Summary)
10551 @findex gnus-summary-expand-window
10552 Expand the summary buffer window (@code{gnus-summary-expand-window}).
10553 If given a prefix, force an @code{article} window configuration.
10554
10555 @item C-M-e
10556 @kindex C-M-e (Summary)
10557 @findex gnus-summary-edit-parameters
10558 Edit the group parameters (@pxref{Group Parameters}) of the current
10559 group (@code{gnus-summary-edit-parameters}).
10560
10561 @item C-M-a
10562 @kindex C-M-a (Summary)
10563 @findex gnus-summary-customize-parameters
10564 Customize the group parameters (@pxref{Group Parameters}) of the current
10565 group (@code{gnus-summary-customize-parameters}).
10566
10567 @end table
10568
10569
10570 @node Exiting the Summary Buffer
10571 @section Exiting the Summary Buffer
10572 @cindex summary exit
10573 @cindex exiting groups
10574
10575 Exiting from the summary buffer will normally update all info on the
10576 group and return you to the group buffer.
10577
10578 @table @kbd
10579
10580 @item Z Z
10581 @itemx Z Q
10582 @itemx q
10583 @kindex Z Z (Summary)
10584 @kindex Z Q (Summary)
10585 @kindex q (Summary)
10586 @findex gnus-summary-exit
10587 @vindex gnus-summary-exit-hook
10588 @vindex gnus-summary-prepare-exit-hook
10589 @vindex gnus-group-no-more-groups-hook
10590 @c @icon{gnus-summary-exit}
10591 Exit the current group and update all information on the group
10592 (@code{gnus-summary-exit}).  @code{gnus-summary-prepare-exit-hook} is
10593 called before doing much of the exiting, which calls
10594 @code{gnus-summary-expire-articles} by default.
10595 @code{gnus-summary-exit-hook} is called after finishing the exit
10596 process.  @code{gnus-group-no-more-groups-hook} is run when returning to
10597 group mode having no more (unread) groups.
10598
10599 @item Z E
10600 @itemx Q
10601 @kindex Z E (Summary)
10602 @kindex Q (Summary)
10603 @findex gnus-summary-exit-no-update
10604 Exit the current group without updating any information on the group
10605 (@code{gnus-summary-exit-no-update}).
10606
10607 @item Z c
10608 @itemx c
10609 @kindex Z c (Summary)
10610 @kindex c (Summary)
10611 @findex gnus-summary-catchup-and-exit
10612 @c @icon{gnus-summary-catchup-and-exit}
10613 Mark all unticked articles in the group as read and then exit
10614 (@code{gnus-summary-catchup-and-exit}).
10615
10616 @item Z C
10617 @kindex Z C (Summary)
10618 @findex gnus-summary-catchup-all-and-exit
10619 Mark all articles, even the ticked ones, as read and then exit
10620 (@code{gnus-summary-catchup-all-and-exit}).
10621
10622 @item Z n
10623 @kindex Z n (Summary)
10624 @findex gnus-summary-catchup-and-goto-next-group
10625 Mark all articles as read and go to the next group
10626 (@code{gnus-summary-catchup-and-goto-next-group}).
10627
10628 @item Z p
10629 @kindex Z p (Summary)
10630 @findex gnus-summary-catchup-and-goto-prev-group
10631 Mark all articles as read and go to the previous group
10632 (@code{gnus-summary-catchup-and-goto-prev-group}).
10633
10634 @item Z R
10635 @itemx C-x C-s
10636 @kindex Z R (Summary)
10637 @kindex C-x C-s (Summary)
10638 @findex gnus-summary-reselect-current-group
10639 Exit this group, and then enter it again
10640 (@code{gnus-summary-reselect-current-group}).  If given a prefix, select
10641 all articles, both read and unread.
10642
10643 @item Z G
10644 @itemx M-g
10645 @kindex Z G (Summary)
10646 @kindex M-g (Summary)
10647 @findex gnus-summary-rescan-group
10648 @c @icon{gnus-summary-mail-get}
10649 Exit the group, check for new articles in the group, and select the
10650 group (@code{gnus-summary-rescan-group}).  If given a prefix, select all
10651 articles, both read and unread.
10652
10653 @item Z N
10654 @kindex Z N (Summary)
10655 @findex gnus-summary-next-group
10656 Exit the group and go to the next group
10657 (@code{gnus-summary-next-group}).
10658
10659 @item Z P
10660 @kindex Z P (Summary)
10661 @findex gnus-summary-prev-group
10662 Exit the group and go to the previous group
10663 (@code{gnus-summary-prev-group}).
10664
10665 @item Z s
10666 @kindex Z s (Summary)
10667 @findex gnus-summary-save-newsrc
10668 Save the current number of read/marked articles in the dribble buffer
10669 and then save the dribble buffer (@code{gnus-summary-save-newsrc}).  If
10670 given a prefix, also save the @file{.newsrc} file(s).  Using this
10671 command will make exit without updating (the @kbd{Q} command) worthless.
10672 @end table
10673
10674 @vindex gnus-exit-group-hook
10675 @code{gnus-exit-group-hook} is called when you exit the current group
10676 with an ``updating'' exit.  For instance @kbd{Q}
10677 (@code{gnus-summary-exit-no-update}) does not call this hook.
10678
10679 @findex gnus-summary-wake-up-the-dead
10680 @findex gnus-dead-summary-mode
10681 @vindex gnus-kill-summary-on-exit
10682 If you're in the habit of exiting groups, and then changing your mind
10683 about it, you might set @code{gnus-kill-summary-on-exit} to @code{nil}.
10684 If you do that, Gnus won't kill the summary buffer when you exit it.
10685 (Quelle surprise!)  Instead it will change the name of the buffer to
10686 something like @samp{*Dead Summary ... *} and install a minor mode
10687 called @code{gnus-dead-summary-mode}.  Now, if you switch back to this
10688 buffer, you'll find that all keys are mapped to a function called
10689 @code{gnus-summary-wake-up-the-dead}.  So tapping any keys in a dead
10690 summary buffer will result in a live, normal summary buffer.
10691
10692 There will never be more than one dead summary buffer at any one time.
10693
10694 @vindex gnus-use-cross-reference
10695 The data on the current group will be updated (which articles you have
10696 read, which articles you have replied to, etc.) when you exit the
10697 summary buffer.  If the @code{gnus-use-cross-reference} variable is
10698 @code{t} (which is the default), articles that are cross-referenced to
10699 this group and are marked as read, will also be marked as read in the
10700 other subscribed groups they were cross-posted to.  If this variable is
10701 neither @code{nil} nor @code{t}, the article will be marked as read in
10702 both subscribed and unsubscribed groups (@pxref{Crosspost Handling}).
10703
10704
10705 @node Crosspost Handling
10706 @section Crosspost Handling
10707
10708 @cindex velveeta
10709 @cindex spamming
10710 Marking cross-posted articles as read ensures that you'll never have to
10711 read the same article more than once.  Unless, of course, somebody has
10712 posted it to several groups separately.  Posting the same article to
10713 several groups (not cross-posting) is called @dfn{spamming}, and you are
10714 by law required to send nasty-grams to anyone who perpetrates such a
10715 heinous crime.  You may want to try NoCeM handling to filter out spam
10716 (@pxref{NoCeM}).
10717
10718 Remember: Cross-posting is kinda ok, but posting the same article
10719 separately to several groups is not.  Massive cross-posting (aka.
10720 @dfn{velveeta}) is to be avoided at all costs, and you can even use the
10721 @code{gnus-summary-mail-crosspost-complaint} command to complain about
10722 excessive crossposting (@pxref{Summary Mail Commands}).
10723
10724 @cindex cross-posting
10725 @cindex Xref
10726 @cindex @acronym{NOV}
10727 One thing that may cause Gnus to not do the cross-posting thing
10728 correctly is if you use an @acronym{NNTP} server that supports @sc{xover}
10729 (which is very nice, because it speeds things up considerably) which
10730 does not include the @code{Xref} header in its @acronym{NOV} lines.  This is
10731 Evil, but all too common, alas, alack.  Gnus tries to Do The Right Thing
10732 even with @sc{xover} by registering the @code{Xref} lines of all
10733 articles you actually read, but if you kill the articles, or just mark
10734 them as read without reading them, Gnus will not get a chance to snoop
10735 the @code{Xref} lines out of these articles, and will be unable to use
10736 the cross reference mechanism.
10737
10738 @cindex LIST overview.fmt
10739 @cindex overview.fmt
10740 To check whether your @acronym{NNTP} server includes the @code{Xref} header
10741 in its overview files, try @samp{telnet your.nntp.server nntp},
10742 @samp{MODE READER} on @code{inn} servers, and then say @samp{LIST
10743 overview.fmt}.  This may not work, but if it does, and the last line you
10744 get does not read @samp{Xref:full}, then you should shout and whine at
10745 your news admin until she includes the @code{Xref} header in the
10746 overview files.
10747
10748 @vindex gnus-nov-is-evil
10749 If you want Gnus to get the @code{Xref}s right all the time, you have to
10750 set @code{gnus-nov-is-evil} to @code{t}, which slows things down
10751 considerably.
10752
10753 C'est la vie.
10754
10755 For an alternative approach, @pxref{Duplicate Suppression}.
10756
10757
10758 @node Duplicate Suppression
10759 @section Duplicate Suppression
10760
10761 By default, Gnus tries to make sure that you don't have to read the same
10762 article more than once by utilizing the crossposting mechanism
10763 (@pxref{Crosspost Handling}).  However, that simple and efficient
10764 approach may not work satisfactory for some users for various
10765 reasons.
10766
10767 @enumerate
10768 @item
10769 The @acronym{NNTP} server may fail to generate the @code{Xref} header.  This
10770 is evil and not very common.
10771
10772 @item
10773 The @acronym{NNTP} server may fail to include the @code{Xref} header in the
10774 @file{.overview} data bases.  This is evil and all too common, alas.
10775
10776 @item
10777 You may be reading the same group (or several related groups) from
10778 different @acronym{NNTP} servers.
10779
10780 @item
10781 You may be getting mail that duplicates articles posted to groups.
10782 @end enumerate
10783
10784 I'm sure there are other situations where @code{Xref} handling fails as
10785 well, but these four are the most common situations.
10786
10787 If, and only if, @code{Xref} handling fails for you, then you may
10788 consider switching on @dfn{duplicate suppression}.  If you do so, Gnus
10789 will remember the @code{Message-ID}s of all articles you have read or
10790 otherwise marked as read, and then, as if by magic, mark them as read
10791 all subsequent times you see them---in @emph{all} groups.  Using this
10792 mechanism is quite likely to be somewhat inefficient, but not overly
10793 so.  It's certainly preferable to reading the same articles more than
10794 once.
10795
10796 Duplicate suppression is not a very subtle instrument.  It's more like a
10797 sledge hammer than anything else.  It works in a very simple
10798 fashion---if you have marked an article as read, it adds this Message-ID
10799 to a cache.  The next time it sees this Message-ID, it will mark the
10800 article as read with the @samp{M} mark.  It doesn't care what group it
10801 saw the article in.
10802
10803 @table @code
10804 @item gnus-suppress-duplicates
10805 @vindex gnus-suppress-duplicates
10806 If non-@code{nil}, suppress duplicates.
10807
10808 @item gnus-save-duplicate-list
10809 @vindex gnus-save-duplicate-list
10810 If non-@code{nil}, save the list of duplicates to a file.  This will
10811 make startup and shutdown take longer, so the default is @code{nil}.
10812 However, this means that only duplicate articles read in a single Gnus
10813 session are suppressed.
10814
10815 @item gnus-duplicate-list-length
10816 @vindex gnus-duplicate-list-length
10817 This variable says how many @code{Message-ID}s to keep in the duplicate
10818 suppression list.  The default is 10000.
10819
10820 @item gnus-duplicate-file
10821 @vindex gnus-duplicate-file
10822 The name of the file to store the duplicate suppression list in.  The
10823 default is @file{~/News/suppression}.
10824 @end table
10825
10826 If you have a tendency to stop and start Gnus often, setting
10827 @code{gnus-save-duplicate-list} to @code{t} is probably a good idea.  If
10828 you leave Gnus running for weeks on end, you may have it @code{nil}.  On
10829 the other hand, saving the list makes startup and shutdown much slower,
10830 so that means that if you stop and start Gnus often, you should set
10831 @code{gnus-save-duplicate-list} to @code{nil}.  Uhm.  I'll leave this up
10832 to you to figure out, I think.
10833
10834 @node Security
10835 @section Security
10836
10837 Gnus is able to verify signed messages or decrypt encrypted messages.
10838 The formats that are supported are @acronym{PGP}, @acronym{PGP/MIME}
10839 and @acronym{S/MIME}, however you need some external programs to get
10840 things to work:
10841
10842 @enumerate
10843 @item
10844 To handle @acronym{PGP} and @acronym{PGP/MIME} messages, you have to
10845 install an OpenPGP implementation such as GnuPG.  The Lisp interface
10846 to GnuPG included with Gnus is called PGG (@pxref{Top, ,PGG, pgg, PGG
10847 Manual}), but Mailcrypt and gpg.el are also supported.
10848
10849 @item
10850 To handle @acronym{S/MIME} message, you need to install OpenSSL.  OpenSSL 0.9.6
10851 or newer is recommended.
10852
10853 @end enumerate
10854
10855 The variables that control security functionality on reading messages
10856 include:
10857
10858 @table @code
10859 @item mm-verify-option
10860 @vindex mm-verify-option
10861 Option of verifying signed parts.  @code{never}, not verify;
10862 @code{always}, always verify; @code{known}, only verify known
10863 protocols.  Otherwise, ask user.
10864
10865 @item mm-decrypt-option
10866 @vindex mm-decrypt-option
10867 Option of decrypting encrypted parts.  @code{never}, no decryption;
10868 @code{always}, always decrypt; @code{known}, only decrypt known
10869 protocols.  Otherwise, ask user.
10870
10871 @item mml1991-use
10872 @vindex mml1991-use
10873 Symbol indicating elisp interface to OpenPGP implementation for
10874 @acronym{PGP} messages.  The default is @code{pgg}, but
10875 @code{mailcrypt} and @code{gpg} are also supported although
10876 deprecated.
10877
10878 @item mml2015-use
10879 @vindex mml2015-use
10880 Symbol indicating elisp interface to OpenPGP implementation for
10881 @acronym{PGP/MIME} messages.  The default is @code{pgg}, but
10882 @code{mailcrypt} and @code{gpg} are also supported although
10883 deprecated.
10884
10885 @end table
10886
10887 By default the buttons that display security information are not
10888 shown, because they clutter reading the actual e-mail.  You can type
10889 @kbd{K b} manually to display the information.  Use the
10890 @code{gnus-buttonized-mime-types} and
10891 @code{gnus-unbuttonized-mime-types} variables to control this
10892 permanently.  @ref{MIME Commands} for further details, and hints on
10893 how to customize these variables to always display security
10894 information.
10895
10896 @cindex snarfing keys
10897 @cindex importing PGP keys
10898 @cindex PGP key ring import
10899 Snarfing OpenPGP keys (i.e., importing keys from articles into your
10900 key ring) is not supported explicitly through a menu item or command,
10901 rather Gnus do detect and label keys as @samp{application/pgp-keys},
10902 allowing you to specify whatever action you think is appropriate
10903 through the usual @acronym{MIME} infrastructure.  You can use a
10904 @file{~/.mailcap} entry (@pxref{mailcap, , mailcap, emacs-mime, The
10905 Emacs MIME Manual}) such as the following to import keys using GNU
10906 Privacy Guard when you click on the @acronym{MIME} button
10907 (@pxref{Using MIME}).
10908
10909 @example
10910 application/pgp-keys; gpg --import --interactive --verbose; needsterminal
10911 @end example
10912 @noindent
10913 This happens to also be the default action defined in
10914 @code{mailcap-mime-data}.
10915
10916 More information on how to set things for sending outgoing signed and
10917 encrypted messages up can be found in the message manual
10918 (@pxref{Security, ,Security, message, Message Manual}).
10919
10920 @node Mailing List
10921 @section Mailing List
10922 @cindex mailing list
10923 @cindex RFC 2396
10924
10925 @kindex A M (summary)
10926 @findex gnus-mailing-list-insinuate
10927 Gnus understands some mailing list fields of RFC 2369.  To enable it,
10928 add a @code{to-list} group parameter (@pxref{Group Parameters}),
10929 possibly using @kbd{A M} (@code{gnus-mailing-list-insinuate}) in the
10930 summary buffer.
10931
10932 That enables the following commands to the summary buffer:
10933
10934 @table @kbd
10935
10936 @item C-c C-n h
10937 @kindex C-c C-n h (Summary)
10938 @findex gnus-mailing-list-help
10939 Send a message to fetch mailing list help, if List-Help field exists.
10940
10941 @item C-c C-n s
10942 @kindex C-c C-n s (Summary)
10943 @findex gnus-mailing-list-subscribe
10944 Send a message to subscribe the mailing list, if List-Subscribe field exists.
10945
10946 @item C-c C-n u
10947 @kindex C-c C-n u (Summary)
10948 @findex gnus-mailing-list-unsubscribe
10949 Send a message to unsubscribe the mailing list, if List-Unsubscribe
10950 field exists.
10951
10952 @item C-c C-n p
10953 @kindex C-c C-n p (Summary)
10954 @findex gnus-mailing-list-post
10955 Post to the mailing list, if List-Post field exists.
10956
10957 @item C-c C-n o
10958 @kindex C-c C-n o (Summary)
10959 @findex gnus-mailing-list-owner
10960 Send a message to the mailing list owner, if List-Owner field exists.
10961
10962 @item C-c C-n a
10963 @kindex C-c C-n a (Summary)
10964 @findex gnus-mailing-list-archive
10965 Browse the mailing list archive, if List-Archive field exists.
10966
10967 @end table
10968
10969
10970 @node Article Buffer
10971 @chapter Article Buffer
10972 @cindex article buffer
10973
10974 The articles are displayed in the article buffer, of which there is only
10975 one.  All the summary buffers share the same article buffer unless you
10976 tell Gnus otherwise.
10977
10978 @menu
10979 * Hiding Headers::              Deciding what headers should be displayed.
10980 * Using MIME::                  Pushing articles through @acronym{MIME} before reading them.
10981 * Customizing Articles::        Tailoring the look of the articles.
10982 * Article Keymap::              Keystrokes available in the article buffer.
10983 * Misc Article::                Other stuff.
10984 @end menu
10985
10986
10987 @node Hiding Headers
10988 @section Hiding Headers
10989 @cindex hiding headers
10990 @cindex deleting headers
10991
10992 The top section of each article is the @dfn{head}.  (The rest is the
10993 @dfn{body}, but you may have guessed that already.)
10994
10995 @vindex gnus-show-all-headers
10996 There is a lot of useful information in the head: the name of the person
10997 who wrote the article, the date it was written and the subject of the
10998 article.  That's well and nice, but there's also lots of information
10999 most people do not want to see---what systems the article has passed
11000 through before reaching you, the @code{Message-ID}, the
11001 @code{References}, etc. ad nauseam---and you'll probably want to get rid
11002 of some of those lines.  If you want to keep all those lines in the
11003 article buffer, you can set @code{gnus-show-all-headers} to @code{t}.
11004
11005 Gnus provides you with two variables for sifting headers:
11006
11007 @table @code
11008
11009 @item gnus-visible-headers
11010 @vindex gnus-visible-headers
11011 If this variable is non-@code{nil}, it should be a regular expression
11012 that says what headers you wish to keep in the article buffer.  All
11013 headers that do not match this variable will be hidden.
11014
11015 For instance, if you only want to see the name of the person who wrote
11016 the article and the subject, you'd say:
11017
11018 @lisp
11019 (setq gnus-visible-headers "^From:\\|^Subject:")
11020 @end lisp
11021
11022 This variable can also be a list of regexps to match headers to
11023 remain visible.
11024
11025 @item gnus-ignored-headers
11026 @vindex gnus-ignored-headers
11027 This variable is the reverse of @code{gnus-visible-headers}.  If this
11028 variable is set (and @code{gnus-visible-headers} is @code{nil}), it
11029 should be a regular expression that matches all lines that you want to
11030 hide.  All lines that do not match this variable will remain visible.
11031
11032 For instance, if you just want to get rid of the @code{References} line
11033 and the @code{Xref} line, you might say:
11034
11035 @lisp
11036 (setq gnus-ignored-headers "^References:\\|^Xref:")
11037 @end lisp
11038
11039 This variable can also be a list of regexps to match headers to
11040 be removed.
11041
11042 Note that if @code{gnus-visible-headers} is non-@code{nil}, this
11043 variable will have no effect.
11044
11045 @end table
11046
11047 @vindex gnus-sorted-header-list
11048 Gnus can also sort the headers for you.  (It does this by default.)  You
11049 can control the sorting by setting the @code{gnus-sorted-header-list}
11050 variable.  It is a list of regular expressions that says in what order
11051 the headers are to be displayed.
11052
11053 For instance, if you want the name of the author of the article first,
11054 and then the subject, you might say something like:
11055
11056 @lisp
11057 (setq gnus-sorted-header-list '("^From:" "^Subject:"))
11058 @end lisp
11059
11060 Any headers that are to remain visible, but are not listed in this
11061 variable, will be displayed in random order after all the headers listed in this variable.
11062
11063 @findex gnus-article-hide-boring-headers
11064 @vindex gnus-boring-article-headers
11065 You can hide further boring headers by setting
11066 @code{gnus-treat-hide-boring-headers} to @code{head}.  What this function
11067 does depends on the @code{gnus-boring-article-headers} variable.  It's a
11068 list, but this list doesn't actually contain header names.  Instead it
11069 lists various @dfn{boring conditions} that Gnus can check and remove
11070 from sight.
11071
11072 These conditions are:
11073 @table @code
11074 @item empty
11075 Remove all empty headers.
11076 @item followup-to
11077 Remove the @code{Followup-To} header if it is identical to the
11078 @code{Newsgroups} header.
11079 @item reply-to
11080 Remove the @code{Reply-To} header if it lists the same addresses as
11081 the @code{From} header, or if the @code{broken-reply-to} group
11082 parameter is set.
11083 @item newsgroups
11084 Remove the @code{Newsgroups} header if it only contains the current group
11085 name.
11086 @item to-address
11087 Remove the @code{To} header if it only contains the address identical to
11088 the current group's @code{to-address} parameter.
11089 @item to-list
11090 Remove the @code{To} header if it only contains the address identical to
11091 the current group's @code{to-list} parameter.
11092 @item cc-list
11093 Remove the @code{CC} header if it only contains the address identical to
11094 the current group's @code{to-list} parameter.
11095 @item date
11096 Remove the @code{Date} header if the article is less than three days
11097 old.
11098 @item long-to
11099 Remove the @code{To} header if it is very long.
11100 @item many-to
11101 Remove all @code{To} headers if there are more than one.
11102 @end table
11103
11104 To include these three elements, you could say something like:
11105
11106 @lisp
11107 (setq gnus-boring-article-headers
11108       '(empty followup-to reply-to))
11109 @end lisp
11110
11111 This is also the default value for this variable.
11112
11113
11114 @node Using MIME
11115 @section Using MIME
11116 @cindex @acronym{MIME}
11117
11118 Mime is a standard for waving your hands through the air, aimlessly,
11119 while people stand around yawning.
11120
11121 @acronym{MIME}, however, is a standard for encoding your articles, aimlessly,
11122 while all newsreaders die of fear.
11123
11124 @acronym{MIME} may specify what character set the article uses, the encoding
11125 of the characters, and it also makes it possible to embed pictures and
11126 other naughty stuff in innocent-looking articles.
11127
11128 @vindex gnus-display-mime-function
11129 @findex gnus-display-mime
11130 Gnus pushes @acronym{MIME} articles through @code{gnus-display-mime-function}
11131 to display the @acronym{MIME} parts.  This is @code{gnus-display-mime} by
11132 default, which creates a bundle of clickable buttons that can be used to
11133 display, save and manipulate the @acronym{MIME} objects.
11134
11135 The following commands are available when you have placed point over a
11136 @acronym{MIME} button:
11137
11138 @table @kbd
11139 @findex gnus-article-press-button
11140 @item RET (Article)
11141 @kindex RET (Article)
11142 @itemx BUTTON-2 (Article)
11143 Toggle displaying of the @acronym{MIME} object
11144 (@code{gnus-article-press-button}).  If built-in viewers can not display
11145 the object, Gnus resorts to external viewers in the @file{mailcap}
11146 files.  If a viewer has the @samp{copiousoutput} specification, the
11147 object is displayed inline.
11148
11149 @findex gnus-mime-view-part
11150 @item M-RET (Article)
11151 @kindex M-RET (Article)
11152 @itemx v (Article)
11153 Prompt for a method, and then view the @acronym{MIME} object using this
11154 method (@code{gnus-mime-view-part}).
11155
11156 @findex gnus-mime-view-part-as-type
11157 @item t (Article)
11158 @kindex t (Article)
11159 View the @acronym{MIME} object as if it were a different @acronym{MIME} media type
11160 (@code{gnus-mime-view-part-as-type}).
11161
11162 @findex gnus-mime-view-part-as-charset
11163 @item C (Article)
11164 @kindex C (Article)
11165 Prompt for a charset, and then view the @acronym{MIME} object using this
11166 charset (@code{gnus-mime-view-part-as-charset}).
11167
11168 @findex gnus-mime-save-part
11169 @item o (Article)
11170 @kindex o (Article)
11171 Prompt for a file name, and then save the @acronym{MIME} object
11172 (@code{gnus-mime-save-part}).
11173
11174 @findex gnus-mime-save-part-and-strip
11175 @item C-o (Article)
11176 @kindex C-o (Article)
11177 Prompt for a file name, then save the @acronym{MIME} object and strip it from
11178 the article.  Then proceed to article editing, where a reasonable
11179 suggestion is being made on how the altered article should look
11180 like.  The stripped @acronym{MIME} object will be referred via the
11181 message/external-body @acronym{MIME} type.
11182 (@code{gnus-mime-save-part-and-strip}).
11183
11184 @findex gnus-mime-replace-part
11185 @item r (Article)
11186 @kindex r (Article)
11187 Prompt for a file name, replace the @acronym{MIME} object with an
11188 external body refering to the file via the message/external-body
11189 @acronym{MIME} type.  (@code{gnus-mime-replace-part}).
11190
11191 @findex gnus-mime-delete-part
11192 @item d (Article)
11193 @kindex d (Article)
11194 Delete the @acronym{MIME} object from the article and replace it with some
11195 information about the removed @acronym{MIME} object
11196 (@code{gnus-mime-delete-part}).
11197
11198 @c FIXME: gnus-auto-select-part should be documented here
11199
11200 @findex gnus-mime-copy-part
11201 @item c (Article)
11202 @kindex c (Article)
11203 Copy the @acronym{MIME} object to a fresh buffer and display this buffer
11204 (@code{gnus-mime-copy-part}).  If given a prefix, copy the raw contents
11205 without decoding.  If given a numerical prefix, you can do semi-manual
11206 charset stuff (see @code{gnus-summary-show-article-charset-alist} in
11207 @ref{Paging the Article}).  Compressed files like @file{.gz} and
11208 @file{.bz2} are automatically decompressed if
11209 @code{auto-compression-mode} is enabled (@pxref{Compressed Files,,
11210 Accessing Compressed Files, emacs, The Emacs Editor}).
11211
11212 @findex gnus-mime-print-part
11213 @item p (Article)
11214 @kindex p (Article)
11215 Print the @acronym{MIME} object (@code{gnus-mime-print-part}).  This
11216 command respects the @samp{print=} specifications in the
11217 @file{.mailcap} file.
11218
11219 @findex gnus-mime-inline-part
11220 @item i (Article)
11221 @kindex i (Article)
11222 Insert the contents of the @acronym{MIME} object into the buffer
11223 (@code{gnus-mime-inline-part}) as text/plain.  If given a prefix, insert
11224 the raw contents without decoding.  If given a numerical prefix, you can
11225 do semi-manual charset stuff (see
11226 @code{gnus-summary-show-article-charset-alist} in @ref{Paging the
11227 Article}).  Compressed files like @file{.gz} and @file{.bz2} are
11228 automatically decompressed depending on @code{jka-compr} regardless of
11229 @code{auto-compression-mode} (@pxref{Compressed Files,, Accessing
11230 Compressed Files, emacs, The Emacs Editor}).
11231
11232 @findex gnus-mime-view-part-internally
11233 @item E (Article)
11234 @kindex E (Article)
11235 View the @acronym{MIME} object with an internal viewer.  If no internal
11236 viewer is available, use an external viewer
11237 (@code{gnus-mime-view-part-internally}).
11238
11239 @findex gnus-mime-view-part-externally
11240 @item e (Article)
11241 @kindex e (Article)
11242 View the @acronym{MIME} object with an external viewer.
11243 (@code{gnus-mime-view-part-externally}).
11244
11245 @findex gnus-mime-pipe-part
11246 @item | (Article)
11247 @kindex | (Article)
11248 Output the @acronym{MIME} object to a process (@code{gnus-mime-pipe-part}).
11249
11250 @findex gnus-mime-action-on-part
11251 @item . (Article)
11252 @kindex . (Article)
11253 Interactively run an action on the @acronym{MIME} object
11254 (@code{gnus-mime-action-on-part}).
11255
11256 @end table
11257
11258 Gnus will display some @acronym{MIME} objects automatically.  The way Gnus
11259 determines which parts to do this with is described in the Emacs
11260 @acronym{MIME} manual.
11261
11262 It might be best to just use the toggling functions from the article
11263 buffer to avoid getting nasty surprises.  (For instance, you enter the
11264 group @samp{alt.sing-a-long} and, before you know it, @acronym{MIME} has
11265 decoded the sound file in the article and some horrible sing-a-long song
11266 comes screaming out your speakers, and you can't find the volume button,
11267 because there isn't one, and people are starting to look at you, and you
11268 try to stop the program, but you can't, and you can't find the program
11269 to control the volume, and everybody else in the room suddenly decides
11270 to look at you disdainfully, and you'll feel rather stupid.)
11271
11272 Any similarity to real events and people is purely coincidental.  Ahem.
11273
11274 Also @pxref{MIME Commands}.
11275
11276
11277 @node Customizing Articles
11278 @section Customizing Articles
11279 @cindex article customization
11280
11281 A slew of functions for customizing how the articles are to look like
11282 exist.  You can call these functions interactively
11283 (@pxref{Article Washing}), or you can have them
11284 called automatically when you select the articles.
11285
11286 To have them called automatically, you should set the corresponding
11287 ``treatment'' variable.  For instance, to have headers hidden, you'd set
11288 @code{gnus-treat-hide-headers}.  Below is a list of variables that can
11289 be set, but first we discuss the values these variables can have.
11290
11291 Note: Some values, while valid, make little sense.  Check the list below
11292 for sensible values.
11293
11294 @enumerate
11295 @item
11296 @code{nil}: Don't do this treatment.
11297
11298 @item
11299 @code{t}: Do this treatment on all body parts.
11300
11301 @item
11302 @code{head}: Do the treatment on the headers.
11303
11304 @item
11305 @code{first}: Do this treatment on the first body part.
11306
11307 @item
11308 @code{last}: Do this treatment on the last body part.
11309
11310 @item
11311 An integer: Do this treatment on all body parts that have a length less
11312 than this number.
11313
11314 @item
11315 A list of strings: Do this treatment on all body parts that are in
11316 articles that are read in groups that have names that match one of the
11317 regexps in the list.
11318
11319 @item
11320 A list where the first element is not a string:
11321
11322 The list is evaluated recursively.  The first element of the list is a
11323 predicate.  The following predicates are recognized: @code{or},
11324 @code{and}, @code{not} and @code{typep}.  Here's an example:
11325
11326 @lisp
11327 (or last
11328     (typep "text/x-vcard"))
11329 @end lisp
11330
11331 @end enumerate
11332
11333 You may have noticed that the word @dfn{part} is used here.  This refers
11334 to the fact that some messages are @acronym{MIME} multipart articles that may
11335 be divided into several parts.  Articles that are not multiparts are
11336 considered to contain just a single part.
11337
11338 @vindex gnus-article-treat-types
11339 Are the treatments applied to all sorts of multipart parts?  Yes, if you
11340 want to, but by default, only @samp{text/plain} parts are given the
11341 treatment.  This is controlled by the @code{gnus-article-treat-types}
11342 variable, which is a list of regular expressions that are matched to the
11343 type of the part.  This variable is ignored if the value of the
11344 controlling variable is a predicate list, as described above.
11345
11346 The following treatment options are available.  The easiest way to
11347 customize this is to examine the @code{gnus-article-treat} customization
11348 group.  Values in parenthesis are suggested sensible values.  Others are
11349 possible but those listed are probably sufficient for most people.
11350
11351 @table @code
11352 @item gnus-treat-buttonize (t, integer)
11353 @item gnus-treat-buttonize-head (head)
11354
11355 @xref{Article Buttons}.
11356
11357 @item gnus-treat-capitalize-sentences (t, integer)
11358 @item gnus-treat-overstrike (t, integer)
11359 @item gnus-treat-strip-cr (t, integer)
11360 @item gnus-treat-strip-headers-in-body (t, integer)
11361 @item gnus-treat-strip-leading-blank-lines (t, first, integer)
11362 @item gnus-treat-strip-multiple-blank-lines (t, integer)
11363 @item gnus-treat-strip-pem (t, last, integer)
11364 @item gnus-treat-strip-trailing-blank-lines (t, last, integer)
11365 @item gnus-treat-unsplit-urls (t, integer)
11366 @item gnus-treat-wash-html (t, integer)
11367
11368 @xref{Article Washing}.
11369
11370 @item gnus-treat-date-english (head)
11371 @item gnus-treat-date-iso8601 (head)
11372 @item gnus-treat-date-lapsed (head)
11373 @item gnus-treat-date-local (head)
11374 @item gnus-treat-date-original (head)
11375 @item gnus-treat-date-user-defined (head)
11376 @item gnus-treat-date-ut (head)
11377
11378 @xref{Article Date}.
11379
11380 @item gnus-treat-from-picon (head)
11381 @item gnus-treat-mail-picon (head)
11382 @item gnus-treat-newsgroups-picon (head)
11383
11384 @xref{Picons}.
11385
11386 @item gnus-treat-display-smileys (t, integer)
11387
11388 @item gnus-treat-body-boundary (head)
11389
11390 @vindex gnus-body-boundary-delimiter
11391 Adds a delimiter between header and body, the string used as delimiter
11392 is controlled by @code{gnus-body-boundary-delimiter}.
11393
11394 @xref{Smileys}.
11395
11396 @item gnus-treat-display-x-face (head)
11397
11398 @xref{X-Face}.
11399
11400 @item gnus-treat-display-face (head)
11401
11402 @xref{Face}.
11403
11404 @item gnus-treat-emphasize (t, head, integer)
11405 @item gnus-treat-fill-article (t, integer)
11406 @item gnus-treat-fill-long-lines (t, integer)
11407 @item gnus-treat-hide-boring-headers (head)
11408 @item gnus-treat-hide-citation (t, integer)
11409 @item gnus-treat-hide-citation-maybe (t, integer)
11410 @item gnus-treat-hide-headers (head)
11411 @item gnus-treat-hide-signature (t, last)
11412 @item gnus-treat-strip-banner (t, last)
11413 @item gnus-treat-strip-list-identifiers (head)
11414
11415 @xref{Article Hiding}.
11416
11417 @item gnus-treat-highlight-citation (t, integer)
11418 @item gnus-treat-highlight-headers (head)
11419 @item gnus-treat-highlight-signature (t, last, integer)
11420
11421 @xref{Article Highlighting}.
11422
11423 @item gnus-treat-play-sounds
11424 @item gnus-treat-translate
11425 @item gnus-treat-ansi-sequences (t)
11426 @item gnus-treat-x-pgp-sig (head)
11427
11428 @item gnus-treat-unfold-headers (head)
11429 @item gnus-treat-fold-headers (head)
11430 @item gnus-treat-fold-newsgroups (head)
11431 @item gnus-treat-leading-whitespace (head)
11432
11433 @xref{Article Header}.
11434
11435
11436 @end table
11437
11438 @vindex gnus-part-display-hook
11439 You can, of course, write your own functions to be called from
11440 @code{gnus-part-display-hook}.  The functions are called narrowed to the
11441 part, and you can do anything you like, pretty much.  There is no
11442 information that you have to keep in the buffer---you can change
11443 everything.
11444
11445
11446 @node Article Keymap
11447 @section Article Keymap
11448
11449 Most of the keystrokes in the summary buffer can also be used in the
11450 article buffer.  They should behave as if you typed them in the summary
11451 buffer, which means that you don't actually have to have a summary
11452 buffer displayed while reading.  You can do it all from the article
11453 buffer.
11454
11455 @kindex v (Article)
11456 @cindex keys, reserved for users (Article)
11457 The key @kbd{v} is reserved for users.  You can bind it key to some
11458 function or better use it as a prefix key.
11459
11460 A few additional keystrokes are available:
11461
11462 @table @kbd
11463
11464 @item SPACE
11465 @kindex SPACE (Article)
11466 @findex gnus-article-next-page
11467 Scroll forwards one page (@code{gnus-article-next-page}).
11468 This is exactly the same as @kbd{h SPACE h}.
11469
11470 @item DEL
11471 @kindex DEL (Article)
11472 @findex gnus-article-prev-page
11473 Scroll backwards one page (@code{gnus-article-prev-page}).
11474 This is exactly the same as @kbd{h DEL h}.
11475
11476 @item C-c ^
11477 @kindex C-c ^ (Article)
11478 @findex gnus-article-refer-article
11479 If point is in the neighborhood of a @code{Message-ID} and you press
11480 @kbd{C-c ^}, Gnus will try to get that article from the server
11481 (@code{gnus-article-refer-article}).
11482
11483 @item C-c C-m
11484 @kindex C-c C-m (Article)
11485 @findex gnus-article-mail
11486 Send a reply to the address near point (@code{gnus-article-mail}).  If
11487 given a prefix, include the mail.
11488
11489 @item s
11490 @kindex s (Article)
11491 @findex gnus-article-show-summary
11492 Reconfigure the buffers so that the summary buffer becomes visible
11493 (@code{gnus-article-show-summary}).
11494
11495 @item ?
11496 @kindex ? (Article)
11497 @findex gnus-article-describe-briefly
11498 Give a very brief description of the available keystrokes
11499 (@code{gnus-article-describe-briefly}).
11500
11501 @item TAB
11502 @kindex TAB (Article)
11503 @findex gnus-article-next-button
11504 Go to the next button, if any (@code{gnus-article-next-button}).  This
11505 only makes sense if you have buttonizing turned on.
11506
11507 @item M-TAB
11508 @kindex M-TAB (Article)
11509 @findex gnus-article-prev-button
11510 Go to the previous button, if any (@code{gnus-article-prev-button}).
11511
11512 @item R
11513 @kindex R (Article)
11514 @findex gnus-article-reply-with-original
11515 Send a reply to the current article and yank the current article
11516 (@code{gnus-article-reply-with-original}).  If given a prefix, make a
11517 wide reply.  If the region is active, only yank the text in the
11518 region.
11519
11520 @item F
11521 @kindex F (Article)
11522 @findex gnus-article-followup-with-original
11523 Send a followup to the current article and yank the current article
11524 (@code{gnus-article-followup-with-original}).  If given a prefix, make
11525 a wide reply.  If the region is active, only yank the text in the
11526 region.
11527
11528
11529 @end table
11530
11531
11532 @node Misc Article
11533 @section Misc Article
11534
11535 @table @code
11536
11537 @item gnus-single-article-buffer
11538 @vindex gnus-single-article-buffer
11539 If non-@code{nil}, use the same article buffer for all the groups.
11540 (This is the default.)  If @code{nil}, each group will have its own
11541 article buffer.
11542
11543 @vindex gnus-article-decode-hook
11544 @item gnus-article-decode-hook
11545 @cindex @acronym{MIME}
11546 Hook used to decode @acronym{MIME} articles.  The default value is
11547 @code{(article-decode-charset article-decode-encoded-words)}
11548
11549 @vindex gnus-article-prepare-hook
11550 @item gnus-article-prepare-hook
11551 This hook is called right after the article has been inserted into the
11552 article buffer.  It is mainly intended for functions that do something
11553 depending on the contents; it should probably not be used for changing
11554 the contents of the article buffer.
11555
11556 @item gnus-article-mode-hook
11557 @vindex gnus-article-mode-hook
11558 Hook called in article mode buffers.
11559
11560 @item gnus-article-mode-syntax-table
11561 @vindex gnus-article-mode-syntax-table
11562 Syntax table used in article buffers.  It is initialized from
11563 @code{text-mode-syntax-table}.
11564
11565 @vindex gnus-article-over-scroll
11566 @item gnus-article-over-scroll
11567 If non-@code{nil}, allow scrolling the article buffer even when there
11568 no more new text to scroll in.  The default is @code{nil}.
11569
11570 @vindex gnus-article-mode-line-format
11571 @item gnus-article-mode-line-format
11572 This variable is a format string along the same lines as
11573 @code{gnus-summary-mode-line-format} (@pxref{Summary Buffer Mode
11574 Line}).  It accepts the same format specifications as that variable,
11575 with two extensions:
11576
11577 @table @samp
11578
11579 @item w
11580 The @dfn{wash status} of the article.  This is a short string with one
11581 character for each possible article wash operation that may have been
11582 performed.  The characters and their meaning:
11583
11584 @table @samp
11585
11586 @item c
11587 Displayed when cited text may be hidden in the article buffer.
11588
11589 @item h
11590 Displayed when headers are hidden in the article buffer.
11591
11592 @item p
11593 Displayed when article is digitally signed or encrypted, and Gnus has
11594 hidden the security headers.  (N.B. does not tell anything about
11595 security status, i.e. good or bad signature.)
11596
11597 @item s
11598 Displayed when the signature has been hidden in the Article buffer.
11599
11600 @item o
11601 Displayed when Gnus has treated overstrike characters in the article buffer.
11602
11603 @item e
11604 Displayed when Gnus has treated emphasised strings in the article buffer.
11605
11606 @end table
11607
11608 @item m
11609 The number of @acronym{MIME} parts in the article.
11610
11611 @end table
11612
11613 @vindex gnus-break-pages
11614
11615 @item gnus-break-pages
11616 Controls whether @dfn{page breaking} is to take place.  If this variable
11617 is non-@code{nil}, the articles will be divided into pages whenever a
11618 page delimiter appears in the article.  If this variable is @code{nil},
11619 paging will not be done.
11620
11621 @item gnus-page-delimiter
11622 @vindex gnus-page-delimiter
11623 This is the delimiter mentioned above.  By default, it is @samp{^L}
11624 (formfeed).
11625
11626 @cindex IDNA
11627 @cindex internationalized domain names
11628 @vindex gnus-use-idna
11629 @item gnus-use-idna
11630 This variable controls whether Gnus performs IDNA decoding of
11631 internationalized domain names inside @samp{From}, @samp{To} and
11632 @samp{Cc} headers.  @xref{IDNA, ,IDNA,message, The Message Manual},
11633 for how to compose such messages.  This requires
11634 @uref{http://www.gnu.org/software/libidn/, GNU Libidn}, and this
11635 variable is only enabled if you have installed it.
11636
11637 @end table
11638
11639
11640 @node Composing Messages
11641 @chapter Composing Messages
11642 @cindex composing messages
11643 @cindex messages
11644 @cindex mail
11645 @cindex sending mail
11646 @cindex reply
11647 @cindex followup
11648 @cindex post
11649 @cindex using gpg
11650 @cindex using s/mime
11651 @cindex using smime
11652
11653 @kindex C-c C-c (Post)
11654 All commands for posting and mailing will put you in a message buffer
11655 where you can edit the article all you like, before you send the
11656 article by pressing @kbd{C-c C-c}.  @xref{Top, , Overview, message,
11657 Message Manual}.  Where the message will be posted/mailed to depends
11658 on your setup (@pxref{Posting Server}).
11659
11660 @menu
11661 * Mail::                        Mailing and replying.
11662 * Posting Server::              What server should you post and mail via?
11663 * POP before SMTP::             You cannot send a mail unless you read a mail.
11664 * Mail and Post::               Mailing and posting at the same time.
11665 * Archived Messages::           Where Gnus stores the messages you've sent.
11666 * Posting Styles::              An easier way to specify who you are.
11667 * Drafts::                      Postponing messages and rejected messages.
11668 * Rejected Articles::           What happens if the server doesn't like your article?
11669 * Signing and encrypting::      How to compose secure messages.
11670 @end menu
11671
11672 Also @pxref{Canceling and Superseding} for information on how to
11673 remove articles you shouldn't have posted.
11674
11675
11676 @node Mail
11677 @section Mail
11678
11679 Variables for customizing outgoing mail:
11680
11681 @table @code
11682 @item gnus-uu-digest-headers
11683 @vindex gnus-uu-digest-headers
11684 List of regexps to match headers included in digested messages.  The
11685 headers will be included in the sequence they are matched.  If
11686 @code{nil} include all headers.
11687
11688 @item gnus-add-to-list
11689 @vindex gnus-add-to-list
11690 If non-@code{nil}, add a @code{to-list} group parameter to mail groups
11691 that have none when you do a @kbd{a}.
11692
11693 @item gnus-confirm-mail-reply-to-news
11694 @vindex gnus-confirm-mail-reply-to-news
11695 If non-@code{nil}, Gnus will ask you for a confirmation when you are
11696 about to reply to news articles by mail.  If it is @code{nil}, nothing
11697 interferes in what you want to do.  This can also be a function
11698 receiving the group name as the only parameter which should return
11699 non-@code{nil} if a confirmation is needed, or a regular expression
11700 matching group names, where confirmation should be asked for.
11701
11702 If you find yourself never wanting to reply to mail, but occasionally
11703 press @kbd{R} anyway, this variable might be for you.
11704
11705 @item gnus-confirm-treat-mail-like-news
11706 @vindex gnus-confirm-treat-mail-like-news
11707 If non-@code{nil}, Gnus also requests confirmation according to
11708 @code{gnus-confirm-mail-reply-to-news} when replying to mail.  This is
11709 useful for treating mailing lists like newsgroups.
11710
11711 @end table
11712
11713
11714 @node Posting Server
11715 @section Posting Server
11716
11717 When you press those magical @kbd{C-c C-c} keys to ship off your latest
11718 (extremely intelligent, of course) article, where does it go?
11719
11720 Thank you for asking.  I hate you.
11721
11722 It can be quite complicated.
11723
11724 @vindex gnus-post-method
11725 When posting news, Message usually invokes @code{message-send-news}
11726 (@pxref{News Variables, , News Variables, message, Message Manual}).
11727 Normally, Gnus will post using the same select method as you're
11728 reading from (which might be convenient if you're reading lots of
11729 groups from different private servers).  However.  If the server
11730 you're reading from doesn't allow posting, just reading, you probably
11731 want to use some other server to post your (extremely intelligent and
11732 fabulously interesting) articles.  You can then set the
11733 @code{gnus-post-method} to some other method:
11734
11735 @lisp
11736 (setq gnus-post-method '(nnspool ""))
11737 @end lisp
11738
11739 Now, if you've done this, and then this server rejects your article, or
11740 this server is down, what do you do then?  To override this variable you
11741 can use a non-zero prefix to the @kbd{C-c C-c} command to force using
11742 the ``current'' server, to get back the default behavior, for posting.
11743
11744 If you give a zero prefix (i.e., @kbd{C-u 0 C-c C-c}) to that command,
11745 Gnus will prompt you for what method to use for posting.
11746
11747 You can also set @code{gnus-post-method} to a list of select methods.
11748 If that's the case, Gnus will always prompt you for what method to use
11749 for posting.
11750
11751 Finally, if you want to always post using the native select method,
11752 you can set this variable to @code{native}.
11753
11754 When sending mail, Message invokes @code{message-send-mail-function}.
11755 The default function, @code{message-send-mail-with-sendmail}, pipes
11756 your article to the @code{sendmail} binary for further queuing and
11757 sending.  When your local system is not configured for sending mail
11758 using @code{sendmail}, and you have access to a remote @acronym{SMTP}
11759 server, you can set @code{message-send-mail-function} to
11760 @code{smtpmail-send-it} and make sure to setup the @code{smtpmail}
11761 package correctly.  An example:
11762
11763 @lisp
11764 (setq message-send-mail-function 'smtpmail-send-it
11765       smtpmail-default-smtp-server "YOUR SMTP HOST")
11766 @end lisp
11767
11768 To the thing similar to this, there is
11769 @code{message-smtpmail-send-it}.  It is useful if your @acronym{ISP}
11770 requires the @acronym{POP}-before-@acronym{SMTP} authentication.
11771 @xref{POP before SMTP}.
11772
11773 Other possible choices for @code{message-send-mail-function} includes
11774 @code{message-send-mail-with-mh}, @code{message-send-mail-with-qmail},
11775 and @code{feedmail-send-it}.
11776
11777 @node POP before SMTP
11778 @section POP before SMTP
11779 @cindex pop before smtp
11780 @findex message-smtpmail-send-it
11781 @findex mail-source-touch-pop
11782
11783 Does your @acronym{ISP} require the @acronym{POP}-before-@acronym{SMTP}
11784 authentication?  It is whether you need to connect to the @acronym{POP}
11785 mail server within a certain time before sending mails.  If so, there is
11786 a convenient way.  To do that, put the following lines in your
11787 @file{~/.gnus.el} file:
11788
11789 @lisp
11790 (setq message-send-mail-function 'message-smtpmail-send-it)
11791 (add-hook 'message-send-mail-hook 'mail-source-touch-pop)
11792 @end lisp
11793
11794 @noindent
11795 It means to let Gnus connect to the @acronym{POP} mail server in advance
11796 whenever you send a mail.  The @code{mail-source-touch-pop} function
11797 does only a @acronym{POP} authentication according to the value of
11798 @code{mail-sources} without fetching mails, just before sending a mail.
11799 Note that you have to use @code{message-smtpmail-send-it} which runs
11800 @code{message-send-mail-hook} rather than @code{smtpmail-send-it} and
11801 set the value of @code{mail-sources} for a @acronym{POP} connection
11802 correctly.  @xref{Mail Sources}.
11803
11804 If you have two or more @acronym{POP} mail servers set in
11805 @code{mail-sources}, you may want to specify one of them to
11806 @code{mail-source-primary-source} as the @acronym{POP} mail server to be
11807 used for the @acronym{POP}-before-@acronym{SMTP} authentication.  If it
11808 is your primary @acronym{POP} mail server (i.e., you are fetching mails
11809 mainly from that server), you can set it permanently as follows:
11810
11811 @lisp
11812 (setq mail-source-primary-source
11813       '(pop :server "pop3.mail.server"
11814             :password "secret"))
11815 @end lisp
11816
11817 @noindent
11818 Otherwise, bind it dynamically only when performing the
11819 @acronym{POP}-before-@acronym{SMTP} authentication as follows:
11820
11821 @lisp
11822 (add-hook 'message-send-mail-hook
11823           (lambda ()
11824             (let ((mail-source-primary-source
11825                    '(pop :server "pop3.mail.server"
11826                          :password "secret")))
11827               (mail-source-touch-pop))))
11828 @end lisp
11829
11830 @node Mail and Post
11831 @section Mail and Post
11832
11833 Here's a list of variables relevant to both mailing and
11834 posting:
11835
11836 @table @code
11837 @item gnus-mailing-list-groups
11838 @findex gnus-mailing-list-groups
11839 @cindex mailing lists
11840
11841 If your news server offers groups that are really mailing lists
11842 gatewayed to the @acronym{NNTP} server, you can read those groups without
11843 problems, but you can't post/followup to them without some difficulty.
11844 One solution is to add a @code{to-address} to the group parameters
11845 (@pxref{Group Parameters}).  An easier thing to do is set the
11846 @code{gnus-mailing-list-groups} to a regexp that matches the groups that
11847 really are mailing lists.  Then, at least, followups to the mailing
11848 lists will work most of the time.  Posting to these groups (@kbd{a}) is
11849 still a pain, though.
11850
11851 @item gnus-user-agent
11852 @vindex gnus-user-agent
11853 @cindex User-Agent
11854
11855 This variable controls which information should be exposed in the
11856 User-Agent header.  It can be one of the symbols @code{gnus} (show only
11857 Gnus version), @code{emacs-gnus} (show only Emacs and Gnus versions),
11858 @code{emacs-gnus-config} (same as @code{emacs-gnus} plus system
11859 configuration), @code{emacs-gnus-type} (same as @code{emacs-gnus} plus
11860 system type) or a custom string.  If you set it to a string, be sure to
11861 use a valid format, see RFC 2616.
11862
11863 @end table
11864
11865 You may want to do spell-checking on messages that you send out.  Or, if
11866 you don't want to spell-check by hand, you could add automatic
11867 spell-checking via the @code{ispell} package:
11868
11869 @cindex ispell
11870 @findex ispell-message
11871 @lisp
11872 (add-hook 'message-send-hook 'ispell-message)
11873 @end lisp
11874
11875 If you want to change the @code{ispell} dictionary based on what group
11876 you're in, you could say something like the following:
11877
11878 @lisp
11879 (add-hook 'gnus-select-group-hook
11880           (lambda ()
11881             (cond
11882              ((string-match
11883                "^de\\." (gnus-group-real-name gnus-newsgroup-name))
11884               (ispell-change-dictionary "deutsch"))
11885              (t
11886               (ispell-change-dictionary "english")))))
11887 @end lisp
11888
11889 Modify to suit your needs.
11890
11891
11892 @node Archived Messages
11893 @section Archived Messages
11894 @cindex archived messages
11895 @cindex sent messages
11896
11897 Gnus provides a few different methods for storing the mail and news you
11898 send.  The default method is to use the @dfn{archive virtual server} to
11899 store the messages.  If you want to disable this completely, the
11900 @code{gnus-message-archive-group} variable should be @code{nil}, which
11901 is the default.
11902
11903 For archiving interesting messages in a group you read, see the
11904 @kbd{B c} (@code{gnus-summary-copy-article}) command (@pxref{Mail
11905 Group Commands}).
11906
11907 @vindex gnus-message-archive-method
11908 @code{gnus-message-archive-method} says what virtual server Gnus is to
11909 use to store sent messages.  The default is:
11910
11911 @lisp
11912 (nnfolder "archive"
11913           (nnfolder-directory   "~/Mail/archive")
11914           (nnfolder-active-file "~/Mail/archive/active")
11915           (nnfolder-get-new-mail nil)
11916           (nnfolder-inhibit-expiry t))
11917 @end lisp
11918
11919 You can, however, use any mail select method (@code{nnml},
11920 @code{nnmbox}, etc.).  @code{nnfolder} is a quite likable select method
11921 for doing this sort of thing, though.  If you don't like the default
11922 directory chosen, you could say something like:
11923
11924 @lisp
11925 (setq gnus-message-archive-method
11926       '(nnfolder "archive"
11927                  (nnfolder-inhibit-expiry t)
11928                  (nnfolder-active-file "~/News/sent-mail/active")
11929                  (nnfolder-directory "~/News/sent-mail/")))
11930 @end lisp
11931
11932 @vindex gnus-message-archive-group
11933 @cindex Gcc
11934 Gnus will insert @code{Gcc} headers in all outgoing messages that point
11935 to one or more group(s) on that server.  Which group to use is
11936 determined by the @code{gnus-message-archive-group} variable.
11937
11938 This variable can be used to do the following:
11939
11940 @table @asis
11941 @item a string
11942 Messages will be saved in that group.
11943
11944 Note that you can include a select method in the group name, then the
11945 message will not be stored in the select method given by
11946 @code{gnus-message-archive-method}, but in the select method specified
11947 by the group name, instead.  Suppose @code{gnus-message-archive-method}
11948 has the default value shown above.  Then setting
11949 @code{gnus-message-archive-group} to @code{"foo"} means that outgoing
11950 messages are stored in @samp{nnfolder+archive:foo}, but if you use the
11951 value @code{"nnml:foo"}, then outgoing messages will be stored in
11952 @samp{nnml:foo}.
11953
11954 @item a list of strings
11955 Messages will be saved in all those groups.
11956
11957 @item an alist of regexps, functions and forms
11958 When a key ``matches'', the result is used.
11959
11960 @item @code{nil}
11961 No message archiving will take place.  This is the default.
11962 @end table
11963
11964 Let's illustrate:
11965
11966 Just saving to a single group called @samp{MisK}:
11967 @lisp
11968 (setq gnus-message-archive-group "MisK")
11969 @end lisp
11970
11971 Saving to two groups, @samp{MisK} and @samp{safe}:
11972 @lisp
11973 (setq gnus-message-archive-group '("MisK" "safe"))
11974 @end lisp
11975
11976 Save to different groups based on what group you are in:
11977 @lisp
11978 (setq gnus-message-archive-group
11979       '(("^alt" "sent-to-alt")
11980         ("mail" "sent-to-mail")
11981         (".*" "sent-to-misc")))
11982 @end lisp
11983
11984 More complex stuff:
11985 @lisp
11986 (setq gnus-message-archive-group
11987       '((if (message-news-p)
11988             "misc-news"
11989           "misc-mail")))
11990 @end lisp
11991
11992 How about storing all news messages in one file, but storing all mail
11993 messages in one file per month:
11994
11995 @lisp
11996 (setq gnus-message-archive-group
11997       '((if (message-news-p)
11998             "misc-news"
11999           (concat "mail." (format-time-string "%Y-%m")))))
12000 @end lisp
12001
12002 @c (XEmacs 19.13 doesn't have @code{format-time-string}, so you'll have to
12003 @c use a different value for @code{gnus-message-archive-group} there.)
12004
12005 Now, when you send a message off, it will be stored in the appropriate
12006 group.  (If you want to disable storing for just one particular message,
12007 you can just remove the @code{Gcc} header that has been inserted.)  The
12008 archive group will appear in the group buffer the next time you start
12009 Gnus, or the next time you press @kbd{F} in the group buffer.  You can
12010 enter it and read the articles in it just like you'd read any other
12011 group.  If the group gets really big and annoying, you can simply rename
12012 if (using @kbd{G r} in the group buffer) to something
12013 nice---@samp{misc-mail-september-1995}, or whatever.  New messages will
12014 continue to be stored in the old (now empty) group.
12015
12016 That's the default method of archiving sent messages.  Gnus offers a
12017 different way for the people who don't like the default method.  In that
12018 case you should set @code{gnus-message-archive-group} to @code{nil};
12019 this will disable archiving.
12020
12021 @table @code
12022 @item gnus-outgoing-message-group
12023 @vindex gnus-outgoing-message-group
12024 All outgoing messages will be put in this group.  If you want to store
12025 all your outgoing mail and articles in the group @samp{nnml:archive},
12026 you set this variable to that value.  This variable can also be a list of
12027 group names.
12028
12029 If you want to have greater control over what group to put each
12030 message in, you can set this variable to a function that checks the
12031 current newsgroup name and then returns a suitable group name (or list
12032 of names).
12033
12034 This variable can be used instead of @code{gnus-message-archive-group},
12035 but the latter is the preferred method.
12036
12037 @item gnus-gcc-mark-as-read
12038 @vindex gnus-gcc-mark-as-read
12039 If non-@code{nil}, automatically mark @code{Gcc} articles as read.
12040
12041 @item gnus-gcc-externalize-attachments
12042 @vindex gnus-gcc-externalize-attachments
12043 If @code{nil}, attach files as normal parts in Gcc copies; if a regexp
12044 and matches the Gcc group name, attach files as external parts; if it is
12045 @code{all}, attach local files as external parts; if it is other
12046 non-@code{nil}, the behavior is the same as @code{all}, but it may be
12047 changed in the future.
12048
12049 @end table
12050
12051
12052 @node Posting Styles
12053 @section Posting Styles
12054 @cindex posting styles
12055 @cindex styles
12056
12057 All them variables, they make my head swim.
12058
12059 So what if you want a different @code{Organization} and signature based
12060 on what groups you post to?  And you post both from your home machine
12061 and your work machine, and you want different @code{From} lines, and so
12062 on?
12063
12064 @vindex gnus-posting-styles
12065 One way to do stuff like that is to write clever hooks that change the
12066 variables you need to have changed.  That's a bit boring, so somebody
12067 came up with the bright idea of letting the user specify these things in
12068 a handy alist.  Here's an example of a @code{gnus-posting-styles}
12069 variable:
12070
12071 @lisp
12072 ((".*"
12073   (signature "Peace and happiness")
12074   (organization "What me?"))
12075  ("^comp"
12076   (signature "Death to everybody"))
12077  ("comp.emacs.i-love-it"
12078   (organization "Emacs is it")))
12079 @end lisp
12080
12081 As you might surmise from this example, this alist consists of several
12082 @dfn{styles}.  Each style will be applicable if the first element
12083 ``matches'', in some form or other.  The entire alist will be iterated
12084 over, from the beginning towards the end, and each match will be
12085 applied, which means that attributes in later styles that match override
12086 the same attributes in earlier matching styles.  So
12087 @samp{comp.programming.literate} will have the @samp{Death to everybody}
12088 signature and the @samp{What me?} @code{Organization} header.
12089
12090 The first element in each style is called the @code{match}.  If it's a
12091 string, then Gnus will try to regexp match it against the group name.
12092 If it is the form @code{(header @var{match} @var{regexp})}, then Gnus
12093 will look in the original article for a header whose name is
12094 @var{match} and compare that @var{regexp}.  @var{match} and
12095 @var{regexp} are strings.  (The original article is the one you are
12096 replying or following up to.  If you are not composing a reply or a
12097 followup, then there is nothing to match against.)  If the
12098 @code{match} is a function symbol, that function will be called with
12099 no arguments.  If it's a variable symbol, then the variable will be
12100 referenced.  If it's a list, then that list will be @code{eval}ed.  In
12101 any case, if this returns a non-@code{nil} value, then the style is
12102 said to @dfn{match}.
12103
12104 Each style may contain an arbitrary amount of @dfn{attributes}.  Each
12105 attribute consists of a @code{(@var{name} @var{value})} pair.  In
12106 addition, you can also use the @code{(@var{name} :file @var{value})}
12107 form or the @code{(@var{name} :value @var{value})} form.  Where
12108 @code{:file} signifies @var{value} represents a file name and its
12109 contents should be used as the attribute value, @code{:value} signifies
12110 @var{value} does not represent a file name explicitly.  The attribute
12111 name can be one of:
12112
12113 @itemize @bullet
12114 @item @code{signature}
12115 @item @code{signature-file}
12116 @item @code{x-face-file}
12117 @item @code{address}, overriding @code{user-mail-address}
12118 @item @code{name}, overriding @code{(user-full-name)}
12119 @item @code{body}
12120 @end itemize
12121
12122 The attribute name can also be a string or a symbol.  In that case,
12123 this will be used as a header name, and the value will be inserted in
12124 the headers of the article; if the value is @code{nil}, the header
12125 name will be removed.  If the attribute name is @code{eval}, the form
12126 is evaluated, and the result is thrown away.
12127
12128 The attribute value can be a string (used verbatim), a function with
12129 zero arguments (the return value will be used), a variable (its value
12130 will be used) or a list (it will be @code{eval}ed and the return value
12131 will be used).  The functions and sexps are called/@code{eval}ed in the
12132 message buffer that is being set up.  The headers of the current article
12133 are available through the @code{message-reply-headers} variable, which
12134 is a vector of the following headers: number subject from date id
12135 references chars lines xref extra.
12136
12137 @vindex message-reply-headers
12138
12139 If you wish to check whether the message you are about to compose is
12140 meant to be a news article or a mail message, you can check the values
12141 of the @code{message-news-p} and @code{message-mail-p} functions.
12142
12143 @findex message-mail-p
12144 @findex message-news-p
12145
12146 So here's a new example:
12147
12148 @lisp
12149 (setq gnus-posting-styles
12150       '((".*"
12151          (signature-file "~/.signature")
12152          (name "User Name")
12153          (x-face-file "~/.xface")
12154          (x-url (getenv "WWW_HOME"))
12155          (organization "People's Front Against MWM"))
12156         ("^rec.humor"
12157          (signature my-funny-signature-randomizer))
12158         ((equal (system-name) "gnarly")  ;; @r{A form}
12159          (signature my-quote-randomizer))
12160         (message-news-p        ;; @r{A function symbol}
12161          (signature my-news-signature))
12162         (window-system         ;; @r{A value symbol}
12163          ("X-Window-System" (format "%s" window-system)))
12164         ;; @r{If I'm replying to Larsi, set the Organization header.}
12165         ((header "from" "larsi.*org")
12166          (Organization "Somewhere, Inc."))
12167         ((posting-from-work-p) ;; @r{A user defined function}
12168          (signature-file "~/.work-signature")
12169          (address "user@@bar.foo")
12170          (body "You are fired.\n\nSincerely, your boss.")
12171          (organization "Important Work, Inc"))
12172         ("nnml:.*"
12173          (From (save-excursion
12174                  (set-buffer gnus-article-buffer)
12175                  (message-fetch-field "to"))))
12176         ("^nn.+:"
12177          (signature-file "~/.mail-signature"))))
12178 @end lisp
12179
12180 The @samp{nnml:.*} rule means that you use the @code{To} address as the
12181 @code{From} address in all your outgoing replies, which might be handy
12182 if you fill many roles.
12183
12184
12185 @node Drafts
12186 @section Drafts
12187 @cindex drafts
12188
12189 If you are writing a message (mail or news) and suddenly remember that
12190 you have a steak in the oven (or some pesto in the food processor, you
12191 craaazy vegetarians), you'll probably wish there was a method to save
12192 the message you are writing so that you can continue editing it some
12193 other day, and send it when you feel its finished.
12194
12195 Well, don't worry about it.  Whenever you start composing a message of
12196 some sort using the Gnus mail and post commands, the buffer you get will
12197 automatically associate to an article in a special @dfn{draft} group.
12198 If you save the buffer the normal way (@kbd{C-x C-s}, for instance), the
12199 article will be saved there.  (Auto-save files also go to the draft
12200 group.)
12201
12202 @cindex nndraft
12203 @vindex nndraft-directory
12204 The draft group is a special group (which is implemented as an
12205 @code{nndraft} group, if you absolutely have to know) called
12206 @samp{nndraft:drafts}.  The variable @code{nndraft-directory} says where
12207 @code{nndraft} is to store its files.  What makes this group special is
12208 that you can't tick any articles in it or mark any articles as
12209 read---all articles in the group are permanently unread.
12210
12211 If the group doesn't exist, it will be created and you'll be subscribed
12212 to it.  The only way to make it disappear from the Group buffer is to
12213 unsubscribe it.  The special properties of the draft group comes from
12214 a group property (@pxref{Group Parameters}), and if lost the group
12215 behaves like any other group.  This means the commands below will not
12216 be available.  To restore the special properties of the group, the
12217 simplest way is to kill the group, using @kbd{C-k}, and restart
12218 Gnus.  The group is automatically created again with the
12219 correct parameters.  The content of the group is not lost.
12220
12221 @c @findex gnus-dissociate-buffer-from-draft
12222 @c @kindex C-c M-d (Mail)
12223 @c @kindex C-c M-d (Post)
12224 @c @findex gnus-associate-buffer-with-draft
12225 @c @kindex C-c C-d (Mail)
12226 @c @kindex C-c C-d (Post)
12227 @c If you're writing some super-secret message that you later want to
12228 @c encode with PGP before sending, you may wish to turn the auto-saving
12229 @c (and association with the draft group) off.  You never know who might be
12230 @c interested in reading all your extremely valuable and terribly horrible
12231 @c and interesting secrets.  The @kbd{C-c M-d}
12232 @c (@code{gnus-dissociate-buffer-from-draft}) command does that for you.
12233 @c If you change your mind and want to turn the auto-saving back on again,
12234 @c @kbd{C-c C-d} (@code{gnus-associate-buffer-with-draft} does that.
12235 @c
12236 @c @vindex gnus-use-draft
12237 @c To leave association with the draft group off by default, set
12238 @c @code{gnus-use-draft} to @code{nil}.  It is @code{t} by default.
12239
12240 @findex gnus-draft-edit-message
12241 @kindex D e (Draft)
12242 When you want to continue editing the article, you simply enter the
12243 draft group and push @kbd{D e} (@code{gnus-draft-edit-message}) to do
12244 that.  You will be placed in a buffer where you left off.
12245
12246 Rejected articles will also be put in this draft group (@pxref{Rejected
12247 Articles}).
12248
12249 @findex gnus-draft-send-all-messages
12250 @kindex D s (Draft)
12251 @findex gnus-draft-send-message
12252 @kindex D S (Draft)
12253 If you have lots of rejected messages you want to post (or mail) without
12254 doing further editing, you can use the @kbd{D s} command
12255 (@code{gnus-draft-send-message}).  This command understands the
12256 process/prefix convention (@pxref{Process/Prefix}).  The @kbd{D S}
12257 command (@code{gnus-draft-send-all-messages}) will ship off all messages
12258 in the buffer.
12259
12260 @findex gnus-draft-toggle-sending
12261 @kindex D t (Draft)
12262 If you have some messages that you wish not to send, you can use the
12263 @kbd{D t} (@code{gnus-draft-toggle-sending}) command to mark the message
12264 as unsendable.  This is a toggling command.
12265
12266
12267 @node Rejected Articles
12268 @section Rejected Articles
12269 @cindex rejected articles
12270
12271 Sometimes a news server will reject an article.  Perhaps the server
12272 doesn't like your face.  Perhaps it just feels miserable.  Perhaps
12273 @emph{there be demons}.  Perhaps you have included too much cited text.
12274 Perhaps the disk is full.  Perhaps the server is down.
12275
12276 These situations are, of course, totally beyond the control of Gnus.
12277 (Gnus, of course, loves the way you look, always feels great, has angels
12278 fluttering around inside of it, doesn't care about how much cited text
12279 you include, never runs full and never goes down.)  So Gnus saves these
12280 articles until some later time when the server feels better.
12281
12282 The rejected articles will automatically be put in a special draft group
12283 (@pxref{Drafts}).  When the server comes back up again, you'd then
12284 typically enter that group and send all the articles off.
12285
12286 @node Signing and encrypting
12287 @section Signing and encrypting
12288 @cindex using gpg
12289 @cindex using s/mime
12290 @cindex using smime
12291
12292 Gnus can digitally sign and encrypt your messages, using vanilla
12293 @acronym{PGP} format or @acronym{PGP/MIME} or @acronym{S/MIME}.  For
12294 decoding such messages, see the @code{mm-verify-option} and
12295 @code{mm-decrypt-option} options (@pxref{Security}).
12296
12297 @vindex gnus-message-replysign
12298 @vindex gnus-message-replyencrypt
12299 @vindex gnus-message-replysignencrypted
12300 Often, you would like to sign replies to people who send you signed
12301 messages.  Even more often, you might want to encrypt messages which
12302 are in reply to encrypted messages.  Gnus offers
12303 @code{gnus-message-replysign} to enable the former, and
12304 @code{gnus-message-replyencrypt} for the latter.  In addition, setting
12305 @code{gnus-message-replysignencrypted} (on by default) will sign
12306 automatically encrypted messages.
12307
12308 Instructing @acronym{MML} to perform security operations on a
12309 @acronym{MIME} part is done using the @kbd{C-c C-m s} key map for
12310 signing and the @kbd{C-c C-m c} key map for encryption, as follows.
12311
12312 @table @kbd
12313
12314 @item C-c C-m s s
12315 @kindex C-c C-m s s (Message)
12316 @findex mml-secure-message-sign-smime
12317
12318 Digitally sign current message using @acronym{S/MIME}.
12319
12320 @item C-c C-m s o
12321 @kindex C-c C-m s o (Message)
12322 @findex mml-secure-message-sign-pgp
12323
12324 Digitally sign current message using @acronym{PGP}.
12325
12326 @item C-c C-m s p
12327 @kindex C-c C-m s p (Message)
12328 @findex mml-secure-message-sign-pgp
12329
12330 Digitally sign current message using @acronym{PGP/MIME}.
12331
12332 @item C-c C-m c s
12333 @kindex C-c C-m c s (Message)
12334 @findex mml-secure-message-encrypt-smime
12335
12336 Digitally encrypt current message using @acronym{S/MIME}.
12337
12338 @item C-c C-m c o
12339 @kindex C-c C-m c o (Message)
12340 @findex mml-secure-message-encrypt-pgp
12341
12342 Digitally encrypt current message using @acronym{PGP}.
12343
12344 @item C-c C-m c p
12345 @kindex C-c C-m c p (Message)
12346 @findex mml-secure-message-encrypt-pgpmime
12347
12348 Digitally encrypt current message using @acronym{PGP/MIME}.
12349
12350 @item C-c C-m C-n
12351 @kindex C-c C-m C-n (Message)
12352 @findex mml-unsecure-message
12353 Remove security related @acronym{MML} tags from message.
12354
12355 @end table
12356
12357 @xref{Security, ,Security, message, Message Manual}, for more information.
12358
12359 @node Select Methods
12360 @chapter Select Methods
12361 @cindex foreign groups
12362 @cindex select methods
12363
12364 A @dfn{foreign group} is a group not read by the usual (or
12365 default) means.  It could be, for instance, a group from a different
12366 @acronym{NNTP} server, it could be a virtual group, or it could be your own
12367 personal mail group.
12368
12369 A foreign group (or any group, really) is specified by a @dfn{name} and
12370 a @dfn{select method}.  To take the latter first, a select method is a
12371 list where the first element says what back end to use (e.g. @code{nntp},
12372 @code{nnspool}, @code{nnml}) and the second element is the @dfn{server
12373 name}.  There may be additional elements in the select method, where the
12374 value may have special meaning for the back end in question.
12375
12376 One could say that a select method defines a @dfn{virtual server}---so
12377 we do just that (@pxref{Server Buffer}).
12378
12379 The @dfn{name} of the group is the name the back end will recognize the
12380 group as.
12381
12382 For instance, the group @samp{soc.motss} on the @acronym{NNTP} server
12383 @samp{some.where.edu} will have the name @samp{soc.motss} and select
12384 method @code{(nntp "some.where.edu")}.  Gnus will call this group
12385 @samp{nntp+some.where.edu:soc.motss}, even though the @code{nntp}
12386 back end just knows this group as @samp{soc.motss}.
12387
12388 The different methods all have their peculiarities, of course.
12389
12390 @menu
12391 * Server Buffer::               Making and editing virtual servers.
12392 * Getting News::                Reading USENET news with Gnus.
12393 * Getting Mail::                Reading your personal mail with Gnus.
12394 * Browsing the Web::            Getting messages from a plethora of Web sources.
12395 * IMAP::                        Using Gnus as a @acronym{IMAP} client.
12396 * Other Sources::               Reading directories, files, SOUP packets.
12397 * Combined Groups::             Combining groups into one group.
12398 * Email Based Diary::           Using mails to manage diary events in Gnus.
12399 * Gnus Unplugged::              Reading news and mail offline.
12400 @end menu
12401
12402
12403 @node Server Buffer
12404 @section Server Buffer
12405
12406 Traditionally, a @dfn{server} is a machine or a piece of software that
12407 one connects to, and then requests information from.  Gnus does not
12408 connect directly to any real servers, but does all transactions through
12409 one back end or other.  But that's just putting one layer more between
12410 the actual media and Gnus, so we might just as well say that each
12411 back end represents a virtual server.
12412
12413 For instance, the @code{nntp} back end may be used to connect to several
12414 different actual @acronym{NNTP} servers, or, perhaps, to many different ports
12415 on the same actual @acronym{NNTP} server.  You tell Gnus which back end to
12416 use, and what parameters to set by specifying a @dfn{select method}.
12417
12418 These select method specifications can sometimes become quite
12419 complicated---say, for instance, that you want to read from the
12420 @acronym{NNTP} server @samp{news.funet.fi} on port number 13, which
12421 hangs if queried for @acronym{NOV} headers and has a buggy select.  Ahem.
12422 Anyway, if you had to specify that for each group that used this
12423 server, that would be too much work, so Gnus offers a way of naming
12424 select methods, which is what you do in the server buffer.
12425
12426 To enter the server buffer, use the @kbd{^}
12427 (@code{gnus-group-enter-server-mode}) command in the group buffer.
12428
12429 @menu
12430 * Server Buffer Format::        You can customize the look of this buffer.
12431 * Server Commands::             Commands to manipulate servers.
12432 * Example Methods::             Examples server specifications.
12433 * Creating a Virtual Server::   An example session.
12434 * Server Variables::            Which variables to set.
12435 * Servers and Methods::         You can use server names as select methods.
12436 * Unavailable Servers::         Some servers you try to contact may be down.
12437 @end menu
12438
12439 @vindex gnus-server-mode-hook
12440 @code{gnus-server-mode-hook} is run when creating the server buffer.
12441
12442
12443 @node Server Buffer Format
12444 @subsection Server Buffer Format
12445 @cindex server buffer format
12446
12447 @vindex gnus-server-line-format
12448 You can change the look of the server buffer lines by changing the
12449 @code{gnus-server-line-format} variable.  This is a @code{format}-like
12450 variable, with some simple extensions:
12451
12452 @table @samp
12453
12454 @item h
12455 How the news is fetched---the back end name.
12456
12457 @item n
12458 The name of this server.
12459
12460 @item w
12461 Where the news is to be fetched from---the address.
12462
12463 @item s
12464 The opened/closed/denied status of the server.
12465
12466 @item a
12467 Whether this server is agentized.
12468 @end table
12469
12470 @vindex gnus-server-mode-line-format
12471 The mode line can also be customized by using the
12472 @code{gnus-server-mode-line-format} variable (@pxref{Mode Line
12473 Formatting}).  The following specs are understood:
12474
12475 @table @samp
12476 @item S
12477 Server name.
12478
12479 @item M
12480 Server method.
12481 @end table
12482
12483 Also @pxref{Formatting Variables}.
12484
12485
12486 @node Server Commands
12487 @subsection Server Commands
12488 @cindex server commands
12489
12490 @table @kbd
12491
12492 @item v
12493 @kindex v (Server)
12494 @cindex keys, reserved for users (Server)
12495 The key @kbd{v} is reserved for users.  You can bind it key to some
12496 function or better use it as a prefix key.
12497
12498 @item a
12499 @kindex a (Server)
12500 @findex gnus-server-add-server
12501 Add a new server (@code{gnus-server-add-server}).
12502
12503 @item e
12504 @kindex e (Server)
12505 @findex gnus-server-edit-server
12506 Edit a server (@code{gnus-server-edit-server}).
12507
12508 @item SPACE
12509 @kindex SPACE (Server)
12510 @findex gnus-server-read-server
12511 Browse the current server (@code{gnus-server-read-server}).
12512
12513 @item q
12514 @kindex q (Server)
12515 @findex gnus-server-exit
12516 Return to the group buffer (@code{gnus-server-exit}).
12517
12518 @item k
12519 @kindex k (Server)
12520 @findex gnus-server-kill-server
12521 Kill the current server (@code{gnus-server-kill-server}).
12522
12523 @item y
12524 @kindex y (Server)
12525 @findex gnus-server-yank-server
12526 Yank the previously killed server (@code{gnus-server-yank-server}).
12527
12528 @item c
12529 @kindex c (Server)
12530 @findex gnus-server-copy-server
12531 Copy the current server (@code{gnus-server-copy-server}).
12532
12533 @item l
12534 @kindex l (Server)
12535 @findex gnus-server-list-servers
12536 List all servers (@code{gnus-server-list-servers}).
12537
12538 @item s
12539 @kindex s (Server)
12540 @findex gnus-server-scan-server
12541 Request that the server scan its sources for new articles
12542 (@code{gnus-server-scan-server}).  This is mainly sensible with mail
12543 servers.
12544
12545 @item g
12546 @kindex g (Server)
12547 @findex gnus-server-regenerate-server
12548 Request that the server regenerate all its data structures
12549 (@code{gnus-server-regenerate-server}).  This can be useful if you have
12550 a mail back end that has gotten out of sync.
12551
12552 @end table
12553
12554
12555 @node Example Methods
12556 @subsection Example Methods
12557
12558 Most select methods are pretty simple and self-explanatory:
12559
12560 @lisp
12561 (nntp "news.funet.fi")
12562 @end lisp
12563
12564 Reading directly from the spool is even simpler:
12565
12566 @lisp
12567 (nnspool "")
12568 @end lisp
12569
12570 As you can see, the first element in a select method is the name of the
12571 back end, and the second is the @dfn{address}, or @dfn{name}, if you
12572 will.
12573
12574 After these two elements, there may be an arbitrary number of
12575 @code{(@var{variable} @var{form})} pairs.
12576
12577 To go back to the first example---imagine that you want to read from
12578 port 15 on that machine.  This is what the select method should
12579 look like then:
12580
12581 @lisp
12582 (nntp "news.funet.fi" (nntp-port-number 15))
12583 @end lisp
12584
12585 You should read the documentation to each back end to find out what
12586 variables are relevant, but here's an @code{nnmh} example:
12587
12588 @code{nnmh} is a mail back end that reads a spool-like structure.  Say
12589 you have two structures that you wish to access: One is your private
12590 mail spool, and the other is a public one.  Here's the possible spec for
12591 your private mail:
12592
12593 @lisp
12594 (nnmh "private" (nnmh-directory "~/private/mail/"))
12595 @end lisp
12596
12597 (This server is then called @samp{private}, but you may have guessed
12598 that.)
12599
12600 Here's the method for a public spool:
12601
12602 @lisp
12603 (nnmh "public"
12604       (nnmh-directory "/usr/information/spool/")
12605       (nnmh-get-new-mail nil))
12606 @end lisp
12607
12608 @cindex proxy
12609 @cindex firewall
12610
12611 If you are behind a firewall and only have access to the @acronym{NNTP}
12612 server from the firewall machine, you can instruct Gnus to @code{rlogin}
12613 on the firewall machine and telnet from there to the @acronym{NNTP} server.
12614 Doing this can be rather fiddly, but your virtual server definition
12615 should probably look something like this:
12616
12617 @lisp
12618 (nntp "firewall"
12619       (nntp-open-connection-function nntp-open-via-rlogin-and-telnet)
12620       (nntp-via-address "the.firewall.machine")
12621       (nntp-address "the.real.nntp.host")
12622       (nntp-end-of-line "\n"))
12623 @end lisp
12624
12625 If you want to use the wonderful @code{ssh} program to provide a
12626 compressed connection over the modem line, you could add the following
12627 configuration to the example above:
12628
12629 @lisp
12630       (nntp-via-rlogin-command "ssh")
12631 @end lisp
12632
12633 See also @code{nntp-via-rlogin-command-switches}.  Here's an example for
12634 an indirect connection:
12635 @lisp
12636 (setq gnus-select-method
12637       '(nntp "indirect"
12638              (nntp-address "news.server.example")
12639              (nntp-via-user-name "intermediate_user_name")
12640              (nntp-via-address "intermediate.host.example")
12641              (nntp-via-rlogin-command "ssh")
12642              (nntp-end-of-line "\n")
12643              (nntp-via-rlogin-command-switches ("-C" "-t" "-e" "none"))
12644              (nntp-open-connection-function nntp-open-via-rlogin-and-telnet)))
12645 @end lisp
12646
12647 If you're behind a firewall, but have direct access to the outside world
12648 through a wrapper command like "runsocks", you could open a socksified
12649 telnet connection to the news server as follows:
12650
12651 @lisp
12652 (nntp "outside"
12653       (nntp-pre-command "runsocks")
12654       (nntp-open-connection-function nntp-open-via-telnet)
12655       (nntp-address "the.news.server")
12656       (nntp-end-of-line "\n"))
12657 @end lisp
12658
12659 This means that you have to have set up @code{ssh-agent} correctly to
12660 provide automatic authorization, of course.  And to get a compressed
12661 connection, you have to have the @samp{Compression} option in the
12662 @code{ssh} @file{config} file.
12663
12664
12665 @node Creating a Virtual Server
12666 @subsection Creating a Virtual Server
12667
12668 If you're saving lots of articles in the cache by using persistent
12669 articles, you may want to create a virtual server to read the cache.
12670
12671 First you need to add a new server.  The @kbd{a} command does that.  It
12672 would probably be best to use @code{nnml} to read the cache.  You
12673 could also use @code{nnspool} or @code{nnmh}, though.
12674
12675 Type @kbd{a nnml RET cache RET}.
12676
12677 You should now have a brand new @code{nnml} virtual server called
12678 @samp{cache}.  You now need to edit it to have the right definitions.
12679 Type @kbd{e} to edit the server.  You'll be entered into a buffer that
12680 will contain the following:
12681
12682 @lisp
12683 (nnml "cache")
12684 @end lisp
12685
12686 Change that to:
12687
12688 @lisp
12689 (nnml "cache"
12690          (nnml-directory "~/News/cache/")
12691          (nnml-active-file "~/News/cache/active"))
12692 @end lisp
12693
12694 Type @kbd{C-c C-c} to return to the server buffer.  If you now press
12695 @kbd{RET} over this virtual server, you should be entered into a browse
12696 buffer, and you should be able to enter any of the groups displayed.
12697
12698
12699 @node Server Variables
12700 @subsection Server Variables
12701 @cindex server variables
12702 @cindex server parameters
12703
12704 One sticky point when defining variables (both on back ends and in Emacs
12705 in general) is that some variables are typically initialized from other
12706 variables when the definition of the variables is being loaded.  If you
12707 change the ``base'' variable after the variables have been loaded, you
12708 won't change the ``derived'' variables.
12709
12710 This typically affects directory and file variables.  For instance,
12711 @code{nnml-directory} is @file{~/Mail/} by default, and all @code{nnml}
12712 directory variables are initialized from that variable, so
12713 @code{nnml-active-file} will be @file{~/Mail/active}.  If you define a
12714 new virtual @code{nnml} server, it will @emph{not} suffice to set just
12715 @code{nnml-directory}---you have to explicitly set all the file
12716 variables to be what you want them to be.  For a complete list of
12717 variables for each back end, see each back end's section later in this
12718 manual, but here's an example @code{nnml} definition:
12719
12720 @lisp
12721 (nnml "public"
12722       (nnml-directory "~/my-mail/")
12723       (nnml-active-file "~/my-mail/active")
12724       (nnml-newsgroups-file "~/my-mail/newsgroups"))
12725 @end lisp
12726
12727 Server variables are often called @dfn{server parameters}.
12728
12729 @node Servers and Methods
12730 @subsection Servers and Methods
12731
12732 Wherever you would normally use a select method
12733 (e.g. @code{gnus-secondary-select-method}, in the group select method,
12734 when browsing a foreign server) you can use a virtual server name
12735 instead.  This could potentially save lots of typing.  And it's nice all
12736 over.
12737
12738
12739 @node Unavailable Servers
12740 @subsection Unavailable Servers
12741
12742 If a server seems to be unreachable, Gnus will mark that server as
12743 @code{denied}.  That means that any subsequent attempt to make contact
12744 with that server will just be ignored.  ``It can't be opened,'' Gnus
12745 will tell you, without making the least effort to see whether that is
12746 actually the case or not.
12747
12748 That might seem quite naughty, but it does make sense most of the time.
12749 Let's say you have 10 groups subscribed to on server
12750 @samp{nephelococcygia.com}.  This server is located somewhere quite far
12751 away from you and the machine is quite slow, so it takes 1 minute just
12752 to find out that it refuses connection to you today.  If Gnus were to
12753 attempt to do that 10 times, you'd be quite annoyed, so Gnus won't
12754 attempt to do that.  Once it has gotten a single ``connection refused'',
12755 it will regard that server as ``down''.
12756
12757 So, what happens if the machine was only feeling unwell temporarily?
12758 How do you test to see whether the machine has come up again?
12759
12760 You jump to the server buffer (@pxref{Server Buffer}) and poke it
12761 with the following commands:
12762
12763 @table @kbd
12764
12765 @item O
12766 @kindex O (Server)
12767 @findex gnus-server-open-server
12768 Try to establish connection to the server on the current line
12769 (@code{gnus-server-open-server}).
12770
12771 @item C
12772 @kindex C (Server)
12773 @findex gnus-server-close-server
12774 Close the connection (if any) to the server
12775 (@code{gnus-server-close-server}).
12776
12777 @item D
12778 @kindex D (Server)
12779 @findex gnus-server-deny-server
12780 Mark the current server as unreachable
12781 (@code{gnus-server-deny-server}).
12782
12783 @item M-o
12784 @kindex M-o (Server)
12785 @findex gnus-server-open-all-servers
12786 Open the connections to all servers in the buffer
12787 (@code{gnus-server-open-all-servers}).
12788
12789 @item M-c
12790 @kindex M-c (Server)
12791 @findex gnus-server-close-all-servers
12792 Close the connections to all servers in the buffer
12793 (@code{gnus-server-close-all-servers}).
12794
12795 @item R
12796 @kindex R (Server)
12797 @findex gnus-server-remove-denials
12798 Remove all marks to whether Gnus was denied connection from any servers
12799 (@code{gnus-server-remove-denials}).
12800
12801 @item L
12802 @kindex L (Server)
12803 @findex gnus-server-offline-server
12804 Set server status to offline (@code{gnus-server-offline-server}).
12805
12806 @end table
12807
12808
12809 @node Getting News
12810 @section Getting News
12811 @cindex reading news
12812 @cindex news back ends
12813
12814 A newsreader is normally used for reading news.  Gnus currently provides
12815 only two methods of getting news---it can read from an @acronym{NNTP} server,
12816 or it can read from a local spool.
12817
12818 @menu
12819 * NNTP::                        Reading news from an @acronym{NNTP} server.
12820 * News Spool::                  Reading news from the local spool.
12821 @end menu
12822
12823
12824 @node NNTP
12825 @subsection NNTP
12826 @cindex nntp
12827
12828 Subscribing to a foreign group from an @acronym{NNTP} server is rather easy.
12829 You just specify @code{nntp} as method and the address of the @acronym{NNTP}
12830 server as the, uhm, address.
12831
12832 If the @acronym{NNTP} server is located at a non-standard port, setting the
12833 third element of the select method to this port number should allow you
12834 to connect to the right port.  You'll have to edit the group info for
12835 that (@pxref{Foreign Groups}).
12836
12837 The name of the foreign group can be the same as a native group.  In
12838 fact, you can subscribe to the same group from as many different servers
12839 you feel like.  There will be no name collisions.
12840
12841 The following variables can be used to create a virtual @code{nntp}
12842 server:
12843
12844 @table @code
12845
12846 @item nntp-server-opened-hook
12847 @vindex nntp-server-opened-hook
12848 @cindex @sc{mode reader}
12849 @cindex authinfo
12850 @cindex authentification
12851 @cindex nntp authentification
12852 @findex nntp-send-authinfo
12853 @findex nntp-send-mode-reader
12854 is run after a connection has been made.  It can be used to send
12855 commands to the @acronym{NNTP} server after it has been contacted.  By
12856 default it sends the command @code{MODE READER} to the server with the
12857 @code{nntp-send-mode-reader} function.  This function should always be
12858 present in this hook.
12859
12860 @item nntp-authinfo-function
12861 @vindex nntp-authinfo-function
12862 @findex nntp-send-authinfo
12863 @vindex nntp-authinfo-file
12864 This function will be used to send @samp{AUTHINFO} to the @acronym{NNTP}
12865 server.  The default function is @code{nntp-send-authinfo}, which looks
12866 through your @file{~/.authinfo} (or whatever you've set the
12867 @code{nntp-authinfo-file} variable to) for applicable entries.  If none
12868 are found, it will prompt you for a login name and a password.  The
12869 format of the @file{~/.authinfo} file is (almost) the same as the
12870 @code{ftp} @file{~/.netrc} file, which is defined in the @code{ftp}
12871 manual page, but here are the salient facts:
12872
12873 @enumerate
12874 @item
12875 The file contains one or more line, each of which define one server.
12876
12877 @item
12878 Each line may contain an arbitrary number of token/value pairs.
12879
12880 The valid tokens include @samp{machine}, @samp{login}, @samp{password},
12881 @samp{default}.  In addition Gnus introduces two new tokens, not present
12882 in the original @file{.netrc}/@code{ftp} syntax, namely @samp{port} and
12883 @samp{force}.  (This is the only way the @file{.authinfo} file format
12884 deviates from the @file{.netrc} file format.)  @samp{port} is used to
12885 indicate what port on the server the credentials apply to and
12886 @samp{force} is explained below.
12887
12888 @end enumerate
12889
12890 Here's an example file:
12891
12892 @example
12893 machine news.uio.no login larsi password geheimnis
12894 machine nntp.ifi.uio.no login larsi force yes
12895 @end example
12896
12897 The token/value pairs may appear in any order; @samp{machine} doesn't
12898 have to be first, for instance.
12899
12900 In this example, both login name and password have been supplied for the
12901 former server, while the latter has only the login name listed, and the
12902 user will be prompted for the password.  The latter also has the
12903 @samp{force} tag, which means that the authinfo will be sent to the
12904 @var{nntp} server upon connection; the default (i.e., when there is not
12905 @samp{force} tag) is to not send authinfo to the @var{nntp} server
12906 until the @var{nntp} server asks for it.
12907
12908 You can also add @samp{default} lines that will apply to all servers
12909 that don't have matching @samp{machine} lines.
12910
12911 @example
12912 default force yes
12913 @end example
12914
12915 This will force sending @samp{AUTHINFO} commands to all servers not
12916 previously mentioned.
12917
12918 Remember to not leave the @file{~/.authinfo} file world-readable.
12919
12920 @item nntp-server-action-alist
12921 @vindex nntp-server-action-alist
12922 This is a list of regexps to match on server types and actions to be
12923 taken when matches are made.  For instance, if you want Gnus to beep
12924 every time you connect to innd, you could say something like:
12925
12926 @lisp
12927 (setq nntp-server-action-alist
12928       '(("innd" (ding))))
12929 @end lisp
12930
12931 You probably don't want to do that, though.
12932
12933 The default value is
12934
12935 @lisp
12936 '(("nntpd 1\\.5\\.11t"
12937    (remove-hook 'nntp-server-opened-hook
12938                 'nntp-send-mode-reader)))
12939 @end lisp
12940
12941 This ensures that Gnus doesn't send the @code{MODE READER} command to
12942 nntpd 1.5.11t, since that command chokes that server, I've been told.
12943
12944 @item nntp-maximum-request
12945 @vindex nntp-maximum-request
12946 If the @acronym{NNTP} server doesn't support @acronym{NOV} headers, this back end
12947 will collect headers by sending a series of @code{head} commands.  To
12948 speed things up, the back end sends lots of these commands without
12949 waiting for reply, and then reads all the replies.  This is controlled
12950 by the @code{nntp-maximum-request} variable, and is 400 by default.  If
12951 your network is buggy, you should set this to 1.
12952
12953 @item nntp-connection-timeout
12954 @vindex nntp-connection-timeout
12955 If you have lots of foreign @code{nntp} groups that you connect to
12956 regularly, you're sure to have problems with @acronym{NNTP} servers not
12957 responding properly, or being too loaded to reply within reasonable
12958 time.  This is can lead to awkward problems, which can be helped
12959 somewhat by setting @code{nntp-connection-timeout}.  This is an integer
12960 that says how many seconds the @code{nntp} back end should wait for a
12961 connection before giving up.  If it is @code{nil}, which is the default,
12962 no timeouts are done.
12963
12964 @item nntp-nov-is-evil
12965 @vindex nntp-nov-is-evil
12966 If the @acronym{NNTP} server does not support @acronym{NOV}, you could set this
12967 variable to @code{t}, but @code{nntp} usually checks automatically whether @acronym{NOV}
12968 can be used.
12969
12970 @item nntp-xover-commands
12971 @vindex nntp-xover-commands
12972 @cindex @acronym{NOV}
12973 @cindex XOVER
12974 List of strings used as commands to fetch @acronym{NOV} lines from a
12975 server.  The default value of this variable is @code{("XOVER"
12976 "XOVERVIEW")}.
12977
12978 @item nntp-nov-gap
12979 @vindex nntp-nov-gap
12980 @code{nntp} normally sends just one big request for @acronym{NOV} lines to
12981 the server.  The server responds with one huge list of lines.  However,
12982 if you have read articles 2-5000 in the group, and only want to read
12983 article 1 and 5001, that means that @code{nntp} will fetch 4999 @acronym{NOV}
12984 lines that you will not need.  This variable says how
12985 big a gap between two consecutive articles is allowed to be before the
12986 @code{XOVER} request is split into several request.  Note that if your
12987 network is fast, setting this variable to a really small number means
12988 that fetching will probably be slower.  If this variable is @code{nil},
12989 @code{nntp} will never split requests.  The default is 5.
12990
12991 @item nntp-prepare-server-hook
12992 @vindex nntp-prepare-server-hook
12993 A hook run before attempting to connect to an @acronym{NNTP} server.
12994
12995 @item nntp-record-commands
12996 @vindex nntp-record-commands
12997 If non-@code{nil}, @code{nntp} will log all commands it sends to the
12998 @acronym{NNTP} server (along with a timestamp) in the @samp{*nntp-log*}
12999 buffer.  This is useful if you are debugging a Gnus/@acronym{NNTP} connection
13000 that doesn't seem to work.
13001
13002 @item nntp-open-connection-function
13003 @vindex nntp-open-connection-function
13004 It is possible to customize how the connection to the nntp server will
13005 be opened.  If you specify an @code{nntp-open-connection-function}
13006 parameter, Gnus will use that function to establish the connection.
13007 Seven pre-made functions are supplied.  These functions can be grouped
13008 in two categories: direct connection functions (four pre-made), and
13009 indirect ones (three pre-made).
13010
13011 @item nntp-prepare-post-hook
13012 @vindex nntp-prepare-post-hook
13013 A hook run just before posting an article.  If there is no
13014 @code{Message-ID} header in the article and the news server provides the
13015 recommended ID, it will be added to the article before running this
13016 hook.  It is useful to make @code{Cancel-Lock} headers even if you
13017 inhibit Gnus to add a @code{Message-ID} header, you could say:
13018
13019 @lisp
13020 (add-hook 'nntp-prepare-post-hook 'canlock-insert-header)
13021 @end lisp
13022
13023 Note that not all servers support the recommended ID.  This works for
13024 INN versions 2.3.0 and later, for instance.
13025
13026 @end table
13027
13028 @menu
13029 * Direct Functions::            Connecting directly to the server.
13030 * Indirect Functions::          Connecting indirectly to the server.
13031 * Common Variables::            Understood by several connection functions.
13032 * NNTP marks::                  Storing marks for @acronym{NNTP} servers.
13033 @end menu
13034
13035
13036 @node Direct Functions
13037 @subsubsection Direct Functions
13038 @cindex direct connection functions
13039
13040 These functions are called direct because they open a direct connection
13041 between your machine and the @acronym{NNTP} server.  The behavior of these
13042 functions is also affected by commonly understood variables
13043 (@pxref{Common Variables}).
13044
13045 @table @code
13046 @findex nntp-open-network-stream
13047 @item nntp-open-network-stream
13048 This is the default, and simply connects to some port or other on the
13049 remote system.
13050
13051 @findex nntp-open-tls-stream
13052 @item nntp-open-tls-stream
13053 Opens a connection to a server over a @dfn{secure} channel.  To use
13054 this you must have @uref{http://www.gnu.org/software/gnutls/, GNUTLS}
13055 installed.  You then define a server as follows:
13056
13057 @lisp
13058 ;; @r{"nntps" is port 563 and is predefined in our @file{/etc/services}}
13059 ;; @r{however, @samp{gnutls-cli -p} doesn't like named ports.}
13060 ;;
13061 (nntp "snews.bar.com"
13062       (nntp-open-connection-function nntp-open-tls-stream)
13063       (nntp-port-number )
13064       (nntp-address "snews.bar.com"))
13065 @end lisp
13066
13067 @findex nntp-open-ssl-stream
13068 @item nntp-open-ssl-stream
13069 Opens a connection to a server over a @dfn{secure} channel.  To use
13070 this you must have @uref{http://www.openssl.org, OpenSSL} or
13071 @uref{ftp://ftp.psy.uq.oz.au/pub/Crypto/SSL, SSLeay} installed.  You
13072 then define a server as follows:
13073
13074 @lisp
13075 ;; @r{"snews" is port 563 and is predefined in our @file{/etc/services}}
13076 ;; @r{however, @samp{openssl s_client -port} doesn't like named ports.}
13077 ;;
13078 (nntp "snews.bar.com"
13079       (nntp-open-connection-function nntp-open-ssl-stream)
13080       (nntp-port-number 563)
13081       (nntp-address "snews.bar.com"))
13082 @end lisp
13083
13084 @findex nntp-open-telnet-stream
13085 @item nntp-open-telnet-stream
13086 Opens a connection to an @acronym{NNTP} server by simply @samp{telnet}'ing
13087 it.  You might wonder why this function exists, since we have the
13088 default @code{nntp-open-network-stream} which would do the job.  (One
13089 of) the reason(s) is that if you are behind a firewall but have direct
13090 connections to the outside world thanks to a command wrapper like
13091 @code{runsocks}, you can use it like this:
13092
13093 @lisp
13094 (nntp "socksified"
13095       (nntp-pre-command "runsocks")
13096       (nntp-open-connection-function nntp-open-telnet-stream)
13097       (nntp-address "the.news.server"))
13098 @end lisp
13099
13100 With the default method, you would need to wrap your whole Emacs
13101 session, which is not a good idea.
13102 @end table
13103
13104
13105 @node Indirect Functions
13106 @subsubsection Indirect Functions
13107 @cindex indirect connection functions
13108
13109 These functions are called indirect because they connect to an
13110 intermediate host before actually connecting to the @acronym{NNTP} server.
13111 All of these functions and related variables are also said to belong to
13112 the ``via'' family of connection: they're all prefixed with ``via'' to make
13113 things cleaner.  The behavior of these functions is also affected by
13114 commonly understood variables (@pxref{Common Variables}).
13115
13116 @table @code
13117 @item nntp-open-via-rlogin-and-telnet
13118 @findex nntp-open-via-rlogin-and-telnet
13119 Does an @samp{rlogin} on a remote system, and then does a @samp{telnet}
13120 to the real @acronym{NNTP} server from there.  This is useful for instance if
13121 you need to connect to a firewall machine first.
13122
13123 @code{nntp-open-via-rlogin-and-telnet}-specific variables:
13124
13125 @table @code
13126 @item nntp-via-rlogin-command
13127 @vindex nntp-via-rlogin-command
13128 Command used to log in on the intermediate host.  The default is
13129 @samp{rsh}, but @samp{ssh} is a popular alternative.
13130
13131 @item nntp-via-rlogin-command-switches
13132 @vindex nntp-via-rlogin-command-switches
13133 List of strings to be used as the switches to
13134 @code{nntp-via-rlogin-command}.  The default is @code{nil}.  If you use
13135 @samp{ssh} for @code{nntp-via-rlogin-command}, you may set this to
13136 @samp{("-C")} in order to compress all data connections, otherwise set
13137 this to @samp{("-t" "-e" "none")} or @samp{("-C" "-t" "-e" "none")} if
13138 the telnet command requires a pseudo-tty allocation on an intermediate
13139 host.
13140 @end table
13141
13142 Note that you may want to change the value for @code{nntp-end-of-line}
13143 to @samp{\n} (@pxref{Common Variables}).
13144
13145 @item nntp-open-via-rlogin-and-netcat
13146 @findex nntp-open-via-rlogin-and-netcat
13147 Does essentially the same, but uses
13148 @uref{http://netcat.sourceforge.net/, netcat} instead of @samp{telnet}
13149 to connect to the real @acronym{NNTP} server from the intermediate host.
13150
13151 @code{nntp-open-via-rlogin-and-netcat}-specific variables:
13152
13153 @table @code
13154 @item nntp-via-netcat-command
13155 @vindex nntp-via-netcat-command
13156 Command used to connect to the real @acronym{NNTP} server from the
13157 intermediate host.  The default is @samp{nc}.  You can also use other
13158 programs like @uref{http://www.imasy.or.jp/~gotoh/ssh/connect.html,
13159 connect} instead.
13160
13161 @item nntp-via-netcat-switches
13162 @vindex nntp-via-netcat-switches
13163 List of strings to be used as the switches to the
13164 @code{nntp-via-telnet-command} command.  The default is @code{nil}.
13165
13166 @item nntp-via-rlogin-command
13167 @vindex nntp-via-rlogin-command
13168 Command used to log in on the intermediate host.  The default is
13169 @samp{rsh}, but @samp{ssh} is a popular alternative.
13170
13171 @item nntp-via-rlogin-command-switches
13172 @vindex nntp-via-rlogin-command-switches
13173 List of strings to be used as the switches to
13174 @code{nntp-via-rlogin-command}.  The default is @code{nil}.
13175 @end table
13176
13177 @item nntp-open-via-telnet-and-telnet
13178 @findex nntp-open-via-telnet-and-telnet
13179 Does essentially the same, but uses @samp{telnet} instead of
13180 @samp{rlogin} to connect to the intermediate host.
13181
13182 @code{nntp-open-via-telnet-and-telnet}-specific variables:
13183
13184 @table @code
13185 @item nntp-via-telnet-command
13186 @vindex nntp-via-telnet-command
13187 Command used to @code{telnet} the intermediate host.  The default is
13188 @samp{telnet}.
13189
13190 @item nntp-via-telnet-switches
13191 @vindex nntp-via-telnet-switches
13192 List of strings to be used as the switches to the
13193 @code{nntp-via-telnet-command} command.  The default is @samp{("-8")}.
13194
13195 @item nntp-via-user-password
13196 @vindex nntp-via-user-password
13197 Password to use when logging in on the intermediate host.
13198
13199 @item nntp-via-envuser
13200 @vindex nntp-via-envuser
13201 If non-@code{nil}, the intermediate @code{telnet} session (client and
13202 server both) will support the @code{ENVIRON} option and not prompt for
13203 login name.  This works for Solaris @code{telnet}, for instance.
13204
13205 @item nntp-via-shell-prompt
13206 @vindex nntp-via-shell-prompt
13207 Regexp matching the shell prompt on the intermediate host.  The default
13208 is @samp{bash\\|\$ *\r?$\\|> *\r?}.
13209
13210 @end table
13211
13212 Note that you may want to change the value for @code{nntp-end-of-line}
13213 to @samp{\n} (@pxref{Common Variables}).
13214 @end table
13215
13216
13217 Here are some additional variables that are understood by all the above
13218 functions:
13219
13220 @table @code
13221
13222 @item nntp-via-user-name
13223 @vindex nntp-via-user-name
13224 User name to use when connecting to the intermediate host.
13225
13226 @item nntp-via-address
13227 @vindex nntp-via-address
13228 Address of the intermediate host to connect to.
13229
13230 @end table
13231
13232
13233 @node Common Variables
13234 @subsubsection Common Variables
13235
13236 The following variables affect the behavior of all, or several of the
13237 pre-made connection functions.  When not specified, all functions are
13238 affected (the values of the following variables will be used as the
13239 default if each virtual @code{nntp} server doesn't specify those server
13240 variables individually).
13241
13242 @table @code
13243
13244 @item nntp-pre-command
13245 @vindex nntp-pre-command
13246 A command wrapper to use when connecting through a non native
13247 connection function (all except @code{nntp-open-network-stream},
13248 @code{nntp-open-tls-stream}, and @code{nntp-open-ssl-stream}).  This is
13249 where you would put a @samp{SOCKS} wrapper for instance.
13250
13251 @item nntp-address
13252 @vindex nntp-address
13253 The address of the @acronym{NNTP} server.
13254
13255 @item nntp-port-number
13256 @vindex nntp-port-number
13257 Port number to connect to the @acronym{NNTP} server.  The default is
13258 @samp{nntp}.  If you use @acronym{NNTP} over
13259 @acronym{TLS}/@acronym{SSL}, you may want to use integer ports rather
13260 than named ports (i.e, use @samp{563} instead of @samp{snews} or
13261 @samp{nntps}), because external @acronym{TLS}/@acronym{SSL} tools may
13262 not work with named ports.
13263
13264 @item nntp-end-of-line
13265 @vindex nntp-end-of-line
13266 String to use as end-of-line marker when talking to the @acronym{NNTP}
13267 server.  This is @samp{\r\n} by default, but should be @samp{\n} when
13268 using a non native telnet connection function.
13269
13270 @item nntp-telnet-command
13271 @vindex nntp-telnet-command
13272 Command to use when connecting to the @acronym{NNTP} server through
13273 @samp{telnet}.  This is @emph{not} for an intermediate host.  This is
13274 just for the real @acronym{NNTP} server.  The default is
13275 @samp{telnet}.
13276
13277 @item nntp-telnet-switches
13278 @vindex nntp-telnet-switches
13279 A list of switches to pass to @code{nntp-telnet-command}.  The default
13280 is @samp{("-8")}.
13281
13282 @end table
13283
13284 @node NNTP marks
13285 @subsubsection NNTP marks
13286 @cindex storing NNTP marks
13287
13288 Gnus stores marks (@pxref{Marking Articles}) for @acronym{NNTP}
13289 servers in marks files.  A marks file records what marks you have set
13290 in a group and each file is specific to the corresponding server.
13291 Marks files are stored in @file{~/News/marks}
13292 (@code{nntp-marks-directory}) under a classic hierarchy resembling
13293 that of a news server, for example marks for the group
13294 @samp{gmane.discuss} on the news.gmane.org server will be stored in
13295 the file @file{~/News/marks/news.gmane.org/gmane/discuss/.marks}.
13296
13297 Marks files are useful because you can copy the @file{~/News/marks}
13298 directory (using rsync, scp or whatever) to another Gnus installation,
13299 and it will realize what articles you have read and marked.  The data
13300 in @file{~/News/marks} has priority over the same data in
13301 @file{~/.newsrc.eld}.
13302
13303 Note that marks files are very much server-specific: Gnus remembers
13304 the article numbers so if you don't use the same servers on both
13305 installations things are most likely to break (most @acronym{NNTP}
13306 servers do not use the same article numbers as any other server).
13307 However, if you use servers A, B, C on one installation and servers A,
13308 D, E on the other, you can sync the marks files for A and then you'll
13309 get synchronization for that server between the two installations.
13310
13311 Using @acronym{NNTP} marks can possibly incur a performance penalty so
13312 if Gnus feels sluggish, try setting the @code{nntp-marks-is-evil}
13313 variable to @code{t}.  Marks will then be stored in @file{~/.newsrc.eld}.
13314
13315 Related variables:
13316
13317 @table @code
13318
13319 @item nntp-marks-is-evil
13320 @vindex nntp-marks-is-evil
13321 If non-@code{nil}, this back end will ignore any marks files.  The
13322 default is @code{nil}.
13323
13324 @item nntp-marks-directory
13325 @vindex nntp-marks-directory
13326 The directory where marks for nntp groups will be stored.
13327
13328 @end table
13329
13330
13331 @node News Spool
13332 @subsection News Spool
13333 @cindex nnspool
13334 @cindex news spool
13335
13336 Subscribing to a foreign group from the local spool is extremely easy,
13337 and might be useful, for instance, to speed up reading groups that
13338 contain very big articles---@samp{alt.binaries.pictures.furniture}, for
13339 instance.
13340
13341 Anyway, you just specify @code{nnspool} as the method and @code{""} (or
13342 anything else) as the address.
13343
13344 If you have access to a local spool, you should probably use that as the
13345 native select method (@pxref{Finding the News}).  It is normally faster
13346 than using an @code{nntp} select method, but might not be.  It depends.
13347 You just have to try to find out what's best at your site.
13348
13349 @table @code
13350
13351 @item nnspool-inews-program
13352 @vindex nnspool-inews-program
13353 Program used to post an article.
13354
13355 @item nnspool-inews-switches
13356 @vindex nnspool-inews-switches
13357 Parameters given to the inews program when posting an article.
13358
13359 @item nnspool-spool-directory
13360 @vindex nnspool-spool-directory
13361 Where @code{nnspool} looks for the articles.  This is normally
13362 @file{/usr/spool/news/}.
13363
13364 @item nnspool-nov-directory
13365 @vindex nnspool-nov-directory
13366 Where @code{nnspool} will look for @acronym{NOV} files.  This is normally@*
13367 @file{/usr/spool/news/over.view/}.
13368
13369 @item nnspool-lib-dir
13370 @vindex nnspool-lib-dir
13371 Where the news lib dir is (@file{/usr/lib/news/} by default).
13372
13373 @item nnspool-active-file
13374 @vindex nnspool-active-file
13375 The name of the active file.
13376
13377 @item nnspool-newsgroups-file
13378 @vindex nnspool-newsgroups-file
13379 The name of the group descriptions file.
13380
13381 @item nnspool-history-file
13382 @vindex nnspool-history-file
13383 The name of the news history file.
13384
13385 @item nnspool-active-times-file
13386 @vindex nnspool-active-times-file
13387 The name of the active date file.
13388
13389 @item nnspool-nov-is-evil
13390 @vindex nnspool-nov-is-evil
13391 If non-@code{nil}, @code{nnspool} won't try to use any @acronym{NOV} files
13392 that it finds.
13393
13394 @item nnspool-sift-nov-with-sed
13395 @vindex nnspool-sift-nov-with-sed
13396 @cindex sed
13397 If non-@code{nil}, which is the default, use @code{sed} to get the
13398 relevant portion from the overview file.  If @code{nil},
13399 @code{nnspool} will load the entire file into a buffer and process it
13400 there.
13401
13402 @end table
13403
13404
13405 @node Getting Mail
13406 @section Getting Mail
13407 @cindex reading mail
13408 @cindex mail
13409
13410 Reading mail with a newsreader---isn't that just plain WeIrD? But of
13411 course.
13412
13413 @menu
13414 * Mail in a Newsreader::        Important introductory notes.
13415 * Getting Started Reading Mail::  A simple cookbook example.
13416 * Splitting Mail::              How to create mail groups.
13417 * Mail Sources::                How to tell Gnus where to get mail from.
13418 * Mail Back End Variables::     Variables for customizing mail handling.
13419 * Fancy Mail Splitting::        Gnus can do hairy splitting of incoming mail.
13420 * Group Mail Splitting::        Use group customize to drive mail splitting.
13421 * Incorporating Old Mail::      What about the old mail you have?
13422 * Expiring Mail::               Getting rid of unwanted mail.
13423 * Washing Mail::                Removing cruft from the mail you get.
13424 * Duplicates::                  Dealing with duplicated mail.
13425 * Not Reading Mail::            Using mail back ends for reading other files.
13426 * Choosing a Mail Back End::    Gnus can read a variety of mail formats.
13427 @end menu
13428
13429
13430 @node Mail in a Newsreader
13431 @subsection Mail in a Newsreader
13432
13433 If you are used to traditional mail readers, but have decided to switch
13434 to reading mail with Gnus, you may find yourself experiencing something
13435 of a culture shock.
13436
13437 Gnus does not behave like traditional mail readers.  If you want to make
13438 it behave that way, you can, but it's an uphill battle.
13439
13440 Gnus, by default, handles all its groups using the same approach.  This
13441 approach is very newsreaderly---you enter a group, see the new/unread
13442 messages, and when you read the messages, they get marked as read, and
13443 you don't see them any more.  (Unless you explicitly ask for them.)
13444
13445 In particular, you do not do anything explicitly to delete messages.
13446
13447 Does this mean that all the messages that have been marked as read are
13448 deleted?  How awful!
13449
13450 But, no, it means that old messages are @dfn{expired} according to some
13451 scheme or other.  For news messages, the expire process is controlled by
13452 the news administrator; for mail, the expire process is controlled by
13453 you.  The expire process for mail is covered in depth in @ref{Expiring
13454 Mail}.
13455
13456 What many Gnus users find, after using it a while for both news and
13457 mail, is that the transport mechanism has very little to do with how
13458 they want to treat a message.
13459
13460 Many people subscribe to several mailing lists.  These are transported
13461 via @acronym{SMTP}, and are therefore mail.  But we might go for weeks without
13462 answering, or even reading these messages very carefully.  We may not
13463 need to save them because if we should need to read one again, they are
13464 archived somewhere else.
13465
13466 Some people have local news groups which have only a handful of readers.
13467 These are transported via @acronym{NNTP}, and are therefore news.  But we may need
13468 to read and answer a large fraction of the messages very carefully in
13469 order to do our work.  And there may not be an archive, so we may need
13470 to save the interesting messages the same way we would personal mail.
13471
13472 The important distinction turns out to be not the transport mechanism,
13473 but other factors such as how interested we are in the subject matter,
13474 or how easy it is to retrieve the message if we need to read it again.
13475
13476 Gnus provides many options for sorting mail into ``groups'' which behave
13477 like newsgroups, and for treating each group (whether mail or news)
13478 differently.
13479
13480 Some users never get comfortable using the Gnus (ahem) paradigm and wish
13481 that Gnus should grow up and be a male, er, mail reader.  It is possible
13482 to whip Gnus into a more mailreaderly being, but, as said before, it's
13483 not easy.  People who prefer proper mail readers should try @sc{vm}
13484 instead, which is an excellent, and proper, mail reader.
13485
13486 I don't mean to scare anybody off, but I want to make it clear that you
13487 may be required to learn a new way of thinking about messages.  After
13488 you've been subjected to The Gnus Way, you will come to love it.  I can
13489 guarantee it.  (At least the guy who sold me the Emacs Subliminal
13490 Brain-Washing Functions that I've put into Gnus did guarantee it.  You
13491 Will Be Assimilated.  You Love Gnus.  You Love The Gnus Mail Way.
13492 You Do.)
13493
13494
13495 @node Getting Started Reading Mail
13496 @subsection Getting Started Reading Mail
13497
13498 It's quite easy to use Gnus to read your new mail.  You just plonk the
13499 mail back end of your choice into @code{gnus-secondary-select-methods},
13500 and things will happen automatically.
13501
13502 For instance, if you want to use @code{nnml} (which is a ``one file per
13503 mail'' back end), you could put the following in your @file{~/.gnus.el} file:
13504
13505 @lisp
13506 (setq gnus-secondary-select-methods '((nnml "")))
13507 @end lisp
13508
13509 Now, the next time you start Gnus, this back end will be queried for new
13510 articles, and it will move all the messages in your spool file to its
13511 directory, which is @file{~/Mail/} by default.  The new group that will
13512 be created (@samp{mail.misc}) will be subscribed, and you can read it
13513 like any other group.
13514
13515 You will probably want to split the mail into several groups, though:
13516
13517 @lisp
13518 (setq nnmail-split-methods
13519       '(("junk" "^From:.*Lars Ingebrigtsen")
13520         ("crazy" "^Subject:.*die\\|^Organization:.*flabby")
13521         ("other" "")))
13522 @end lisp
13523
13524 This will result in three new @code{nnml} mail groups being created:
13525 @samp{nnml:junk}, @samp{nnml:crazy}, and @samp{nnml:other}.  All the
13526 mail that doesn't fit into the first two groups will be placed in the
13527 last group.
13528
13529 This should be sufficient for reading mail with Gnus.  You might want to
13530 give the other sections in this part of the manual a perusal, though.
13531 Especially @pxref{Choosing a Mail Back End} and @pxref{Expiring Mail}.
13532
13533
13534 @node Splitting Mail
13535 @subsection Splitting Mail
13536 @cindex splitting mail
13537 @cindex mail splitting
13538 @cindex mail filtering (splitting)
13539
13540 @vindex nnmail-split-methods
13541 The @code{nnmail-split-methods} variable says how the incoming mail is
13542 to be split into groups.
13543
13544 @lisp
13545 (setq nnmail-split-methods
13546   '(("mail.junk" "^From:.*Lars Ingebrigtsen")
13547     ("mail.crazy" "^Subject:.*die\\|^Organization:.*flabby")
13548     ("mail.other" "")))
13549 @end lisp
13550
13551 This variable is a list of lists, where the first element of each of
13552 these lists is the name of the mail group (they do not have to be called
13553 something beginning with @samp{mail}, by the way), and the second
13554 element is a regular expression used on the header of each mail to
13555 determine if it belongs in this mail group.  The first string may
13556 contain @samp{\\1} forms, like the ones used by @code{replace-match} to
13557 insert sub-expressions from the matched text.  For instance:
13558
13559 @lisp
13560 ("list.\\1" "From:.* \\(.*\\)-list@@majordomo.com")
13561 @end lisp
13562
13563 @noindent
13564 In that case, @code{nnmail-split-lowercase-expanded} controls whether
13565 the inserted text should be made lowercase.  @xref{Fancy Mail Splitting}.
13566
13567 The second element can also be a function.  In that case, it will be
13568 called narrowed to the headers with the first element of the rule as the
13569 argument.  It should return a non-@code{nil} value if it thinks that the
13570 mail belongs in that group.
13571
13572 @cindex @samp{bogus} group
13573 The last of these groups should always be a general one, and the regular
13574 expression should @emph{always} be @samp{""} so that it matches any mails
13575 that haven't been matched by any of the other regexps.  (These rules are
13576 processed from the beginning of the alist toward the end.  The first rule
13577 to make a match will ``win'', unless you have crossposting enabled.  In
13578 that case, all matching rules will ``win''.)  If no rule matched, the mail
13579 will end up in the @samp{bogus} group.  When new groups are created by
13580 splitting mail, you may want to run @code{gnus-group-find-new-groups} to
13581 see the new groups.  This also applies to the @samp{bogus} group.
13582
13583 If you like to tinker with this yourself, you can set this variable to a
13584 function of your choice.  This function will be called without any
13585 arguments in a buffer narrowed to the headers of an incoming mail
13586 message.  The function should return a list of group names that it
13587 thinks should carry this mail message.
13588
13589 Note that the mail back ends are free to maul the poor, innocent,
13590 incoming headers all they want to.  They all add @code{Lines} headers;
13591 some add @code{X-Gnus-Group} headers; most rename the Unix mbox
13592 @code{From<SPACE>} line to something else.
13593
13594 @vindex nnmail-crosspost
13595 The mail back ends all support cross-posting.  If several regexps match,
13596 the mail will be ``cross-posted'' to all those groups.
13597 @code{nnmail-crosspost} says whether to use this mechanism or not.  Note
13598 that no articles are crossposted to the general (@samp{""}) group.
13599
13600 @vindex nnmail-crosspost-link-function
13601 @cindex crosspost
13602 @cindex links
13603 @code{nnmh} and @code{nnml} makes crossposts by creating hard links to
13604 the crossposted articles.  However, not all file systems support hard
13605 links.  If that's the case for you, set
13606 @code{nnmail-crosspost-link-function} to @code{copy-file}.  (This
13607 variable is @code{add-name-to-file} by default.)
13608
13609 @kindex M-x nnmail-split-history
13610 @findex nnmail-split-history
13611 If you wish to see where the previous mail split put the messages, you
13612 can use the @kbd{M-x nnmail-split-history} command.  If you wish to see
13613 where re-spooling messages would put the messages, you can use
13614 @code{gnus-summary-respool-trace} and related commands (@pxref{Mail
13615 Group Commands}).
13616
13617 @vindex nnmail-split-header-length-limit
13618 Header lines longer than the value of
13619 @code{nnmail-split-header-length-limit} are excluded from the split
13620 function.
13621
13622 @vindex nnmail-mail-splitting-charset
13623 @vindex nnmail-mail-splitting-decodes
13624 By default the splitting codes @acronym{MIME} decodes headers so you
13625 can match on non-@acronym{ASCII} strings.  The
13626 @code{nnmail-mail-splitting-charset} variable specifies the default
13627 charset for decoding.  The behavior can be turned off completely by
13628 binding @code{nnmail-mail-splitting-decodes} to @code{nil}, which is
13629 useful if you want to match articles based on the raw header data.
13630
13631 @vindex nnmail-resplit-incoming
13632 By default, splitting is performed on all incoming messages.  If you
13633 specify a @code{directory} entry for the variable @code{mail-sources}
13634 (@pxref{Mail Source Specifiers}), however, then splitting does
13635 @emph{not} happen by default.  You can set the variable
13636 @code{nnmail-resplit-incoming} to a non-@code{nil} value to make
13637 splitting happen even in this case.  (This variable has no effect on
13638 other kinds of entries.)
13639
13640 Gnus gives you all the opportunity you could possibly want for shooting
13641 yourself in the foot.  Let's say you create a group that will contain
13642 all the mail you get from your boss.  And then you accidentally
13643 unsubscribe from the group.  Gnus will still put all the mail from your
13644 boss in the unsubscribed group, and so, when your boss mails you ``Have
13645 that report ready by Monday or you're fired!'', you'll never see it and,
13646 come Tuesday, you'll still believe that you're gainfully employed while
13647 you really should be out collecting empty bottles to save up for next
13648 month's rent money.
13649
13650
13651 @node Mail Sources
13652 @subsection Mail Sources
13653
13654 Mail can be gotten from many different sources---the mail spool, from
13655 a @acronym{POP} mail server, from a procmail directory, or from a
13656 maildir, for instance.
13657
13658 @menu
13659 * Mail Source Specifiers::      How to specify what a mail source is.
13660 * Mail Source Customization::   Some variables that influence things.
13661 * Fetching Mail::               Using the mail source specifiers.
13662 @end menu
13663
13664
13665 @node Mail Source Specifiers
13666 @subsubsection Mail Source Specifiers
13667 @cindex POP
13668 @cindex mail server
13669 @cindex procmail
13670 @cindex mail spool
13671 @cindex mail source
13672
13673 You tell Gnus how to fetch mail by setting @code{mail-sources}
13674 (@pxref{Fetching Mail}) to a @dfn{mail source specifier}.
13675
13676 Here's an example:
13677
13678 @lisp
13679 (pop :server "pop3.mailserver.com" :user "myname")
13680 @end lisp
13681
13682 As can be observed, a mail source specifier is a list where the first
13683 element is a @dfn{mail source type}, followed by an arbitrary number of
13684 @dfn{keywords}.  Keywords that are not explicitly specified are given
13685 default values.
13686
13687 The following mail source types are available:
13688
13689 @table @code
13690 @item file
13691 Get mail from a single file; typically from the mail spool.
13692
13693 Keywords:
13694
13695 @table @code
13696 @item :path
13697 The file name.  Defaults to the value of the @env{MAIL}
13698 environment variable or the value of @code{rmail-spool-directory}
13699 (usually something like @file{/usr/mail/spool/user-name}).
13700
13701 @item :prescript
13702 @itemx :postscript
13703 Script run before/after fetching mail.
13704 @end table
13705
13706 An example file mail source:
13707
13708 @lisp
13709 (file :path "/usr/spool/mail/user-name")
13710 @end lisp
13711
13712 Or using the default file name:
13713
13714 @lisp
13715 (file)
13716 @end lisp
13717
13718 If the mail spool file is not located on the local machine, it's best
13719 to use @acronym{POP} or @acronym{IMAP} or the like to fetch the mail.
13720 You can not use ange-ftp file names here---it has no way to lock the
13721 mail spool while moving the mail.
13722
13723 If it's impossible to set up a proper server, you can use ssh instead.
13724
13725 @lisp
13726 (setq mail-sources
13727       '((file :prescript "ssh host bin/getmail >%t")))
13728 @end lisp
13729
13730 The @samp{getmail} script would look something like the following:
13731
13732 @example
13733 #!/bin/sh
13734 #  getmail - move mail from spool to stdout
13735 #  flu@@iki.fi
13736
13737 MOVEMAIL=/usr/lib/emacs/20.3/i386-redhat-linux/movemail
13738 TMP=$HOME/Mail/tmp
13739 rm -f $TMP; $MOVEMAIL $MAIL $TMP >/dev/null && cat $TMP
13740 @end example
13741
13742 Alter this script to fit find the @samp{movemail} you want to use.
13743
13744
13745 @item directory
13746 @vindex nnmail-scan-directory-mail-source-once
13747 Get mail from several files in a directory.  This is typically used
13748 when you have procmail split the incoming mail into several files.
13749 That is, there is a one-to-one correspondence between files in that
13750 directory and groups, so that mail from the file @file{foo.bar.spool}
13751 will be put in the group @code{foo.bar}.  (You can change the suffix
13752 to be used instead of @code{.spool}.)  Setting
13753 @code{nnmail-scan-directory-mail-source-once} to non-@code{nil} forces
13754 Gnus to scan the mail source only once.  This is particularly useful
13755 if you want to scan mail groups at a specified level.
13756
13757 @vindex nnmail-resplit-incoming
13758 There is also the variable @code{nnmail-resplit-incoming}, if you set
13759 that to a non-@code{nil} value, then the normal splitting process is
13760 applied to all the files from the directory, @ref{Splitting Mail}.
13761
13762 Keywords:
13763
13764 @table @code
13765 @item :path
13766 The name of the directory where the files are.  There is no default
13767 value.
13768
13769 @item :suffix
13770 Only files ending with this suffix are used.  The default is
13771 @samp{.spool}.
13772
13773 @item :predicate
13774 Only files that have this predicate return non-@code{nil} are returned.
13775 The default is @code{identity}.  This is used as an additional
13776 filter---only files that have the right suffix @emph{and} satisfy this
13777 predicate are considered.
13778
13779 @item :prescript
13780 @itemx :postscript
13781 Script run before/after fetching mail.
13782
13783 @end table
13784
13785 An example directory mail source:
13786
13787 @lisp
13788 (directory :path "/home/user-name/procmail-dir/"
13789            :suffix ".prcml")
13790 @end lisp
13791
13792 @item pop
13793 Get mail from a @acronym{POP} server.
13794
13795 Keywords:
13796
13797 @table @code
13798 @item :server
13799 The name of the @acronym{POP} server.  The default is taken from the
13800 @env{MAILHOST} environment variable.
13801
13802 @item :port
13803 The port number of the @acronym{POP} server.  This can be a number (eg,
13804 @samp{:port 1234}) or a string (eg, @samp{:port "pop3"}).  If it is a
13805 string, it should be a service name as listed in @file{/etc/services} on
13806 Unix systems.  The default is @samp{"pop3"}.  On some systems you might
13807 need to specify it as @samp{"pop-3"} instead.
13808
13809 @item :user
13810 The user name to give to the @acronym{POP} server.  The default is the login
13811 name.
13812
13813 @item :password
13814 The password to give to the @acronym{POP} server.  If not specified,
13815 the user is prompted.
13816
13817 @item :program
13818 The program to use to fetch mail from the @acronym{POP} server.  This
13819 should be a @code{format}-like string.  Here's an example:
13820
13821 @example
13822 fetchmail %u@@%s -P %p %t
13823 @end example
13824
13825 The valid format specifier characters are:
13826
13827 @table @samp
13828 @item t
13829 The name of the file the mail is to be moved to.  This must always be
13830 included in this string.
13831
13832 @item s
13833 The name of the server.
13834
13835 @item P
13836 The port number of the server.
13837
13838 @item u
13839 The user name to use.
13840
13841 @item p
13842 The password to use.
13843 @end table
13844
13845 The values used for these specs are taken from the values you give the
13846 corresponding keywords.
13847
13848 @item :prescript
13849 A script to be run before fetching the mail.  The syntax is the same as
13850 the @code{:program} keyword.  This can also be a function to be run.
13851
13852 @item :postscript
13853 A script to be run after fetching the mail.  The syntax is the same as
13854 the @code{:program} keyword.  This can also be a function to be run.
13855
13856 @item :function
13857 The function to use to fetch mail from the @acronym{POP} server.  The
13858 function is called with one parameter---the name of the file where the
13859 mail should be moved to.
13860
13861 @item :authentication
13862 This can be either the symbol @code{password} or the symbol @code{apop}
13863 and says what authentication scheme to use.  The default is
13864 @code{password}.
13865
13866 @end table
13867
13868 @vindex pop3-movemail
13869 @vindex pop3-leave-mail-on-server
13870 If the @code{:program} and @code{:function} keywords aren't specified,
13871 @code{pop3-movemail} will be used.  If the
13872 @code{pop3-leave-mail-on-server} is non-@code{nil} the mail is to be
13873 left on the @acronym{POP} server after fetching when using
13874 @code{pop3-movemail}.  Note that POP servers maintain no state
13875 information between sessions, so what the client believes is there and
13876 what is actually there may not match up.  If they do not, then the whole
13877 thing can fall apart and leave you with a corrupt mailbox.
13878
13879 Here are some examples.  Fetch from the default @acronym{POP} server,
13880 using the default user name, and default fetcher:
13881
13882 @lisp
13883 (pop)
13884 @end lisp
13885
13886 Fetch from a named server with a named user and password:
13887
13888 @lisp
13889 (pop :server "my.pop.server"
13890      :user "user-name" :password "secret")
13891 @end lisp
13892
13893 Use @samp{movemail} to move the mail:
13894
13895 @lisp
13896 (pop :program "movemail po:%u %t %p")
13897 @end lisp
13898
13899 @item maildir
13900 Get mail from a maildir.  This is a type of mailbox that is supported by
13901 at least qmail and postfix, where each file in a special directory
13902 contains exactly one mail.
13903
13904 Keywords:
13905
13906 @table @code
13907 @item :path
13908 The name of the directory where the mails are stored.  The default is
13909 taken from the @env{MAILDIR} environment variable or
13910 @file{~/Maildir/}.
13911 @item :subdirs
13912 The subdirectories of the Maildir.  The default is
13913 @samp{("new" "cur")}.
13914
13915 @c If you sometimes look at your mail through a pop3 daemon before fetching
13916 @c them with Gnus, you may also have to fetch your mails from the
13917 @c @code{cur} directory inside the maildir, like in the first example
13918 @c below.
13919
13920 You can also get mails from remote hosts (because maildirs don't suffer
13921 from locking problems).
13922
13923 @end table
13924
13925 Two example maildir mail sources:
13926
13927 @lisp
13928 (maildir :path "/home/user-name/Maildir/"
13929          :subdirs ("cur" "new"))
13930 @end lisp
13931
13932 @lisp
13933 (maildir :path "/user@@remotehost.org:~/Maildir/"
13934          :subdirs ("new"))
13935 @end lisp
13936
13937 @item imap
13938 Get mail from a @acronym{IMAP} server.  If you don't want to use
13939 @acronym{IMAP} as intended, as a network mail reading protocol (ie
13940 with nnimap), for some reason or other, Gnus let you treat it similar
13941 to a @acronym{POP} server and fetches articles from a given
13942 @acronym{IMAP} mailbox.  @xref{IMAP}, for more information.
13943
13944 Note that for the Kerberos, GSSAPI, @acronym{TLS}/@acronym{SSL} and STARTTLS support you
13945 may need external programs and libraries, @xref{IMAP}.
13946
13947 Keywords:
13948
13949 @table @code
13950 @item :server
13951 The name of the @acronym{IMAP} server.  The default is taken from the
13952 @env{MAILHOST} environment variable.
13953
13954 @item :port
13955 The port number of the @acronym{IMAP} server.  The default is @samp{143}, or
13956 @samp{993} for @acronym{TLS}/@acronym{SSL} connections.
13957
13958 @item :user
13959 The user name to give to the @acronym{IMAP} server.  The default is the login
13960 name.
13961
13962 @item :password
13963 The password to give to the @acronym{IMAP} server.  If not specified, the user is
13964 prompted.
13965
13966 @item :stream
13967 What stream to use for connecting to the server, this is one of the
13968 symbols in @code{imap-stream-alist}.  Right now, this means
13969 @samp{gssapi}, @samp{kerberos4}, @samp{starttls}, @samp{tls},
13970 @samp{ssl}, @samp{shell} or the default @samp{network}.
13971
13972 @item :authentication
13973 Which authenticator to use for authenticating to the server, this is
13974 one of the symbols in @code{imap-authenticator-alist}.  Right now,
13975 this means @samp{gssapi}, @samp{kerberos4}, @samp{digest-md5},
13976 @samp{cram-md5}, @samp{anonymous} or the default @samp{login}.
13977
13978 @item :program
13979 When using the `shell' :stream, the contents of this variable is
13980 mapped into the @code{imap-shell-program} variable.  This should be a
13981 @code{format}-like string (or list of strings).  Here's an example:
13982
13983 @example
13984 ssh %s imapd
13985 @end example
13986
13987 The valid format specifier characters are:
13988
13989 @table @samp
13990 @item s
13991 The name of the server.
13992
13993 @item l
13994 User name from @code{imap-default-user}.
13995
13996 @item p
13997 The port number of the server.
13998 @end table
13999
14000 The values used for these specs are taken from the values you give the
14001 corresponding keywords.
14002
14003 @item :mailbox
14004 The name of the mailbox to get mail from.  The default is @samp{INBOX}
14005 which normally is the mailbox which receive incoming mail.
14006
14007 @item :predicate
14008 The predicate used to find articles to fetch.  The default, @samp{UNSEEN
14009 UNDELETED}, is probably the best choice for most people, but if you
14010 sometimes peek in your mailbox with a @acronym{IMAP} client and mark some
14011 articles as read (or; SEEN) you might want to set this to @samp{1:*}.
14012 Then all articles in the mailbox is fetched, no matter what.  For a
14013 complete list of predicates, see RFC 2060 section 6.4.4.
14014
14015 @item :fetchflag
14016 How to flag fetched articles on the server, the default @samp{\Deleted}
14017 will mark them as deleted, an alternative would be @samp{\Seen} which
14018 would simply mark them as read.  These are the two most likely choices,
14019 but more flags are defined in RFC 2060 section 2.3.2.
14020
14021 @item :dontexpunge
14022 If non-@code{nil}, don't remove all articles marked as deleted in the
14023 mailbox after finishing the fetch.
14024
14025 @end table
14026
14027 An example @acronym{IMAP} mail source:
14028
14029 @lisp
14030 (imap :server "mail.mycorp.com"
14031       :stream kerberos4
14032       :fetchflag "\\Seen")
14033 @end lisp
14034
14035 @item webmail
14036 Get mail from a webmail server, such as @uref{http://www.hotmail.com/},
14037 @uref{http://webmail.netscape.com/}, @uref{http://www.netaddress.com/},
14038 @uref{http://mail.yahoo.com/}.
14039
14040 NOTE: Webmail largely depends on cookies.  A "one-line-cookie" patch is
14041 required for url "4.0pre.46".
14042
14043 WARNING: Mails may be lost.  NO WARRANTY.
14044
14045 Keywords:
14046
14047 @table @code
14048 @item :subtype
14049 The type of the webmail server.  The default is @code{hotmail}.  The
14050 alternatives are @code{netscape}, @code{netaddress}, @code{my-deja}.
14051
14052 @item :user
14053 The user name to give to the webmail server.  The default is the login
14054 name.
14055
14056 @item :password
14057 The password to give to the webmail server.  If not specified, the user is
14058 prompted.
14059
14060 @item :dontexpunge
14061 If non-@code{nil}, only fetch unread articles and don't move them to
14062 trash folder after finishing the fetch.
14063
14064 @end table
14065
14066 An example webmail source:
14067
14068 @lisp
14069 (webmail :subtype 'hotmail
14070          :user "user-name"
14071          :password "secret")
14072 @end lisp
14073 @end table
14074
14075 @table @dfn
14076 @item Common Keywords
14077 Common keywords can be used in any type of mail source.
14078
14079 Keywords:
14080
14081 @table @code
14082 @item :plugged
14083 If non-@code{nil}, fetch the mail even when Gnus is unplugged.  If you
14084 use directory source to get mail, you can specify it as in this
14085 example:
14086
14087 @lisp
14088 (setq mail-sources
14089       '((directory :path "/home/pavel/.Spool/"
14090                    :suffix ""
14091                    :plugged t)))
14092 @end lisp
14093
14094 Gnus will then fetch your mail even when you are unplugged.  This is
14095 useful when you use local mail and news.
14096
14097 @end table
14098 @end table
14099
14100 @subsubsection Function Interface
14101
14102 Some of the above keywords specify a Lisp function to be executed.
14103 For each keyword @code{:foo}, the Lisp variable @code{foo} is bound to
14104 the value of the keyword while the function is executing.  For example,
14105 consider the following mail-source setting:
14106
14107 @lisp
14108 (setq mail-sources '((pop :user "jrl"
14109                           :server "pophost" :function fetchfunc)))
14110 @end lisp
14111
14112 While the function @code{fetchfunc} is executing, the symbol @code{user}
14113 is bound to @code{"jrl"}, and the symbol @code{server} is bound to
14114 @code{"pophost"}.  The symbols @code{port}, @code{password},
14115 @code{program}, @code{prescript}, @code{postscript}, @code{function},
14116 and @code{authentication} are also bound (to their default values).
14117
14118 See above for a list of keywords for each type of mail source.
14119
14120
14121 @node Mail Source Customization
14122 @subsubsection Mail Source Customization
14123
14124 The following is a list of variables that influence how the mail is
14125 fetched.  You would normally not need to set or change any of these
14126 variables.
14127
14128 @table @code
14129 @item mail-source-crash-box
14130 @vindex mail-source-crash-box
14131 File where mail will be stored while processing it.  The default is@*
14132 @file{~/.emacs-mail-crash-box}.
14133
14134 @item mail-source-delete-incoming
14135 @vindex mail-source-delete-incoming
14136 If non-@code{nil}, delete incoming files after handling them.  If
14137 @code{t}, delete the files immediately, if @code{nil}, never delete any
14138 files.  If a positive number, delete files older than number of days
14139 (This will only happen, when receiving new mail).  You may also set
14140 @code{mail-source-delete-incoming} to @code{nil} and call
14141 @code{mail-source-delete-old-incoming} from a hook or interactively.
14142
14143 @item mail-source-delete-old-incoming-confirm
14144 @vindex mail-source-delete-old-incoming-confirm
14145 If non-@code{nil}, ask for for confirmation before deleting old incoming
14146 files.  This variable only applies when
14147 @code{mail-source-delete-incoming} is a positive number.
14148
14149 @item mail-source-ignore-errors
14150 @vindex mail-source-ignore-errors
14151 If non-@code{nil}, ignore errors when reading mail from a mail source.
14152
14153 @item mail-source-directory
14154 @vindex mail-source-directory
14155 Directory where incoming mail source files (if any) will be stored.  The
14156 default is @file{~/Mail/}.  At present, the only thing this is used for
14157 is to say where the incoming files will be stored if the variable
14158 @code{mail-source-delete-incoming} is @code{nil} or a number.
14159
14160 @item mail-source-incoming-file-prefix
14161 @vindex mail-source-incoming-file-prefix
14162 Prefix for file name for storing incoming mail.  The default is
14163 @file{Incoming}, in which case files will end up with names like
14164 @file{Incoming30630D_} or @file{Incoming298602ZD}.  This is really only
14165 relevant if @code{mail-source-delete-incoming} is @code{nil} or a
14166 number.
14167
14168 @item mail-source-default-file-modes
14169 @vindex mail-source-default-file-modes
14170 All new mail files will get this file mode.  The default is 384.
14171
14172 @item mail-source-movemail-program
14173 @vindex mail-source-movemail-program
14174 If non-@code{nil}, name of program for fetching new mail.  If
14175 @code{nil}, @code{movemail} in @var{exec-directory}.
14176
14177 @end table
14178
14179
14180 @node Fetching Mail
14181 @subsubsection Fetching Mail
14182
14183 @vindex mail-sources
14184 @vindex nnmail-spool-file
14185 The way to actually tell Gnus where to get new mail from is to set
14186 @code{mail-sources} to a list of mail source specifiers
14187 (@pxref{Mail Source Specifiers}).
14188
14189 If this variable (and the obsolescent @code{nnmail-spool-file}) is
14190 @code{nil}, the mail back ends will never attempt to fetch mail by
14191 themselves.
14192
14193 If you want to fetch mail both from your local spool as well as a
14194 @acronym{POP} mail server, you'd say something like:
14195
14196 @lisp
14197 (setq mail-sources
14198       '((file)
14199         (pop :server "pop3.mail.server"
14200              :password "secret")))
14201 @end lisp
14202
14203 Or, if you don't want to use any of the keyword defaults:
14204
14205 @lisp
14206 (setq mail-sources
14207       '((file :path "/var/spool/mail/user-name")
14208         (pop :server "pop3.mail.server"
14209              :user "user-name"
14210              :port "pop3"
14211              :password "secret")))
14212 @end lisp
14213
14214
14215 When you use a mail back end, Gnus will slurp all your mail from your
14216 inbox and plonk it down in your home directory.  Gnus doesn't move any
14217 mail if you're not using a mail back end---you have to do a lot of magic
14218 invocations first.  At the time when you have finished drawing the
14219 pentagram, lightened the candles, and sacrificed the goat, you really
14220 shouldn't be too surprised when Gnus moves your mail.
14221
14222
14223
14224 @node Mail Back End Variables
14225 @subsection Mail Back End Variables
14226
14227 These variables are (for the most part) pertinent to all the various
14228 mail back ends.
14229
14230 @table @code
14231 @vindex nnmail-read-incoming-hook
14232 @item nnmail-read-incoming-hook
14233 The mail back ends all call this hook after reading new mail.  You can
14234 use this hook to notify any mail watch programs, if you want to.
14235
14236 @vindex nnmail-split-hook
14237 @item nnmail-split-hook
14238 @findex gnus-article-decode-encoded-words
14239 @cindex RFC 1522 decoding
14240 @cindex RFC 2047 decoding
14241 Hook run in the buffer where the mail headers of each message is kept
14242 just before the splitting based on these headers is done.  The hook is
14243 free to modify the buffer contents in any way it sees fit---the buffer
14244 is discarded after the splitting has been done, and no changes performed
14245 in the buffer will show up in any files.
14246 @code{gnus-article-decode-encoded-words} is one likely function to add
14247 to this hook.
14248
14249 @vindex nnmail-pre-get-new-mail-hook
14250 @vindex nnmail-post-get-new-mail-hook
14251 @item nnmail-pre-get-new-mail-hook
14252 @itemx nnmail-post-get-new-mail-hook
14253 These are two useful hooks executed when treating new incoming
14254 mail---@code{nnmail-pre-get-new-mail-hook} (is called just before
14255 starting to handle the new mail) and
14256 @code{nnmail-post-get-new-mail-hook} (is called when the mail handling
14257 is done).  Here's and example of using these two hooks to change the
14258 default file modes the new mail files get:
14259
14260 @lisp
14261 (add-hook 'nnmail-pre-get-new-mail-hook
14262           (lambda () (set-default-file-modes 511)))
14263
14264 (add-hook 'nnmail-post-get-new-mail-hook
14265           (lambda () (set-default-file-modes 551)))
14266 @end lisp
14267
14268 @item nnmail-use-long-file-names
14269 @vindex nnmail-use-long-file-names
14270 If non-@code{nil}, the mail back ends will use long file and directory
14271 names.  Groups like @samp{mail.misc} will end up in directories
14272 (assuming use of @code{nnml} back end) or files (assuming use of
14273 @code{nnfolder} back end) like @file{mail.misc}.  If it is @code{nil},
14274 the same group will end up in @file{mail/misc}.
14275
14276 @item nnmail-delete-file-function
14277 @vindex nnmail-delete-file-function
14278 @findex delete-file
14279 Function called to delete files.  It is @code{delete-file} by default.
14280
14281 @item nnmail-cache-accepted-message-ids
14282 @vindex nnmail-cache-accepted-message-ids
14283 If non-@code{nil}, put the @code{Message-ID}s of articles imported into
14284 the back end (via @code{Gcc}, for instance) into the mail duplication
14285 discovery cache.  The default is @code{nil}.
14286
14287 @item nnmail-cache-ignore-groups
14288 @vindex nnmail-cache-ignore-groups
14289 This can be a regular expression or a list of regular expressions.
14290 Group names that match any of the regular expressions will never be
14291 recorded in the @code{Message-ID} cache.
14292
14293 This can be useful, for example, when using Fancy Splitting
14294 (@pxref{Fancy Mail Splitting}) together with the function
14295 @code{nnmail-split-fancy-with-parent}.
14296
14297 @end table
14298
14299
14300 @node Fancy Mail Splitting
14301 @subsection Fancy Mail Splitting
14302 @cindex mail splitting
14303 @cindex fancy mail splitting
14304
14305 @vindex nnmail-split-fancy
14306 @findex nnmail-split-fancy
14307 If the rather simple, standard method for specifying how to split mail
14308 doesn't allow you to do what you want, you can set
14309 @code{nnmail-split-methods} to @code{nnmail-split-fancy}.  Then you can
14310 play with the @code{nnmail-split-fancy} variable.
14311
14312 Let's look at an example value of this variable first:
14313
14314 @lisp
14315 ;; @r{Messages from the mailer daemon are not crossposted to any of}
14316 ;; @r{the ordinary groups.  Warnings are put in a separate group}
14317 ;; @r{from real errors.}
14318 (| ("from" mail (| ("subject" "warn.*" "mail.warning")
14319                    "mail.misc"))
14320    ;; @r{Non-error messages are crossposted to all relevant}
14321    ;; @r{groups, but we don't crosspost between the group for the}
14322    ;; @r{(ding) list and the group for other (ding) related mail.}
14323    (& (| (any "ding@@ifi\\.uio\\.no" "ding.list")
14324          ("subject" "ding" "ding.misc"))
14325       ;; @r{Other mailing lists@dots{}}
14326       (any "procmail@@informatik\\.rwth-aachen\\.de" "procmail.list")
14327       (any "SmartList@@informatik\\.rwth-aachen\\.de" "SmartList.list")
14328       ;; @r{Both lists below have the same suffix, so prevent}
14329       ;; @r{cross-posting to mkpkg.list of messages posted only to}
14330       ;; @r{the bugs- list, but allow cross-posting when the}
14331       ;; @r{message was really cross-posted.}
14332       (any "bugs-mypackage@@somewhere" "mypkg.bugs")
14333       (any "mypackage@@somewhere" - "bugs-mypackage" "mypkg.list")
14334       ;; @r{People@dots{}}
14335       (any "larsi@@ifi\\.uio\\.no" "people.Lars_Magne_Ingebrigtsen"))
14336    ;; @r{Unmatched mail goes to the catch all group.}
14337    "misc.misc")
14338 @end lisp
14339
14340 This variable has the format of a @dfn{split}.  A split is a
14341 (possibly) recursive structure where each split may contain other
14342 splits.  Here are the possible split syntaxes:
14343
14344 @table @code
14345
14346 @item group
14347 If the split is a string, that will be taken as a group name.  Normal
14348 regexp match expansion will be done.  See below for examples.
14349
14350 @c Don't fold this line.
14351 @item (@var{field} @var{value} [- @var{restrict} [@dots{}] ] @var{split} [@var{invert-partial}])
14352 The split can be a list containing at least three elements.  If the
14353 first element @var{field} (a regexp matching a header) contains
14354 @var{value} (also a regexp) then store the message as specified by
14355 @var{split}.
14356
14357 If @var{restrict} (yet another regexp) matches some string after
14358 @var{field} and before the end of the matched @var{value}, the
14359 @var{split} is ignored.  If none of the @var{restrict} clauses match,
14360 @var{split} is processed.
14361
14362 The last element @var{invert-partial} is optional.  If it is
14363 non-@code{nil}, the match-partial-words behavior controlled by the
14364 variable @code{nnmail-split-fancy-match-partial-words} (see below) is
14365 be inverted.  (New in Gnus 5.10.7)
14366
14367 @item (| @var{split} @dots{})
14368 If the split is a list, and the first element is @code{|} (vertical
14369 bar), then process each @var{split} until one of them matches.  A
14370 @var{split} is said to match if it will cause the mail message to be
14371 stored in one or more groups.
14372
14373 @item (& @var{split} @dots{})
14374 If the split is a list, and the first element is @code{&}, then
14375 process all @var{split}s in the list.
14376
14377 @item junk
14378 If the split is the symbol @code{junk}, then don't save (i.e., delete)
14379 this message.  Use with extreme caution.
14380
14381 @item (: @var{function} @var{arg1} @var{arg2} @dots{})
14382 If the split is a list, and the first element is @samp{:}, then the
14383 second element will be called as a function with @var{args} given as
14384 arguments.  The function should return a @var{split}.
14385
14386 @cindex body split
14387 For instance, the following function could be used to split based on the
14388 body of the messages:
14389
14390 @lisp
14391 (defun split-on-body ()
14392   (save-excursion
14393     (save-restriction
14394       (widen)
14395       (goto-char (point-min))
14396       (when (re-search-forward "Some.*string" nil t)
14397         "string.group"))))
14398 @end lisp
14399
14400 The buffer is narrowed to the message in question when @var{function}
14401 is run.  That's why @code{(widen)} needs to be called after
14402 @code{save-excursion} and @code{save-restriction} in the example
14403 above.  Also note that with the nnimap back end, message bodies will
14404 not be downloaded by default.  You need to set
14405 @code{nnimap-split-download-body} to @code{t} to do that
14406 (@pxref{Splitting in IMAP}).
14407
14408 @item (! @var{func} @var{split})
14409 If the split is a list, and the first element is @code{!}, then
14410 @var{split} will be processed, and @var{func} will be called as a
14411 function with the result of @var{split} as argument.  @var{func}
14412 should return a split.
14413
14414 @item nil
14415 If the split is @code{nil}, it is ignored.
14416
14417 @end table
14418
14419 In these splits, @var{field} must match a complete field name.
14420
14421 Normally, @var{value} in these splits must match a complete @emph{word}
14422 according to the fundamental mode syntax table.  In other words, all
14423 @var{value}'s will be implicitly surrounded by @code{\<...\>} markers,
14424 which are word delimiters.  Therefore, if you use the following split,
14425 for example,
14426
14427 @example
14428 (any "joe" "joemail")
14429 @end example
14430
14431 @noindent
14432 messages sent from @samp{joedavis@@foo.org} will normally not be filed
14433 in @samp{joemail}.  If you want to alter this behavior, you can use any
14434 of the following three ways:
14435
14436 @enumerate
14437 @item
14438 @vindex nnmail-split-fancy-match-partial-words
14439 You can set the @code{nnmail-split-fancy-match-partial-words} variable
14440 to non-@code{nil} in order to ignore word boundaries and instead the
14441 match becomes more like a grep.  This variable controls whether partial
14442 words are matched during fancy splitting.  The default value is
14443 @code{nil}.
14444
14445 Note that it influences all @var{value}'s in your split rules.
14446
14447 @item
14448 @var{value} beginning with @code{.*} ignores word boundaries in front of
14449 a word.  Similarly, if @var{value} ends with @code{.*}, word boundaries
14450 in the rear of a word will be ignored.  For example, the @var{value}
14451 @code{"@@example\\.com"} does not match @samp{foo@@example.com} but
14452 @code{".*@@example\\.com"} does.
14453
14454 @item
14455 You can set the @var{invert-partial} flag in your split rules of the
14456 @samp{(@var{field} @var{value} @dots{})} types, aforementioned in this
14457 section.  If the flag is set, word boundaries on both sides of a word
14458 are ignored even if @code{nnmail-split-fancy-match-partial-words} is
14459 @code{nil}.  Contrarily, if the flag is set, word boundaries are not
14460 ignored even if @code{nnmail-split-fancy-match-partial-words} is
14461 non-@code{nil}.  (New in Gnus 5.10.7)
14462 @end enumerate
14463
14464 @vindex nnmail-split-abbrev-alist
14465 @var{field} and @var{value} can also be Lisp symbols, in that case
14466 they are expanded as specified by the variable
14467 @code{nnmail-split-abbrev-alist}.  This is an alist of cons cells,
14468 where the @sc{car} of a cell contains the key, and the @sc{cdr}
14469 contains the associated value.  Predefined entries in
14470 @code{nnmail-split-abbrev-alist} include:
14471
14472 @table @code
14473 @item from
14474 Matches the @samp{From}, @samp{Sender} and @samp{Resent-From} fields.
14475 @item to
14476 Matches the @samp{To}, @samp{Cc}, @samp{Apparently-To},
14477 @samp{Resent-To} and @samp{Resent-Cc} fields.
14478 @item any
14479 Is the union of the @code{from} and @code{to} entries.
14480 @end table
14481
14482 @vindex nnmail-split-fancy-syntax-table
14483 @code{nnmail-split-fancy-syntax-table} is the syntax table in effect
14484 when all this splitting is performed.
14485
14486 If you want to have Gnus create groups dynamically based on some
14487 information in the headers (i.e., do @code{replace-match}-like
14488 substitutions in the group names), you can say things like:
14489
14490 @example
14491 (any "debian-\\b\\(\\w+\\)@@lists.debian.org" "mail.debian.\\1")
14492 @end example
14493
14494 In this example, messages sent to @samp{debian-foo@@lists.debian.org}
14495 will be filed in @samp{mail.debian.foo}.
14496
14497 If the string contains the element @samp{\&}, then the previously
14498 matched string will be substituted.  Similarly, the elements @samp{\\1}
14499 up to @samp{\\9} will be substituted with the text matched by the
14500 groupings 1 through 9.
14501
14502 @vindex nnmail-split-lowercase-expanded
14503 Where @code{nnmail-split-lowercase-expanded} controls whether the
14504 lowercase of the matched string should be used for the substitution.
14505 Setting it as non-@code{nil} is useful to avoid the creation of multiple
14506 groups when users send to an address using different case
14507 (i.e. mailing-list@@domain vs Mailing-List@@Domain).  The default value
14508 is @code{t}.
14509
14510 @findex nnmail-split-fancy-with-parent
14511 @code{nnmail-split-fancy-with-parent} is a function which allows you to
14512 split followups into the same groups their parents are in.  Sometimes
14513 you can't make splitting rules for all your mail.  For example, your
14514 boss might send you personal mail regarding different projects you are
14515 working on, and as you can't tell your boss to put a distinguishing
14516 string into the subject line, you have to resort to manually moving the
14517 messages into the right group.  With this function, you only have to do
14518 it once per thread.
14519
14520 To use this feature, you have to set @code{nnmail-treat-duplicates}
14521 and @code{nnmail-cache-accepted-message-ids} to a non-@code{nil}
14522 value.  And then you can include @code{nnmail-split-fancy-with-parent}
14523 using the colon feature, like so:
14524 @lisp
14525 (setq nnmail-treat-duplicates 'warn     ; @r{or @code{delete}}
14526       nnmail-cache-accepted-message-ids t
14527       nnmail-split-fancy
14528       '(| (: nnmail-split-fancy-with-parent)
14529           ;; @r{other splits go here}
14530         ))
14531 @end lisp
14532
14533 This feature works as follows: when @code{nnmail-treat-duplicates} is
14534 non-@code{nil}, Gnus records the message id of every message it sees
14535 in the file specified by the variable
14536 @code{nnmail-message-id-cache-file}, together with the group it is in
14537 (the group is omitted for non-mail messages).  When mail splitting is
14538 invoked, the function @code{nnmail-split-fancy-with-parent} then looks
14539 at the References (and In-Reply-To) header of each message to split
14540 and searches the file specified by @code{nnmail-message-id-cache-file}
14541 for the message ids.  When it has found a parent, it returns the
14542 corresponding group name unless the group name matches the regexp
14543 @code{nnmail-split-fancy-with-parent-ignore-groups}.  It is
14544 recommended that you set @code{nnmail-message-id-cache-length} to a
14545 somewhat higher number than the default so that the message ids are
14546 still in the cache.  (A value of 5000 appears to create a file some
14547 300 kBytes in size.)
14548 @vindex nnmail-cache-accepted-message-ids
14549 When @code{nnmail-cache-accepted-message-ids} is non-@code{nil}, Gnus
14550 also records the message ids of moved articles, so that the followup
14551 messages goes into the new group.
14552
14553 Also see the variable @code{nnmail-cache-ignore-groups} if you don't
14554 want certain groups to be recorded in the cache.  For example, if all
14555 outgoing messages are written to an ``outgoing'' group, you could set
14556 @code{nnmail-cache-ignore-groups} to match that group name.
14557 Otherwise, answers to all your messages would end up in the
14558 ``outgoing'' group.
14559
14560
14561 @node Group Mail Splitting
14562 @subsection Group Mail Splitting
14563 @cindex mail splitting
14564 @cindex group mail splitting
14565
14566 @findex gnus-group-split
14567 If you subscribe to dozens of mailing lists but you don't want to
14568 maintain mail splitting rules manually, group mail splitting is for you.
14569 You just have to set @code{to-list} and/or @code{to-address} in group
14570 parameters or group customization and set @code{nnmail-split-methods} to
14571 @code{gnus-group-split}.  This splitting function will scan all groups
14572 for those parameters and split mail accordingly, i.e., messages posted
14573 from or to the addresses specified in the parameters @code{to-list} or
14574 @code{to-address} of a mail group will be stored in that group.
14575
14576 Sometimes, mailing lists have multiple addresses, and you may want mail
14577 splitting to recognize them all: just set the @code{extra-aliases} group
14578 parameter to the list of additional addresses and it's done.  If you'd
14579 rather use a regular expression, set @code{split-regexp}.
14580
14581 All these parameters in a group will be used to create an
14582 @code{nnmail-split-fancy} split, in which the @var{field} is @samp{any},
14583 the @var{value} is a single regular expression that matches
14584 @code{to-list}, @code{to-address}, all of @code{extra-aliases} and all
14585 matches of @code{split-regexp}, and the @var{split} is the name of the
14586 group.  @var{restrict}s are also supported: just set the
14587 @code{split-exclude} parameter to a list of regular expressions.
14588
14589 If you can't get the right split to be generated using all these
14590 parameters, or you just need something fancier, you can set the
14591 parameter @code{split-spec} to an @code{nnmail-split-fancy} split.  In
14592 this case, all other aforementioned parameters will be ignored by
14593 @code{gnus-group-split}.  In particular, @code{split-spec} may be set to
14594 @code{nil}, in which case the group will be ignored by
14595 @code{gnus-group-split}.
14596
14597 @vindex gnus-group-split-default-catch-all-group
14598 @code{gnus-group-split} will do cross-posting on all groups that match,
14599 by defining a single @code{&} fancy split containing one split for each
14600 group.  If a message doesn't match any split, it will be stored in the
14601 group named in @code{gnus-group-split-default-catch-all-group}, unless
14602 some group has @code{split-spec} set to @code{catch-all}, in which case
14603 that group is used as the catch-all group.  Even though this variable is
14604 often used just to name a group, it may also be set to an arbitrarily
14605 complex fancy split (after all, a group name is a fancy split), and this
14606 may be useful to split mail that doesn't go to any mailing list to
14607 personal mail folders.  Note that this fancy split is added as the last
14608 element of a @code{|} split list that also contains a @code{&} split
14609 with the rules extracted from group parameters.
14610
14611 It's time for an example.  Assume the following group parameters have
14612 been defined:
14613
14614 @example
14615 nnml:mail.bar:
14616 ((to-address . "bar@@femail.com")
14617  (split-regexp . ".*@@femail\\.com"))
14618 nnml:mail.foo:
14619 ((to-list . "foo@@nowhere.gov")
14620  (extra-aliases "foo@@localhost" "foo-redist@@home")
14621  (split-exclude "bugs-foo" "rambling-foo")
14622  (admin-address . "foo-request@@nowhere.gov"))
14623 nnml:mail.others:
14624 ((split-spec . catch-all))
14625 @end example
14626
14627 Setting @code{nnmail-split-methods} to @code{gnus-group-split} will
14628 behave as if @code{nnmail-split-fancy} had been selected and variable
14629 @code{nnmail-split-fancy} had been set as follows:
14630
14631 @lisp
14632 (| (& (any "\\(bar@@femail\\.com\\|.*@@femail\\.com\\)" "mail.bar")
14633       (any "\\(foo@@nowhere\\.gov\\|foo@@localhost\\|foo-redist@@home\\)"
14634            - "bugs-foo" - "rambling-foo" "mail.foo"))
14635    "mail.others")
14636 @end lisp
14637
14638 @findex gnus-group-split-fancy
14639 If you'd rather not use group splitting for all your mail groups, you
14640 may use it for only some of them, by using @code{nnmail-split-fancy}
14641 splits like this:
14642
14643 @lisp
14644 (: gnus-group-split-fancy @var{groups} @var{no-crosspost} @var{catch-all})
14645 @end lisp
14646
14647 @var{groups} may be a regular expression or a list of group names whose
14648 parameters will be scanned to generate the output split.
14649 @var{no-crosspost} can be used to disable cross-posting; in this case, a
14650 single @code{|} split will be output.  @var{catch-all} is the fall back
14651 fancy split, used like @code{gnus-group-split-default-catch-all-group}.
14652 If @var{catch-all} is @code{nil}, or if @code{split-regexp} matches the
14653 empty string in any selected group, no catch-all split will be issued.
14654 Otherwise, if some group has @code{split-spec} set to @code{catch-all},
14655 this group will override the value of the @var{catch-all} argument.
14656
14657 @findex gnus-group-split-setup
14658 Unfortunately, scanning all groups and their parameters can be quite
14659 slow, especially considering that it has to be done for every message.
14660 But don't despair!  The function @code{gnus-group-split-setup} can be
14661 used to enable @code{gnus-group-split} in a much more efficient way.  It
14662 sets @code{nnmail-split-methods} to @code{nnmail-split-fancy} and sets
14663 @code{nnmail-split-fancy} to the split produced by
14664 @code{gnus-group-split-fancy}.  Thus, the group parameters are only
14665 scanned once, no matter how many messages are split.
14666
14667 @findex gnus-group-split-update
14668 However, if you change group parameters, you'd have to update
14669 @code{nnmail-split-fancy} manually.  You can do it by running
14670 @code{gnus-group-split-update}.  If you'd rather have it updated
14671 automatically, just tell @code{gnus-group-split-setup} to do it for
14672 you.  For example, add to your @file{~/.gnus.el}:
14673
14674 @lisp
14675 (gnus-group-split-setup @var{auto-update} @var{catch-all})
14676 @end lisp
14677
14678 If @var{auto-update} is non-@code{nil}, @code{gnus-group-split-update}
14679 will be added to @code{nnmail-pre-get-new-mail-hook}, so you won't ever
14680 have to worry about updating @code{nnmail-split-fancy} again.  If you
14681 don't omit @var{catch-all} (it's optional, equivalent to @code{nil}),
14682 @code{gnus-group-split-default-catch-all-group} will be set to its
14683 value.
14684
14685 @vindex gnus-group-split-updated-hook
14686 Because you may want to change @code{nnmail-split-fancy} after it is set
14687 by @code{gnus-group-split-update}, this function will run
14688 @code{gnus-group-split-updated-hook} just before finishing.
14689
14690 @node Incorporating Old Mail
14691 @subsection Incorporating Old Mail
14692 @cindex incorporating old mail
14693 @cindex import old mail
14694
14695 Most people have lots of old mail stored in various file formats.  If
14696 you have set up Gnus to read mail using one of the spiffy Gnus mail
14697 back ends, you'll probably wish to have that old mail incorporated into
14698 your mail groups.
14699
14700 Doing so can be quite easy.
14701
14702 To take an example: You're reading mail using @code{nnml}
14703 (@pxref{Mail Spool}), and have set @code{nnmail-split-methods} to a
14704 satisfactory value (@pxref{Splitting Mail}).  You have an old Unix mbox
14705 file filled with important, but old, mail.  You want to move it into
14706 your @code{nnml} groups.
14707
14708 Here's how:
14709
14710 @enumerate
14711 @item
14712 Go to the group buffer.
14713
14714 @item
14715 Type @kbd{G f} and give the file name to the mbox file when prompted to create an
14716 @code{nndoc} group from the mbox file (@pxref{Foreign Groups}).
14717
14718 @item
14719 Type @kbd{SPACE} to enter the newly created group.
14720
14721 @item
14722 Type @kbd{M P b} to process-mark all articles in this group's buffer
14723 (@pxref{Setting Process Marks}).
14724
14725 @item
14726 Type @kbd{B r} to respool all the process-marked articles, and answer
14727 @samp{nnml} when prompted (@pxref{Mail Group Commands}).
14728 @end enumerate
14729
14730 All the mail messages in the mbox file will now also be spread out over
14731 all your @code{nnml} groups.  Try entering them and check whether things
14732 have gone without a glitch.  If things look ok, you may consider
14733 deleting the mbox file, but I wouldn't do that unless I was absolutely
14734 sure that all the mail has ended up where it should be.
14735
14736 Respooling is also a handy thing to do if you're switching from one mail
14737 back end to another.  Just respool all the mail in the old mail groups
14738 using the new mail back end.
14739
14740
14741 @node Expiring Mail
14742 @subsection Expiring Mail
14743 @cindex article expiry
14744
14745 Traditional mail readers have a tendency to remove mail articles when
14746 you mark them as read, in some way.  Gnus takes a fundamentally
14747 different approach to mail reading.
14748
14749 Gnus basically considers mail just to be news that has been received in
14750 a rather peculiar manner.  It does not think that it has the power to
14751 actually change the mail, or delete any mail messages.  If you enter a
14752 mail group, and mark articles as ``read'', or kill them in some other
14753 fashion, the mail articles will still exist on the system.  I repeat:
14754 Gnus will not delete your old, read mail.  Unless you ask it to, of
14755 course.
14756
14757 To make Gnus get rid of your unwanted mail, you have to mark the
14758 articles as @dfn{expirable}.  (With the default key bindings, this means
14759 that you have to type @kbd{E}.)  This does not mean that the articles
14760 will disappear right away, however.  In general, a mail article will be
14761 deleted from your system if, 1) it is marked as expirable, AND 2) it is
14762 more than one week old.  If you do not mark an article as expirable, it
14763 will remain on your system until hell freezes over.  This bears
14764 repeating one more time, with some spurious capitalizations: IF you do
14765 NOT mark articles as EXPIRABLE, Gnus will NEVER delete those ARTICLES.
14766
14767 You do not have to mark articles as expirable by hand.  Gnus provides
14768 two features, called ``auto-expire'' and ``total-expire'', that can help you
14769 with this.  In a nutshell, ``auto-expire'' means that Gnus hits @kbd{E}
14770 for you when you select an article.  And ``total-expire'' means that Gnus
14771 considers all articles as expirable that are read.  So, in addition to
14772 the articles marked @samp{E}, also the articles marked @samp{r},
14773 @samp{R}, @samp{O}, @samp{K}, @samp{Y} and so on are considered
14774 expirable.
14775
14776 When should either auto-expire or total-expire be used?  Most people
14777 who are subscribed to mailing lists split each list into its own group
14778 and then turn on auto-expire or total-expire for those groups.
14779 (@xref{Splitting Mail}, for more information on splitting each list
14780 into its own group.)
14781
14782 Which one is better, auto-expire or total-expire?  It's not easy to
14783 answer.  Generally speaking, auto-expire is probably faster.  Another
14784 advantage of auto-expire is that you get more marks to work with: for
14785 the articles that are supposed to stick around, you can still choose
14786 between tick and dormant and read marks.  But with total-expire, you
14787 only have dormant and ticked to choose from.  The advantage of
14788 total-expire is that it works well with adaptive scoring (@pxref{Adaptive
14789 Scoring}).  Auto-expire works with normal scoring but not with adaptive
14790 scoring.
14791
14792 @vindex gnus-auto-expirable-newsgroups
14793 Groups that match the regular expression
14794 @code{gnus-auto-expirable-newsgroups} will have all articles that you
14795 read marked as expirable automatically.  All articles marked as
14796 expirable have an @samp{E} in the first column in the summary buffer.
14797
14798 By default, if you have auto expiry switched on, Gnus will mark all the
14799 articles you read as expirable, no matter if they were read or unread
14800 before.  To avoid having articles marked as read marked as expirable
14801 automatically, you can put something like the following in your
14802 @file{~/.gnus.el} file:
14803
14804 @vindex gnus-mark-article-hook
14805 @lisp
14806 (remove-hook 'gnus-mark-article-hook
14807              'gnus-summary-mark-read-and-unread-as-read)
14808 (add-hook 'gnus-mark-article-hook 'gnus-summary-mark-unread-as-read)
14809 @end lisp
14810
14811 Note that making a group auto-expirable doesn't mean that all read
14812 articles are expired---only the articles marked as expirable
14813 will be expired.  Also note that using the @kbd{d} command won't make
14814 articles expirable---only semi-automatic marking of articles as read will
14815 mark the articles as expirable in auto-expirable groups.
14816
14817 Let's say you subscribe to a couple of mailing lists, and you want the
14818 articles you have read to disappear after a while:
14819
14820 @lisp
14821 (setq gnus-auto-expirable-newsgroups
14822       "mail.nonsense-list\\|mail.nice-list")
14823 @end lisp
14824
14825 Another way to have auto-expiry happen is to have the element
14826 @code{auto-expire} in the group parameters of the group.
14827
14828 If you use adaptive scoring (@pxref{Adaptive Scoring}) and
14829 auto-expiring, you'll have problems.  Auto-expiring and adaptive scoring
14830 don't really mix very well.
14831
14832 @vindex nnmail-expiry-wait
14833 The @code{nnmail-expiry-wait} variable supplies the default time an
14834 expirable article has to live.  Gnus starts counting days from when the
14835 message @emph{arrived}, not from when it was sent.  The default is seven
14836 days.
14837
14838 Gnus also supplies a function that lets you fine-tune how long articles
14839 are to live, based on what group they are in.  Let's say you want to
14840 have one month expiry period in the @samp{mail.private} group, a one day
14841 expiry period in the @samp{mail.junk} group, and a six day expiry period
14842 everywhere else:
14843
14844 @vindex nnmail-expiry-wait-function
14845 @lisp
14846 (setq nnmail-expiry-wait-function
14847       (lambda (group)
14848        (cond ((string= group "mail.private")
14849                31)
14850              ((string= group "mail.junk")
14851                1)
14852              ((string= group "important")
14853                'never)
14854              (t
14855                6))))
14856 @end lisp
14857
14858 The group names this function is fed are ``unadorned'' group
14859 names---no @samp{nnml:} prefixes and the like.
14860
14861 The @code{nnmail-expiry-wait} variable and
14862 @code{nnmail-expiry-wait-function} function can either be a number (not
14863 necessarily an integer) or one of the symbols @code{immediate} or
14864 @code{never}.
14865
14866 You can also use the @code{expiry-wait} group parameter to selectively
14867 change the expiry period (@pxref{Group Parameters}).
14868
14869 @vindex nnmail-expiry-target
14870 The normal action taken when expiring articles is to delete them.
14871 However, in some circumstances it might make more sense to move them
14872 to other groups instead of deleting them.  The variable
14873 @code{nnmail-expiry-target} (and the @code{expiry-target} group
14874 parameter) controls this.  The variable supplies a default value for
14875 all groups, which can be overridden for specific groups by the group
14876 parameter.  default value is @code{delete}, but this can also be a
14877 string (which should be the name of the group the message should be
14878 moved to), or a function (which will be called in a buffer narrowed to
14879 the message in question, and with the name of the group being moved
14880 from as its parameter) which should return a target---either a group
14881 name or @code{delete}.
14882
14883 Here's an example for specifying a group name:
14884 @lisp
14885 (setq nnmail-expiry-target "nnml:expired")
14886 @end lisp
14887
14888 @findex nnmail-fancy-expiry-target
14889 @vindex nnmail-fancy-expiry-targets
14890 Gnus provides a function @code{nnmail-fancy-expiry-target} which will
14891 expire mail to groups according to the variable
14892 @code{nnmail-fancy-expiry-targets}.  Here's an example:
14893
14894 @lisp
14895  (setq nnmail-expiry-target 'nnmail-fancy-expiry-target
14896        nnmail-fancy-expiry-targets
14897        '((to-from "boss" "nnfolder:Work")
14898          ("subject" "IMPORTANT" "nnfolder:IMPORTANT.%Y.%b")
14899          ("from" ".*" "nnfolder:Archive-%Y")))
14900 @end lisp
14901
14902 With this setup, any mail that has @code{IMPORTANT} in its Subject
14903 header and was sent in the year @code{YYYY} and month @code{MMM}, will
14904 get expired to the group @code{nnfolder:IMPORTANT.YYYY.MMM}.  If its
14905 From or To header contains the string @code{boss}, it will get expired
14906 to @code{nnfolder:Work}.  All other mail will get expired to
14907 @code{nnfolder:Archive-YYYY}.
14908
14909 @vindex nnmail-keep-last-article
14910 If @code{nnmail-keep-last-article} is non-@code{nil}, Gnus will never
14911 expire the final article in a mail newsgroup.  This is to make life
14912 easier for procmail users.
14913
14914 @vindex gnus-total-expirable-newsgroups
14915 By the way: That line up there, about Gnus never expiring non-expirable
14916 articles, is a lie.  If you put @code{total-expire} in the group
14917 parameters, articles will not be marked as expirable, but all read
14918 articles will be put through the expiry process.  Use with extreme
14919 caution.  Even more dangerous is the
14920 @code{gnus-total-expirable-newsgroups} variable.  All groups that match
14921 this regexp will have all read articles put through the expiry process,
14922 which means that @emph{all} old mail articles in the groups in question
14923 will be deleted after a while.  Use with extreme caution, and don't come
14924 crying to me when you discover that the regexp you used matched the
14925 wrong group and all your important mail has disappeared.  Be a
14926 @emph{man}!  Or a @emph{woman}!  Whatever you feel more comfortable
14927 with!  So there!
14928
14929 Most people make most of their mail groups total-expirable, though.
14930
14931 @vindex gnus-inhibit-user-auto-expire
14932 If @code{gnus-inhibit-user-auto-expire} is non-@code{nil}, user marking
14933 commands will not mark an article as expirable, even if the group has
14934 auto-expire turned on.
14935
14936
14937 @node Washing Mail
14938 @subsection Washing Mail
14939 @cindex mail washing
14940 @cindex list server brain damage
14941 @cindex incoming mail treatment
14942
14943 Mailers and list servers are notorious for doing all sorts of really,
14944 really stupid things with mail.  ``Hey, RFC 822 doesn't explicitly
14945 prohibit us from adding the string @code{wE aRe ElItE!!!!!1!!} to the
14946 end of all lines passing through our server, so let's do that!!!!1!''
14947 Yes, but RFC 822 wasn't designed to be read by morons.  Things that were
14948 considered to be self-evident were not discussed.  So.  Here we are.
14949
14950 Case in point:  The German version of Microsoft Exchange adds @samp{AW:
14951 } to the subjects of replies instead of @samp{Re: }.  I could pretend to
14952 be shocked and dismayed by this, but I haven't got the energy.  It is to
14953 laugh.
14954
14955 Gnus provides a plethora of functions for washing articles while
14956 displaying them, but it might be nicer to do the filtering before
14957 storing the mail to disk.  For that purpose, we have three hooks and
14958 various functions that can be put in these hooks.
14959
14960 @table @code
14961 @item nnmail-prepare-incoming-hook
14962 @vindex nnmail-prepare-incoming-hook
14963 This hook is called before doing anything with the mail and is meant for
14964 grand, sweeping gestures.  It is called in a buffer that contains all
14965 the new, incoming mail.  Functions to be used include:
14966
14967 @table @code
14968 @item nnheader-ms-strip-cr
14969 @findex nnheader-ms-strip-cr
14970 Remove trailing carriage returns from each line.  This is default on
14971 Emacs running on MS machines.
14972
14973 @end table
14974
14975 @item nnmail-prepare-incoming-header-hook
14976 @vindex nnmail-prepare-incoming-header-hook
14977 This hook is called narrowed to each header.  It can be used when
14978 cleaning up the headers.  Functions that can be used include:
14979
14980 @table @code
14981 @item nnmail-remove-leading-whitespace
14982 @findex nnmail-remove-leading-whitespace
14983 Clear leading white space that ``helpful'' listservs have added to the
14984 headers to make them look nice.  Aaah.
14985
14986 (Note that this function works on both the header on the body of all
14987 messages, so it is a potentially dangerous function to use (if a body
14988 of a message contains something that looks like a header line).  So
14989 rather than fix the bug, it is of course the right solution to make it
14990 into a feature by documenting it.)
14991
14992 @item nnmail-remove-list-identifiers
14993 @findex nnmail-remove-list-identifiers
14994 Some list servers add an identifier---for example, @samp{(idm)}---to the
14995 beginning of all @code{Subject} headers.  I'm sure that's nice for
14996 people who use stone age mail readers.  This function will remove
14997 strings that match the @code{nnmail-list-identifiers} regexp, which can
14998 also be a list of regexp.  @code{nnmail-list-identifiers} may not contain
14999 @code{\\(..\\)}.
15000
15001 For instance, if you want to remove the @samp{(idm)} and the
15002 @samp{nagnagnag} identifiers:
15003
15004 @lisp
15005 (setq nnmail-list-identifiers
15006       '("(idm)" "nagnagnag"))
15007 @end lisp
15008
15009 This can also be done non-destructively with
15010 @code{gnus-list-identifiers}, @xref{Article Hiding}.
15011
15012 @item nnmail-remove-tabs
15013 @findex nnmail-remove-tabs
15014 Translate all @samp{TAB} characters into @samp{SPACE} characters.
15015
15016 @item nnmail-fix-eudora-headers
15017 @findex nnmail-fix-eudora-headers
15018 @cindex Eudora
15019 Eudora produces broken @code{References} headers, but OK
15020 @code{In-Reply-To} headers.  This function will get rid of the
15021 @code{References} headers.
15022
15023 @end table
15024
15025 @item nnmail-prepare-incoming-message-hook
15026 @vindex nnmail-prepare-incoming-message-hook
15027 This hook is called narrowed to each message.  Functions to be used
15028 include:
15029
15030 @table @code
15031 @item article-de-quoted-unreadable
15032 @findex article-de-quoted-unreadable
15033 Decode Quoted Readable encoding.
15034
15035 @end table
15036 @end table
15037
15038
15039 @node Duplicates
15040 @subsection Duplicates
15041
15042 @vindex nnmail-treat-duplicates
15043 @vindex nnmail-message-id-cache-length
15044 @vindex nnmail-message-id-cache-file
15045 @cindex duplicate mails
15046 If you are a member of a couple of mailing lists, you will sometimes
15047 receive two copies of the same mail.  This can be quite annoying, so
15048 @code{nnmail} checks for and treats any duplicates it might find.  To do
15049 this, it keeps a cache of old @code{Message-ID}s---
15050 @code{nnmail-message-id-cache-file}, which is @file{~/.nnmail-cache} by
15051 default.  The approximate maximum number of @code{Message-ID}s stored
15052 there is controlled by the @code{nnmail-message-id-cache-length}
15053 variable, which is 1000 by default.  (So 1000 @code{Message-ID}s will be
15054 stored.) If all this sounds scary to you, you can set
15055 @code{nnmail-treat-duplicates} to @code{warn} (which is what it is by
15056 default), and @code{nnmail} won't delete duplicate mails.  Instead it
15057 will insert a warning into the head of the mail saying that it thinks
15058 that this is a duplicate of a different message.
15059
15060 This variable can also be a function.  If that's the case, the function
15061 will be called from a buffer narrowed to the message in question with
15062 the @code{Message-ID} as a parameter.  The function must return either
15063 @code{nil}, @code{warn}, or @code{delete}.
15064
15065 You can turn this feature off completely by setting the variable to
15066 @code{nil}.
15067
15068 If you want all the duplicate mails to be put into a special
15069 @dfn{duplicates} group, you could do that using the normal mail split
15070 methods:
15071
15072 @lisp
15073 (setq nnmail-split-fancy
15074       '(| ;; @r{Messages duplicates go to a separate group.}
15075         ("gnus-warning" "duplicat\\(e\\|ion\\) of message" "duplicate")
15076         ;; @r{Message from daemons, postmaster, and the like to another.}
15077         (any mail "mail.misc")
15078         ;; @r{Other rules.}
15079         [...] ))
15080 @end lisp
15081 @noindent
15082 Or something like:
15083 @lisp
15084 (setq nnmail-split-methods
15085       '(("duplicates" "^Gnus-Warning:.*duplicate")
15086         ;; @r{Other rules.}
15087         [...]))
15088 @end lisp
15089
15090 Here's a neat feature: If you know that the recipient reads her mail
15091 with Gnus, and that she has @code{nnmail-treat-duplicates} set to
15092 @code{delete}, you can send her as many insults as you like, just by
15093 using a @code{Message-ID} of a mail that you know that she's already
15094 received.  Think of all the fun!  She'll never see any of it!  Whee!
15095
15096
15097 @node Not Reading Mail
15098 @subsection Not Reading Mail
15099
15100 If you start using any of the mail back ends, they have the annoying
15101 habit of assuming that you want to read mail with them.  This might not
15102 be unreasonable, but it might not be what you want.
15103
15104 If you set @code{mail-sources} and @code{nnmail-spool-file} to
15105 @code{nil}, none of the back ends will ever attempt to read incoming
15106 mail, which should help.
15107
15108 @vindex nnbabyl-get-new-mail
15109 @vindex nnmbox-get-new-mail
15110 @vindex nnml-get-new-mail
15111 @vindex nnmh-get-new-mail
15112 @vindex nnfolder-get-new-mail
15113 This might be too much, if, for instance, you are reading mail quite
15114 happily with @code{nnml} and just want to peek at some old Rmail
15115 file you have stashed away with @code{nnbabyl}.  All back ends have
15116 variables called back-end-@code{get-new-mail}.  If you want to disable
15117 the @code{nnbabyl} mail reading, you edit the virtual server for the
15118 group to have a setting where @code{nnbabyl-get-new-mail} to @code{nil}.
15119
15120 All the mail back ends will call @code{nn}*@code{-prepare-save-mail-hook}
15121 narrowed to the article to be saved before saving it when reading
15122 incoming mail.
15123
15124
15125 @node Choosing a Mail Back End
15126 @subsection Choosing a Mail Back End
15127
15128 Gnus will read the mail spool when you activate a mail group.  The mail
15129 file is first copied to your home directory.  What happens after that
15130 depends on what format you want to store your mail in.
15131
15132 There are six different mail back ends in the standard Gnus, and more
15133 back ends are available separately.  The mail back end most people use
15134 (because it is possibly the fastest) is @code{nnml} (@pxref{Mail
15135 Spool}).
15136
15137 @menu
15138 * Unix Mail Box::               Using the (quite) standard Un*x mbox.
15139 * Rmail Babyl::                 Emacs programs use the Rmail Babyl format.
15140 * Mail Spool::                  Store your mail in a private spool?
15141 * MH Spool::                    An mhspool-like back end.
15142 * Maildir::                     Another one-file-per-message format.
15143 * Mail Folders::                Having one file for each group.
15144 * Comparing Mail Back Ends::    An in-depth looks at pros and cons.
15145 @end menu
15146
15147
15148 @node Unix Mail Box
15149 @subsubsection Unix Mail Box
15150 @cindex nnmbox
15151 @cindex unix mail box
15152
15153 @vindex nnmbox-active-file
15154 @vindex nnmbox-mbox-file
15155 The @dfn{nnmbox} back end will use the standard Un*x mbox file to store
15156 mail.  @code{nnmbox} will add extra headers to each mail article to say
15157 which group it belongs in.
15158
15159 Virtual server settings:
15160
15161 @table @code
15162 @item nnmbox-mbox-file
15163 @vindex nnmbox-mbox-file
15164 The name of the mail box in the user's home directory.  Default is
15165 @file{~/mbox}.
15166
15167 @item nnmbox-active-file
15168 @vindex nnmbox-active-file
15169 The name of the active file for the mail box.  Default is
15170 @file{~/.mbox-active}.
15171
15172 @item nnmbox-get-new-mail
15173 @vindex nnmbox-get-new-mail
15174 If non-@code{nil}, @code{nnmbox} will read incoming mail and split it
15175 into groups.  Default is @code{t}.
15176 @end table
15177
15178
15179 @node Rmail Babyl
15180 @subsubsection Rmail Babyl
15181 @cindex nnbabyl
15182 @cindex Rmail mbox
15183
15184 @vindex nnbabyl-active-file
15185 @vindex nnbabyl-mbox-file
15186 The @dfn{nnbabyl} back end will use a Babyl mail box (aka. @dfn{Rmail
15187 mbox}) to store mail.  @code{nnbabyl} will add extra headers to each
15188 mail article to say which group it belongs in.
15189
15190 Virtual server settings:
15191
15192 @table @code
15193 @item nnbabyl-mbox-file
15194 @vindex nnbabyl-mbox-file
15195 The name of the Rmail mbox file.  The default is @file{~/RMAIL}
15196
15197 @item nnbabyl-active-file
15198 @vindex nnbabyl-active-file
15199 The name of the active file for the rmail box.  The default is
15200 @file{~/.rmail-active}
15201
15202 @item nnbabyl-get-new-mail
15203 @vindex nnbabyl-get-new-mail
15204 If non-@code{nil}, @code{nnbabyl} will read incoming mail.  Default is
15205 @code{t}
15206 @end table
15207
15208
15209 @node Mail Spool
15210 @subsubsection Mail Spool
15211 @cindex nnml
15212 @cindex mail @acronym{NOV} spool
15213
15214 The @dfn{nnml} spool mail format isn't compatible with any other known
15215 format.  It should be used with some caution.
15216
15217 @vindex nnml-directory
15218 If you use this back end, Gnus will split all incoming mail into files,
15219 one file for each mail, and put the articles into the corresponding
15220 directories under the directory specified by the @code{nnml-directory}
15221 variable.  The default value is @file{~/Mail/}.
15222
15223 You do not have to create any directories beforehand; Gnus will take
15224 care of all that.
15225
15226 If you have a strict limit as to how many files you are allowed to store
15227 in your account, you should not use this back end.  As each mail gets its
15228 own file, you might very well occupy thousands of inodes within a few
15229 weeks.  If this is no problem for you, and it isn't a problem for you
15230 having your friendly systems administrator walking around, madly,
15231 shouting ``Who is eating all my inodes?! Who? Who!?!'', then you should
15232 know that this is probably the fastest format to use.  You do not have
15233 to trudge through a big mbox file just to read your new mail.
15234
15235 @code{nnml} is probably the slowest back end when it comes to article
15236 splitting.  It has to create lots of files, and it also generates
15237 @acronym{NOV} databases for the incoming mails.  This makes it possibly the
15238 fastest back end when it comes to reading mail.
15239
15240 @cindex self contained nnml servers
15241 @cindex marks
15242 When the marks file is used (which it is by default), @code{nnml}
15243 servers have the property that you may backup them using @code{tar} or
15244 similar, and later be able to restore them into Gnus (by adding the
15245 proper @code{nnml} server) and have all your marks be preserved.  Marks
15246 for a group are usually stored in the @code{.marks} file (but see
15247 @code{nnml-marks-file-name}) within each @code{nnml} group's directory.
15248 Individual @code{nnml} groups are also possible to backup, use @kbd{G m}
15249 to restore the group (after restoring the backup into the nnml
15250 directory).
15251
15252 If for some reason you believe your @file{.marks} files are screwed
15253 up, you can just delete them all.  Gnus will then correctly regenerate
15254 them next time it starts.
15255
15256 Virtual server settings:
15257
15258 @table @code
15259 @item nnml-directory
15260 @vindex nnml-directory
15261 All @code{nnml} directories will be placed under this directory.  The
15262 default is the value of @code{message-directory} (whose default value
15263 is @file{~/Mail}).
15264
15265 @item nnml-active-file
15266 @vindex nnml-active-file
15267 The active file for the @code{nnml} server.  The default is
15268 @file{~/Mail/active}.
15269
15270 @item nnml-newsgroups-file
15271 @vindex nnml-newsgroups-file
15272 The @code{nnml} group descriptions file.  @xref{Newsgroups File
15273 Format}.  The default is @file{~/Mail/newsgroups}.
15274
15275 @item nnml-get-new-mail
15276 @vindex nnml-get-new-mail
15277 If non-@code{nil}, @code{nnml} will read incoming mail.  The default is
15278 @code{t}.
15279
15280 @item nnml-nov-is-evil
15281 @vindex nnml-nov-is-evil
15282 If non-@code{nil}, this back end will ignore any @acronym{NOV} files.  The
15283 default is @code{nil}.
15284
15285 @item nnml-nov-file-name
15286 @vindex nnml-nov-file-name
15287 The name of the @acronym{NOV} files.  The default is @file{.overview}.
15288
15289 @item nnml-prepare-save-mail-hook
15290 @vindex nnml-prepare-save-mail-hook
15291 Hook run narrowed to an article before saving.
15292
15293 @item nnml-marks-is-evil
15294 @vindex nnml-marks-is-evil
15295 If non-@code{nil}, this back end will ignore any @sc{marks} files.  The
15296 default is @code{nil}.
15297
15298 @item nnml-marks-file-name
15299 @vindex nnml-marks-file-name
15300 The name of the @dfn{marks} files.  The default is @file{.marks}.
15301
15302 @item nnml-use-compressed-files
15303 @vindex nnml-use-compressed-files
15304 If non-@code{nil}, @code{nnml} will allow using compressed message
15305 files.  This requires @code{auto-compression-mode} to be enabled
15306 (@pxref{Compressed Files, ,Compressed Files, emacs, The Emacs Manual}).
15307 If the value of @code{nnml-use-compressed-files} is a string, it is used
15308 as the file extension specifying the comression program.  You can set it
15309 to @samp{.bz2} if your Emacs supports it.  A value of @code{t} is
15310 equivalent to @samp{.gz}.
15311
15312 @item nnml-compressed-files-size-threshold
15313 @vindex nnml-compressed-files-size-threshold
15314 Default size threshold for compressed message files.  Message files with
15315 bodies larger than that many characters will be automatically compressed
15316 if @code{nnml-use-compressed-files} is non-@code{nil}.
15317
15318 @end table
15319
15320 @findex nnml-generate-nov-databases
15321 If your @code{nnml} groups and @acronym{NOV} files get totally out of
15322 whack, you can do a complete update by typing @kbd{M-x
15323 nnml-generate-nov-databases}.  This command will trawl through the
15324 entire @code{nnml} hierarchy, looking at each and every article, so it
15325 might take a while to complete.  A better interface to this
15326 functionality can be found in the server buffer (@pxref{Server
15327 Commands}).
15328
15329
15330 @node MH Spool
15331 @subsubsection MH Spool
15332 @cindex nnmh
15333 @cindex mh-e mail spool
15334
15335 @code{nnmh} is just like @code{nnml}, except that is doesn't generate
15336 @acronym{NOV} databases and it doesn't keep an active file or marks
15337 file.  This makes @code{nnmh} a @emph{much} slower back end than
15338 @code{nnml}, but it also makes it easier to write procmail scripts
15339 for.
15340
15341 Virtual server settings:
15342
15343 @table @code
15344 @item nnmh-directory
15345 @vindex nnmh-directory
15346 All @code{nnmh} directories will be located under this directory.  The
15347 default is the value of @code{message-directory} (whose default is
15348 @file{~/Mail})
15349
15350 @item nnmh-get-new-mail
15351 @vindex nnmh-get-new-mail
15352 If non-@code{nil}, @code{nnmh} will read incoming mail.  The default is
15353 @code{t}.
15354
15355 @item nnmh-be-safe
15356 @vindex nnmh-be-safe
15357 If non-@code{nil}, @code{nnmh} will go to ridiculous lengths to make
15358 sure that the articles in the folder are actually what Gnus thinks
15359 they are.  It will check date stamps and stat everything in sight, so
15360 setting this to @code{t} will mean a serious slow-down.  If you never
15361 use anything but Gnus to read the @code{nnmh} articles, you do not
15362 have to set this variable to @code{t}.  The default is @code{nil}.
15363 @end table
15364
15365
15366 @node Maildir
15367 @subsubsection Maildir
15368 @cindex nnmaildir
15369 @cindex maildir
15370
15371 @code{nnmaildir} stores mail in the maildir format, with each maildir
15372 corresponding to a group in Gnus.  This format is documented here:
15373 @uref{http://cr.yp.to/proto/maildir.html} and here:
15374 @uref{http://www.qmail.org/man/man5/maildir.html}.  @code{nnmaildir}
15375 also stores extra information in the @file{.nnmaildir/} directory
15376 within a maildir.
15377
15378 Maildir format was designed to allow concurrent deliveries and
15379 reading, without needing locks.  With other back ends, you would have
15380 your mail delivered to a spool of some kind, and then you would
15381 configure Gnus to split mail from that spool into your groups.  You
15382 can still do that with @code{nnmaildir}, but the more common
15383 configuration is to have your mail delivered directly to the maildirs
15384 that appear as group in Gnus.
15385
15386 @code{nnmaildir} is designed to be perfectly reliable: @kbd{C-g} will
15387 never corrupt its data in memory, and @code{SIGKILL} will never
15388 corrupt its data in the filesystem.
15389
15390 @code{nnmaildir} stores article marks and @acronym{NOV} data in each
15391 maildir.  So you can copy a whole maildir from one Gnus setup to
15392 another, and you will keep your marks.
15393
15394 Virtual server settings:
15395
15396 @table @code
15397 @item directory
15398 For each of your @code{nnmaildir} servers (it's very unlikely that
15399 you'd need more than one), you need to create a directory and populate
15400 it with maildirs or symlinks to maildirs (and nothing else; do not
15401 choose a directory already used for other purposes).  Each maildir
15402 will be represented in Gnus as a newsgroup on that server; the
15403 filename of the symlink will be the name of the group.  Any filenames
15404 in the directory starting with @samp{.} are ignored.  The directory is
15405 scanned when you first start Gnus, and each time you type @kbd{g} in
15406 the group buffer; if any maildirs have been removed or added,
15407 @code{nnmaildir} notices at these times.
15408
15409 The value of the @code{directory} parameter should be a Lisp form
15410 which is processed by @code{eval} and @code{expand-file-name} to get
15411 the path of the directory for this server.  The form is @code{eval}ed
15412 only when the server is opened; the resulting string is used until the
15413 server is closed.  (If you don't know about forms and @code{eval},
15414 don't worry---a simple string will work.)  This parameter is not
15415 optional; you must specify it.  I don't recommend using
15416 @code{"~/Mail"} or a subdirectory of it; several other parts of Gnus
15417 use that directory by default for various things, and may get confused
15418 if @code{nnmaildir} uses it too.  @code{"~/.nnmaildir"} is a typical
15419 value.
15420
15421 @item target-prefix
15422 This should be a Lisp form which is processed by @code{eval} and
15423 @code{expand-file-name}.  The form is @code{eval}ed only when the
15424 server is opened; the resulting string is used until the server is
15425 closed.
15426
15427 When you create a group on an @code{nnmaildir} server, the maildir is
15428 created with @code{target-prefix} prepended to its name, and a symlink
15429 pointing to that maildir is created, named with the plain group name.
15430 So if @code{directory} is @code{"~/.nnmaildir"} and
15431 @code{target-prefix} is @code{"../maildirs/"}, then when you create
15432 the group @code{foo}, @code{nnmaildir} will create
15433 @file{~/.nnmaildir/../maildirs/foo} as a maildir, and will create
15434 @file{~/.nnmaildir/foo} as a symlink pointing to
15435 @file{../maildirs/foo}.
15436
15437 You can set @code{target-prefix} to a string without any slashes to
15438 create both maildirs and symlinks in the same @code{directory}; in
15439 this case, any maildirs found in @code{directory} whose names start
15440 with @code{target-prefix} will not be listed as groups (but the
15441 symlinks pointing to them will be).
15442
15443 As a special case, if @code{target-prefix} is @code{""} (the default),
15444 then when you create a group, the maildir will be created in
15445 @code{directory} without a corresponding symlink.  Beware that you
15446 cannot use @code{gnus-group-delete-group} on such groups without the
15447 @code{force} argument.
15448
15449 @item directory-files
15450 This should be a function with the same interface as
15451 @code{directory-files} (such as @code{directory-files} itself).  It is
15452 used to scan the server's @code{directory} for maildirs.  This
15453 parameter is optional; the default is
15454 @code{nnheader-directory-files-safe} if
15455 @code{nnheader-directory-files-is-safe} is @code{nil}, and
15456 @code{directory-files} otherwise.
15457 (@code{nnheader-directory-files-is-safe} is checked only once when the
15458 server is opened; if you want to check it each time the directory is
15459 scanned, you'll have to provide your own function that does that.)
15460
15461 @item get-new-mail
15462 If non-@code{nil}, then after scanning for new mail in the group
15463 maildirs themselves as usual, this server will also incorporate mail
15464 the conventional Gnus way, from @code{mail-sources} according to
15465 @code{nnmail-split-methods} or @code{nnmail-split-fancy}.  The default
15466 value is @code{nil}.
15467
15468 Do @emph{not} use the same maildir both in @code{mail-sources} and as
15469 an @code{nnmaildir} group.  The results might happen to be useful, but
15470 that would be by chance, not by design, and the results might be
15471 different in the future.  If your split rules create new groups,
15472 remember to supply a @code{create-directory} server parameter.
15473 @end table
15474
15475 @subsubsection Group parameters
15476
15477 @code{nnmaildir} uses several group parameters.  It's safe to ignore
15478 all this; the default behavior for @code{nnmaildir} is the same as the
15479 default behavior for other mail back ends: articles are deleted after
15480 one week, etc.  Except for the expiry parameters, all this
15481 functionality is unique to @code{nnmaildir}, so you can ignore it if
15482 you're just trying to duplicate the behavior you already have with
15483 another back end.
15484
15485 If the value of any of these parameters is a vector, the first element
15486 is evaluated as a Lisp form and the result is used, rather than the
15487 original value.  If the value is not a vector, the value itself is
15488 evaluated as a Lisp form.  (This is why these parameters use names
15489 different from those of other, similar parameters supported by other
15490 back ends: they have different, though similar, meanings.)  (For
15491 numbers, strings, @code{nil}, and @code{t}, you can ignore the
15492 @code{eval} business again; for other values, remember to use an extra
15493 quote and wrap the value in a vector when appropriate.)
15494
15495 @table @code
15496 @item expire-age
15497 An integer specifying the minimum age, in seconds, of an article
15498 before it will be expired, or the symbol @code{never} to specify that
15499 articles should never be expired.  If this parameter is not set,
15500 @code{nnmaildir} falls back to the usual
15501 @code{nnmail-expiry-wait}(@code{-function}) variables (the
15502 @code{expiry-wait} group parameter overrides @code{nnmail-expiry-wait}
15503 and makes @code{nnmail-expiry-wait-function} ineffective).  If you
15504 wanted a value of 3 days, you could use something like @code{[(* 3 24
15505 60 60)]}; @code{nnmaildir} will evaluate the form and use the result.
15506 An article's age is measured starting from the article file's
15507 modification time.  Normally, this is the same as the article's
15508 delivery time, but editing an article makes it younger.  Moving an
15509 article (other than via expiry) may also make an article younger.
15510
15511 @item expire-group
15512 If this is set to a string such as a full Gnus group name, like
15513 @example
15514 "backend+server.address.string:group.name"
15515 @end example
15516 and if it is not the name of the same group that the parameter belongs
15517 to, then articles will be moved to the specified group during expiry
15518 before being deleted.  @emph{If this is set to an @code{nnmaildir}
15519 group, the article will be just as old in the destination group as it
15520 was in the source group.}  So be careful with @code{expire-age} in the
15521 destination group.  If this is set to the name of the same group that
15522 the parameter belongs to, then the article is not expired at all.  If
15523 you use the vector form, the first element is evaluated once for each
15524 article.  So that form can refer to
15525 @code{nnmaildir-article-file-name}, etc., to decide where to put the
15526 article.  @emph{Even if this parameter is not set, @code{nnmaildir}
15527 does not fall back to the @code{expiry-target} group parameter or the
15528 @code{nnmail-expiry-target} variable.}
15529
15530 @item read-only
15531 If this is set to @code{t}, @code{nnmaildir} will treat the articles
15532 in this maildir as read-only.  This means: articles are not renamed
15533 from @file{new/} into @file{cur/}; articles are only found in
15534 @file{new/}, not @file{cur/}; articles are never deleted; articles
15535 cannot be edited.  @file{new/} is expected to be a symlink to the
15536 @file{new/} directory of another maildir---e.g., a system-wide mailbox
15537 containing a mailing list of common interest.  Everything in the
15538 maildir outside @file{new/} is @emph{not} treated as read-only, so for
15539 a shared mailbox, you do still need to set up your own maildir (or
15540 have write permission to the shared mailbox); your maildir just won't
15541 contain extra copies of the articles.
15542
15543 @item directory-files
15544 A function with the same interface as @code{directory-files}.  It is
15545 used to scan the directories in the maildir corresponding to this
15546 group to find articles.  The default is the function specified by the
15547 server's @code{directory-files} parameter.
15548
15549 @item distrust-Lines:
15550 If non-@code{nil}, @code{nnmaildir} will always count the lines of an
15551 article, rather than use the @code{Lines:} header field.  If
15552 @code{nil}, the header field will be used if present.
15553
15554 @item always-marks
15555 A list of mark symbols, such as @code{['(read expire)]}.  Whenever
15556 Gnus asks @code{nnmaildir} for article marks, @code{nnmaildir} will
15557 say that all articles have these marks, regardless of whether the
15558 marks stored in the filesystem say so.  This is a proof-of-concept
15559 feature that will probably be removed eventually; it ought to be done
15560 in Gnus proper, or abandoned if it's not worthwhile.
15561
15562 @item never-marks
15563 A list of mark symbols, such as @code{['(tick expire)]}.  Whenever
15564 Gnus asks @code{nnmaildir} for article marks, @code{nnmaildir} will
15565 say that no articles have these marks, regardless of whether the marks
15566 stored in the filesystem say so.  @code{never-marks} overrides
15567 @code{always-marks}.  This is a proof-of-concept feature that will
15568 probably be removed eventually; it ought to be done in Gnus proper, or
15569 abandoned if it's not worthwhile.
15570
15571 @item nov-cache-size
15572 An integer specifying the size of the @acronym{NOV} memory cache.  To
15573 speed things up, @code{nnmaildir} keeps @acronym{NOV} data in memory
15574 for a limited number of articles in each group.  (This is probably not
15575 worthwhile, and will probably be removed in the future.)  This
15576 parameter's value is noticed only the first time a group is seen after
15577 the server is opened---i.e., when you first start Gnus, typically.
15578 The @acronym{NOV} cache is never resized until the server is closed
15579 and reopened.  The default is an estimate of the number of articles
15580 that would be displayed in the summary buffer: a count of articles
15581 that are either marked with @code{tick} or not marked with
15582 @code{read}, plus a little extra.
15583 @end table
15584
15585 @subsubsection Article identification
15586 Articles are stored in the @file{cur/} subdirectory of each maildir.
15587 Each article file is named like @code{uniq:info}, where @code{uniq}
15588 contains no colons.  @code{nnmaildir} ignores, but preserves, the
15589 @code{:info} part.  (Other maildir readers typically use this part of
15590 the filename to store marks.)  The @code{uniq} part uniquely
15591 identifies the article, and is used in various places in the
15592 @file{.nnmaildir/} subdirectory of the maildir to store information
15593 about the corresponding article.  The full pathname of an article is
15594 available in the variable @code{nnmaildir-article-file-name} after you
15595 request the article in the summary buffer.
15596
15597 @subsubsection NOV data
15598 An article identified by @code{uniq} has its @acronym{NOV} data (used
15599 to generate lines in the summary buffer) stored in
15600 @code{.nnmaildir/nov/uniq}.  There is no
15601 @code{nnmaildir-generate-nov-databases} function.  (There isn't much
15602 need for it---an article's @acronym{NOV} data is updated automatically
15603 when the article or @code{nnmail-extra-headers} has changed.)  You can
15604 force @code{nnmaildir} to regenerate the @acronym{NOV} data for a
15605 single article simply by deleting the corresponding @acronym{NOV}
15606 file, but @emph{beware}: this will also cause @code{nnmaildir} to
15607 assign a new article number for this article, which may cause trouble
15608 with @code{seen} marks, the Agent, and the cache.
15609
15610 @subsubsection Article marks
15611 An article identified by @code{uniq} is considered to have the mark
15612 @code{flag} when the file @file{.nnmaildir/marks/flag/uniq} exists.
15613 When Gnus asks @code{nnmaildir} for a group's marks, @code{nnmaildir}
15614 looks for such files and reports the set of marks it finds.  When Gnus
15615 asks @code{nnmaildir} to store a new set of marks, @code{nnmaildir}
15616 creates and deletes the corresponding files as needed.  (Actually,
15617 rather than create a new file for each mark, it just creates hard
15618 links to @file{.nnmaildir/markfile}, to save inodes.)
15619
15620 You can invent new marks by creating a new directory in
15621 @file{.nnmaildir/marks/}.  You can tar up a maildir and remove it from
15622 your server, untar it later, and keep your marks.  You can add and
15623 remove marks yourself by creating and deleting mark files.  If you do
15624 this while Gnus is running and your @code{nnmaildir} server is open,
15625 it's best to exit all summary buffers for @code{nnmaildir} groups and
15626 type @kbd{s} in the group buffer first, and to type @kbd{g} or
15627 @kbd{M-g} in the group buffer afterwards.  Otherwise, Gnus might not
15628 pick up the changes, and might undo them.
15629
15630
15631 @node Mail Folders
15632 @subsubsection Mail Folders
15633 @cindex nnfolder
15634 @cindex mbox folders
15635 @cindex mail folders
15636
15637 @code{nnfolder} is a back end for storing each mail group in a
15638 separate file.  Each file is in the standard Un*x mbox format.
15639 @code{nnfolder} will add extra headers to keep track of article
15640 numbers and arrival dates.
15641
15642 @cindex self contained nnfolder servers
15643 @cindex marks
15644 When the marks file is used (which it is by default), @code{nnfolder}
15645 servers have the property that you may backup them using @code{tar} or
15646 similar, and later be able to restore them into Gnus (by adding the
15647 proper @code{nnfolder} server) and have all your marks be preserved.
15648 Marks for a group are usually stored in a file named as the mbox file
15649 with @code{.mrk} concatenated to it (but see
15650 @code{nnfolder-marks-file-suffix}) within the @code{nnfolder}
15651 directory.  Individual @code{nnfolder} groups are also possible to
15652 backup, use @kbd{G m} to restore the group (after restoring the backup
15653 into the @code{nnfolder} directory).
15654
15655 Virtual server settings:
15656
15657 @table @code
15658 @item nnfolder-directory
15659 @vindex nnfolder-directory
15660 All the @code{nnfolder} mail boxes will be stored under this
15661 directory.  The default is the value of @code{message-directory}
15662 (whose default is @file{~/Mail})
15663
15664 @item nnfolder-active-file
15665 @vindex nnfolder-active-file
15666 The name of the active file.  The default is @file{~/Mail/active}.
15667
15668 @item nnfolder-newsgroups-file
15669 @vindex nnfolder-newsgroups-file
15670 The name of the group descriptions file.  @xref{Newsgroups File
15671 Format}.  The default is @file{~/Mail/newsgroups}
15672
15673 @item nnfolder-get-new-mail
15674 @vindex nnfolder-get-new-mail
15675 If non-@code{nil}, @code{nnfolder} will read incoming mail.  The
15676 default is @code{t}
15677
15678 @item nnfolder-save-buffer-hook
15679 @vindex nnfolder-save-buffer-hook
15680 @cindex backup files
15681 Hook run before saving the folders.  Note that Emacs does the normal
15682 backup renaming of files even with the @code{nnfolder} buffers.  If
15683 you wish to switch this off, you could say something like the
15684 following in your @file{.emacs} file:
15685
15686 @lisp
15687 (defun turn-off-backup ()
15688   (set (make-local-variable 'backup-inhibited) t))
15689
15690 (add-hook 'nnfolder-save-buffer-hook 'turn-off-backup)
15691 @end lisp
15692
15693 @item nnfolder-delete-mail-hook
15694 @vindex nnfolder-delete-mail-hook
15695 Hook run in a buffer narrowed to the message that is to be deleted.
15696 This function can be used to copy the message to somewhere else, or to
15697 extract some information from it before removing it.
15698
15699 @item nnfolder-nov-is-evil
15700 @vindex nnfolder-nov-is-evil
15701 If non-@code{nil}, this back end will ignore any @acronym{NOV} files.  The
15702 default is @code{nil}.
15703
15704 @item nnfolder-nov-file-suffix
15705 @vindex nnfolder-nov-file-suffix
15706 The extension for @acronym{NOV} files.  The default is @file{.nov}.
15707
15708 @item nnfolder-nov-directory
15709 @vindex nnfolder-nov-directory
15710 The directory where the @acronym{NOV} files should be stored.  If
15711 @code{nil}, @code{nnfolder-directory} is used.
15712
15713 @item nnfolder-marks-is-evil
15714 @vindex nnfolder-marks-is-evil
15715 If non-@code{nil}, this back end will ignore any @sc{marks} files.  The
15716 default is @code{nil}.
15717
15718 @item nnfolder-marks-file-suffix
15719 @vindex nnfolder-marks-file-suffix
15720 The extension for @sc{marks} files.  The default is @file{.mrk}.
15721
15722 @item nnfolder-marks-directory
15723 @vindex nnfolder-marks-directory
15724 The directory where the @sc{marks} files should be stored.  If
15725 @code{nil}, @code{nnfolder-directory} is used.
15726
15727 @end table
15728
15729
15730 @findex nnfolder-generate-active-file
15731 @kindex M-x nnfolder-generate-active-file
15732 If you have lots of @code{nnfolder}-like files you'd like to read with
15733 @code{nnfolder}, you can use the @kbd{M-x nnfolder-generate-active-file}
15734 command to make @code{nnfolder} aware of all likely files in
15735 @code{nnfolder-directory}.  This only works if you use long file names,
15736 though.
15737
15738 @node Comparing Mail Back Ends
15739 @subsubsection Comparing Mail Back Ends
15740
15741 First, just for terminology, the @dfn{back end} is the common word for a
15742 low-level access method---a transport, if you will, by which something
15743 is acquired.  The sense is that one's mail has to come from somewhere,
15744 and so selection of a suitable back end is required in order to get that
15745 mail within spitting distance of Gnus.
15746
15747 The same concept exists for Usenet itself: Though access to articles is
15748 typically done by @acronym{NNTP} these days, once upon a midnight dreary, everyone
15749 in the world got at Usenet by running a reader on the machine where the
15750 articles lay (the machine which today we call an @acronym{NNTP} server), and
15751 access was by the reader stepping into the articles' directory spool
15752 area directly.  One can still select between either the @code{nntp} or
15753 @code{nnspool} back ends, to select between these methods, if one happens
15754 actually to live on the server (or can see its spool directly, anyway,
15755 via NFS).
15756
15757 The goal in selecting a mail back end is to pick one which
15758 simultaneously represents a suitable way of dealing with the original
15759 format plus leaving mail in a form that is convenient to use in the
15760 future.  Here are some high and low points on each:
15761
15762 @table @code
15763 @item nnmbox
15764
15765 UNIX systems have historically had a single, very common, and well-
15766 defined format.  All messages arrive in a single @dfn{spool file}, and
15767 they are delineated by a line whose regular expression matches
15768 @samp{^From_}.  (My notational use of @samp{_} is to indicate a space,
15769 to make it clear in this instance that this is not the RFC-specified
15770 @samp{From:} header.)  Because Emacs and therefore Gnus emanate
15771 historically from the Unix environment, it is simplest if one does not
15772 mess a great deal with the original mailbox format, so if one chooses
15773 this back end, Gnus' primary activity in getting mail from the real spool
15774 area to Gnus' preferred directory is simply to copy it, with no
15775 (appreciable) format change in the process.  It is the ``dumbest'' way
15776 to move mail into availability in the Gnus environment.  This makes it
15777 fast to move into place, but slow to parse, when Gnus has to look at
15778 what's where.
15779
15780 @item nnbabyl
15781
15782 Once upon a time, there was the DEC-10 and DEC-20, running operating
15783 systems called TOPS and related things, and the usual (only?) mail
15784 reading environment was a thing called Babyl.  I don't know what format
15785 was used for mail landing on the system, but Babyl had its own internal
15786 format to which mail was converted, primarily involving creating a
15787 spool-file-like entity with a scheme for inserting Babyl-specific
15788 headers and status bits above the top of each message in the file.
15789 Rmail was Emacs' first mail reader, it was written by Richard Stallman,
15790 and Stallman came out of that TOPS/Babyl environment, so he wrote Rmail
15791 to understand the mail files folks already had in existence.  Gnus (and
15792 VM, for that matter) continue to support this format because it's
15793 perceived as having some good qualities in those mailer-specific
15794 headers/status bits stuff.  Rmail itself still exists as well, of
15795 course, and is still maintained by Stallman.
15796
15797 Both of the above forms leave your mail in a single file on your
15798 file system, and they must parse that entire file each time you take a
15799 look at your mail.
15800
15801 @item nnml
15802
15803 @code{nnml} is the back end which smells the most as though you were
15804 actually operating with an @code{nnspool}-accessed Usenet system.  (In
15805 fact, I believe @code{nnml} actually derived from @code{nnspool} code,
15806 lo these years ago.)  One's mail is taken from the original spool file,
15807 and is then cut up into individual message files, 1:1.  It maintains a
15808 Usenet-style active file (analogous to what one finds in an INN- or
15809 CNews-based news system in (for instance) @file{/var/lib/news/active},
15810 or what is returned via the @samp{NNTP LIST} verb) and also creates
15811 @dfn{overview} files for efficient group entry, as has been defined for
15812 @acronym{NNTP} servers for some years now.  It is slower in mail-splitting,
15813 due to the creation of lots of files, updates to the @code{nnml} active
15814 file, and additions to overview files on a per-message basis, but it is
15815 extremely fast on access because of what amounts to the indexing support
15816 provided by the active file and overviews.
15817
15818 @code{nnml} costs @dfn{inodes} in a big way; that is, it soaks up the
15819 resource which defines available places in the file system to put new
15820 files.  Sysadmins take a dim view of heavy inode occupation within
15821 tight, shared file systems.  But if you live on a personal machine where
15822 the file system is your own and space is not at a premium, @code{nnml}
15823 wins big.
15824
15825 It is also problematic using this back end if you are living in a
15826 FAT16-based Windows world, since much space will be wasted on all these
15827 tiny files.
15828
15829 @item nnmh
15830
15831 The Rand MH mail-reading system has been around UNIX systems for a very
15832 long time; it operates by splitting one's spool file of messages into
15833 individual files, but with little or no indexing support---@code{nnmh}
15834 is considered to be semantically equivalent to ``@code{nnml} without
15835 active file or overviews''.  This is arguably the worst choice, because
15836 one gets the slowness of individual file creation married to the
15837 slowness of access parsing when learning what's new in one's groups.
15838
15839 @item nnfolder
15840
15841 Basically the effect of @code{nnfolder} is @code{nnmbox} (the first
15842 method described above) on a per-group basis.  That is, @code{nnmbox}
15843 itself puts @emph{all} one's mail in one file; @code{nnfolder} provides a
15844 little bit of optimization to this so that each of one's mail groups has
15845 a Unix mail box file.  It's faster than @code{nnmbox} because each group
15846 can be parsed separately, and still provides the simple Unix mail box
15847 format requiring minimal effort in moving the mail around.  In addition,
15848 it maintains an ``active'' file making it much faster for Gnus to figure
15849 out how many messages there are in each separate group.
15850
15851 If you have groups that are expected to have a massive amount of
15852 messages, @code{nnfolder} is not the best choice, but if you receive
15853 only a moderate amount of mail, @code{nnfolder} is probably the most
15854 friendly mail back end all over.
15855
15856 @item nnmaildir
15857
15858 For configuring expiry and other things, @code{nnmaildir} uses
15859 incompatible group parameters, slightly different from those of other
15860 mail back ends.
15861
15862 @code{nnmaildir} is largely similar to @code{nnml}, with some notable
15863 differences.  Each message is stored in a separate file, but the
15864 filename is unrelated to the article number in Gnus.  @code{nnmaildir}
15865 also stores the equivalent of @code{nnml}'s overview files in one file
15866 per article, so it uses about twice as many inodes as @code{nnml}.  (Use
15867 @code{df -i} to see how plentiful your inode supply is.)  If this slows
15868 you down or takes up very much space, consider switching to
15869 @uref{http://www.namesys.com/, ReiserFS} or another non-block-structured
15870 file system.
15871
15872 Since maildirs don't require locking for delivery, the maildirs you use
15873 as groups can also be the maildirs your mail is directly delivered to.
15874 This means you can skip Gnus' mail splitting if your mail is already
15875 organized into different mailboxes during delivery.  A @code{directory}
15876 entry in @code{mail-sources} would have a similar effect, but would
15877 require one set of mailboxes for spooling deliveries (in mbox format,
15878 thus damaging message bodies), and another set to be used as groups (in
15879 whatever format you like).  A maildir has a built-in spool, in the
15880 @code{new/} subdirectory.  Beware that currently, mail moved from
15881 @code{new/} to @code{cur/} instead of via mail splitting will not
15882 undergo treatment such as duplicate checking.
15883
15884 @code{nnmaildir} stores article marks for a given group in the
15885 corresponding maildir, in a way designed so that it's easy to manipulate
15886 them from outside Gnus.  You can tar up a maildir, unpack it somewhere
15887 else, and still have your marks.  @code{nnml} also stores marks, but
15888 it's not as easy to work with them from outside Gnus as with
15889 @code{nnmaildir}.
15890
15891 @code{nnmaildir} uses a significant amount of memory to speed things up.
15892 (It keeps in memory some of the things that @code{nnml} stores in files
15893 and that @code{nnmh} repeatedly parses out of message files.)  If this
15894 is a problem for you, you can set the @code{nov-cache-size} group
15895 parameter to something small (0 would probably not work, but 1 probably
15896 would) to make it use less memory.  This caching will probably be
15897 removed in the future.
15898
15899 Startup is likely to be slower with @code{nnmaildir} than with other
15900 back ends.  Everything else is likely to be faster, depending in part
15901 on your file system.
15902
15903 @code{nnmaildir} does not use @code{nnoo}, so you cannot use @code{nnoo}
15904 to write an @code{nnmaildir}-derived back end.
15905
15906 @end table
15907
15908
15909 @node Browsing the Web
15910 @section Browsing the Web
15911 @cindex web
15912 @cindex browsing the web
15913 @cindex www
15914 @cindex http
15915
15916 Web-based discussion forums are getting more and more popular.  On many
15917 subjects, the web-based forums have become the most important forums,
15918 eclipsing the importance of mailing lists and news groups.  The reason
15919 is easy to understand---they are friendly to new users; you just point
15920 and click, and there's the discussion.  With mailing lists, you have to
15921 go through a cumbersome subscription procedure, and most people don't
15922 even know what a news group is.
15923
15924 The problem with this scenario is that web browsers are not very good at
15925 being newsreaders.  They do not keep track of what articles you've read;
15926 they do not allow you to score on subjects you're interested in; they do
15927 not allow off-line browsing; they require you to click around and drive
15928 you mad in the end.
15929
15930 So---if web browsers suck at reading discussion forums, why not use Gnus
15931 to do it instead?
15932
15933 Gnus has been getting a bit of a collection of back ends for providing
15934 interfaces to these sources.
15935
15936 @menu
15937 * Archiving Mail::
15938 * Web Searches::                Creating groups from articles that match a string.
15939 * Slashdot::                    Reading the Slashdot comments.
15940 * Ultimate::                    The Ultimate Bulletin Board systems.
15941 * Web Archive::                 Reading mailing list archived on web.
15942 * RSS::                         Reading RDF site summary.
15943 * Customizing W3::              Doing stuff to Emacs/W3 from Gnus.
15944 @end menu
15945
15946 All the web sources require Emacs/W3 and the url library or those
15947 alternatives to work.
15948
15949 The main caveat with all these web sources is that they probably won't
15950 work for a very long time.  Gleaning information from the @acronym{HTML} data
15951 is guesswork at best, and when the layout is altered, the Gnus back end
15952 will fail.  If you have reasonably new versions of these back ends,
15953 though, you should be ok.
15954
15955 One thing all these Web methods have in common is that the Web sources
15956 are often down, unavailable or just plain too slow to be fun.  In those
15957 cases, it makes a lot of sense to let the Gnus Agent (@pxref{Gnus
15958 Unplugged}) handle downloading articles, and then you can read them at
15959 leisure from your local disk.  No more World Wide Wait for you.
15960
15961 @node Archiving Mail
15962 @subsection Archiving Mail
15963 @cindex archiving mail
15964 @cindex backup of mail
15965
15966 Some of the back ends, notably @code{nnml}, @code{nnfolder}, and
15967 @code{nnmaildir}, now actually store the article marks with each group.
15968 For these servers, archiving and restoring a group while preserving
15969 marks is fairly simple.
15970
15971 (Preserving the group level and group parameters as well still
15972 requires ritual dancing and sacrifices to the @file{.newsrc.eld} deity
15973 though.)
15974
15975 To archive an entire @code{nnml}, @code{nnfolder}, or @code{nnmaildir}
15976 server, take a recursive copy of the server directory.  There is no need
15977 to shut down Gnus, so archiving may be invoked by @code{cron} or
15978 similar.  You restore the data by restoring the directory tree, and
15979 adding a server definition pointing to that directory in Gnus.  The
15980 @ref{Article Backlog}, @ref{Asynchronous Fetching} and other things
15981 might interfere with overwriting data, so you may want to shut down Gnus
15982 before you restore the data.
15983
15984 It is also possible to archive individual @code{nnml},
15985 @code{nnfolder}, or @code{nnmaildir} groups, while preserving marks.
15986 For @code{nnml} or @code{nnmaildir}, you copy all files in the group's
15987 directory.  For @code{nnfolder} you need to copy both the base folder
15988 file itself (@file{FOO}, say), and the marks file (@file{FOO.mrk} in
15989 this example).  Restoring the group is done with @kbd{G m} from the Group
15990 buffer.  The last step makes Gnus notice the new directory.
15991 @code{nnmaildir} notices the new directory automatically, so @kbd{G m}
15992 is unnecessary in that case.
15993
15994 @node Web Searches
15995 @subsection Web Searches
15996 @cindex nnweb
15997 @cindex Google
15998 @cindex dejanews
15999 @cindex gmane
16000 @cindex Usenet searches
16001 @cindex searching the Usenet
16002
16003 It's, like, too neat to search the Usenet for articles that match a
16004 string, but it, like, totally @emph{sucks}, like, totally, to use one of
16005 those, like, Web browsers, and you, like, have to, rilly, like, look at
16006 the commercials, so, like, with Gnus you can do @emph{rad}, rilly,
16007 searches without having to use a browser.
16008
16009 The @code{nnweb} back end allows an easy interface to the mighty search
16010 engine.  You create an @code{nnweb} group, enter a search pattern, and
16011 then enter the group and read the articles like you would any normal
16012 group.  The @kbd{G w} command in the group buffer (@pxref{Foreign
16013 Groups}) will do this in an easy-to-use fashion.
16014
16015 @code{nnweb} groups don't really lend themselves to being solid
16016 groups---they have a very fleeting idea of article numbers.  In fact,
16017 each time you enter an @code{nnweb} group (not even changing the search
16018 pattern), you are likely to get the articles ordered in a different
16019 manner.  Not even using duplicate suppression (@pxref{Duplicate
16020 Suppression}) will help, since @code{nnweb} doesn't even know the
16021 @code{Message-ID} of the articles before reading them using some search
16022 engines (Google, for instance).  The only possible way to keep track
16023 of which articles you've read is by scoring on the @code{Date}
16024 header---mark all articles posted before the last date you read the
16025 group as read.
16026
16027 If the search engine changes its output substantially, @code{nnweb}
16028 won't be able to parse it and will fail.  One could hardly fault the Web
16029 providers if they were to do this---their @emph{raison d'@^etre} is to
16030 make money off of advertisements, not to provide services to the
16031 community.  Since @code{nnweb} washes the ads off all the articles, one
16032 might think that the providers might be somewhat miffed.  We'll see.
16033
16034 You must have the @code{url} and @code{W3} package or those alternatives
16035 (try @code{customize-group} on the @samp{mm-url} variable group)
16036 installed to be able to use @code{nnweb}.
16037
16038 Virtual server variables:
16039
16040 @table @code
16041 @item nnweb-type
16042 @vindex nnweb-type
16043 What search engine type is being used.  The currently supported types
16044 are @code{google}, @code{dejanews}, and @code{gmane}.  Note that
16045 @code{dejanews} is an alias to @code{google}.
16046
16047 @item nnweb-search
16048 @vindex nnweb-search
16049 The search string to feed to the search engine.
16050
16051 @item nnweb-max-hits
16052 @vindex nnweb-max-hits
16053 Advisory maximum number of hits per search to display.  The default is
16054 999.
16055
16056 @item nnweb-type-definition
16057 @vindex nnweb-type-definition
16058 Type-to-definition alist.  This alist says what @code{nnweb} should do
16059 with the various search engine types.  The following elements must be
16060 present:
16061
16062 @table @code
16063 @item article
16064 Function to decode the article and provide something that Gnus
16065 understands.
16066
16067 @item map
16068 Function to create an article number to message header and URL alist.
16069
16070 @item search
16071 Function to send the search string to the search engine.
16072
16073 @item address
16074 The address the aforementioned function should send the search string
16075 to.
16076
16077 @item id
16078 Format string URL to fetch an article by @code{Message-ID}.
16079 @end table
16080
16081 @end table
16082
16083
16084 @node Slashdot
16085 @subsection Slashdot
16086 @cindex Slashdot
16087 @cindex nnslashdot
16088
16089 @uref{http://slashdot.org/, Slashdot} is a popular news site, with
16090 lively discussion following the news articles.  @code{nnslashdot} will
16091 let you read this forum in a convenient manner.
16092
16093 The easiest way to read this source is to put something like the
16094 following in your @file{~/.gnus.el} file:
16095
16096 @lisp
16097 (setq gnus-secondary-select-methods
16098       '((nnslashdot "")))
16099 @end lisp
16100
16101 This will make Gnus query the @code{nnslashdot} back end for new comments
16102 and groups.  The @kbd{F} command will subscribe each new news article as
16103 a new Gnus group, and you can read the comments by entering these
16104 groups.  (Note that the default subscription method is to subscribe new
16105 groups as zombies.  Other methods are available (@pxref{Subscription
16106 Methods}).
16107
16108 If you want to remove an old @code{nnslashdot} group, the @kbd{G DEL}
16109 command is the most handy tool (@pxref{Foreign Groups}).
16110
16111 When following up to @code{nnslashdot} comments (or posting new
16112 comments), some light @acronym{HTML}izations will be performed.  In
16113 particular, text quoted with @samp{> } will be quoted with
16114 @samp{blockquote} instead, and signatures will have @samp{br} added to
16115 the end of each line.  Other than that, you can just write @acronym{HTML}
16116 directly into the message buffer.  Note that Slashdot filters out some
16117 @acronym{HTML} forms.
16118
16119 The following variables can be altered to change its behavior:
16120
16121 @table @code
16122 @item nnslashdot-threaded
16123 Whether @code{nnslashdot} should display threaded groups or not.  The
16124 default is @code{t}.  To be able to display threads, @code{nnslashdot}
16125 has to retrieve absolutely all comments in a group upon entry.  If a
16126 threaded display is not required, @code{nnslashdot} will only retrieve
16127 the comments that are actually wanted by the user.  Threading is nicer,
16128 but much, much slower than unthreaded.
16129
16130 @item nnslashdot-login-name
16131 @vindex nnslashdot-login-name
16132 The login name to use when posting.
16133
16134 @item nnslashdot-password
16135 @vindex nnslashdot-password
16136 The password to use when posting.
16137
16138 @item nnslashdot-directory
16139 @vindex nnslashdot-directory
16140 Where @code{nnslashdot} will store its files.  The default is
16141 @file{~/News/slashdot/}.
16142
16143 @item nnslashdot-active-url
16144 @vindex nnslashdot-active-url
16145 The @acronym{URL} format string that will be used to fetch the
16146 information on news articles and comments.  The default is@*
16147 @samp{http://slashdot.org/search.pl?section=&min=%d}.
16148
16149 @item nnslashdot-comments-url
16150 @vindex nnslashdot-comments-url
16151 The @acronym{URL} format string that will be used to fetch comments.
16152
16153 @item nnslashdot-article-url
16154 @vindex nnslashdot-article-url
16155 The @acronym{URL} format string that will be used to fetch the news
16156 article.  The default is
16157 @samp{http://slashdot.org/article.pl?sid=%s&mode=nocomment}.
16158
16159 @item nnslashdot-threshold
16160 @vindex nnslashdot-threshold
16161 The score threshold.  The default is -1.
16162
16163 @item nnslashdot-group-number
16164 @vindex nnslashdot-group-number
16165 The number of old groups, in addition to the ten latest, to keep
16166 updated.  The default is 0.
16167
16168 @end table
16169
16170
16171
16172 @node Ultimate
16173 @subsection Ultimate
16174 @cindex nnultimate
16175 @cindex Ultimate Bulletin Board
16176
16177 @uref{http://www.ultimatebb.com/, The Ultimate Bulletin Board} is
16178 probably the most popular Web bulletin board system used.  It has a
16179 quite regular and nice interface, and it's possible to get the
16180 information Gnus needs to keep groups updated.
16181
16182 The easiest way to get started with @code{nnultimate} is to say
16183 something like the following in the group buffer:  @kbd{B nnultimate RET
16184 http://www.tcj.com/messboard/ubbcgi/ RET}.  (Substitute the @acronym{URL}
16185 (not including @samp{Ultimate.cgi} or the like at the end) for a forum
16186 you're interested in; there's quite a list of them on the Ultimate web
16187 site.)  Then subscribe to the groups you're interested in from the
16188 server buffer, and read them from the group buffer.
16189
16190 The following @code{nnultimate} variables can be altered:
16191
16192 @table @code
16193 @item nnultimate-directory
16194 @vindex nnultimate-directory
16195 The directory where @code{nnultimate} stores its files.  The default is@*
16196 @file{~/News/ultimate/}.
16197 @end table
16198
16199
16200 @node Web Archive
16201 @subsection Web Archive
16202 @cindex nnwarchive
16203 @cindex Web Archive
16204
16205 Some mailing lists only have archives on Web servers, such as
16206 @uref{http://www.egroups.com/} and
16207 @uref{http://www.mail-archive.com/}.  It has a quite regular and nice
16208 interface, and it's possible to get the information Gnus needs to keep
16209 groups updated.
16210
16211 @findex gnus-group-make-warchive-group
16212 The easiest way to get started with @code{nnwarchive} is to say
16213 something like the following in the group buffer: @kbd{M-x
16214 gnus-group-make-warchive-group RET @var{an_egroup} RET egroups RET
16215 www.egroups.com RET @var{your@@email.address} RET}.  (Substitute the
16216 @var{an_egroup} with the mailing list you subscribed, the
16217 @var{your@@email.address} with your email address.), or to browse the
16218 back end by @kbd{B nnwarchive RET mail-archive RET}.
16219
16220 The following @code{nnwarchive} variables can be altered:
16221
16222 @table @code
16223 @item nnwarchive-directory
16224 @vindex nnwarchive-directory
16225 The directory where @code{nnwarchive} stores its files.  The default is@*
16226 @file{~/News/warchive/}.
16227
16228 @item nnwarchive-login
16229 @vindex nnwarchive-login
16230 The account name on the web server.
16231
16232 @item nnwarchive-passwd
16233 @vindex nnwarchive-passwd
16234 The password for your account on the web server.
16235 @end table
16236
16237 @node RSS
16238 @subsection RSS
16239 @cindex nnrss
16240 @cindex RSS
16241
16242 Some web sites have an RDF Site Summary (@acronym{RSS}).
16243 @acronym{RSS} is a format for summarizing headlines from news related
16244 sites (such as BBC or CNN).  But basically anything list-like can be
16245 presented as an @acronym{RSS} feed: weblogs, changelogs or recent
16246 changes to a wiki (e.g. @url{http://cliki.net/recent-changes.rdf}).
16247
16248 @acronym{RSS} has a quite regular and nice interface, and it's
16249 possible to get the information Gnus needs to keep groups updated.
16250
16251 Note: you had better use Emacs which supports the @code{utf-8} coding
16252 system because @acronym{RSS} uses UTF-8 for encoding non-@acronym{ASCII}
16253 text by default.  It is also used by default for non-@acronym{ASCII}
16254 group names.
16255
16256 @kindex G R (Group)
16257 Use @kbd{G R} from the group buffer to subscribe to a feed---you will be
16258 prompted for the location, the title and the description of the feed.
16259 The title, which allows any characters, will be used for the group name
16260 and the name of the group data file.  The description can be omitted.
16261
16262 An easy way to get started with @code{nnrss} is to say something like
16263 the following in the group buffer: @kbd{B nnrss RET RET y}, then
16264 subscribe to groups.
16265
16266 The @code{nnrss} back end saves the group data file in
16267 @code{nnrss-directory} (see below) for each @code{nnrss} group.  File
16268 names containing non-@acronym{ASCII} characters will be encoded by the
16269 coding system specified with the @code{nnmail-pathname-coding-system}
16270 variable.  If it is @code{nil}, in Emacs the coding system defaults to
16271 the value of @code{default-file-name-coding-system}.  If you are using
16272 XEmacs and want to use non-@acronym{ASCII} group names, you should set
16273 the value for the @code{nnmail-pathname-coding-system} variable properly.
16274
16275 The @code{nnrss} back end generates @samp{multipart/alternative}
16276 @acronym{MIME} articles in which each contains a @samp{text/plain} part
16277 and a @samp{text/html} part.
16278
16279 @cindex OPML
16280 You can also use the following commands to import and export your
16281 subscriptions from a file in @acronym{OPML} format (Outline Processor
16282 Markup Language).
16283
16284 @defun nnrss-opml-import file
16285 Prompt for an @acronym{OPML} file, and subscribe to each feed in the
16286 file.
16287 @end defun
16288
16289 @defun nnrss-opml-export
16290 Write your current @acronym{RSS} subscriptions to a buffer in
16291 @acronym{OPML} format.
16292 @end defun
16293
16294 The following @code{nnrss} variables can be altered:
16295
16296 @table @code
16297 @item nnrss-directory
16298 @vindex nnrss-directory
16299 The directory where @code{nnrss} stores its files.  The default is
16300 @file{~/News/rss/}.
16301
16302 @item nnrss-file-coding-system
16303 @vindex nnrss-file-coding-system
16304 The coding system used when reading and writing the @code{nnrss} groups
16305 data files.  The default is the value of
16306 @code{mm-universal-coding-system} (which defaults to @code{emacs-mule}
16307 in Emacs or @code{escape-quoted} in XEmacs).
16308
16309 @item nnrss-use-local
16310 @vindex nnrss-use-local
16311 @findex nnrss-generate-download-script
16312 If you set @code{nnrss-use-local} to @code{t}, @code{nnrss} will read
16313 the feeds from local files in @code{nnrss-directory}.  You can use
16314 the command @code{nnrss-generate-download-script} to generate a
16315 download script using @command{wget}.
16316
16317 @item nnrss-wash-html-in-text-plain-parts
16318 Non-@code{nil} means that @code{nnrss} renders text in @samp{text/plain}
16319 parts as @acronym{HTML}.  The function specified by the
16320 @code{mm-text-html-renderer} variable (@pxref{Display Customization,
16321 ,Display Customization, emacs-mime, The Emacs MIME Manual}) will be used
16322 to render text.  If it is @code{nil}, which is the default, text will
16323 simply be folded.  Leave it @code{nil} if you prefer to see
16324 @samp{text/html} parts.
16325 @end table
16326
16327 The following code may be helpful, if you want to show the description in
16328 the summary buffer.
16329
16330 @lisp
16331 (add-to-list 'nnmail-extra-headers nnrss-description-field)
16332 (setq gnus-summary-line-format "%U%R%z%I%(%[%4L: %-15,15f%]%) %s%uX\n")
16333
16334 (defun gnus-user-format-function-X (header)
16335   (let ((descr
16336          (assq nnrss-description-field (mail-header-extra header))))
16337     (if descr (concat "\n\t" (cdr descr)) "")))
16338 @end lisp
16339
16340 The following code may be useful to open an nnrss url directly from the
16341 summary buffer.
16342
16343 @lisp
16344 (require 'browse-url)
16345
16346 (defun browse-nnrss-url( arg )
16347   (interactive "p")
16348   (let ((url (assq nnrss-url-field
16349                    (mail-header-extra
16350                     (gnus-data-header
16351                      (assq (gnus-summary-article-number)
16352                            gnus-newsgroup-data))))))
16353     (if url
16354         (progn
16355           (browse-url (cdr url))
16356           (gnus-summary-mark-as-read-forward 1))
16357       (gnus-summary-scroll-up arg))))
16358
16359 (eval-after-load "gnus"
16360   #'(define-key gnus-summary-mode-map
16361       (kbd "<RET>") 'browse-nnrss-url))
16362 (add-to-list 'nnmail-extra-headers nnrss-url-field)
16363 @end lisp
16364
16365 Even if you have added @code{"text/html"} to the
16366 @code{mm-discouraged-alternatives} variable (@pxref{Display
16367 Customization, ,Display Customization, emacs-mime, The Emacs MIME
16368 Manual}) since you don't want to see @acronym{HTML} parts, it might be
16369 more useful especially in @code{nnrss} groups to display
16370 @samp{text/html} parts.  Here's an example of setting
16371 @code{mm-discouraged-alternatives} as a group parameter (@pxref{Group
16372 Parameters}) in order to display @samp{text/html} parts only in
16373 @code{nnrss} groups:
16374
16375 @lisp
16376 ;; @r{Set the default value of @code{mm-discouraged-alternatives}.}
16377 (eval-after-load "gnus-sum"
16378   '(add-to-list
16379     'gnus-newsgroup-variables
16380     '(mm-discouraged-alternatives
16381       . '("text/html" "image/.*"))))
16382
16383 ;; @r{Display @samp{text/html} parts in @code{nnrss} groups.}
16384 (add-to-list
16385  'gnus-parameters
16386  '("\\`nnrss:" (mm-discouraged-alternatives nil)))
16387 @end lisp
16388
16389
16390 @node Customizing W3
16391 @subsection Customizing W3
16392 @cindex W3
16393 @cindex html
16394 @cindex url
16395 @cindex Netscape
16396
16397 Gnus uses the url library to fetch web pages and Emacs/W3 (or those
16398 alternatives) to display web pages.  Emacs/W3 is documented in its own
16399 manual, but there are some things that may be more relevant for Gnus
16400 users.
16401
16402 For instance, a common question is how to make Emacs/W3 follow links
16403 using the @code{browse-url} functions (which will call some external web
16404 browser like Netscape).  Here's one way:
16405
16406 @lisp
16407 (eval-after-load "w3"
16408   '(progn
16409     (fset 'w3-fetch-orig (symbol-function 'w3-fetch))
16410     (defun w3-fetch (&optional url target)
16411       (interactive (list (w3-read-url-with-default)))
16412       (if (eq major-mode 'gnus-article-mode)
16413           (browse-url url)
16414         (w3-fetch-orig url target)))))
16415 @end lisp
16416
16417 Put that in your @file{.emacs} file, and hitting links in W3-rendered
16418 @acronym{HTML} in the Gnus article buffers will use @code{browse-url} to
16419 follow the link.
16420
16421
16422 @node IMAP
16423 @section IMAP
16424 @cindex nnimap
16425 @cindex @acronym{IMAP}
16426
16427 @acronym{IMAP} is a network protocol for reading mail (or news, or @dots{}),
16428 think of it as a modernized @acronym{NNTP}.  Connecting to a @acronym{IMAP}
16429 server is much similar to connecting to a news server, you just
16430 specify the network address of the server.
16431
16432 @acronym{IMAP} has two properties.  First, @acronym{IMAP} can do
16433 everything that @acronym{POP} can, it can hence be viewed as a
16434 @acronym{POP++}.  Secondly, @acronym{IMAP} is a mail storage protocol,
16435 similar to @acronym{NNTP} being a news storage protocol---however,
16436 @acronym{IMAP} offers more features than @acronym{NNTP} because news
16437 is more or less read-only whereas mail is read-write.
16438
16439 If you want to use @acronym{IMAP} as a @acronym{POP++}, use an imap
16440 entry in @code{mail-sources}.  With this, Gnus will fetch mails from
16441 the @acronym{IMAP} server and store them on the local disk.  This is
16442 not the usage described in this section---@xref{Mail Sources}.
16443
16444 If you want to use @acronym{IMAP} as a mail storage protocol, use an nnimap
16445 entry in @code{gnus-secondary-select-methods}.  With this, Gnus will
16446 manipulate mails stored on the @acronym{IMAP} server.  This is the kind of
16447 usage explained in this section.
16448
16449 A server configuration in @file{~/.gnus.el} with a few @acronym{IMAP}
16450 servers might look something like the following.  (Note that for
16451 @acronym{TLS}/@acronym{SSL}, you need external programs and libraries,
16452 see below.)
16453
16454 @lisp
16455 (setq gnus-secondary-select-methods
16456       '((nnimap "simpleserver") ; @r{no special configuration}
16457         ; @r{perhaps a ssh port forwarded server:}
16458         (nnimap "dolk"
16459                 (nnimap-address "localhost")
16460                 (nnimap-server-port 1430))
16461         ; @r{a UW server running on localhost}
16462         (nnimap "barbar"
16463                 (nnimap-server-port 143)
16464                 (nnimap-address "localhost")
16465                 (nnimap-list-pattern ("INBOX" "mail/*")))
16466         ; @r{anonymous public cyrus server:}
16467         (nnimap "cyrus.andrew.cmu.edu"
16468                 (nnimap-authenticator anonymous)
16469                 (nnimap-list-pattern "archive.*")
16470                 (nnimap-stream network))
16471         ; @r{a ssl server on a non-standard port:}
16472         (nnimap "vic20"
16473                 (nnimap-address "vic20.somewhere.com")
16474                 (nnimap-server-port 9930)
16475                 (nnimap-stream ssl))))
16476 @end lisp
16477
16478 After defining the new server, you can subscribe to groups on the
16479 server using normal Gnus commands such as @kbd{U} in the Group Buffer
16480 (@pxref{Subscription Commands}) or via the Server Buffer
16481 (@pxref{Server Buffer}).
16482
16483 The following variables can be used to create a virtual @code{nnimap}
16484 server:
16485
16486 @table @code
16487
16488 @item nnimap-address
16489 @vindex nnimap-address
16490
16491 The address of the remote @acronym{IMAP} server.  Defaults to the virtual
16492 server name if not specified.
16493
16494 @item nnimap-server-port
16495 @vindex nnimap-server-port
16496 Port on server to contact.  Defaults to port 143, or 993 for @acronym{TLS}/@acronym{SSL}.
16497
16498 Note that this should be an integer, example server specification:
16499
16500 @lisp
16501 (nnimap "mail.server.com"
16502         (nnimap-server-port 4711))
16503 @end lisp
16504
16505 @item nnimap-list-pattern
16506 @vindex nnimap-list-pattern
16507 String or list of strings of mailboxes to limit available groups to.
16508 This is used when the server has very many mailboxes and you're only
16509 interested in a few---some servers export your home directory via
16510 @acronym{IMAP}, you'll probably want to limit the mailboxes to those in
16511 @file{~/Mail/*} then.
16512
16513 The string can also be a cons of REFERENCE and the string as above, what
16514 REFERENCE is used for is server specific, but on the University of
16515 Washington server it's a directory that will be concatenated with the
16516 mailbox.
16517
16518 Example server specification:
16519
16520 @lisp
16521 (nnimap "mail.server.com"
16522         (nnimap-list-pattern ("INBOX" "Mail/*" "alt.sex.*"
16523                                ("~friend/Mail/" . "list/*"))))
16524 @end lisp
16525
16526 @item nnimap-stream
16527 @vindex nnimap-stream
16528 The type of stream used to connect to your server.  By default, nnimap
16529 will detect and automatically use all of the below, with the exception
16530 of @acronym{TLS}/@acronym{SSL}.  (@acronym{IMAP} over
16531 @acronym{TLS}/@acronym{SSL} is being replaced by STARTTLS, which can
16532 be automatically detected, but it's not widely deployed yet.)
16533
16534 Example server specification:
16535
16536 @lisp
16537 (nnimap "mail.server.com"
16538         (nnimap-stream ssl))
16539 @end lisp
16540
16541 Please note that the value of @code{nnimap-stream} is a symbol!
16542
16543 @itemize @bullet
16544 @item
16545 @dfn{gssapi:} Connect with GSSAPI (usually Kerberos 5).  Requires the
16546 @samp{gsasl} or @samp{imtest} program.
16547 @item
16548 @dfn{kerberos4:} Connect with Kerberos 4.  Requires the @samp{imtest} program.
16549 @item
16550 @dfn{starttls:} Connect via the STARTTLS extension (similar to
16551 @acronym{TLS}/@acronym{SSL}).  Requires the external library @samp{starttls.el} and program
16552 @samp{starttls}.
16553 @item
16554 @dfn{tls:} Connect through @acronym{TLS}.  Requires GNUTLS (the program
16555 @samp{gnutls-cli}).
16556 @item
16557 @dfn{ssl:} Connect through @acronym{SSL}.  Requires OpenSSL (the program
16558 @samp{openssl}) or SSLeay (@samp{s_client}).
16559 @item
16560 @dfn{shell:} Use a shell command to start @acronym{IMAP} connection.
16561 @item
16562 @dfn{network:} Plain, TCP/IP network connection.
16563 @end itemize
16564
16565 @vindex imap-kerberos4-program
16566 The @samp{imtest} program is shipped with Cyrus IMAPD.  If you're
16567 using @samp{imtest} from Cyrus IMAPD < 2.0.14 (which includes version
16568 1.5.x and 1.6.x) you need to frob @code{imap-process-connection-type}
16569 to make @code{imap.el} use a pty instead of a pipe when communicating
16570 with @samp{imtest}.  You will then suffer from a line length
16571 restrictions on @acronym{IMAP} commands, which might make Gnus seem to hang
16572 indefinitely if you have many articles in a mailbox.  The variable
16573 @code{imap-kerberos4-program} contain parameters to pass to the imtest
16574 program.
16575
16576 For @acronym{TLS} connection, the @code{gnutls-cli} program from GNUTLS is
16577 needed.  It is available from
16578 @uref{http://www.gnu.org/software/gnutls/}.
16579
16580 @vindex imap-gssapi-program
16581 This parameter specifies a list of command lines that invoke a GSSAPI
16582 authenticated @acronym{IMAP} stream in a subshell.  They are tried
16583 sequentially until a connection is made, or the list has been
16584 exhausted.  By default, @samp{gsasl} from GNU SASL, available from
16585 @uref{http://www.gnu.org/software/gsasl/}, and the @samp{imtest}
16586 program from Cyrus IMAPD (see @code{imap-kerberos4-program}), are
16587 tried.
16588
16589 @vindex imap-ssl-program
16590 For @acronym{SSL} connections, the OpenSSL program is available from
16591 @uref{http://www.openssl.org/}.  OpenSSL was formerly known as SSLeay,
16592 and nnimap support it too---although the most recent versions of
16593 SSLeay, 0.9.x, are known to have serious bugs making it
16594 useless.  Earlier versions, especially 0.8.x, of SSLeay are known to
16595 work.  The variable @code{imap-ssl-program} contain parameters to pass
16596 to OpenSSL/SSLeay.
16597
16598 @vindex imap-shell-program
16599 @vindex imap-shell-host
16600 For @acronym{IMAP} connections using the @code{shell} stream, the variable
16601 @code{imap-shell-program} specify what program to call.
16602
16603 @item nnimap-authenticator
16604 @vindex nnimap-authenticator
16605
16606 The authenticator used to connect to the server.  By default, nnimap
16607 will use the most secure authenticator your server is capable of.
16608
16609 Example server specification:
16610
16611 @lisp
16612 (nnimap "mail.server.com"
16613         (nnimap-authenticator anonymous))
16614 @end lisp
16615
16616 Please note that the value of @code{nnimap-authenticator} is a symbol!
16617
16618 @itemize @bullet
16619 @item
16620 @dfn{gssapi:} GSSAPI (usually kerberos 5) authentication.  Requires
16621 external program @code{gsasl} or @code{imtest}.
16622 @item
16623 @dfn{kerberos4:} Kerberos 4 authentication.  Requires external program
16624 @code{imtest}.
16625 @item
16626 @dfn{digest-md5:} Encrypted username/password via DIGEST-MD5.  Requires
16627 external library @code{digest-md5.el}.
16628 @item
16629 @dfn{cram-md5:} Encrypted username/password via CRAM-MD5.
16630 @item
16631 @dfn{login:} Plain-text username/password via LOGIN.
16632 @item
16633 @dfn{anonymous:} Login as ``anonymous'', supplying your email address as password.
16634 @end itemize
16635
16636 @item nnimap-expunge-on-close
16637 @cindex expunging
16638 @vindex nnimap-expunge-on-close
16639 Unlike Parmenides the @acronym{IMAP} designers have decided things that
16640 don't exist actually do exist.  More specifically, @acronym{IMAP} has
16641 this concept of marking articles @code{Deleted} which doesn't actually
16642 delete them, and this (marking them @code{Deleted}, that is) is what
16643 nnimap does when you delete an article in Gnus (with @kbd{B DEL} or
16644 similar).
16645
16646 Since the articles aren't really removed when we mark them with the
16647 @code{Deleted} flag we'll need a way to actually delete them.  Feel like
16648 running in circles yet?
16649
16650 Traditionally, nnimap has removed all articles marked as @code{Deleted}
16651 when closing a mailbox but this is now configurable by this server
16652 variable.
16653
16654 The possible options are:
16655
16656 @table @code
16657
16658 @item always
16659 The default behavior, delete all articles marked as ``Deleted'' when
16660 closing a mailbox.
16661 @item never
16662 Never actually delete articles.  Currently there is no way of showing
16663 the articles marked for deletion in nnimap, but other @acronym{IMAP} clients
16664 may allow you to do this.  If you ever want to run the EXPUNGE command
16665 manually, @xref{Expunging mailboxes}.
16666 @item ask
16667 When closing mailboxes, nnimap will ask if you wish to expunge deleted
16668 articles or not.
16669
16670 @end table
16671
16672 @item nnimap-importantize-dormant
16673 @vindex nnimap-importantize-dormant
16674
16675 If non-@code{nil} (the default), marks dormant articles as ticked (as
16676 well), for other @acronym{IMAP} clients.  Within Gnus, dormant articles will
16677 naturally still (only) be marked as dormant.  This is to make dormant
16678 articles stand out, just like ticked articles, in other @acronym{IMAP}
16679 clients.  (In other words, Gnus has two ``Tick'' marks and @acronym{IMAP}
16680 has only one.)
16681
16682 Probably the only reason for frobing this would be if you're trying
16683 enable per-user persistent dormant flags, using something like:
16684
16685 @lisp
16686 (setcdr (assq 'dormant nnimap-mark-to-flag-alist)
16687         (format "gnus-dormant-%s" (user-login-name)))
16688 (setcdr (assq 'dormant nnimap-mark-to-predicate-alist)
16689         (format "KEYWORD gnus-dormant-%s" (user-login-name)))
16690 @end lisp
16691
16692 In this case, you would not want the per-user dormant flag showing up
16693 as ticked for other users.
16694
16695 @item nnimap-expunge-search-string
16696 @cindex expunging
16697 @vindex nnimap-expunge-search-string
16698
16699 This variable contain the @acronym{IMAP} search command sent to server when
16700 searching for articles eligible for expiring.  The default is
16701 @code{"UID %s NOT SINCE %s"}, where the first @code{%s} is replaced by
16702 UID set and the second @code{%s} is replaced by a date.
16703
16704 Probably the only useful value to change this to is
16705 @code{"UID %s NOT SENTSINCE %s"}, which makes nnimap use the Date: in
16706 messages instead of the internal article date.  See section 6.4.4 of
16707 RFC 2060 for more information on valid strings.
16708
16709 @item nnimap-authinfo-file
16710 @vindex nnimap-authinfo-file
16711
16712 A file containing credentials used to log in on servers.  The format is
16713 (almost) the same as the @code{ftp} @file{~/.netrc} file.  See the
16714 variable @code{nntp-authinfo-file} for exact syntax; also see
16715 @ref{NNTP}.  An example of an .authinfo line for an IMAP server, is:
16716
16717 @example
16718 machine students.uio.no login larsi password geheimnis port imap
16719 @end example
16720
16721 Note that it should be @code{port imap}, or @code{port 143}, if you
16722 use a @code{nnimap-stream} of @code{tls} or @code{ssl}, even if the
16723 actual port number used is port 993 for secured IMAP.  For
16724 convenience, Gnus will accept @code{port imaps} as a synonym of
16725 @code{port imap}.
16726
16727 @item nnimap-need-unselect-to-notice-new-mail
16728 @vindex nnimap-need-unselect-to-notice-new-mail
16729
16730 Unselect mailboxes before looking for new mail in them.  Some servers
16731 seem to need this under some circumstances; it was reported that
16732 Courier 1.7.1 did.
16733
16734 @end table
16735
16736 @menu
16737 * Splitting in IMAP::           Splitting mail with nnimap.
16738 * Expiring in IMAP::            Expiring mail with nnimap.
16739 * Editing IMAP ACLs::           Limiting/enabling other users access to a mailbox.
16740 * Expunging mailboxes::         Equivalent of a ``compress mailbox'' button.
16741 * A note on namespaces::        How to (not) use @acronym{IMAP} namespace in Gnus.
16742 * Debugging IMAP::              What to do when things don't work.
16743 @end menu
16744
16745
16746
16747 @node Splitting in IMAP
16748 @subsection Splitting in IMAP
16749 @cindex splitting imap mail
16750
16751 Splitting is something Gnus users have loved and used for years, and now
16752 the rest of the world is catching up.  Yeah, dream on, not many
16753 @acronym{IMAP} servers have server side splitting and those that have
16754 splitting seem to use some non-standard protocol.  This means that
16755 @acronym{IMAP} support for Gnus has to do its own splitting.
16756
16757 And it does.
16758
16759 (Incidentally, people seem to have been dreaming on, and Sieve has
16760 gaining a market share and is supported by several IMAP servers.
16761 Fortunately, Gnus support it too, @xref{Sieve Commands}.)
16762
16763 Here are the variables of interest:
16764
16765 @table @code
16766
16767 @item nnimap-split-crosspost
16768 @cindex splitting, crosspost
16769 @cindex crosspost
16770 @vindex nnimap-split-crosspost
16771
16772 If non-@code{nil}, do crossposting if several split methods match the
16773 mail.  If @code{nil}, the first match in @code{nnimap-split-rule}
16774 found will be used.
16775
16776 Nnmail equivalent: @code{nnmail-crosspost}.
16777
16778 @item nnimap-split-inbox
16779 @cindex splitting, inbox
16780 @cindex inbox
16781 @vindex nnimap-split-inbox
16782
16783 A string or a list of strings that gives the name(s) of @acronym{IMAP}
16784 mailboxes to split from.  Defaults to @code{nil}, which means that
16785 splitting is disabled!
16786
16787 @lisp
16788 (setq nnimap-split-inbox
16789       '("INBOX" ("~/friend/Mail" . "lists/*") "lists.imap"))
16790 @end lisp
16791
16792 No nnmail equivalent.
16793
16794 @item nnimap-split-rule
16795 @cindex splitting, rules
16796 @vindex nnimap-split-rule
16797
16798 New mail found in @code{nnimap-split-inbox} will be split according to
16799 this variable.
16800
16801 This variable contains a list of lists, where the first element in the
16802 sublist gives the name of the @acronym{IMAP} mailbox to move articles
16803 matching the regexp in the second element in the sublist.  Got that?
16804 Neither did I, we need examples.
16805
16806 @lisp
16807 (setq nnimap-split-rule
16808       '(("INBOX.nnimap"
16809          "^Sender: owner-nnimap@@vic20.globalcom.se")
16810         ("INBOX.junk"    "^Subject:.*MAKE MONEY")
16811         ("INBOX.private" "")))
16812 @end lisp
16813
16814 This will put all articles from the nnimap mailing list into mailbox
16815 INBOX.nnimap, all articles containing MAKE MONEY in the Subject: line
16816 into INBOX.junk and everything else in INBOX.private.
16817
16818 The first string may contain @samp{\\1} forms, like the ones used by
16819 replace-match to insert sub-expressions from the matched text.  For
16820 instance:
16821
16822 @lisp
16823 ("INBOX.lists.\\1"     "^Sender: owner-\\([a-z-]+\\)@@")
16824 @end lisp
16825
16826 The first element can also be the symbol @code{junk} to indicate that
16827 matching messages should simply be deleted.  Use with care.
16828
16829 The second element can also be a function.  In that case, it will be
16830 called with the first element of the rule as the argument, in a buffer
16831 containing the headers of the article.  It should return a
16832 non-@code{nil} value if it thinks that the mail belongs in that group.
16833
16834 Nnmail users might recollect that the last regexp had to be empty to
16835 match all articles (like in the example above).  This is not required in
16836 nnimap.  Articles not matching any of the regexps will not be moved out
16837 of your inbox.  (This might affect performance if you keep lots of
16838 unread articles in your inbox, since the splitting code would go over
16839 them every time you fetch new mail.)
16840
16841 These rules are processed from the beginning of the alist toward the
16842 end.  The first rule to make a match will ``win'', unless you have
16843 crossposting enabled.  In that case, all matching rules will ``win''.
16844
16845 This variable can also have a function as its value, the function will
16846 be called with the headers narrowed and should return a group where it
16847 thinks the article should be split to.  See @code{nnimap-split-fancy}.
16848
16849 The splitting code tries to create mailboxes if it needs to.
16850
16851 To allow for different split rules on different virtual servers, and
16852 even different split rules in different inboxes on the same server,
16853 the syntax of this variable have been extended along the lines of:
16854
16855 @lisp
16856 (setq nnimap-split-rule
16857       '(("my1server"    (".*" (("ding"    "ding@@gnus.org")
16858                                ("junk"    "From:.*Simon"))))
16859         ("my2server"    ("INBOX" nnimap-split-fancy))
16860         ("my[34]server" (".*" (("private" "To:.*Simon")
16861                                ("junk"    my-junk-func))))))
16862 @end lisp
16863
16864 The virtual server name is in fact a regexp, so that the same rules
16865 may apply to several servers.  In the example, the servers
16866 @code{my3server} and @code{my4server} both use the same rules.
16867 Similarly, the inbox string is also a regexp.  The actual splitting
16868 rules are as before, either a function, or a list with group/regexp or
16869 group/function elements.
16870
16871 Nnmail equivalent: @code{nnmail-split-methods}.
16872
16873 @item nnimap-split-predicate
16874 @cindex splitting
16875 @vindex nnimap-split-predicate
16876
16877 Mail matching this predicate in @code{nnimap-split-inbox} will be
16878 split, it is a string and the default is @samp{UNSEEN UNDELETED}.
16879
16880 This might be useful if you use another @acronym{IMAP} client to read mail in
16881 your inbox but would like Gnus to split all articles in the inbox
16882 regardless of readedness.  Then you might change this to
16883 @samp{UNDELETED}.
16884
16885 @item nnimap-split-fancy
16886 @cindex splitting, fancy
16887 @findex nnimap-split-fancy
16888 @vindex nnimap-split-fancy
16889
16890 It's possible to set @code{nnimap-split-rule} to
16891 @code{nnmail-split-fancy} if you want to use fancy
16892 splitting.  @xref{Fancy Mail Splitting}.
16893
16894 However, to be able to have different fancy split rules for nnmail and
16895 nnimap back ends you can set @code{nnimap-split-rule} to
16896 @code{nnimap-split-fancy} and define the nnimap specific fancy split
16897 rule in @code{nnimap-split-fancy}.
16898
16899 Example:
16900
16901 @lisp
16902 (setq nnimap-split-rule 'nnimap-split-fancy
16903       nnimap-split-fancy ...)
16904 @end lisp
16905
16906 Nnmail equivalent: @code{nnmail-split-fancy}.
16907
16908 @item nnimap-split-download-body
16909 @findex nnimap-split-download-body
16910 @vindex nnimap-split-download-body
16911
16912 Set to non-@code{nil} to download entire articles during splitting.
16913 This is generally not required, and will slow things down
16914 considerably.  You may need it if you want to use an advanced
16915 splitting function that analyzes the body to split the article.
16916
16917 @end table
16918
16919 @node Expiring in IMAP
16920 @subsection Expiring in IMAP
16921 @cindex expiring imap mail
16922
16923 Even though @code{nnimap} is not a proper @code{nnmail} derived back
16924 end, it supports most features in regular expiring (@pxref{Expiring
16925 Mail}).  Unlike splitting in @acronym{IMAP} (@pxref{Splitting in
16926 IMAP}) it does not clone the @code{nnmail} variables (i.e., creating
16927 @var{nnimap-expiry-wait}) but reuse the @code{nnmail} variables.  What
16928 follows below are the variables used by the @code{nnimap} expiry
16929 process.
16930
16931 A note on how the expire mark is stored on the @acronym{IMAP} server is
16932 appropriate here as well.  The expire mark is translated into a
16933 @code{imap} client specific mark, @code{gnus-expire}, and stored on the
16934 message.  This means that likely only Gnus will understand and treat
16935 the @code{gnus-expire} mark properly, although other clients may allow
16936 you to view client specific flags on the message.  It also means that
16937 your server must support permanent storage of client specific flags on
16938 messages.  Most do, fortunately.
16939
16940 @table @code
16941
16942 @item nnmail-expiry-wait
16943 @item nnmail-expiry-wait-function
16944
16945 These variables are fully supported.  The expire value can be a
16946 number, the symbol @code{immediate} or @code{never}.
16947
16948 @item nnmail-expiry-target
16949
16950 This variable is supported, and internally implemented by calling the
16951 @code{nnmail} functions that handle this.  It contains an optimization
16952 that if the destination is a @acronym{IMAP} group on the same server, the
16953 article is copied instead of appended (that is, uploaded again).
16954
16955 @end table
16956
16957 @node Editing IMAP ACLs
16958 @subsection Editing IMAP ACLs
16959 @cindex editing imap acls
16960 @cindex Access Control Lists
16961 @cindex Editing @acronym{IMAP} ACLs
16962 @kindex G l (Group)
16963 @findex gnus-group-nnimap-edit-acl
16964
16965 ACL stands for Access Control List.  ACLs are used in @acronym{IMAP} for
16966 limiting (or enabling) other users access to your mail boxes.  Not all
16967 @acronym{IMAP} servers support this, this function will give an error if it
16968 doesn't.
16969
16970 To edit an ACL for a mailbox, type @kbd{G l}
16971 (@code{gnus-group-edit-nnimap-acl}) and you'll be presented with an ACL
16972 editing window with detailed instructions.
16973
16974 Some possible uses:
16975
16976 @itemize @bullet
16977 @item
16978 Giving ``anyone'' the ``lrs'' rights (lookup, read, keep seen/unseen flags)
16979 on your mailing list mailboxes enables other users on the same server to
16980 follow the list without subscribing to it.
16981 @item
16982 At least with the Cyrus server, you are required to give the user
16983 ``anyone'' posting ("p") capabilities to have ``plussing'' work (that is,
16984 mail sent to user+mailbox@@domain ending up in the @acronym{IMAP} mailbox
16985 INBOX.mailbox).
16986 @end itemize
16987
16988 @node Expunging mailboxes
16989 @subsection Expunging mailboxes
16990 @cindex expunging
16991
16992 @cindex expunge
16993 @cindex manual expunging
16994 @kindex G x (Group)
16995 @findex gnus-group-nnimap-expunge
16996
16997 If you're using the @code{never} setting of @code{nnimap-expunge-on-close},
16998 you may want the option of expunging all deleted articles in a mailbox
16999 manually.  This is exactly what @kbd{G x} does.
17000
17001 Currently there is no way of showing deleted articles, you can just
17002 delete them.
17003
17004 @node A note on namespaces
17005 @subsection A note on namespaces
17006 @cindex IMAP namespace
17007 @cindex namespaces
17008
17009 The @acronym{IMAP} protocol has a concept called namespaces, described
17010 by the following text in the RFC2060:
17011
17012 @display
17013 5.1.2.  Mailbox Namespace Naming Convention
17014
17015    By convention, the first hierarchical element of any mailbox name
17016    which begins with "#" identifies the "namespace" of the remainder of
17017    the name.  This makes it possible to disambiguate between different
17018    types of mailbox stores, each of which have their own namespaces.
17019
17020       For example, implementations which offer access to USENET
17021       newsgroups MAY use the "#news" namespace to partition the USENET
17022       newsgroup namespace from that of other mailboxes.  Thus, the
17023       comp.mail.misc newsgroup would have an mailbox name of
17024       "#news.comp.mail.misc", and the name "comp.mail.misc" could refer
17025       to a different object (e.g. a user's private mailbox).
17026 @end display
17027
17028 While there is nothing in this text that warrants concern for the
17029 @acronym{IMAP} implementation in Gnus, some servers use namespace
17030 prefixes in a way that does not work with how Gnus uses mailbox names.
17031
17032 Specifically, University of Washington's @acronym{IMAP} server uses
17033 mailbox names like @code{#driver.mbx/read-mail} which are valid only
17034 in the @sc{create} and @sc{append} commands.  After the mailbox is
17035 created (or a messages is appended to a mailbox), it must be accessed
17036 without the namespace prefix, i.e. @code{read-mail}.  Since Gnus do
17037 not make it possible for the user to guarantee that user entered
17038 mailbox names will only be used with the CREATE and APPEND commands,
17039 you should simply not use the namespace prefixed mailbox names in
17040 Gnus.
17041
17042 See the UoW IMAPD documentation for the @code{#driver.*/} prefix
17043 for more information on how to use the prefixes.  They are a power
17044 tool and should be used only if you are sure what the effects are.
17045
17046 @node Debugging IMAP
17047 @subsection Debugging IMAP
17048 @cindex IMAP debugging
17049 @cindex protocol dump (IMAP)
17050
17051 @acronym{IMAP} is a complex protocol, more so than @acronym{NNTP} or
17052 @acronym{POP3}.  Implementation bugs are not unlikely, and we do our
17053 best to fix them right away.  If you encounter odd behavior, chances
17054 are that either the server or Gnus is buggy.
17055
17056 If you are familiar with network protocols in general, you will
17057 probably be able to extract some clues from the protocol dump of the
17058 exchanges between Gnus and the server.  Even if you are not familiar
17059 with network protocols, when you include the protocol dump in
17060 @acronym{IMAP}-related bug reports you are helping us with data
17061 critical to solving the problem.  Therefore, we strongly encourage you
17062 to include the protocol dump when reporting IMAP bugs in Gnus.
17063
17064
17065 @vindex imap-log
17066 Because the protocol dump, when enabled, generates lots of data, it is
17067 disabled by default.  You can enable it by setting @code{imap-log} as
17068 follows:
17069
17070 @lisp
17071 (setq imap-log t)
17072 @end lisp
17073
17074 This instructs the @code{imap.el} package to log any exchanges with
17075 the server.  The log is stored in the buffer @samp{*imap-log*}.  Look
17076 for error messages, which sometimes are tagged with the keyword
17077 @code{BAD}---but when submitting a bug, make sure to include all the
17078 data.
17079
17080 @node Other Sources
17081 @section Other Sources
17082
17083 Gnus can do more than just read news or mail.  The methods described
17084 below allow Gnus to view directories and files as if they were
17085 newsgroups.
17086
17087 @menu
17088 * Directory Groups::            You can read a directory as if it was a newsgroup.
17089 * Anything Groups::             Dired?  Who needs dired?
17090 * Document Groups::             Single files can be the basis of a group.
17091 * SOUP::                        Reading @sc{soup} packets ``offline''.
17092 * Mail-To-News Gateways::       Posting articles via mail-to-news gateways.
17093 @end menu
17094
17095
17096 @node Directory Groups
17097 @subsection Directory Groups
17098 @cindex nndir
17099 @cindex directory groups
17100
17101 If you have a directory that has lots of articles in separate files in
17102 it, you might treat it as a newsgroup.  The files have to have numerical
17103 names, of course.
17104
17105 This might be an opportune moment to mention @code{ange-ftp} (and its
17106 successor @code{efs}), that most wonderful of all wonderful Emacs
17107 packages.  When I wrote @code{nndir}, I didn't think much about it---a
17108 back end to read directories.  Big deal.
17109
17110 @code{ange-ftp} changes that picture dramatically.  For instance, if you
17111 enter the @code{ange-ftp} file name
17112 @file{/ftp.hpc.uh.edu:/pub/emacs/ding-list/} as the directory name,
17113 @code{ange-ftp} or @code{efs} will actually allow you to read this
17114 directory over at @samp{sina} as a newsgroup.  Distributed news ahoy!
17115
17116 @code{nndir} will use @acronym{NOV} files if they are present.
17117
17118 @code{nndir} is a ``read-only'' back end---you can't delete or expire
17119 articles with this method.  You can use @code{nnmh} or @code{nnml} for
17120 whatever you use @code{nndir} for, so you could switch to any of those
17121 methods if you feel the need to have a non-read-only @code{nndir}.
17122
17123
17124 @node Anything Groups
17125 @subsection Anything Groups
17126 @cindex nneething
17127
17128 From the @code{nndir} back end (which reads a single spool-like
17129 directory), it's just a hop and a skip to @code{nneething}, which
17130 pretends that any arbitrary directory is a newsgroup.  Strange, but
17131 true.
17132
17133 When @code{nneething} is presented with a directory, it will scan this
17134 directory and assign article numbers to each file.  When you enter such
17135 a group, @code{nneething} must create ``headers'' that Gnus can use.
17136 After all, Gnus is a newsreader, in case you're forgetting.
17137 @code{nneething} does this in a two-step process.  First, it snoops each
17138 file in question.  If the file looks like an article (i.e., the first
17139 few lines look like headers), it will use this as the head.  If this is
17140 just some arbitrary file without a head (e.g. a C source file),
17141 @code{nneething} will cobble up a header out of thin air.  It will use
17142 file ownership, name and date and do whatever it can with these
17143 elements.
17144
17145 All this should happen automatically for you, and you will be presented
17146 with something that looks very much like a newsgroup.  Totally like a
17147 newsgroup, to be precise.  If you select an article, it will be displayed
17148 in the article buffer, just as usual.
17149
17150 If you select a line that represents a directory, Gnus will pop you into
17151 a new summary buffer for this @code{nneething} group.  And so on.  You can
17152 traverse the entire disk this way, if you feel like, but remember that
17153 Gnus is not dired, really, and does not intend to be, either.
17154
17155 There are two overall modes to this action---ephemeral or solid.  When
17156 doing the ephemeral thing (i.e., @kbd{G D} from the group buffer), Gnus
17157 will not store information on what files you have read, and what files
17158 are new, and so on.  If you create a solid @code{nneething} group the
17159 normal way with @kbd{G m}, Gnus will store a mapping table between
17160 article numbers and file names, and you can treat this group like any
17161 other groups.  When you activate a solid @code{nneething} group, you will
17162 be told how many unread articles it contains, etc., etc.
17163
17164 Some variables:
17165
17166 @table @code
17167 @item nneething-map-file-directory
17168 @vindex nneething-map-file-directory
17169 All the mapping files for solid @code{nneething} groups will be stored
17170 in this directory, which defaults to @file{~/.nneething/}.
17171
17172 @item nneething-exclude-files
17173 @vindex nneething-exclude-files
17174 All files that match this regexp will be ignored.  Nice to use to exclude
17175 auto-save files and the like, which is what it does by default.
17176
17177 @item nneething-include-files
17178 @vindex nneething-include-files
17179 Regexp saying what files to include in the group.  If this variable is
17180 non-@code{nil}, only files matching this regexp will be included.
17181
17182 @item nneething-map-file
17183 @vindex nneething-map-file
17184 Name of the map files.
17185 @end table
17186
17187
17188 @node Document Groups
17189 @subsection Document Groups
17190 @cindex nndoc
17191 @cindex documentation group
17192 @cindex help group
17193
17194 @code{nndoc} is a cute little thing that will let you read a single file
17195 as a newsgroup.  Several files types are supported:
17196
17197 @table @code
17198 @cindex Babyl
17199 @cindex Rmail mbox
17200 @item babyl
17201 The Babyl (Rmail) mail box.
17202
17203 @cindex mbox
17204 @cindex Unix mbox
17205 @item mbox
17206 The standard Unix mbox file.
17207
17208 @cindex MMDF mail box
17209 @item mmdf
17210 The MMDF mail box format.
17211
17212 @item news
17213 Several news articles appended into a file.
17214
17215 @cindex rnews batch files
17216 @item rnews
17217 The rnews batch transport format.
17218
17219 @item nsmail
17220 Netscape mail boxes.
17221
17222 @item mime-parts
17223 @acronym{MIME} multipart messages.
17224
17225 @item standard-digest
17226 The standard (RFC 1153) digest format.
17227
17228 @item mime-digest
17229 A @acronym{MIME} digest of messages.
17230
17231 @item lanl-gov-announce
17232 Announcement messages from LANL Gov Announce.
17233
17234 @cindex forwarded messages
17235 @item rfc822-forward
17236 A message forwarded according to RFC822.
17237
17238 @item outlook
17239 The Outlook mail box.
17240
17241 @item oe-dbx
17242 The Outlook Express dbx mail box.
17243
17244 @item exim-bounce
17245 A bounce message from the Exim MTA.
17246
17247 @item forward
17248 A message forwarded according to informal rules.
17249
17250 @item rfc934
17251 An RFC934-forwarded message.
17252
17253 @item mailman
17254 A mailman digest.
17255
17256 @item clari-briefs
17257 A digest of Clarinet brief news items.
17258
17259 @item slack-digest
17260 Non-standard digest format---matches most things, but does it badly.
17261
17262 @item mail-in-mail
17263 The last resort.
17264 @end table
17265
17266 You can also use the special ``file type'' @code{guess}, which means
17267 that @code{nndoc} will try to guess what file type it is looking at.
17268 @code{digest} means that @code{nndoc} should guess what digest type the
17269 file is.
17270
17271 @code{nndoc} will not try to change the file or insert any extra headers into
17272 it---it will simply, like, let you use the file as the basis for a
17273 group.  And that's it.
17274
17275 If you have some old archived articles that you want to insert into your
17276 new & spiffy Gnus mail back end, @code{nndoc} can probably help you with
17277 that.  Say you have an old @file{RMAIL} file with mail that you now want
17278 to split into your new @code{nnml} groups.  You look at that file using
17279 @code{nndoc} (using the @kbd{G f} command in the group buffer
17280 (@pxref{Foreign Groups})), set the process mark on all the articles in
17281 the buffer (@kbd{M P b}, for instance), and then re-spool (@kbd{B r})
17282 using @code{nnml}.  If all goes well, all the mail in the @file{RMAIL}
17283 file is now also stored in lots of @code{nnml} directories, and you can
17284 delete that pesky @file{RMAIL} file.  If you have the guts!
17285
17286 Virtual server variables:
17287
17288 @table @code
17289 @item nndoc-article-type
17290 @vindex nndoc-article-type
17291 This should be one of @code{mbox}, @code{babyl}, @code{digest},
17292 @code{news}, @code{rnews}, @code{mmdf}, @code{forward}, @code{rfc934},
17293 @code{rfc822-forward}, @code{mime-parts}, @code{standard-digest},
17294 @code{slack-digest}, @code{clari-briefs}, @code{nsmail}, @code{outlook},
17295 @code{oe-dbx}, @code{mailman}, and @code{mail-in-mail} or @code{guess}.
17296
17297 @item nndoc-post-type
17298 @vindex nndoc-post-type
17299 This variable says whether Gnus is to consider the group a news group or
17300 a mail group.  There are two valid values:  @code{mail} (the default)
17301 and @code{news}.
17302 @end table
17303
17304 @menu
17305 * Document Server Internals::   How to add your own document types.
17306 @end menu
17307
17308
17309 @node Document Server Internals
17310 @subsubsection Document Server Internals
17311
17312 Adding new document types to be recognized by @code{nndoc} isn't
17313 difficult.  You just have to whip up a definition of what the document
17314 looks like, write a predicate function to recognize that document type,
17315 and then hook into @code{nndoc}.
17316
17317 First, here's an example document type definition:
17318
17319 @example
17320 (mmdf
17321  (article-begin .  "^\^A\^A\^A\^A\n")
17322  (body-end .  "^\^A\^A\^A\^A\n"))
17323 @end example
17324
17325 The definition is simply a unique @dfn{name} followed by a series of
17326 regexp pseudo-variable settings.  Below are the possible
17327 variables---don't be daunted by the number of variables; most document
17328 types can be defined with very few settings:
17329
17330 @table @code
17331 @item first-article
17332 If present, @code{nndoc} will skip past all text until it finds
17333 something that match this regexp.  All text before this will be
17334 totally ignored.
17335
17336 @item article-begin
17337 This setting has to be present in all document type definitions.  It
17338 says what the beginning of each article looks like.  To do more
17339 complicated things that cannot be dealt with a simple regexp, you can
17340 use @code{article-begin-function} instead of this.
17341
17342 @item article-begin-function
17343 If present, this should be a function that moves point to the beginning
17344 of each article.  This setting overrides @code{article-begin}.
17345
17346 @item head-begin
17347 If present, this should be a regexp that matches the head of the
17348 article.  To do more complicated things that cannot be dealt with a
17349 simple regexp, you can use @code{head-begin-function} instead of this.
17350
17351 @item head-begin-function
17352 If present, this should be a function that moves point to the head of
17353 the article.  This setting overrides @code{head-begin}.
17354
17355 @item head-end
17356 This should match the end of the head of the article.  It defaults to
17357 @samp{^$}---the empty line.
17358
17359 @item body-begin
17360 This should match the beginning of the body of the article.  It defaults
17361 to @samp{^\n}.  To do more complicated things that cannot be dealt with
17362 a simple regexp, you can use @code{body-begin-function} instead of this.
17363
17364 @item body-begin-function
17365 If present, this function should move point to the beginning of the body
17366 of the article.  This setting overrides @code{body-begin}.
17367
17368 @item body-end
17369 If present, this should match the end of the body of the article.  To do
17370 more complicated things that cannot be dealt with a simple regexp, you
17371 can use @code{body-end-function} instead of this.
17372
17373 @item body-end-function
17374 If present, this function should move point to the end of the body of
17375 the article.  This setting overrides @code{body-end}.
17376
17377 @item file-begin
17378 If present, this should match the beginning of the file.  All text
17379 before this regexp will be totally ignored.
17380
17381 @item file-end
17382 If present, this should match the end of the file.  All text after this
17383 regexp will be totally ignored.
17384
17385 @end table
17386
17387 So, using these variables @code{nndoc} is able to dissect a document
17388 file into a series of articles, each with a head and a body.  However, a
17389 few more variables are needed since not all document types are all that
17390 news-like---variables needed to transform the head or the body into
17391 something that's palatable for Gnus:
17392
17393 @table @code
17394 @item prepare-body-function
17395 If present, this function will be called when requesting an article.  It
17396 will be called with point at the start of the body, and is useful if the
17397 document has encoded some parts of its contents.
17398
17399 @item article-transform-function
17400 If present, this function is called when requesting an article.  It's
17401 meant to be used for more wide-ranging transformation of both head and
17402 body of the article.
17403
17404 @item generate-head-function
17405 If present, this function is called to generate a head that Gnus can
17406 understand.  It is called with the article number as a parameter, and is
17407 expected to generate a nice head for the article in question.  It is
17408 called when requesting the headers of all articles.
17409
17410 @item generate-article-function
17411 If present, this function is called to generate an entire article that
17412 Gnus can understand.  It is called with the article number as a
17413 parameter when requesting all articles.
17414
17415 @item dissection-function
17416 If present, this function is called to dissect a document by itself,
17417 overriding @code{first-article}, @code{article-begin},
17418 @code{article-begin-function}, @code{head-begin},
17419 @code{head-begin-function}, @code{head-end}, @code{body-begin},
17420 @code{body-begin-function}, @code{body-end}, @code{body-end-function},
17421 @code{file-begin}, and @code{file-end}.
17422
17423 @end table
17424
17425 Let's look at the most complicated example I can come up with---standard
17426 digests:
17427
17428 @example
17429 (standard-digest
17430  (first-article . ,(concat "^" (make-string 70 ?-) "\n\n+"))
17431  (article-begin . ,(concat "\n\n" (make-string 30 ?-) "\n\n+"))
17432  (prepare-body-function . nndoc-unquote-dashes)
17433  (body-end-function . nndoc-digest-body-end)
17434  (head-end . "^ ?$")
17435  (body-begin . "^ ?\n")
17436  (file-end . "^End of .*digest.*[0-9].*\n\\*\\*\\|^End of.*Digest *$")
17437  (subtype digest guess))
17438 @end example
17439
17440 We see that all text before a 70-width line of dashes is ignored; all
17441 text after a line that starts with that @samp{^End of} is also ignored;
17442 each article begins with a 30-width line of dashes; the line separating
17443 the head from the body may contain a single space; and that the body is
17444 run through @code{nndoc-unquote-dashes} before being delivered.
17445
17446 To hook your own document definition into @code{nndoc}, use the
17447 @code{nndoc-add-type} function.  It takes two parameters---the first
17448 is the definition itself and the second (optional) parameter says
17449 where in the document type definition alist to put this definition.
17450 The alist is traversed sequentially, and
17451 @code{nndoc-@var{type}-type-p} is called for a given type @var{type}.
17452 So @code{nndoc-mmdf-type-p} is called to see whether a document is of
17453 @code{mmdf} type, and so on.  These type predicates should return
17454 @code{nil} if the document is not of the correct type; @code{t} if it
17455 is of the correct type; and a number if the document might be of the
17456 correct type.  A high number means high probability; a low number
17457 means low probability with @samp{0} being the lowest valid number.
17458
17459
17460 @node SOUP
17461 @subsection SOUP
17462 @cindex SOUP
17463 @cindex offline
17464
17465 In the PC world people often talk about ``offline'' newsreaders.  These
17466 are thingies that are combined reader/news transport monstrosities.
17467 With built-in modem programs.  Yecchh!
17468
17469 Of course, us Unix Weenie types of human beans use things like
17470 @code{uucp} and, like, @code{nntpd} and set up proper news and mail
17471 transport things like Ghod intended.  And then we just use normal
17472 newsreaders.
17473
17474 However, it can sometimes be convenient to do something that's a bit
17475 easier on the brain if you have a very slow modem, and you're not really
17476 that interested in doing things properly.
17477
17478 A file format called @sc{soup} has been developed for transporting news
17479 and mail from servers to home machines and back again.  It can be a bit
17480 fiddly.
17481
17482 First some terminology:
17483
17484 @table @dfn
17485
17486 @item server
17487 This is the machine that is connected to the outside world and where you
17488 get news and/or mail from.
17489
17490 @item home machine
17491 This is the machine that you want to do the actual reading and responding
17492 on.  It is typically not connected to the rest of the world in any way.
17493
17494 @item packet
17495 Something that contains messages and/or commands.  There are two kinds
17496 of packets:
17497
17498 @table @dfn
17499 @item message packets
17500 These are packets made at the server, and typically contain lots of
17501 messages for you to read.  These are called @file{SoupoutX.tgz} by
17502 default, where @var{x} is a number.
17503
17504 @item response packets
17505 These are packets made at the home machine, and typically contains
17506 replies that you've written.  These are called @file{SoupinX.tgz} by
17507 default, where @var{x} is a number.
17508
17509 @end table
17510
17511 @end table
17512
17513
17514 @enumerate
17515
17516 @item
17517 You log in on the server and create a @sc{soup} packet.  You can either
17518 use a dedicated @sc{soup} thingie (like the @code{awk} program), or you
17519 can use Gnus to create the packet with its @sc{soup} commands (@kbd{O
17520 s} and/or @kbd{G s b}; and then @kbd{G s p}) (@pxref{SOUP Commands}).
17521
17522 @item
17523 You transfer the packet home.  Rail, boat, car or modem will do fine.
17524
17525 @item
17526 You put the packet in your home directory.
17527
17528 @item
17529 You fire up Gnus on your home machine using the @code{nnsoup} back end as
17530 the native or secondary server.
17531
17532 @item
17533 You read articles and mail and answer and followup to the things you
17534 want (@pxref{SOUP Replies}).
17535
17536 @item
17537 You do the @kbd{G s r} command to pack these replies into a @sc{soup}
17538 packet.
17539
17540 @item
17541 You transfer this packet to the server.
17542
17543 @item
17544 You use Gnus to mail this packet out with the @kbd{G s s} command.
17545
17546 @item
17547 You then repeat until you die.
17548
17549 @end enumerate
17550
17551 So you basically have a bipartite system---you use @code{nnsoup} for
17552 reading and Gnus for packing/sending these @sc{soup} packets.
17553
17554 @menu
17555 * SOUP Commands::               Commands for creating and sending @sc{soup} packets
17556 * SOUP Groups::                 A back end for reading @sc{soup} packets.
17557 * SOUP Replies::                How to enable @code{nnsoup} to take over mail and news.
17558 @end menu
17559
17560
17561 @node SOUP Commands
17562 @subsubsection SOUP Commands
17563
17564 These are commands for creating and manipulating @sc{soup} packets.
17565
17566 @table @kbd
17567 @item G s b
17568 @kindex G s b (Group)
17569 @findex gnus-group-brew-soup
17570 Pack all unread articles in the current group
17571 (@code{gnus-group-brew-soup}).  This command understands the
17572 process/prefix convention.
17573
17574 @item G s w
17575 @kindex G s w (Group)
17576 @findex gnus-soup-save-areas
17577 Save all @sc{soup} data files (@code{gnus-soup-save-areas}).
17578
17579 @item G s s
17580 @kindex G s s (Group)
17581 @findex gnus-soup-send-replies
17582 Send all replies from the replies packet
17583 (@code{gnus-soup-send-replies}).
17584
17585 @item G s p
17586 @kindex G s p (Group)
17587 @findex gnus-soup-pack-packet
17588 Pack all files into a @sc{soup} packet (@code{gnus-soup-pack-packet}).
17589
17590 @item G s r
17591 @kindex G s r (Group)
17592 @findex nnsoup-pack-replies
17593 Pack all replies into a replies packet (@code{nnsoup-pack-replies}).
17594
17595 @item O s
17596 @kindex O s (Summary)
17597 @findex gnus-soup-add-article
17598 This summary-mode command adds the current article to a @sc{soup} packet
17599 (@code{gnus-soup-add-article}).  It understands the process/prefix
17600 convention (@pxref{Process/Prefix}).
17601
17602 @end table
17603
17604
17605 There are a few variables to customize where Gnus will put all these
17606 thingies:
17607
17608 @table @code
17609
17610 @item gnus-soup-directory
17611 @vindex gnus-soup-directory
17612 Directory where Gnus will save intermediate files while composing
17613 @sc{soup} packets.  The default is @file{~/SoupBrew/}.
17614
17615 @item gnus-soup-replies-directory
17616 @vindex gnus-soup-replies-directory
17617 This is what Gnus will use as a temporary directory while sending our
17618 reply packets.  @file{~/SoupBrew/SoupReplies/} is the default.
17619
17620 @item gnus-soup-prefix-file
17621 @vindex gnus-soup-prefix-file
17622 Name of the file where Gnus stores the last used prefix.  The default is
17623 @samp{gnus-prefix}.
17624
17625 @item gnus-soup-packer
17626 @vindex gnus-soup-packer
17627 A format string command for packing a @sc{soup} packet.  The default is
17628 @samp{tar cf - %s | gzip > $HOME/Soupout%d.tgz}.
17629
17630 @item gnus-soup-unpacker
17631 @vindex gnus-soup-unpacker
17632 Format string command for unpacking a @sc{soup} packet.  The default is
17633 @samp{gunzip -c %s | tar xvf -}.
17634
17635 @item gnus-soup-packet-directory
17636 @vindex gnus-soup-packet-directory
17637 Where Gnus will look for reply packets.  The default is @file{~/}.
17638
17639 @item gnus-soup-packet-regexp
17640 @vindex gnus-soup-packet-regexp
17641 Regular expression matching @sc{soup} reply packets in
17642 @code{gnus-soup-packet-directory}.
17643
17644 @end table
17645
17646
17647 @node SOUP Groups
17648 @subsubsection SOUP Groups
17649 @cindex nnsoup
17650
17651 @code{nnsoup} is the back end for reading @sc{soup} packets.  It will
17652 read incoming packets, unpack them, and put them in a directory where
17653 you can read them at leisure.
17654
17655 These are the variables you can use to customize its behavior:
17656
17657 @table @code
17658
17659 @item nnsoup-tmp-directory
17660 @vindex nnsoup-tmp-directory
17661 When @code{nnsoup} unpacks a @sc{soup} packet, it does it in this
17662 directory.  (@file{/tmp/} by default.)
17663
17664 @item nnsoup-directory
17665 @vindex nnsoup-directory
17666 @code{nnsoup} then moves each message and index file to this directory.
17667 The default is @file{~/SOUP/}.
17668
17669 @item nnsoup-replies-directory
17670 @vindex nnsoup-replies-directory
17671 All replies will be stored in this directory before being packed into a
17672 reply packet.  The default is @file{~/SOUP/replies/}.
17673
17674 @item nnsoup-replies-format-type
17675 @vindex nnsoup-replies-format-type
17676 The @sc{soup} format of the replies packets.  The default is @samp{?n}
17677 (rnews), and I don't think you should touch that variable.  I probably
17678 shouldn't even have documented it.  Drats!  Too late!
17679
17680 @item nnsoup-replies-index-type
17681 @vindex nnsoup-replies-index-type
17682 The index type of the replies packet.  The default is @samp{?n}, which
17683 means ``none''.  Don't fiddle with this one either!
17684
17685 @item nnsoup-active-file
17686 @vindex nnsoup-active-file
17687 Where @code{nnsoup} stores lots of information.  This is not an ``active
17688 file'' in the @code{nntp} sense; it's an Emacs Lisp file.  If you lose
17689 this file or mess it up in any way, you're dead.  The default is
17690 @file{~/SOUP/active}.
17691
17692 @item nnsoup-packer
17693 @vindex nnsoup-packer
17694 Format string command for packing a reply @sc{soup} packet.  The default
17695 is @samp{tar cf - %s | gzip > $HOME/Soupin%d.tgz}.
17696
17697 @item nnsoup-unpacker
17698 @vindex nnsoup-unpacker
17699 Format string command for unpacking incoming @sc{soup} packets.  The
17700 default is @samp{gunzip -c %s | tar xvf -}.
17701
17702 @item nnsoup-packet-directory
17703 @vindex nnsoup-packet-directory
17704 Where @code{nnsoup} will look for incoming packets.  The default is
17705 @file{~/}.
17706
17707 @item nnsoup-packet-regexp
17708 @vindex nnsoup-packet-regexp
17709 Regular expression matching incoming @sc{soup} packets.  The default is
17710 @samp{Soupout}.
17711
17712 @item nnsoup-always-save
17713 @vindex nnsoup-always-save
17714 If non-@code{nil}, save the replies buffer after each posted message.
17715
17716 @end table
17717
17718
17719 @node SOUP Replies
17720 @subsubsection SOUP Replies
17721
17722 Just using @code{nnsoup} won't mean that your postings and mailings end
17723 up in @sc{soup} reply packets automagically.  You have to work a bit
17724 more for that to happen.
17725
17726 @findex nnsoup-set-variables
17727 The @code{nnsoup-set-variables} command will set the appropriate
17728 variables to ensure that all your followups and replies end up in the
17729 @sc{soup} system.
17730
17731 In specific, this is what it does:
17732
17733 @lisp
17734 (setq message-send-news-function 'nnsoup-request-post)
17735 (setq message-send-mail-function 'nnsoup-request-mail)
17736 @end lisp
17737
17738 And that's it, really.  If you only want news to go into the @sc{soup}
17739 system you just use the first line.  If you only want mail to be
17740 @sc{soup}ed you use the second.
17741
17742
17743 @node Mail-To-News Gateways
17744 @subsection Mail-To-News Gateways
17745 @cindex mail-to-news gateways
17746 @cindex gateways
17747
17748 If your local @code{nntp} server doesn't allow posting, for some reason
17749 or other, you can post using one of the numerous mail-to-news gateways.
17750 The @code{nngateway} back end provides the interface.
17751
17752 Note that you can't read anything from this back end---it can only be
17753 used to post with.
17754
17755 Server variables:
17756
17757 @table @code
17758 @item nngateway-address
17759 @vindex nngateway-address
17760 This is the address of the mail-to-news gateway.
17761
17762 @item nngateway-header-transformation
17763 @vindex nngateway-header-transformation
17764 News headers often have to be transformed in some odd way or other
17765 for the mail-to-news gateway to accept it.  This variable says what
17766 transformation should be called, and defaults to
17767 @code{nngateway-simple-header-transformation}.  The function is called
17768 narrowed to the headers to be transformed and with one parameter---the
17769 gateway address.
17770
17771 This default function just inserts a new @code{To} header based on the
17772 @code{Newsgroups} header and the gateway address.
17773 For instance, an article with this @code{Newsgroups} header:
17774
17775 @example
17776 Newsgroups: alt.religion.emacs
17777 @end example
17778
17779 will get this @code{To} header inserted:
17780
17781 @example
17782 To: alt-religion-emacs@@GATEWAY
17783 @end example
17784
17785 The following pre-defined functions exist:
17786
17787 @findex nngateway-simple-header-transformation
17788 @table @code
17789
17790 @item nngateway-simple-header-transformation
17791 Creates a @code{To} header that looks like
17792 @var{newsgroup}@@@code{nngateway-address}.
17793
17794 @findex nngateway-mail2news-header-transformation
17795
17796 @item nngateway-mail2news-header-transformation
17797 Creates a @code{To} header that looks like
17798 @code{nngateway-address}.
17799 @end table
17800
17801 @end table
17802
17803 Here's an example:
17804
17805 @lisp
17806 (setq gnus-post-method
17807       '(nngateway
17808         "mail2news@@replay.com"
17809         (nngateway-header-transformation
17810          nngateway-mail2news-header-transformation)))
17811 @end lisp
17812
17813 So, to use this, simply say something like:
17814
17815 @lisp
17816 (setq gnus-post-method '(nngateway "GATEWAY.ADDRESS"))
17817 @end lisp
17818
17819
17820
17821 @node Combined Groups
17822 @section Combined Groups
17823
17824 Gnus allows combining a mixture of all the other group types into bigger
17825 groups.
17826
17827 @menu
17828 * Virtual Groups::              Combining articles from many groups.
17829 * Kibozed Groups::              Looking through parts of the newsfeed for articles.
17830 @end menu
17831
17832
17833 @node Virtual Groups
17834 @subsection Virtual Groups
17835 @cindex nnvirtual
17836 @cindex virtual groups
17837 @cindex merging groups
17838
17839 An @dfn{nnvirtual group} is really nothing more than a collection of
17840 other groups.
17841
17842 For instance, if you are tired of reading many small groups, you can
17843 put them all in one big group, and then grow tired of reading one
17844 big, unwieldy group.  The joys of computing!
17845
17846 You specify @code{nnvirtual} as the method.  The address should be a
17847 regexp to match component groups.
17848
17849 All marks in the virtual group will stick to the articles in the
17850 component groups.  So if you tick an article in a virtual group, the
17851 article will also be ticked in the component group from whence it
17852 came.  (And vice versa---marks from the component groups will also be
17853 shown in the virtual group.).  To create an empty virtual group, run
17854 @kbd{G V} (@code{gnus-group-make-empty-virtual}) in the group buffer
17855 and edit the method regexp with @kbd{M-e}
17856 (@code{gnus-group-edit-group-method})
17857
17858 Here's an example @code{nnvirtual} method that collects all Andrea Dworkin
17859 newsgroups into one, big, happy newsgroup:
17860
17861 @lisp
17862 (nnvirtual "^alt\\.fan\\.andrea-dworkin$\\|^rec\\.dworkin.*")
17863 @end lisp
17864
17865 The component groups can be native or foreign; everything should work
17866 smoothly, but if your computer explodes, it was probably my fault.
17867
17868 Collecting the same group from several servers might actually be a good
17869 idea if users have set the Distribution header to limit distribution.
17870 If you would like to read @samp{soc.motss} both from a server in Japan
17871 and a server in Norway, you could use the following as the group regexp:
17872
17873 @example
17874 "^nntp\\+server\\.jp:soc\\.motss$\\|^nntp\\+server\\.no:soc\\.motss$"
17875 @end example
17876
17877 (Remember, though, that if you're creating the group with @kbd{G m}, you
17878 shouldn't double the backslashes, and you should leave off the quote
17879 characters at the beginning and the end of the string.)
17880
17881 This should work kinda smoothly---all articles from both groups should
17882 end up in this one, and there should be no duplicates.  Threading (and
17883 the rest) will still work as usual, but there might be problems with the
17884 sequence of articles.  Sorting on date might be an option here
17885 (@pxref{Selecting a Group}).
17886
17887 One limitation, however---all groups included in a virtual
17888 group have to be alive (i.e., subscribed or unsubscribed).  Killed or
17889 zombie groups can't be component groups for @code{nnvirtual} groups.
17890
17891 @vindex nnvirtual-always-rescan
17892 If the @code{nnvirtual-always-rescan} variable is non-@code{nil} (which
17893 is the default), @code{nnvirtual} will always scan groups for unread
17894 articles when entering a virtual group.  If this variable is @code{nil}
17895 and you read articles in a component group after the virtual group has
17896 been activated, the read articles from the component group will show up
17897 when you enter the virtual group.  You'll also see this effect if you
17898 have two virtual groups that have a component group in common.  If
17899 that's the case, you should set this variable to @code{t}.  Or you can
17900 just tap @code{M-g} on the virtual group every time before you enter
17901 it---it'll have much the same effect.
17902
17903 @code{nnvirtual} can have both mail and news groups as component groups.
17904 When responding to articles in @code{nnvirtual} groups, @code{nnvirtual}
17905 has to ask the back end of the component group the article comes from
17906 whether it is a news or mail back end.  However, when you do a @kbd{^},
17907 there is typically no sure way for the component back end to know this,
17908 and in that case @code{nnvirtual} tells Gnus that the article came from a
17909 not-news back end.  (Just to be on the safe side.)
17910
17911 @kbd{C-c C-n} in the message buffer will insert the @code{Newsgroups}
17912 line from the article you respond to in these cases.
17913
17914 @code{nnvirtual} groups do not inherit anything but articles and marks
17915 from component groups---group parameters, for instance, are not
17916 inherited.
17917
17918
17919 @node Kibozed Groups
17920 @subsection Kibozed Groups
17921 @cindex nnkiboze
17922 @cindex kibozing
17923
17924 @dfn{Kibozing} is defined by the @acronym{OED} as ``grepping through
17925 (parts of) the news feed''.  @code{nnkiboze} is a back end that will
17926 do this for you.  Oh joy!  Now you can grind any @acronym{NNTP} server
17927 down to a halt with useless requests!  Oh happiness!
17928
17929 @kindex G k (Group)
17930 To create a kibozed group, use the @kbd{G k} command in the group
17931 buffer.
17932
17933 The address field of the @code{nnkiboze} method is, as with
17934 @code{nnvirtual}, a regexp to match groups to be ``included'' in the
17935 @code{nnkiboze} group.  That's where most similarities between
17936 @code{nnkiboze} and @code{nnvirtual} end.
17937
17938 In addition to this regexp detailing component groups, an
17939 @code{nnkiboze} group must have a score file to say what articles are
17940 to be included in the group (@pxref{Scoring}).
17941
17942 @kindex M-x nnkiboze-generate-groups
17943 @findex nnkiboze-generate-groups
17944 You must run @kbd{M-x nnkiboze-generate-groups} after creating the
17945 @code{nnkiboze} groups you want to have.  This command will take time.
17946 Lots of time.  Oodles and oodles of time.  Gnus has to fetch the
17947 headers from all the articles in all the component groups and run them
17948 through the scoring process to determine if there are any articles in
17949 the groups that are to be part of the @code{nnkiboze} groups.
17950
17951 Please limit the number of component groups by using restrictive
17952 regexps.  Otherwise your sysadmin may become annoyed with you, and the
17953 @acronym{NNTP} site may throw you off and never let you back in again.
17954 Stranger things have happened.
17955
17956 @code{nnkiboze} component groups do not have to be alive---they can be dead,
17957 and they can be foreign.  No restrictions.
17958
17959 @vindex nnkiboze-directory
17960 The generation of an @code{nnkiboze} group means writing two files in
17961 @code{nnkiboze-directory}, which is @file{~/News/kiboze/} by default.
17962 One contains the @acronym{NOV} header lines for all the articles in
17963 the group, and the other is an additional @file{.newsrc} file to store
17964 information on what groups have been searched through to find
17965 component articles.
17966
17967 Articles marked as read in the @code{nnkiboze} group will have
17968 their @acronym{NOV} lines removed from the @acronym{NOV} file.
17969
17970
17971 @node Email Based Diary
17972 @section Email Based Diary
17973 @cindex diary
17974 @cindex email based diary
17975 @cindex calendar
17976
17977 This section describes a special mail back end called @code{nndiary},
17978 and its companion library @code{gnus-diary}.  It is ``special'' in the
17979 sense that it is not meant to be one of the standard alternatives for
17980 reading mail with Gnus.  See @ref{Choosing a Mail Back End} for that.
17981 Instead, it is used to treat @emph{some} of your mails in a special way,
17982 namely, as event reminders.
17983
17984 Here is a typical scenario:
17985
17986 @itemize @bullet
17987 @item
17988 You've got a date with Andy Mc Dowell or Bruce Willis (select according
17989 to your sexual preference) in one month.  You don't want to forget it.
17990 @item
17991 So you send a ``reminder'' message (actually, a diary one) to yourself.
17992 @item
17993 You forget all about it and keep on getting and reading new mail, as usual.
17994 @item
17995 From time to time, as you type `g' in the group buffer and as the date
17996 is getting closer, the message will pop up again to remind you of your
17997 appointment, just as if it were new and unread.
17998 @item
17999 Read your ``new'' messages, this one included, and start dreaming again
18000 of the night you're gonna have.
18001 @item
18002 Once the date is over (you actually fell asleep just after dinner), the
18003 message will be automatically deleted if it is marked as expirable.
18004 @end itemize
18005
18006 The Gnus Diary back end has the ability to handle regular appointments
18007 (that wouldn't ever be deleted) as well as punctual ones, operates as a
18008 real mail back end and is configurable in many ways.  All of this is
18009 explained in the sections below.
18010
18011 @menu
18012 * The NNDiary Back End::        Basic setup and usage.
18013 * The Gnus Diary Library::      Utility toolkit on top of nndiary.
18014 * Sending or Not Sending::      A final note on sending diary messages.
18015 @end menu
18016
18017
18018 @node The NNDiary Back End
18019 @subsection The NNDiary Back End
18020 @cindex nndiary
18021 @cindex the nndiary back end
18022
18023 @code{nndiary} is a back end very similar to @code{nnml} (@pxref{Mail
18024 Spool}).  Actually, it could appear as a mix of @code{nnml} and
18025 @code{nndraft}.  If you know @code{nnml}, you're already familiar with
18026 the message storing scheme of @code{nndiary}: one file per message, one
18027 directory per group.
18028
18029   Before anything, there is one requirement to be able to run
18030 @code{nndiary} properly: you @emph{must} use the group timestamp feature
18031 of Gnus.  This adds a timestamp to each group's parameters.  @ref{Group
18032 Timestamp} to see how it's done.
18033
18034 @menu
18035 * Diary Messages::              What makes a message valid for nndiary.
18036 * Running NNDiary::             NNDiary has two modes of operation.
18037 * Customizing NNDiary::         Bells and whistles.
18038 @end menu
18039
18040 @node Diary Messages
18041 @subsubsection Diary Messages
18042 @cindex nndiary messages
18043 @cindex nndiary mails
18044
18045 @code{nndiary} messages are just normal ones, except for the mandatory
18046 presence of 7 special headers.  These headers are of the form
18047 @code{X-Diary-<something>}, @code{<something>} being one of
18048 @code{Minute}, @code{Hour}, @code{Dom}, @code{Month}, @code{Year},
18049 @code{Time-Zone} and @code{Dow}.  @code{Dom} means ``Day of Month'', and
18050 @code{dow} means ``Day of Week''.  These headers actually behave like
18051 crontab specifications and define the event date(s):
18052
18053 @itemize @bullet
18054 @item
18055 For all headers except the @code{Time-Zone} one, a header value is
18056 either a star (meaning all possible values), or a list of fields
18057 (separated by a comma).
18058 @item
18059 A field is either an integer, or a range.
18060 @item
18061 A range is two integers separated by a dash.
18062 @item
18063 Possible integer values are 0--59 for @code{Minute}, 0--23 for
18064 @code{Hour}, 1--31 for @code{Dom}, 1--12 for @code{Month}, above 1971
18065 for @code{Year} and 0--6 for @code{Dow} (0 meaning Sunday).
18066 @item
18067 As a special case, a star in either @code{Dom} or @code{Dow} doesn't
18068 mean ``all possible values'', but ``use only the other field''.  Note
18069 that if both are star'ed, the use of either one gives the same result.
18070 @item
18071 The @code{Time-Zone} header is special in that it can only have one
18072 value (@code{GMT}, for instance).  A star doesn't mean ``all possible
18073 values'' (because it makes no sense), but ``the current local time
18074 zone''.  Most of the time, you'll be using a star here.  However, for a
18075 list of available time zone values, see the variable
18076 @code{nndiary-headers}.
18077 @end itemize
18078
18079 As a concrete example, here are the diary headers to add to your message
18080 for specifying ``Each Monday and each 1st of month, at 12:00, 20:00,
18081 21:00, 22:00, 23:00 and 24:00, from 1999 to 2010'' (I'll let you find
18082 what to do then):
18083
18084 @example
18085 X-Diary-Minute: 0
18086 X-Diary-Hour: 12, 20-24
18087 X-Diary-Dom: 1
18088 X-Diary-Month: *
18089 X-Diary-Year: 1999-2010
18090 X-Diary-Dow: 1
18091 X-Diary-Time-Zone: *
18092 @end example
18093
18094 @node Running NNDiary
18095 @subsubsection Running NNDiary
18096 @cindex running nndiary
18097 @cindex nndiary operation modes
18098
18099 @code{nndiary} has two modes of operation: ``traditional'' (the default)
18100 and ``autonomous''.  In traditional mode, @code{nndiary} does not get new
18101 mail by itself.  You have to move (@kbd{B m}) or copy (@kbd{B c}) mails
18102 from your primary mail back end to nndiary groups in order to handle them
18103 as diary messages.  In autonomous mode, @code{nndiary} retrieves its own
18104 mail and handles it independently from your primary mail back end.
18105
18106 One should note that Gnus is not inherently designed to allow several
18107 ``master'' mail back ends at the same time.  However, this does make
18108 sense with @code{nndiary}: you really want to send and receive diary
18109 messages to your diary groups directly.  So, @code{nndiary} supports
18110 being sort of a ``second primary mail back end'' (to my knowledge, it is
18111 the only back end offering this feature).  However, there is a limitation
18112 (which I hope to fix some day): respooling doesn't work in autonomous
18113 mode.
18114
18115 In order to use @code{nndiary} in autonomous mode, you have several
18116 things to do:
18117
18118 @itemize @bullet
18119 @item
18120 Allow @code{nndiary} to retrieve new mail by itself.  Put the following
18121 line in your @file{gnusrc} file:
18122
18123 @lisp
18124 (setq nndiary-get-new-mail t)
18125 @end lisp
18126 @item
18127 You must arrange for diary messages (those containing @code{X-Diary-*}
18128 headers) to be split in a private folder @emph{before} Gnus treat them.
18129 Again, this is needed because Gnus cannot (yet ?) properly handle
18130 multiple primary mail back ends.  Getting those messages from a separate
18131 source will compensate this misfeature to some extent.
18132
18133 As an example, here's my procmailrc entry to store diary files in
18134 @file{~/.nndiary} (the default @code{nndiary} mail source file):
18135
18136 @example
18137 :0 HD :
18138 * ^X-Diary
18139 .nndiary
18140 @end example
18141 @end itemize
18142
18143 Once this is done, you might want to customize the following two options
18144 that affect the diary mail retrieval and splitting processes:
18145
18146 @defvar nndiary-mail-sources
18147 This is the diary-specific replacement for the standard
18148 @code{mail-sources} variable.  It obeys the same syntax, and defaults to
18149 @code{(file :path "~/.nndiary")}.
18150 @end defvar
18151
18152 @defvar nndiary-split-methods
18153 This is the diary-specific replacement for the standard
18154 @code{nnmail-split-methods} variable.  It obeys the same syntax.
18155 @end defvar
18156
18157   Finally, you may add a permanent @code{nndiary} virtual server
18158 (something like @code{(nndiary "diary")} should do) to your
18159 @code{gnus-secondary-select-methods}.
18160
18161   Hopefully, almost everything (see the TODO section in
18162 @file{nndiary.el}) will work as expected when you restart Gnus: in
18163 autonomous mode, typing @kbd{g} and @kbd{M-g} in the group buffer, will
18164 also get your new diary mails and split them according to your
18165 diary-specific rules, @kbd{F} will find your new diary groups etc.
18166
18167 @node Customizing NNDiary
18168 @subsubsection Customizing NNDiary
18169 @cindex customizing nndiary
18170 @cindex nndiary customization
18171
18172 Now that @code{nndiary} is up and running, it's time to customize it.
18173 The custom group is called @code{nndiary} (no, really ?!).  You should
18174 browse it to figure out which options you'd like to tweak.  The following
18175 two variables are probably the only ones you will want to change:
18176
18177 @defvar nndiary-reminders
18178 This is the list of times when you want to be reminded of your
18179 appointements (e.g. 3 weeks before, then 2 days before, then 1 hour
18180 before and that's it).  Remember that ``being reminded'' means that the
18181 diary message will pop up as brand new and unread again when you get new
18182 mail.
18183 @end defvar
18184
18185 @defvar nndiary-week-starts-on-monday
18186 Rather self-explanatory.  Otherwise, Sunday is assumed (this is the
18187 default).
18188 @end defvar
18189
18190
18191 @node The Gnus Diary Library
18192 @subsection The Gnus Diary Library
18193 @cindex gnus-diary
18194 @cindex the gnus diary library
18195
18196 Using @code{nndiary} manually (I mean, writing the headers by hand and
18197 so on) would be rather boring.  Fortunately, there is a library called
18198 @code{gnus-diary} written on top of @code{nndiary}, that does many
18199 useful things for you.
18200
18201   In order to use it, add the following line to your @file{gnusrc} file:
18202
18203 @lisp
18204 (require 'gnus-diary)
18205 @end lisp
18206
18207   Also, you shouldn't use any @code{gnus-user-format-function-[d|D]}
18208 (@pxref{Summary Buffer Lines}).  @code{gnus-diary} provides both of these
18209 (sorry if you used them before).
18210
18211
18212 @menu
18213 * Diary Summary Line Format::           A nicer summary buffer line format.
18214 * Diary Articles Sorting::              A nicer way to sort messages.
18215 * Diary Headers Generation::            Not doing it manually.
18216 * Diary Group Parameters::              Not handling them manually.
18217 @end menu
18218
18219 @node Diary Summary Line Format
18220 @subsubsection Diary Summary Line Format
18221 @cindex diary summary buffer line
18222 @cindex diary summary line format
18223
18224 Displaying diary messages in standard summary line format (usually
18225 something like @samp{From Joe: Subject}) is pretty useless.  Most of
18226 the time, you're the one who wrote the message, and you mostly want to
18227 see the event's date.
18228
18229   @code{gnus-diary} provides two supplemental user formats to be used in
18230 summary line formats.  @code{D} corresponds to a formatted time string
18231 for the next occurrence of the event (e.g. ``Sat, Sep 22 01, 12:00''),
18232 while @code{d} corresponds to an approximative remaining time until the
18233 next occurrence of the event (e.g. ``in 6 months, 1 week'').
18234
18235   For example, here's how Joe's birthday is displayed in my
18236 @code{nndiary+diary:birthdays} summary buffer (note that the message is
18237 expirable, but will never be deleted, as it specifies a periodic event):
18238
18239 @example
18240    E  Sat, Sep 22 01, 12:00: Joe's birthday (in 6 months, 1 week)
18241 @end example
18242
18243 In order to get something like the above, you would normally add the
18244 following line to your diary groups'parameters:
18245
18246 @lisp
18247 (gnus-summary-line-format "%U%R%z %uD: %(%s%) (%ud)\n")
18248 @end lisp
18249
18250 However, @code{gnus-diary} does it automatically (@pxref{Diary Group
18251 Parameters}).  You can however customize the provided summary line format
18252 with the following user options:
18253
18254 @defvar gnus-diary-summary-line-format
18255 Defines the summary line format used for diary groups (@pxref{Summary
18256 Buffer Lines}).  @code{gnus-diary} uses it to automatically update the
18257 diary groups'parameters.
18258 @end defvar
18259
18260 @defvar gnus-diary-time-format
18261 Defines the format to display dates in diary summary buffers.  This is
18262 used by the @code{D} user format.  See the docstring for details.
18263 @end defvar
18264
18265 @defvar gnus-diary-delay-format-function
18266 Defines the format function to use for displaying delays (remaining
18267 times) in diary summary buffers.  This is used by the @code{d} user
18268 format.  There are currently built-in functions for English and French;
18269 you can also define your own.  See the docstring for details.
18270 @end defvar
18271
18272 @node Diary Articles Sorting
18273 @subsubsection Diary Articles Sorting
18274 @cindex diary articles sorting
18275 @cindex diary summary lines sorting
18276 @findex gnus-summary-sort-by-schedule
18277 @findex gnus-thread-sort-by-schedule
18278 @findex gnus-article-sort-by-schedule
18279
18280 @code{gnus-diary} provides new sorting functions (@pxref{Sorting the
18281 Summary Buffer} ) called @code{gnus-summary-sort-by-schedule},
18282 @code{gnus-thread-sort-by-schedule} and
18283 @code{gnus-article-sort-by-schedule}.  These functions let you organize
18284 your diary summary buffers from the closest event to the farthest one.
18285
18286 @code{gnus-diary} automatically installs
18287 @code{gnus-summary-sort-by-schedule} as a menu item in the summary
18288 buffer's ``sort'' menu, and the two others as the primary (hence
18289 default) sorting functions in the group parameters (@pxref{Diary Group
18290 Parameters}).
18291
18292 @node Diary Headers Generation
18293 @subsubsection Diary Headers Generation
18294 @cindex diary headers generation
18295 @findex gnus-diary-check-message
18296
18297 @code{gnus-diary} provides a function called
18298 @code{gnus-diary-check-message} to help you handle the @code{X-Diary-*}
18299 headers.  This function ensures that the current message contains all the
18300 required diary headers, and prompts you for values or corrections if
18301 needed.
18302
18303   This function is hooked into the @code{nndiary} back end, so that
18304 moving or copying an article to a diary group will trigger it
18305 automatically.  It is also bound to @kbd{C-c D c} in @code{message-mode}
18306 and @code{article-edit-mode} in order to ease the process of converting
18307 a usual mail to a diary one.
18308
18309   This function takes a prefix argument which will force prompting of
18310 all diary headers, regardless of their presence or validity.  That way,
18311 you can very easily reschedule an already valid diary message, for
18312 instance.
18313
18314 @node Diary Group Parameters
18315 @subsubsection Diary Group Parameters
18316 @cindex diary group parameters
18317
18318 When you create a new diary group, or visit one, @code{gnus-diary}
18319 automatically checks your group parameters and if needed, sets the
18320 summary line format to the diary-specific value, installs the
18321 diary-specific sorting functions, and also adds the different
18322 @code{X-Diary-*} headers to the group's posting-style.  It is then easier
18323 to send a diary message, because if you use @kbd{C-u a} or @kbd{C-u m}
18324 on a diary group to prepare a message, these headers will be inserted
18325 automatically (although not filled with proper values yet).
18326
18327 @node Sending or Not Sending
18328 @subsection Sending or Not Sending
18329
18330 Well, assuming you've read of of the above, here are two final notes on
18331 mail sending with @code{nndiary}:
18332
18333 @itemize @bullet
18334 @item
18335 @code{nndiary} is a @emph{real} mail back end.  You really send real diary
18336 messsages for real.  This means for instance that you can give
18337 appointements to anybody (provided they use Gnus and @code{nndiary}) by
18338 sending the diary message to them as well.
18339 @item
18340 However, since @code{nndiary} also has a @code{request-post} method, you
18341 can also use @kbd{C-u a} instead of @kbd{C-u m} on a diary group and the
18342 message won't actually be sent; just stored locally in the group. This
18343 comes in very handy for private appointments.
18344 @end itemize
18345
18346 @node Gnus Unplugged
18347 @section Gnus Unplugged
18348 @cindex offline
18349 @cindex unplugged
18350 @cindex agent
18351 @cindex Gnus agent
18352 @cindex Gnus unplugged
18353
18354 In olden times (ca. February '88), people used to run their newsreaders
18355 on big machines with permanent connections to the net.  News transport
18356 was dealt with by news servers, and all the newsreaders had to do was to
18357 read news.  Believe it or not.
18358
18359 Nowadays most people read news and mail at home, and use some sort of
18360 modem to connect to the net.  To avoid running up huge phone bills, it
18361 would be nice to have a way to slurp down all the news and mail, hang up
18362 the phone, read for several hours, and then upload any responses you
18363 have to make.  And then you repeat the procedure.
18364
18365 Of course, you can use news servers for doing this as well.  I've used
18366 @code{inn} together with @code{slurp}, @code{pop} and @code{sendmail}
18367 for some years, but doing that's a bore.  Moving the news server
18368 functionality up to the newsreader makes sense if you're the only person
18369 reading news on a machine.
18370
18371 Setting up Gnus as an ``offline'' newsreader is quite simple.  In
18372 fact, you don't have to configure anything as the agent is now enabled
18373 by default (@pxref{Agent Variables, gnus-agent}).
18374
18375 Of course, to use it as such, you have to learn a few new commands.
18376
18377 @menu
18378 * Agent Basics::                How it all is supposed to work.
18379 * Agent Categories::            How to tell the Gnus Agent what to download.
18380 * Agent Commands::              New commands for all the buffers.
18381 * Agent Visuals::               Ways that the agent may effect your summary buffer.
18382 * Agent as Cache::              The Agent is a big cache too.
18383 * Agent Expiry::                How to make old articles go away.
18384 * Agent Regeneration::          How to recover from lost connections and other accidents.
18385 * Agent and flags::             How the Agent maintains flags.
18386 * Agent and IMAP::              How to use the Agent with @acronym{IMAP}.
18387 * Outgoing Messages::           What happens when you post/mail something?
18388 * Agent Variables::             Customizing is fun.
18389 * Example Setup::               An example @file{~/.gnus.el} file for offline people.
18390 * Batching Agents::             How to fetch news from a @code{cron} job.
18391 * Agent Caveats::               What you think it'll do and what it does.
18392 @end menu
18393
18394
18395 @node Agent Basics
18396 @subsection Agent Basics
18397
18398 First, let's get some terminology out of the way.
18399
18400 The Gnus Agent is said to be @dfn{unplugged} when you have severed the
18401 connection to the net (and notified the Agent that this is the case).
18402 When the connection to the net is up again (and Gnus knows this), the
18403 Agent is @dfn{plugged}.
18404
18405 The @dfn{local} machine is the one you're running on, and which isn't
18406 connected to the net continuously.
18407
18408 @dfn{Downloading} means fetching things from the net to your local
18409 machine.  @dfn{Uploading} is doing the opposite.
18410
18411 You know that Gnus gives you all the opportunity you'd ever want for
18412 shooting yourself in the foot.  Some people call it flexibility.  Gnus
18413 is also customizable to a great extent, which means that the user has a
18414 say on how Gnus behaves.  Other newsreaders might unconditionally shoot
18415 you in your foot, but with Gnus, you have a choice!
18416
18417 Gnus is never really in plugged or unplugged state.  Rather, it applies
18418 that state to each server individually.  This means that some servers
18419 can be plugged while others can be unplugged.  Additionally, some
18420 servers can be ignored by the Agent altogether (which means that
18421 they're kinda like plugged always).
18422
18423 So when you unplug the Agent and then wonder why is Gnus opening a
18424 connection to the Net, the next step to do is to look whether all
18425 servers are agentized.  If there is an unagentized server, you found
18426 the culprit.
18427
18428 Another thing is the @dfn{offline} state.  Sometimes, servers aren't
18429 reachable.  When Gnus notices this, it asks you whether you want the
18430 server to be switched to offline state.  If you say yes, then the
18431 server will behave somewhat as if it was unplugged, except that Gnus
18432 will ask you whether you want to switch it back online again.
18433
18434 Let's take a typical Gnus session using the Agent.
18435
18436 @itemize @bullet
18437
18438 @item
18439 @findex gnus-unplugged
18440 You start Gnus with @code{gnus-unplugged}.  This brings up the Gnus
18441 Agent in a disconnected state.  You can read all the news that you have
18442 already fetched while in this mode.
18443
18444 @item
18445 You then decide to see whether any new news has arrived.  You connect
18446 your machine to the net (using PPP or whatever), and then hit @kbd{J j}
18447 to make Gnus become @dfn{plugged} and use @kbd{g} to check for new mail
18448 as usual.  To check for new mail in unplugged mode (@pxref{Mail
18449 Source Specifiers}).
18450
18451 @item
18452 You can then read the new news immediately, or you can download the
18453 news onto your local machine.  If you want to do the latter, you press
18454 @kbd{g} to check if there are any new news and then @kbd{J s} to fetch
18455 all the eligible articles in all the groups.  (To let Gnus know which
18456 articles you want to download, @pxref{Agent Categories}).
18457
18458 @item
18459 After fetching the articles, you press @kbd{J j} to make Gnus become
18460 unplugged again, and you shut down the PPP thing (or whatever).  And
18461 then you read the news offline.
18462
18463 @item
18464 And then you go to step 2.
18465 @end itemize
18466
18467 Here are some things you should do the first time (or so) that you use
18468 the Agent.
18469
18470 @itemize @bullet
18471
18472 @item
18473 Decide which servers should be covered by the Agent.  If you have a mail
18474 back end, it would probably be nonsensical to have it covered by the
18475 Agent.  Go to the server buffer (@kbd{^} in the group buffer) and press
18476 @kbd{J a} on the server (or servers) that you wish to have covered by the
18477 Agent (@pxref{Server Agent Commands}), or @kbd{J r} on automatically
18478 added servers you do not wish to have covered by the Agent.  By default,
18479 all @code{nntp} and @code{nnimap} servers in @code{gnus-select-method} and
18480 @code{gnus-secondary-select-methods} are agentized.
18481
18482 @item
18483 Decide on download policy.  It's fairly simple once you decide whether
18484 you are going to use agent categories, topic parameters, and/or group
18485 parameters to implement your policy.  If you're new to gnus, it
18486 is probably best to start with a category, @xref{Agent Categories}.
18487
18488 Both topic parameters (@pxref{Topic Parameters}) and agent categories
18489 (@pxref{Agent Categories}) provide for setting a policy that applies
18490 to multiple groups.  Which you use is entirely up to you.  Topic
18491 parameters do override categories so, if you mix the two, you'll have
18492 to take that into account.  If you have a few groups that deviate from
18493 your policy, you can use group parameters (@pxref{Group Parameters}) to
18494 configure them.
18495
18496 @item
18497 Uhm@dots{} that's it.
18498 @end itemize
18499
18500
18501 @node Agent Categories
18502 @subsection Agent Categories
18503
18504 One of the main reasons to integrate the news transport layer into the
18505 newsreader is to allow greater control over what articles to download.
18506 There's not much point in downloading huge amounts of articles, just to
18507 find out that you're not interested in reading any of them.  It's better
18508 to be somewhat more conservative in choosing what to download, and then
18509 mark the articles for downloading manually if it should turn out that
18510 you're interested in the articles anyway.
18511
18512 One of the more effective methods for controlling what is to be
18513 downloaded is to create a @dfn{category} and then assign some (or all)
18514 groups to this category.  Groups that do not belong in any other
18515 category belong to the @code{default} category.  Gnus has its own
18516 buffer for creating and managing categories.
18517
18518 If you prefer, you can also use group parameters (@pxref{Group
18519 Parameters}) and topic parameters (@pxref{Topic Parameters}) for an
18520 alternative approach to controlling the agent.  The only real
18521 difference is that categories are specific to the agent (so there is
18522 less to learn) while group and topic parameters include the kitchen
18523 sink.
18524
18525 Since you can set agent parameters in several different places we have
18526 a rule to decide which source to believe.  This rule specifies that
18527 the parameter sources are checked in the following order: group
18528 parameters, topic parameters, agent category, and finally customizable
18529 variables.  So you can mix all of these sources to produce a wide range
18530 of behavior, just don't blame me if you don't remember where you put
18531 your settings.
18532
18533 @menu
18534 * Category Syntax::             What a category looks like.
18535 * Category Buffer::             A buffer for maintaining categories.
18536 * Category Variables::          Customize'r'Us.
18537 @end menu
18538
18539
18540 @node Category Syntax
18541 @subsubsection Category Syntax
18542
18543 A category consists of a name, the list of groups belonging to the
18544 category, and a number of optional parameters that override the
18545 customizable variables.  The complete list of agent parameters are
18546 listed below.
18547
18548 @cindex Agent Parameters
18549 @table @code
18550 @item agent-groups
18551 The list of groups that are in this category.
18552
18553 @item agent-predicate
18554 A predicate which (generally) gives a rough outline of which articles
18555 are eligible for downloading; and
18556
18557 @item agent-score
18558 a score rule which (generally) gives you a finer granularity when
18559 deciding what articles to download.  (Note that this @dfn{download
18560 score} is not necessarily related to normal scores.)
18561
18562 @item agent-enable-expiration
18563 a boolean indicating whether the agent should expire old articles in
18564 this group.  Most groups should be expired to conserve disk space.  In
18565 fact, its probably safe to say that the gnus.* hierarchy contains the
18566 only groups that should not be expired.
18567
18568 @item agent-days-until-old
18569 an integer indicating the number of days that the agent should wait
18570 before deciding that a read article is safe to expire.
18571
18572 @item agent-low-score
18573 an integer that overrides the value of @code{gnus-agent-low-score}.
18574
18575 @item agent-high-score
18576 an integer that overrides the value of @code{gnus-agent-high-score}.
18577
18578 @item agent-short-article
18579 an integer that overrides the value of
18580 @code{gnus-agent-short-article}.
18581
18582 @item agent-long-article
18583 an integer that overrides the value of @code{gnus-agent-long-article}.
18584
18585 @item agent-enable-undownloaded-faces
18586 a symbol indicating whether the summary buffer should display
18587 undownloaded articles using the @code{gnus-summary-*-undownloaded-face}
18588 faces.  Any symbol other than @code{nil} will enable the use of
18589 undownloaded faces.
18590 @end table
18591
18592 The name of a category can not be changed once the category has been
18593 created.
18594
18595 Each category maintains a list of groups that are exclusive members of
18596 that category.  The exclusivity rule is automatically enforced, add a
18597 group to a new category and it is automatically removed from its old
18598 category.
18599
18600 A predicate in its simplest form can be a single predicate such as
18601 @code{true} or @code{false}.  These two will download every available
18602 article or nothing respectively.  In the case of these two special
18603 predicates an additional score rule is superfluous.
18604
18605 Predicates of @code{high} or @code{low} download articles in respect of
18606 their scores in relationship to @code{gnus-agent-high-score} and
18607 @code{gnus-agent-low-score} as described below.
18608
18609 To gain even finer control of what is to be regarded eligible for
18610 download a predicate can consist of a number of predicates with logical
18611 operators sprinkled in between.
18612
18613 Perhaps some examples are in order.
18614
18615 Here's a simple predicate.  (It's the default predicate, in fact, used
18616 for all groups that don't belong to any other category.)
18617
18618 @lisp
18619 short
18620 @end lisp
18621
18622 Quite simple, eh?  This predicate is true if and only if the article is
18623 short (for some value of ``short'').
18624
18625 Here's a more complex predicate:
18626
18627 @lisp
18628 (or high
18629     (and
18630      (not low)
18631      (not long)))
18632 @end lisp
18633
18634 This means that an article should be downloaded if it has a high score,
18635 or if the score is not low and the article is not long.  You get the
18636 drift.
18637
18638 The available logical operators are @code{or}, @code{and} and
18639 @code{not}.  (If you prefer, you can use the more ``C''-ish operators
18640 @samp{|}, @code{&} and @code{!} instead.)
18641
18642 The following predicates are pre-defined, but if none of these fit what
18643 you want to do, you can write your own.
18644
18645 When evaluating each of these predicates, the named constant will be
18646 bound to the value determined by calling
18647 @code{gnus-agent-find-parameter} on the appropriate parameter.  For
18648 example, gnus-agent-short-article will be bound to
18649 @code{(gnus-agent-find-parameter group 'agent-short-article)}.  This
18650 means that you can specify a predicate in your category then tune that
18651 predicate to individual groups.
18652
18653 @table @code
18654 @item short
18655 True iff the article is shorter than @code{gnus-agent-short-article}
18656 lines; default 100.
18657
18658 @item long
18659 True iff the article is longer than @code{gnus-agent-long-article}
18660 lines; default 200.
18661
18662 @item low
18663 True iff the article has a download score less than
18664 @code{gnus-agent-low-score}; default 0.
18665
18666 @item high
18667 True iff the article has a download score greater than
18668 @code{gnus-agent-high-score}; default 0.
18669
18670 @item spam
18671 True iff the Gnus Agent guesses that the article is spam.  The
18672 heuristics may change over time, but at present it just computes a
18673 checksum and sees whether articles match.
18674
18675 @item true
18676 Always true.
18677
18678 @item false
18679 Always false.
18680 @end table
18681
18682 If you want to create your own predicate function, here's what you have
18683 to know:  The functions are called with no parameters, but the
18684 @code{gnus-headers} and @code{gnus-score} dynamic variables are bound to
18685 useful values.
18686
18687 For example, you could decide that you don't want to download articles
18688 that were posted more than a certain number of days ago (e.g. posted
18689 more than @code{gnus-agent-expire-days} ago) you might write a function
18690 something along the lines of the following:
18691
18692 @lisp
18693 (defun my-article-old-p ()
18694   "Say whether an article is old."
18695   (< (time-to-days (date-to-time (mail-header-date gnus-headers)))
18696      (- (time-to-days (current-time)) gnus-agent-expire-days)))
18697 @end lisp
18698
18699 with the predicate then defined as:
18700
18701 @lisp
18702 (not my-article-old-p)
18703 @end lisp
18704
18705 or you could append your predicate to the predefined
18706 @code{gnus-category-predicate-alist} in your @file{~/.gnus.el} or
18707 wherever.
18708
18709 @lisp
18710 (require 'gnus-agent)
18711 (setq  gnus-category-predicate-alist
18712   (append gnus-category-predicate-alist
18713          '((old . my-article-old-p))))
18714 @end lisp
18715
18716 and simply specify your predicate as:
18717
18718 @lisp
18719 (not old)
18720 @end lisp
18721
18722 If/when using something like the above, be aware that there are many
18723 misconfigured systems/mailers out there and so an article's date is not
18724 always a reliable indication of when it was posted.  Hell, some people
18725 just don't give a damn.
18726
18727 The above predicates apply to @emph{all} the groups which belong to the
18728 category.  However, if you wish to have a specific predicate for an
18729 individual group within a category, or you're just too lazy to set up a
18730 new category, you can enter a group's individual predicate in its group
18731 parameters like so:
18732
18733 @lisp
18734 (agent-predicate . short)
18735 @end lisp
18736
18737 This is the group/topic parameter equivalent of the agent category default.
18738 Note that when specifying a single word predicate like this, the
18739 @code{agent-predicate} specification must be in dotted pair notation.
18740
18741 The equivalent of the longer example from above would be:
18742
18743 @lisp
18744 (agent-predicate or high (and (not low) (not long)))
18745 @end lisp
18746
18747 The outer parenthesis required in the category specification are not
18748 entered here as, not being in dotted pair notation, the value of the
18749 predicate is assumed to be a list.
18750
18751
18752 Now, the syntax of the download score is the same as the syntax of
18753 normal score files, except that all elements that require actually
18754 seeing the article itself are verboten.  This means that only the
18755 following headers can be scored on: @code{Subject}, @code{From},
18756 @code{Date}, @code{Message-ID}, @code{References}, @code{Chars},
18757 @code{Lines}, and @code{Xref}.
18758
18759 As with predicates, the specification of the @code{download score rule}
18760 to use in respect of a group can be in either the category definition if
18761 it's to be applicable to all groups in therein, or a group's parameters
18762 if it's to be specific to that group.
18763
18764 In both of these places the @code{download score rule} can take one of
18765 three forms:
18766
18767 @enumerate
18768 @item
18769 Score rule
18770
18771 This has the same syntax as a normal Gnus score file except only a
18772 subset of scoring keywords are available as mentioned above.
18773
18774 example:
18775
18776 @itemize @bullet
18777 @item
18778 Category specification
18779
18780 @lisp
18781 (("from"
18782        ("Lars Ingebrigtsen" 1000000 nil s))
18783 ("lines"
18784        (500 -100 nil <)))
18785 @end lisp
18786
18787 @item
18788 Group/Topic Parameter specification
18789
18790 @lisp
18791 (agent-score ("from"
18792                    ("Lars Ingebrigtsen" 1000000 nil s))
18793              ("lines"
18794                    (500 -100 nil <)))
18795 @end lisp
18796
18797 Again, note the omission of the outermost parenthesis here.
18798 @end itemize
18799
18800 @item
18801 Agent score file
18802
18803 These score files must @emph{only} contain the permitted scoring
18804 keywords stated above.
18805
18806 example:
18807
18808 @itemize @bullet
18809 @item
18810 Category specification
18811
18812 @lisp
18813 ("~/News/agent.SCORE")
18814 @end lisp
18815
18816 or perhaps
18817
18818 @lisp
18819 ("~/News/agent.SCORE" "~/News/agent.group.SCORE")
18820 @end lisp
18821
18822 @item
18823 Group Parameter specification
18824
18825 @lisp
18826 (agent-score "~/News/agent.SCORE")
18827 @end lisp
18828
18829 Additional score files can be specified as above.  Need I say anything
18830 about parenthesis?
18831 @end itemize
18832
18833 @item
18834 Use @code{normal} score files
18835
18836 If you don't want to maintain two sets of scoring rules for a group, and
18837 your desired @code{downloading} criteria for a group are the same as your
18838 @code{reading} criteria then you can tell the agent to refer to your
18839 @code{normal} score files when deciding what to download.
18840
18841 These directives in either the category definition or a group's
18842 parameters will cause the agent to read in all the applicable score
18843 files for a group, @emph{filtering out} those sections that do not
18844 relate to one of the permitted subset of scoring keywords.
18845
18846 @itemize @bullet
18847 @item
18848 Category Specification
18849
18850 @lisp
18851 file
18852 @end lisp
18853
18854 @item
18855 Group Parameter specification
18856
18857 @lisp
18858 (agent-score . file)
18859 @end lisp
18860 @end itemize
18861 @end enumerate
18862
18863 @node Category Buffer
18864 @subsubsection Category Buffer
18865
18866 You'd normally do all category maintenance from the category buffer.
18867 When you enter it for the first time (with the @kbd{J c} command from
18868 the group buffer), you'll only see the @code{default} category.
18869
18870 The following commands are available in this buffer:
18871
18872 @table @kbd
18873 @item q
18874 @kindex q (Category)
18875 @findex gnus-category-exit
18876 Return to the group buffer (@code{gnus-category-exit}).
18877
18878 @item e
18879 @kindex e (Category)
18880 @findex gnus-category-customize-category
18881 Use a customization buffer to set all of the selected category's
18882 parameters at one time (@code{gnus-category-customize-category}).
18883
18884 @item k
18885 @kindex k (Category)
18886 @findex gnus-category-kill
18887 Kill the current category (@code{gnus-category-kill}).
18888
18889 @item c
18890 @kindex c (Category)
18891 @findex gnus-category-copy
18892 Copy the current category (@code{gnus-category-copy}).
18893
18894 @item a
18895 @kindex a (Category)
18896 @findex gnus-category-add
18897 Add a new category (@code{gnus-category-add}).
18898
18899 @item p
18900 @kindex p (Category)
18901 @findex gnus-category-edit-predicate
18902 Edit the predicate of the current category
18903 (@code{gnus-category-edit-predicate}).
18904
18905 @item g
18906 @kindex g (Category)
18907 @findex gnus-category-edit-groups
18908 Edit the list of groups belonging to the current category
18909 (@code{gnus-category-edit-groups}).
18910
18911 @item s
18912 @kindex s (Category)
18913 @findex gnus-category-edit-score
18914 Edit the download score rule of the current category
18915 (@code{gnus-category-edit-score}).
18916
18917 @item l
18918 @kindex l (Category)
18919 @findex gnus-category-list
18920 List all the categories (@code{gnus-category-list}).
18921 @end table
18922
18923
18924 @node Category Variables
18925 @subsubsection Category Variables
18926
18927 @table @code
18928 @item gnus-category-mode-hook
18929 @vindex gnus-category-mode-hook
18930 Hook run in category buffers.
18931
18932 @item gnus-category-line-format
18933 @vindex gnus-category-line-format
18934 Format of the lines in the category buffer (@pxref{Formatting
18935 Variables}).  Valid elements are:
18936
18937 @table @samp
18938 @item c
18939 The name of the category.
18940
18941 @item g
18942 The number of groups in the category.
18943 @end table
18944
18945 @item gnus-category-mode-line-format
18946 @vindex gnus-category-mode-line-format
18947 Format of the category mode line (@pxref{Mode Line Formatting}).
18948
18949 @item gnus-agent-short-article
18950 @vindex gnus-agent-short-article
18951 Articles that have fewer lines than this are short.  Default 100.
18952
18953 @item gnus-agent-long-article
18954 @vindex gnus-agent-long-article
18955 Articles that have more lines than this are long.  Default 200.
18956
18957 @item gnus-agent-low-score
18958 @vindex gnus-agent-low-score
18959 Articles that have a score lower than this have a low score.  Default
18960 0.
18961
18962 @item gnus-agent-high-score
18963 @vindex gnus-agent-high-score
18964 Articles that have a score higher than this have a high score.  Default
18965 0.
18966
18967 @item gnus-agent-expire-days
18968 @vindex gnus-agent-expire-days
18969 The number of days that a @samp{read} article must stay in the agent's
18970 local disk before becoming eligible for expiration (While the name is
18971 the same, this doesn't mean expiring the article on the server.  It
18972 just means deleting the local copy of the article).  What is also
18973 important to understand is that the counter starts with the time the
18974 article was written to the local disk and not the time the article was
18975 read.
18976 Default 7.
18977
18978 @item gnus-agent-enable-expiration
18979 @vindex gnus-agent-enable-expiration
18980 Determines whether articles in a group are, by default, expired or
18981 retained indefinitely.  The default is @code{ENABLE} which means that
18982 you'll have to disable expiration when desired.  On the other hand,
18983 you could set this to @code{DISABLE}.  In that case, you would then
18984 have to enable expiration in selected groups.
18985
18986 @end table
18987
18988
18989 @node Agent Commands
18990 @subsection Agent Commands
18991 @findex gnus-agent-toggle-plugged
18992 @kindex J j (Agent)
18993
18994 All the Gnus Agent commands are on the @kbd{J} submap.  The @kbd{J j}
18995 (@code{gnus-agent-toggle-plugged}) command works in all modes, and
18996 toggles the plugged/unplugged state of the Gnus Agent.
18997
18998
18999 @menu
19000 * Group Agent Commands::        Configure groups and fetch their contents.
19001 * Summary Agent Commands::      Manually select then fetch specific articles.
19002 * Server Agent Commands::       Select the servers that are supported by the agent.
19003 @end menu
19004
19005
19006
19007
19008 @node Group Agent Commands
19009 @subsubsection Group Agent Commands
19010
19011 @table @kbd
19012 @item J u
19013 @kindex J u (Agent Group)
19014 @findex gnus-agent-fetch-groups
19015 Fetch all eligible articles in the current group
19016 (@code{gnus-agent-fetch-groups}).
19017
19018 @item J c
19019 @kindex J c (Agent Group)
19020 @findex gnus-enter-category-buffer
19021 Enter the Agent category buffer (@code{gnus-enter-category-buffer}).
19022
19023 @item J s
19024 @kindex J s (Agent Group)
19025 @findex gnus-agent-fetch-session
19026 Fetch all eligible articles in all groups
19027 (@code{gnus-agent-fetch-session}).
19028
19029 @item J S
19030 @kindex J S (Agent Group)
19031 @findex gnus-group-send-queue
19032 Send all sendable messages in the queue group
19033 (@code{gnus-group-send-queue}).  @xref{Drafts}.
19034
19035 @item J a
19036 @kindex J a (Agent Group)
19037 @findex gnus-agent-add-group
19038 Add the current group to an Agent category
19039 (@code{gnus-agent-add-group}).  This command understands the
19040 process/prefix convention (@pxref{Process/Prefix}).
19041
19042 @item J r
19043 @kindex J r (Agent Group)
19044 @findex gnus-agent-remove-group
19045 Remove the current group from its category, if any
19046 (@code{gnus-agent-remove-group}).  This command understands the
19047 process/prefix convention (@pxref{Process/Prefix}).
19048
19049 @item J Y
19050 @kindex J Y (Agent Group)
19051 @findex gnus-agent-synchronize-flags
19052 Synchronize flags changed while unplugged with remote server, if any.
19053
19054
19055 @end table
19056
19057
19058 @node Summary Agent Commands
19059 @subsubsection Summary Agent Commands
19060
19061 @table @kbd
19062 @item J #
19063 @kindex J # (Agent Summary)
19064 @findex gnus-agent-mark-article
19065 Mark the article for downloading (@code{gnus-agent-mark-article}).
19066
19067 @item J M-#
19068 @kindex J M-# (Agent Summary)
19069 @findex gnus-agent-unmark-article
19070 Remove the downloading mark from the article
19071 (@code{gnus-agent-unmark-article}).
19072
19073 @cindex %
19074 @item @@
19075 @kindex @@ (Agent Summary)
19076 @findex gnus-agent-toggle-mark
19077 Toggle whether to download the article
19078 (@code{gnus-agent-toggle-mark}).  The download mark is @samp{%} by
19079 default.
19080
19081 @item J c
19082 @kindex J c (Agent Summary)
19083 @findex gnus-agent-catchup
19084 Mark all articles as read (@code{gnus-agent-catchup}) that are neither cached, downloaded, nor downloadable.
19085
19086 @item J S
19087 @kindex J S (Agent Summary)
19088 @findex gnus-agent-fetch-group
19089 Download all eligible (@pxref{Agent Categories}) articles in this group.
19090 (@code{gnus-agent-fetch-group}).
19091
19092 @item J s
19093 @kindex J s (Agent Summary)
19094 @findex gnus-agent-summary-fetch-series
19095 Download all processable articles in this group.
19096 (@code{gnus-agent-summary-fetch-series}).
19097
19098 @item J u
19099 @kindex J u (Agent Summary)
19100 @findex gnus-agent-summary-fetch-group
19101 Download all downloadable articles in the current group
19102 (@code{gnus-agent-summary-fetch-group}).
19103
19104 @end table
19105
19106
19107 @node Server Agent Commands
19108 @subsubsection Server Agent Commands
19109
19110 @table @kbd
19111 @item J a
19112 @kindex J a (Agent Server)
19113 @findex gnus-agent-add-server
19114 Add the current server to the list of servers covered by the Gnus Agent
19115 (@code{gnus-agent-add-server}).
19116
19117 @item J r
19118 @kindex J r (Agent Server)
19119 @findex gnus-agent-remove-server
19120 Remove the current server from the list of servers covered by the Gnus
19121 Agent (@code{gnus-agent-remove-server}).
19122
19123 @end table
19124
19125
19126 @node Agent Visuals
19127 @subsection Agent Visuals
19128
19129 If you open a summary while unplugged and, Gnus knows from the group's
19130 active range that there are more articles than the headers currently
19131 stored in the Agent, you may see some articles whose subject looks
19132 something like @samp{[Undownloaded article #####]}.  These are
19133 placeholders for the missing headers.  Aside from setting a mark,
19134 there is not much that can be done with one of these placeholders.
19135 When Gnus finally gets a chance to fetch the group's headers, the
19136 placeholders will automatically be replaced by the actual headers.
19137 You can configure the summary buffer's maneuvering to skip over the
19138 placeholders if you care (See @code{gnus-auto-goto-ignores}).
19139
19140 While it may be obvious to all, the only headers and articles
19141 available while unplugged are those headers and articles that were
19142 fetched into the Agent while previously plugged.  To put it another
19143 way, ``If you forget to fetch something while plugged, you might have a
19144 less than satisfying unplugged session''.  For this reason, the Agent
19145 adds two visual effects to your summary buffer.  These effects display
19146 the download status of each article so that you always know which
19147 articles will be available when unplugged.
19148
19149 The first visual effect is the @samp{%O} spec.  If you customize
19150 @code{gnus-summary-line-format} to include this specifier, you will add
19151 a single character field that indicates an article's download status.
19152 Articles that have been fetched into either the Agent or the Cache,
19153 will display @code{gnus-downloaded-mark} (defaults to @samp{+}).  All
19154 other articles will display @code{gnus-undownloaded-mark} (defaults to
19155 @samp{-}).  If you open a group that has not been agentized, a space
19156 (@samp{ }) will be displayed.
19157
19158 The second visual effect are the undownloaded faces.  The faces, there
19159 are three indicating the article's score (low, normal, high), seem to
19160 result in a love/hate response from many Gnus users.  The problem is
19161 that the face selection is controlled by a list of condition tests and
19162 face names (See @code{gnus-summary-highlight}).  Each condition is
19163 tested in the order in which it appears in the list so early
19164 conditions have precedence over later conditions.  All of this means
19165 that, if you tick an undownloaded article, the article will continue
19166 to be displayed in the undownloaded face rather than the ticked face.
19167
19168 If you use the Agent as a cache (to avoid downloading the same article
19169 each time you visit it or to minimize your connection time), the
19170 undownloaded face will probably seem like a good idea.  The reason
19171 being that you do all of our work (marking, reading, deleting) with
19172 downloaded articles so the normal faces always appear.  For those
19173 users using the agent to improve online performance by caching the NOV
19174 database (most users since 5.10.2), the undownloaded faces may appear
19175 to be an absolutely horrible idea.  The issue being that, since none
19176 of their articles have been fetched into the Agent, all of the
19177 normal faces will be obscured by the undownloaded faces.
19178
19179 If you would like to use the undownloaded faces, you must enable the
19180 undownloaded faces by setting the @code{agent-enable-undownloaded-faces}
19181 group parameter to @code{t}.  This parameter, like all other agent
19182 parameters, may be set on an Agent Category (@pxref{Agent Categories}),
19183 a Group Topic (@pxref{Topic Parameters}), or an individual group
19184 (@pxref{Group Parameters}).
19185
19186 The one problem common to all users using the agent is how quickly it
19187 can consume disk space.  If you using the agent on many groups, it is
19188 even more difficult to effectively recover disk space.  One solution
19189 is the @samp{%F} format available in @code{gnus-group-line-format}.
19190 This format will display the actual disk space used by articles
19191 fetched into both the agent and cache.  By knowing which groups use
19192 the most space, users know where to focus their efforts when ``agent
19193 expiring'' articles.
19194
19195 @node Agent as Cache
19196 @subsection Agent as Cache
19197
19198 When Gnus is plugged, it is not efficient to download headers or
19199 articles from the server again, if they are already stored in the
19200 Agent.  So, Gnus normally only downloads headers once, and stores them
19201 in the Agent.  These headers are later used when generating the summary
19202 buffer, regardless of whether you are plugged or unplugged.  Articles
19203 are not cached in the Agent by default though (that would potentially
19204 consume lots of disk space), but if you have already downloaded an
19205 article into the Agent, Gnus will not download the article from the
19206 server again but use the locally stored copy instead.
19207
19208 If you so desire, you can configure the agent (see @code{gnus-agent-cache}
19209 @pxref{Agent Variables}) to always download headers and articles while
19210 plugged.  Gnus will almost certainly be slower, but it will be kept
19211 synchronized with the server.  That last point probably won't make any
19212 sense if you are using a nntp or nnimap back end.
19213
19214 @node Agent Expiry
19215 @subsection Agent Expiry
19216
19217 @vindex gnus-agent-expire-days
19218 @findex gnus-agent-expire
19219 @kindex M-x gnus-agent-expire
19220 @kindex M-x gnus-agent-expire-group
19221 @findex gnus-agent-expire-group
19222 @cindex agent expiry
19223 @cindex Gnus agent expiry
19224 @cindex expiry
19225
19226 The Agent back end, @code{nnagent}, doesn't handle expiry.  Well, at
19227 least it doesn't handle it like other back ends.  Instead, there are
19228 special @code{gnus-agent-expire} and @code{gnus-agent-expire-group}
19229 commands that will expire all read articles that are older than
19230 @code{gnus-agent-expire-days} days.  They can be run whenever you feel
19231 that you're running out of space.  Neither are particularly fast or
19232 efficient, and it's not a particularly good idea to interrupt them (with
19233 @kbd{C-g} or anything else) once you've started one of them.
19234
19235 Note that other functions, e.g. @code{gnus-request-expire-articles},
19236 might run @code{gnus-agent-expire} for you to keep the agent
19237 synchronized with the group.
19238
19239 The agent parameter @code{agent-enable-expiration} may be used to
19240 prevent expiration in selected groups.
19241
19242 @vindex gnus-agent-expire-all
19243 If @code{gnus-agent-expire-all} is non-@code{nil}, the agent
19244 expiration commands will expire all articles---unread, read, ticked
19245 and dormant.  If @code{nil} (which is the default), only read articles
19246 are eligible for expiry, and unread, ticked and dormant articles will
19247 be kept indefinitely.
19248
19249 If you find that some articles eligible for expiry are never expired,
19250 perhaps some Gnus Agent files are corrupted.  There's are special
19251 commands, @code{gnus-agent-regenerate} and
19252 @code{gnus-agent-regenerate-group}, to fix possible problems.
19253
19254 @node Agent Regeneration
19255 @subsection Agent Regeneration
19256
19257 @cindex agent regeneration
19258 @cindex Gnus agent regeneration
19259 @cindex regeneration
19260
19261 The local data structures used by @code{nnagent} may become corrupted
19262 due to certain exceptional conditions.  When this happens,
19263 @code{nnagent} functionality may degrade or even fail.  The solution
19264 to this problem is to repair the local data structures by removing all
19265 internal inconsistencies.
19266
19267 For example, if your connection to your server is lost while
19268 downloaded articles into the agent, the local data structures will not
19269 know about articles successfully downloaded prior to the connection
19270 failure.  Running @code{gnus-agent-regenerate} or
19271 @code{gnus-agent-regenerate-group} will update the data structures
19272 such that you don't need to download these articles a second time.
19273
19274 @findex gnus-agent-regenerate
19275 @kindex M-x gnus-agent-regenerate
19276 The command @code{gnus-agent-regenerate} will perform
19277 @code{gnus-agent-regenerate-group} on every agentized group.  While
19278 you can run @code{gnus-agent-regenerate} in any buffer, it is strongly
19279 recommended that you first close all summary buffers.
19280
19281 @findex gnus-agent-regenerate-group
19282 @kindex M-x gnus-agent-regenerate-group
19283 The command @code{gnus-agent-regenerate-group} uses the local copies
19284 of individual articles to repair the local @acronym{NOV}(header) database.  It
19285 then updates the internal data structures that document which articles
19286 are stored locally.  An optional argument will mark articles in the
19287 agent as unread.
19288
19289 @node Agent and flags
19290 @subsection Agent and flags
19291
19292 The Agent works with any Gnus back end including those, such as
19293 nnimap, that store flags (read, ticked, etc) on the server.  Sadly,
19294 the Agent does not actually know which backends keep their flags in
19295 the backend server rather than in @file{.newsrc}.  This means that the
19296 Agent, while unplugged or disconnected, will always record all changes
19297 to the flags in its own files.
19298
19299 When you plug back in, Gnus will then check to see if you have any
19300 changed any flags and ask if you wish to synchronize these with the
19301 server.  This behavior is customizable by @code{gnus-agent-synchronize-flags}.
19302
19303 @vindex gnus-agent-synchronize-flags
19304 If @code{gnus-agent-synchronize-flags} is @code{nil}, the Agent will
19305 never automatically synchronize flags.  If it is @code{ask}, which is
19306 the default, the Agent will check if you made any changes and if so
19307 ask if you wish to synchronize these when you re-connect.  If it has
19308 any other value, all flags will be synchronized automatically.
19309
19310 If you do not wish to synchronize flags automatically when you
19311 re-connect, you can do it manually with the
19312 @code{gnus-agent-synchronize-flags} command that is bound to @kbd{J Y}
19313 in the group buffer.
19314
19315 Technical note: the synchronization algorithm does not work by ``pushing''
19316 all local flags to the server, but rather by incrementally updated the
19317 server view of flags by changing only those flags that were changed by
19318 the user.  Thus, if you set one flag on an article, quit the group then
19319 re-select the group and remove the flag; the flag will be set and
19320 removed from the server when you ``synchronize''.  The queued flag
19321 operations can be found in the per-server @code{flags} file in the Agent
19322 directory.  It's emptied when you synchronize flags.
19323
19324 @node Agent and IMAP
19325 @subsection Agent and IMAP
19326
19327 The Agent works with any Gnus back end, including nnimap.  However,
19328 since there are some conceptual differences between @acronym{NNTP} and
19329 @acronym{IMAP}, this section (should) provide you with some information to
19330 make Gnus Agent work smoother as a @acronym{IMAP} Disconnected Mode client.
19331
19332 Some things are currently not implemented in the Agent that you'd might
19333 expect from a disconnected @acronym{IMAP} client, including:
19334
19335 @itemize @bullet
19336
19337 @item
19338 Copying/moving articles into nnimap groups when unplugged.
19339
19340 @item
19341 Creating/deleting nnimap groups when unplugged.
19342
19343 @end itemize
19344
19345 @node Outgoing Messages
19346 @subsection Outgoing Messages
19347
19348 By default, when Gnus is unplugged, all outgoing messages (both mail
19349 and news) are stored in the draft group ``queue'' (@pxref{Drafts}).
19350 You can view them there after posting, and edit them at will.
19351
19352 You can control the circumstances under which outgoing mail is queued
19353 (see @code{gnus-agent-queue-mail}, @pxref{Agent Variables}).  Outgoing
19354 news is always queued when Gnus is unplugged, and never otherwise.
19355
19356 You can send the messages either from the draft group with the special
19357 commands available there, or you can use the @kbd{J S} command in the
19358 group buffer to send all the sendable messages in the draft group.
19359 Posting news will only work when Gnus is plugged, but you can send
19360 mail at any time.
19361
19362 If sending mail while unplugged does not work for you and you worry
19363 about hitting @kbd{J S} by accident when unplugged, you can have Gnus
19364 ask you to confirm your action (see
19365 @code{gnus-agent-prompt-send-queue}, @pxref{Agent Variables}).
19366
19367 @node Agent Variables
19368 @subsection Agent Variables
19369
19370 @table @code
19371 @item gnus-agent
19372 @vindex gnus-agent
19373 Is the agent enabled?  The default is @code{t}.  When first enabled,
19374 the agent will use @code{gnus-agent-auto-agentize-methods} to
19375 automatically mark some back ends as agentized.  You may change which
19376 back ends are agentized using the agent commands in the server buffer.
19377
19378 To enter the server buffer, use the @kbd{^}
19379 (@code{gnus-group-enter-server-mode}) command in the group buffer.
19380
19381
19382 @item gnus-agent-directory
19383 @vindex gnus-agent-directory
19384 Where the Gnus Agent will store its files.  The default is
19385 @file{~/News/agent/}.
19386
19387 @item gnus-agent-handle-level
19388 @vindex gnus-agent-handle-level
19389 Groups on levels (@pxref{Group Levels}) higher than this variable will
19390 be ignored by the Agent.  The default is @code{gnus-level-subscribed},
19391 which means that only subscribed group will be considered by the Agent
19392 by default.
19393
19394 @item gnus-agent-plugged-hook
19395 @vindex gnus-agent-plugged-hook
19396 Hook run when connecting to the network.
19397
19398 @item gnus-agent-unplugged-hook
19399 @vindex gnus-agent-unplugged-hook
19400 Hook run when disconnecting from the network.
19401
19402 @item gnus-agent-fetched-hook
19403 @vindex gnus-agent-fetched-hook
19404 Hook run when finished fetching articles.
19405
19406 @item gnus-agent-cache
19407 @vindex gnus-agent-cache
19408 Variable to control whether use the locally stored @acronym{NOV} and
19409 articles when plugged, e.g. essentially using the Agent as a cache.
19410 The default is non-@code{nil}, which means to use the Agent as a cache.
19411
19412 @item gnus-agent-go-online
19413 @vindex gnus-agent-go-online
19414 If @code{gnus-agent-go-online} is @code{nil}, the Agent will never
19415 automatically switch offline servers into online status.  If it is
19416 @code{ask}, the default, the Agent will ask if you wish to switch
19417 offline servers into online status when you re-connect.  If it has any
19418 other value, all offline servers will be automatically switched into
19419 online status.
19420
19421 @item gnus-agent-mark-unread-after-downloaded
19422 @vindex gnus-agent-mark-unread-after-downloaded
19423 If @code{gnus-agent-mark-unread-after-downloaded} is non-@code{nil},
19424 mark articles as unread after downloading.  This is usually a safe
19425 thing to do as the newly downloaded article has obviously not been
19426 read.  The default is @code{t}.
19427
19428 @item gnus-agent-synchronize-flags
19429 @vindex gnus-agent-synchronize-flags
19430 If @code{gnus-agent-synchronize-flags} is @code{nil}, the Agent will
19431 never automatically synchronize flags.  If it is @code{ask}, which is
19432 the default, the Agent will check if you made any changes and if so
19433 ask if you wish to synchronize these when you re-connect.  If it has
19434 any other value, all flags will be synchronized automatically.
19435
19436 @item gnus-agent-consider-all-articles
19437 @vindex gnus-agent-consider-all-articles
19438 If @code{gnus-agent-consider-all-articles} is non-@code{nil}, the
19439 agent will let the agent predicate decide whether articles need to be
19440 downloaded or not, for all articles.  When @code{nil}, the default,
19441 the agent will only let the predicate decide whether unread articles
19442 are downloaded or not.  If you enable this, you may also want to look
19443 into the agent expiry settings (@pxref{Category Variables}), so that
19444 the agent doesn't download articles which the agent will later expire,
19445 over and over again.
19446
19447 @item gnus-agent-max-fetch-size
19448 @vindex gnus-agent-max-fetch-size
19449 The agent fetches articles into a temporary buffer prior to parsing
19450 them into individual files.  To avoid exceeding the max. buffer size,
19451 the agent alternates between fetching and parsing until all articles
19452 have been fetched.  @code{gnus-agent-max-fetch-size} provides a size
19453 limit to control how often the cycling occurs.  A large value improves
19454 performance.  A small value minimizes the time lost should the
19455 connection be lost while fetching (You may need to run
19456 @code{gnus-agent-regenerate-group} to update the group's state.
19457 However, all articles parsed prior to loosing the connection will be
19458 available while unplugged).  The default is 10M so it is unusual to
19459 see any cycling.
19460
19461 @item gnus-server-unopen-status
19462 @vindex gnus-server-unopen-status
19463 Perhaps not an Agent variable, but closely related to the Agent, this
19464 variable says what will happen if Gnus cannot open a server.  If the
19465 Agent is enabled, the default, @code{nil}, makes Gnus ask the user
19466 whether to deny the server or whether to unplug the agent.  If the
19467 Agent is disabled, Gnus always simply deny the server.  Other choices
19468 for this variable include @code{denied} and @code{offline} the latter
19469 is only valid if the Agent is used.
19470
19471 @item gnus-auto-goto-ignores
19472 @vindex gnus-auto-goto-ignores
19473 Another variable that isn't an Agent variable, yet so closely related
19474 that most will look for it here, this variable tells the summary
19475 buffer how to maneuver around undownloaded (only headers stored in the
19476 agent) and unfetched (neither article nor headers stored) articles.
19477
19478 The valid values are @code{nil} (maneuver to any article),
19479 @code{undownloaded} (maneuvering while unplugged ignores articles that
19480 have not been fetched), @code{always-undownloaded} (maneuvering always
19481 ignores articles that have not been fetched), @code{unfetched}
19482 (maneuvering ignores articles whose headers have not been fetched).
19483
19484 @item gnus-agent-queue-mail
19485 @vindex gnus-agent-queue-mail
19486 When @code{gnus-agent-queue-mail} is @code{always}, Gnus will always
19487 queue mail rather than sending it straight away.  When @code{t}, Gnus
19488 will queue mail when unplugged only.  When @code{nil}, never queue
19489 mail.  The default is @code{t}.
19490
19491 @item gnus-agent-prompt-send-queue
19492 @vindex gnus-agent-prompt-send-queue
19493 When @code{gnus-agent-prompt-send-queue} is non-@code{nil} Gnus will
19494 prompt you to confirm that you really wish to proceed if you hit
19495 @kbd{J S} while unplugged.  The default is @code{nil}.
19496
19497 @item gnus-agent-auto-agentize-methods
19498 @vindex gnus-agent-auto-agentize-methods
19499 If you have never used the Agent before (or more technically, if
19500 @file{~/News/agent/lib/servers} does not exist), Gnus will
19501 automatically agentize a few servers for you.  This variable control
19502 which back ends should be auto-agentized.  It is typically only useful
19503 to agentize remote back ends.  The auto-agentizing has the same effect
19504 as running @kbd{J a} on the servers (@pxref{Server Agent Commands}).
19505 If the file exist, you must manage the servers manually by adding or
19506 removing them, this variable is only applicable the first time you
19507 start Gnus.  The default is @samp{(nntp nnimap)}.
19508
19509 @end table
19510
19511
19512 @node Example Setup
19513 @subsection Example Setup
19514
19515 If you don't want to read this manual, and you have a fairly standard
19516 setup, you may be able to use something like the following as your
19517 @file{~/.gnus.el} file to get started.
19518
19519 @lisp
19520 ;;; @r{Define how Gnus is to fetch news.  We do this over @acronym{NNTP}}
19521 ;;; @r{from your ISP's server.}
19522 (setq gnus-select-method '(nntp "news.your-isp.com"))
19523
19524 ;;; @r{Define how Gnus is to read your mail.  We read mail from}
19525 ;;; @r{your ISP's @acronym{POP} server.}
19526 (setq mail-sources '((pop :server "pop.your-isp.com")))
19527
19528 ;;; @r{Say how Gnus is to store the mail.  We use nnml groups.}
19529 (setq gnus-secondary-select-methods '((nnml "")))
19530
19531 ;;; @r{Make Gnus into an offline newsreader.}
19532 ;;; (gnus-agentize) ; @r{The obsolete setting.}
19533 ;;; (setq gnus-agent t) ; @r{Now the default.}
19534 @end lisp
19535
19536 That should be it, basically.  Put that in your @file{~/.gnus.el} file,
19537 edit to suit your needs, start up PPP (or whatever), and type @kbd{M-x
19538 gnus}.
19539
19540 If this is the first time you've run Gnus, you will be subscribed
19541 automatically to a few default newsgroups.  You'll probably want to
19542 subscribe to more groups, and to do that, you have to query the
19543 @acronym{NNTP} server for a complete list of groups with the @kbd{A A}
19544 command.  This usually takes quite a while, but you only have to do it
19545 once.
19546
19547 After reading and parsing a while, you'll be presented with a list of
19548 groups.  Subscribe to the ones you want to read with the @kbd{u}
19549 command.  @kbd{l} to make all the killed groups disappear after you've
19550 subscribe to all the groups you want to read.  (@kbd{A k} will bring
19551 back all the killed groups.)
19552
19553 You can now read the groups at once, or you can download the articles
19554 with the @kbd{J s} command.  And then read the rest of this manual to
19555 find out which of the other gazillion things you want to customize.
19556
19557
19558 @node Batching Agents
19559 @subsection Batching Agents
19560 @findex gnus-agent-batch
19561
19562 Having the Gnus Agent fetch articles (and post whatever messages you've
19563 written) is quite easy once you've gotten things set up properly.  The
19564 following shell script will do everything that is necessary:
19565
19566 You can run a complete batch command from the command line with the
19567 following incantation:
19568
19569 @example
19570 #!/bin/sh
19571 emacs -batch -l ~/.emacs -l ~/.gnus.el gnus-agent-batch >/dev/null 2>&1
19572 @end example
19573
19574
19575 @node Agent Caveats
19576 @subsection Agent Caveats
19577
19578 The Gnus Agent doesn't seem to work like most other offline
19579 newsreaders.  Here are some common questions that some imaginary people
19580 may ask:
19581
19582 @table @dfn
19583 @item If I read an article while plugged, do they get entered into the Agent?
19584
19585 @strong{No}.  If you want this behavior, add
19586 @code{gnus-agent-fetch-selected-article} to
19587 @code{gnus-select-article-hook}.
19588
19589 @item If I read an article while plugged, and the article already exists in
19590 the Agent, will it get downloaded once more?
19591
19592 @strong{No}, unless @code{gnus-agent-cache} is @code{nil}.
19593
19594 @end table
19595
19596 In short, when Gnus is unplugged, it only looks into the locally stored
19597 articles; when it's plugged, it talks to your ISP and may also use the
19598 locally stored articles.
19599
19600
19601 @node Scoring
19602 @chapter Scoring
19603 @cindex scoring
19604
19605 Other people use @dfn{kill files}, but we here at Gnus Towers like
19606 scoring better than killing, so we'd rather switch than fight.  They do
19607 something completely different as well, so sit up straight and pay
19608 attention!
19609
19610 @vindex gnus-summary-mark-below
19611 All articles have a default score (@code{gnus-summary-default-score}),
19612 which is 0 by default.  This score may be raised or lowered either
19613 interactively or by score files.  Articles that have a score lower than
19614 @code{gnus-summary-mark-below} are marked as read.
19615
19616 Gnus will read any @dfn{score files} that apply to the current group
19617 before generating the summary buffer.
19618
19619 There are several commands in the summary buffer that insert score
19620 entries based on the current article.  You can, for instance, ask Gnus to
19621 lower or increase the score of all articles with a certain subject.
19622
19623 There are two sorts of scoring entries: Permanent and temporary.
19624 Temporary score entries are self-expiring entries.  Any entries that are
19625 temporary and have not been used for, say, a week, will be removed
19626 silently to help keep the sizes of the score files down.
19627
19628 @menu
19629 * Summary Score Commands::      Adding score entries for the current group.
19630 * Group Score Commands::        General score commands.
19631 * Score Variables::             Customize your scoring.  (My, what terminology).
19632 * Score File Format::           What a score file may contain.
19633 * Score File Editing::          You can edit score files by hand as well.
19634 * Adaptive Scoring::            Big Sister Gnus knows what you read.
19635 * Home Score File::             How to say where new score entries are to go.
19636 * Followups To Yourself::       Having Gnus notice when people answer you.
19637 * Scoring On Other Headers::    Scoring on non-standard headers.
19638 * Scoring Tips::                How to score effectively.
19639 * Reverse Scoring::             That problem child of old is not problem.
19640 * Global Score Files::          Earth-spanning, ear-splitting score files.
19641 * Kill Files::                  They are still here, but they can be ignored.
19642 * Converting Kill Files::       Translating kill files to score files.
19643 * Advanced Scoring::            Using logical expressions to build score rules.
19644 * Score Decays::                It can be useful to let scores wither away.
19645 @end menu
19646
19647
19648 @node Summary Score Commands
19649 @section Summary Score Commands
19650 @cindex score commands
19651
19652 The score commands that alter score entries do not actually modify real
19653 score files.  That would be too inefficient.  Gnus maintains a cache of
19654 previously loaded score files, one of which is considered the
19655 @dfn{current score file alist}.  The score commands simply insert
19656 entries into this list, and upon group exit, this list is saved.
19657
19658 The current score file is by default the group's local score file, even
19659 if no such score file actually exists.  To insert score commands into
19660 some other score file (e.g. @file{all.SCORE}), you must first make this
19661 score file the current one.
19662
19663 General score commands that don't actually change the score file:
19664
19665 @table @kbd
19666
19667 @item V s
19668 @kindex V s (Summary)
19669 @findex gnus-summary-set-score
19670 Set the score of the current article (@code{gnus-summary-set-score}).
19671
19672 @item V S
19673 @kindex V S (Summary)
19674 @findex gnus-summary-current-score
19675 Display the score of the current article
19676 (@code{gnus-summary-current-score}).
19677
19678 @item V t
19679 @kindex V t (Summary)
19680 @findex gnus-score-find-trace
19681 Display all score rules that have been used on the current article
19682 (@code{gnus-score-find-trace}).  In the @code{*Score Trace*} buffer, you
19683 may type @kbd{e} to edit score file corresponding to the score rule on
19684 current line and @kbd{f} to format (@code{gnus-score-pretty-print}) the
19685 score file and edit it.
19686
19687 @item V w
19688 @kindex V w (Summary)
19689 @findex gnus-score-find-favourite-words
19690 List words used in scoring (@code{gnus-score-find-favourite-words}).
19691
19692 @item V R
19693 @kindex V R (Summary)
19694 @findex gnus-summary-rescore
19695 Run the current summary through the scoring process
19696 (@code{gnus-summary-rescore}).  This might be useful if you're playing
19697 around with your score files behind Gnus' back and want to see the
19698 effect you're having.
19699
19700 @item V c
19701 @kindex V c (Summary)
19702 @findex gnus-score-change-score-file
19703 Make a different score file the current
19704 (@code{gnus-score-change-score-file}).
19705
19706 @item V e
19707 @kindex V e (Summary)
19708 @findex gnus-score-edit-current-scores
19709 Edit the current score file (@code{gnus-score-edit-current-scores}).
19710 You will be popped into a @code{gnus-score-mode} buffer (@pxref{Score
19711 File Editing}).
19712
19713 @item V f
19714 @kindex V f (Summary)
19715 @findex gnus-score-edit-file
19716 Edit a score file and make this score file the current one
19717 (@code{gnus-score-edit-file}).
19718
19719 @item V F
19720 @kindex V F (Summary)
19721 @findex gnus-score-flush-cache
19722 Flush the score cache (@code{gnus-score-flush-cache}).  This is useful
19723 after editing score files.
19724
19725 @item V C
19726 @kindex V C (Summary)
19727 @findex gnus-score-customize
19728 Customize a score file in a visually pleasing manner
19729 (@code{gnus-score-customize}).
19730
19731 @end table
19732
19733 The rest of these commands modify the local score file.
19734
19735 @table @kbd
19736
19737 @item V m
19738 @kindex V m (Summary)
19739 @findex gnus-score-set-mark-below
19740 Prompt for a score, and mark all articles with a score below this as
19741 read (@code{gnus-score-set-mark-below}).
19742
19743 @item V x
19744 @kindex V x (Summary)
19745 @findex gnus-score-set-expunge-below
19746 Prompt for a score, and add a score rule to the current score file to
19747 expunge all articles below this score
19748 (@code{gnus-score-set-expunge-below}).
19749 @end table
19750
19751 The keystrokes for actually making score entries follow a very regular
19752 pattern, so there's no need to list all the commands.  (Hundreds of
19753 them.)
19754
19755 @findex gnus-summary-increase-score
19756 @findex gnus-summary-lower-score
19757
19758 @enumerate
19759 @item
19760 The first key is either @kbd{I} (upper case i) for increasing the score
19761 or @kbd{L} for lowering the score.
19762 @item
19763 The second key says what header you want to score on.  The following
19764 keys are available:
19765 @table @kbd
19766
19767 @item a
19768 Score on the author name.
19769
19770 @item s
19771 Score on the subject line.
19772
19773 @item x
19774 Score on the @code{Xref} line---i.e., the cross-posting line.
19775
19776 @item r
19777 Score on the @code{References} line.
19778
19779 @item d
19780 Score on the date.
19781
19782 @item l
19783 Score on the number of lines.
19784
19785 @item i
19786 Score on the @code{Message-ID} header.
19787
19788 @item e
19789 Score on an ``extra'' header, that is, one of those in gnus-extra-headers,
19790 if your @acronym{NNTP} server tracks additional header data in overviews.
19791
19792 @item f
19793 Score on followups---this matches the author name, and adds scores to
19794 the followups to this author.  (Using this key leads to the creation of
19795 @file{ADAPT} files.)
19796
19797 @item b
19798 Score on the body.
19799
19800 @item h
19801 Score on the head.
19802
19803 @item t
19804 Score on thread.  (Using this key leads to the creation of @file{ADAPT}
19805 files.)
19806
19807 @end table
19808
19809 @item
19810 The third key is the match type.  Which match types are valid depends on
19811 what headers you are scoring on.
19812
19813 @table @code
19814
19815 @item strings
19816
19817 @table @kbd
19818
19819 @item e
19820 Exact matching.
19821
19822 @item s
19823 Substring matching.
19824
19825 @item f
19826 Fuzzy matching (@pxref{Fuzzy Matching}).
19827
19828 @item r
19829 Regexp matching
19830 @end table
19831
19832 @item date
19833 @table @kbd
19834
19835 @item b
19836 Before date.
19837
19838 @item a
19839 After date.
19840
19841 @item n
19842 This date.
19843 @end table
19844
19845 @item number
19846 @table @kbd
19847
19848 @item <
19849 Less than number.
19850
19851 @item =
19852 Equal to number.
19853
19854 @item >
19855 Greater than number.
19856 @end table
19857 @end table
19858
19859 @item
19860 The fourth and usually final key says whether this is a temporary (i.e.,
19861 expiring) score entry, or a permanent (i.e., non-expiring) score entry,
19862 or whether it is to be done immediately, without adding to the score
19863 file.
19864 @table @kbd
19865
19866 @item t
19867 Temporary score entry.
19868
19869 @item p
19870 Permanent score entry.
19871
19872 @item i
19873 Immediately scoring.
19874 @end table
19875
19876 @item
19877 If you are scoring on `e' (extra) headers, you will then be prompted for
19878 the header name on which you wish to score.  This must be a header named
19879 in gnus-extra-headers, and @samp{TAB} completion is available.
19880
19881 @end enumerate
19882
19883 So, let's say you want to increase the score on the current author with
19884 exact matching permanently: @kbd{I a e p}.  If you want to lower the
19885 score based on the subject line, using substring matching, and make a
19886 temporary score entry: @kbd{L s s t}.  Pretty easy.
19887
19888 To make things a bit more complicated, there are shortcuts.  If you use
19889 a capital letter on either the second or third keys, Gnus will use
19890 defaults for the remaining one or two keystrokes.  The defaults are
19891 ``substring'' and ``temporary''.  So @kbd{I A} is the same as @kbd{I a s
19892 t}, and @kbd{I a R} is the same as @kbd{I a r t}.
19893
19894 These functions take both the numerical prefix and the symbolic prefix
19895 (@pxref{Symbolic Prefixes}).  A numerical prefix says how much to lower
19896 (or increase) the score of the article.  A symbolic prefix of @code{a}
19897 says to use the @file{all.SCORE} file for the command instead of the
19898 current score file.
19899
19900 @vindex gnus-score-mimic-keymap
19901 The @code{gnus-score-mimic-keymap} says whether these commands will
19902 pretend they are keymaps or not.
19903
19904
19905 @node Group Score Commands
19906 @section Group Score Commands
19907 @cindex group score commands
19908
19909 There aren't many of these as yet, I'm afraid.
19910
19911 @table @kbd
19912
19913 @item W e
19914 @kindex W e (Group)
19915 @findex gnus-score-edit-all-score
19916 Edit the apply-to-all-groups all.SCORE file.  You will be popped into
19917 a @code{gnus-score-mode} buffer (@pxref{Score File Editing}).
19918
19919 @item W f
19920 @kindex W f (Group)
19921 @findex gnus-score-flush-cache
19922 Gnus maintains a cache of score alists to avoid having to reload them
19923 all the time.  This command will flush the cache
19924 (@code{gnus-score-flush-cache}).
19925
19926 @end table
19927
19928 You can do scoring from the command line by saying something like:
19929
19930 @findex gnus-batch-score
19931 @cindex batch scoring
19932 @example
19933 $ emacs -batch -l ~/.emacs -l ~/.gnus.el -f gnus-batch-score
19934 @end example
19935
19936
19937 @node Score Variables
19938 @section Score Variables
19939 @cindex score variables
19940
19941 @table @code
19942
19943 @item gnus-use-scoring
19944 @vindex gnus-use-scoring
19945 If @code{nil}, Gnus will not check for score files, and will not, in
19946 general, do any score-related work.  This is @code{t} by default.
19947
19948 @item gnus-kill-killed
19949 @vindex gnus-kill-killed
19950 If this variable is @code{nil}, Gnus will never apply score files to
19951 articles that have already been through the kill process.  While this
19952 may save you lots of time, it also means that if you apply a kill file
19953 to a group, and then change the kill file and want to run it over you
19954 group again to kill more articles, it won't work.  You have to set this
19955 variable to @code{t} to do that.  (It is @code{t} by default.)
19956
19957 @item gnus-kill-files-directory
19958 @vindex gnus-kill-files-directory
19959 All kill and score files will be stored in this directory, which is
19960 initialized from the @env{SAVEDIR} environment variable by default.
19961 This is @file{~/News/} by default.
19962
19963 @item gnus-score-file-suffix
19964 @vindex gnus-score-file-suffix
19965 Suffix to add to the group name to arrive at the score file name
19966 (@file{SCORE} by default.)
19967
19968 @item gnus-score-uncacheable-files
19969 @vindex gnus-score-uncacheable-files
19970 @cindex score cache
19971 All score files are normally cached to avoid excessive re-loading of
19972 score files.  However, if this might make your Emacs grow big and
19973 bloated, so this regexp can be used to weed out score files unlikely
19974 to be needed again.  It would be a bad idea to deny caching of
19975 @file{all.SCORE}, while it might be a good idea to not cache
19976 @file{comp.infosystems.www.authoring.misc.ADAPT}.  In fact, this
19977 variable is @samp{ADAPT$} by default, so no adaptive score files will
19978 be cached.
19979
19980 @item gnus-save-score
19981 @vindex gnus-save-score
19982 If you have really complicated score files, and do lots of batch
19983 scoring, then you might set this variable to @code{t}.  This will make
19984 Gnus save the scores into the @file{.newsrc.eld} file.
19985
19986 If you do not set this to @code{t}, then manual scores (like those set
19987 with @kbd{V s} (@code{gnus-summary-set-score})) will not be preserved
19988 across group visits.
19989
19990 @item gnus-score-interactive-default-score
19991 @vindex gnus-score-interactive-default-score
19992 Score used by all the interactive raise/lower commands to raise/lower
19993 score with.  Default is 1000, which may seem excessive, but this is to
19994 ensure that the adaptive scoring scheme gets enough room to play with.
19995 We don't want the small changes from the adaptive scoring to overwrite
19996 manually entered data.
19997
19998 @item gnus-summary-default-score
19999 @vindex gnus-summary-default-score
20000 Default score of an article, which is 0 by default.
20001
20002 @item gnus-summary-expunge-below
20003 @vindex gnus-summary-expunge-below
20004 Don't display the summary lines of articles that have scores lower than
20005 this variable.  This is @code{nil} by default, which means that no
20006 articles will be hidden.  This variable is local to the summary buffers,
20007 and has to be set from @code{gnus-summary-mode-hook}.
20008
20009 @item gnus-score-over-mark
20010 @vindex gnus-score-over-mark
20011 Mark (in the third column) used for articles with a score over the
20012 default.  Default is @samp{+}.
20013
20014 @item gnus-score-below-mark
20015 @vindex gnus-score-below-mark
20016 Mark (in the third column) used for articles with a score below the
20017 default.  Default is @samp{-}.
20018
20019 @item gnus-score-find-score-files-function
20020 @vindex gnus-score-find-score-files-function
20021 Function used to find score files for the current group.  This function
20022 is called with the name of the group as the argument.
20023
20024 Predefined functions available are:
20025 @table @code
20026
20027 @item gnus-score-find-single
20028 @findex gnus-score-find-single
20029 Only apply the group's own score file.
20030
20031 @item gnus-score-find-bnews
20032 @findex gnus-score-find-bnews
20033 Apply all score files that match, using bnews syntax.  This is the
20034 default.  If the current group is @samp{gnu.emacs.gnus}, for instance,
20035 @file{all.emacs.all.SCORE}, @file{not.alt.all.SCORE} and
20036 @file{gnu.all.SCORE} would all apply.  In short, the instances of
20037 @samp{all} in the score file names are translated into @samp{.*}, and
20038 then a regexp match is done.
20039
20040 This means that if you have some score entries that you want to apply to
20041 all groups, then you put those entries in the @file{all.SCORE} file.
20042
20043 The score files are applied in a semi-random order, although Gnus will
20044 try to apply the more general score files before the more specific score
20045 files.  It does this by looking at the number of elements in the score
20046 file names---discarding the @samp{all} elements.
20047
20048 @item gnus-score-find-hierarchical
20049 @findex gnus-score-find-hierarchical
20050 Apply all score files from all the parent groups.  This means that you
20051 can't have score files like @file{all.SCORE}, but you can have
20052 @file{SCORE}, @file{comp.SCORE} and @file{comp.emacs.SCORE} for each
20053 server.
20054
20055 @end table
20056 This variable can also be a list of functions.  In that case, all
20057 these functions will be called with the group name as argument, and
20058 all the returned lists of score files will be applied.  These
20059 functions can also return lists of lists of score alists directly.  In
20060 that case, the functions that return these non-file score alists
20061 should probably be placed before the ``real'' score file functions, to
20062 ensure that the last score file returned is the local score file.
20063 Phu.
20064
20065 For example, to do hierarchical scoring but use a non-server-specific
20066 overall score file, you could use the value
20067 @example
20068 (list (lambda (group) ("all.SCORE"))
20069       'gnus-score-find-hierarchical)
20070 @end example
20071
20072 @item gnus-score-expiry-days
20073 @vindex gnus-score-expiry-days
20074 This variable says how many days should pass before an unused score file
20075 entry is expired.  If this variable is @code{nil}, no score file entries
20076 are expired.  It's 7 by default.
20077
20078 @item gnus-update-score-entry-dates
20079 @vindex gnus-update-score-entry-dates
20080 If this variable is non-@code{nil}, temporary score entries that have
20081 been triggered (matched) will have their dates updated.  (This is how Gnus
20082 controls expiry---all non-matched-entries will become too old while
20083 matched entries will stay fresh and young.)  However, if you set this
20084 variable to @code{nil}, even matched entries will grow old and will
20085 have to face that oh-so grim reaper.
20086
20087 @item gnus-score-after-write-file-function
20088 @vindex gnus-score-after-write-file-function
20089 Function called with the name of the score file just written.
20090
20091 @item gnus-score-thread-simplify
20092 @vindex gnus-score-thread-simplify
20093 If this variable is non-@code{nil}, article subjects will be
20094 simplified for subject scoring purposes in the same manner as with
20095 threading---according to the current value of
20096 @code{gnus-simplify-subject-functions}.  If the scoring entry uses
20097 @code{substring} or @code{exact} matching, the match will also be
20098 simplified in this manner.
20099
20100 @end table
20101
20102
20103 @node Score File Format
20104 @section Score File Format
20105 @cindex score file format
20106
20107 A score file is an @code{emacs-lisp} file that normally contains just a
20108 single form.  Casual users are not expected to edit these files;
20109 everything can be changed from the summary buffer.
20110
20111 Anyway, if you'd like to dig into it yourself, here's an example:
20112
20113 @lisp
20114 (("from"
20115   ("Lars Ingebrigtsen" -10000)
20116   ("Per Abrahamsen")
20117   ("larsi\\|lmi" -50000 nil R))
20118  ("subject"
20119   ("Ding is Badd" nil 728373))
20120  ("xref"
20121   ("alt.politics" -1000 728372 s))
20122  ("lines"
20123   (2 -100 nil <))
20124  (mark 0)
20125  (expunge -1000)
20126  (mark-and-expunge -10)
20127  (read-only nil)
20128  (orphan -10)
20129  (adapt t)
20130  (files "/hom/larsi/News/gnu.SCORE")
20131  (exclude-files "all.SCORE")
20132  (local (gnus-newsgroup-auto-expire t)
20133         (gnus-summary-make-false-root empty))
20134  (eval (ding)))
20135 @end lisp
20136
20137 This example demonstrates most score file elements.  @xref{Advanced
20138 Scoring}, for a different approach.
20139
20140 Even though this looks much like Lisp code, nothing here is actually
20141 @code{eval}ed.  The Lisp reader is used to read this form, though, so it
20142 has to be valid syntactically, if not semantically.
20143
20144 Six keys are supported by this alist:
20145
20146 @table @code
20147
20148 @item STRING
20149 If the key is a string, it is the name of the header to perform the
20150 match on.  Scoring can only be performed on these eight headers:
20151 @code{From}, @code{Subject}, @code{References}, @code{Message-ID},
20152 @code{Xref}, @code{Lines}, @code{Chars} and @code{Date}.  In addition to
20153 these headers, there are three strings to tell Gnus to fetch the entire
20154 article and do the match on larger parts of the article: @code{Body}
20155 will perform the match on the body of the article, @code{Head} will
20156 perform the match on the head of the article, and @code{All} will
20157 perform the match on the entire article.  Note that using any of these
20158 last three keys will slow down group entry @emph{considerably}.  The
20159 final ``header'' you can score on is @code{Followup}.  These score
20160 entries will result in new score entries being added for all follow-ups
20161 to articles that matches these score entries.
20162
20163 Following this key is an arbitrary number of score entries, where each
20164 score entry has one to four elements.
20165 @enumerate
20166
20167 @item
20168 The first element is the @dfn{match element}.  On most headers this will
20169 be a string, but on the Lines and Chars headers, this must be an
20170 integer.
20171
20172 @item
20173 If the second element is present, it should be a number---the @dfn{score
20174 element}.  This number should be an integer in the neginf to posinf
20175 interval.  This number is added to the score of the article if the match
20176 is successful.  If this element is not present, the
20177 @code{gnus-score-interactive-default-score} number will be used
20178 instead.  This is 1000 by default.
20179
20180 @item
20181 If the third element is present, it should be a number---the @dfn{date
20182 element}.  This date says when the last time this score entry matched,
20183 which provides a mechanism for expiring the score entries.  It this
20184 element is not present, the score entry is permanent.  The date is
20185 represented by the number of days since December 31, 1 BCE.
20186
20187 @item
20188 If the fourth element is present, it should be a symbol---the @dfn{type
20189 element}.  This element specifies what function should be used to see
20190 whether this score entry matches the article.  What match types that can
20191 be used depends on what header you wish to perform the match on.
20192 @table @dfn
20193
20194 @item From, Subject, References, Xref, Message-ID
20195 For most header types, there are the @code{r} and @code{R} (regexp), as
20196 well as @code{s} and @code{S} (substring) types, and @code{e} and
20197 @code{E} (exact match), and @code{w} (word match) types.  If this
20198 element is not present, Gnus will assume that substring matching should
20199 be used.  @code{R}, @code{S}, and @code{E} differ from the others in
20200 that the matches will be done in a case-sensitive manner.  All these
20201 one-letter types are really just abbreviations for the @code{regexp},
20202 @code{string}, @code{exact}, and @code{word} types, which you can use
20203 instead, if you feel like.
20204
20205 @item Extra
20206 Just as for the standard string overview headers, if you are using
20207 gnus-extra-headers, you can score on these headers' values.  In this
20208 case, there is a 5th element in the score entry, being the name of the
20209 header to be scored.  The following entry is useful in your
20210 @file{all.SCORE} file in case of spam attacks from a single origin
20211 host, if your @acronym{NNTP} server tracks @samp{NNTP-Posting-Host} in
20212 overviews:
20213
20214 @lisp
20215 ("111.222.333.444" -1000 nil s
20216  "NNTP-Posting-Host")
20217 @end lisp
20218
20219 @item Lines, Chars
20220 These two headers use different match types: @code{<}, @code{>},
20221 @code{=}, @code{>=} and @code{<=}.
20222
20223 These predicates are true if
20224
20225 @example
20226 (PREDICATE HEADER MATCH)
20227 @end example
20228
20229 evaluates to non-@code{nil}.  For instance, the advanced match
20230 @code{("lines" 4 <)} (@pxref{Advanced Scoring}) will result in the
20231 following form:
20232
20233 @lisp
20234 (< header-value 4)
20235 @end lisp
20236
20237 Or to put it another way: When using @code{<} on @code{Lines} with 4 as
20238 the match, we get the score added if the article has less than 4 lines.
20239 (It's easy to get confused and think it's the other way around.  But
20240 it's not.  I think.)
20241
20242 When matching on @code{Lines}, be careful because some back ends (like
20243 @code{nndir}) do not generate @code{Lines} header, so every article ends
20244 up being marked as having 0 lines.  This can lead to strange results if
20245 you happen to lower score of the articles with few lines.
20246
20247 @item Date
20248 For the Date header we have three kinda silly match types:
20249 @code{before}, @code{at} and @code{after}.  I can't really imagine this
20250 ever being useful, but, like, it would feel kinda silly not to provide
20251 this function.  Just in case.  You never know.  Better safe than sorry.
20252 Once burnt, twice shy.  Don't judge a book by its cover.  Never not have
20253 sex on a first date.  (I have been told that at least one person, and I
20254 quote, ``found this function indispensable'', however.)
20255
20256 @cindex ISO8601
20257 @cindex date
20258 A more useful match type is @code{regexp}.  With it, you can match the
20259 date string using a regular expression.  The date is normalized to
20260 ISO8601 compact format first---@var{YYYYMMDD}@code{T}@var{HHMMSS}.  If
20261 you want to match all articles that have been posted on April 1st in
20262 every year, you could use @samp{....0401.........} as a match string,
20263 for instance.  (Note that the date is kept in its original time zone, so
20264 this will match articles that were posted when it was April 1st where
20265 the article was posted from.  Time zones are such wholesome fun for the
20266 whole family, eh?)
20267
20268 @item Head, Body, All
20269 These three match keys use the same match types as the @code{From} (etc)
20270 header uses.
20271
20272 @item Followup
20273 This match key is somewhat special, in that it will match the
20274 @code{From} header, and affect the score of not only the matching
20275 articles, but also all followups to the matching articles.  This allows
20276 you e.g. increase the score of followups to your own articles, or
20277 decrease the score of followups to the articles of some known
20278 trouble-maker.  Uses the same match types as the @code{From} header
20279 uses.  (Using this match key will lead to creation of @file{ADAPT}
20280 files.)
20281
20282 @item Thread
20283 This match key works along the same lines as the @code{Followup} match
20284 key.  If you say that you want to score on a (sub-)thread started by an
20285 article with a @code{Message-ID} @var{x}, then you add a @samp{thread}
20286 match.  This will add a new @samp{thread} match for each article that
20287 has @var{x} in its @code{References} header.  (These new @samp{thread}
20288 matches will use the @code{Message-ID}s of these matching articles.)
20289 This will ensure that you can raise/lower the score of an entire thread,
20290 even though some articles in the thread may not have complete
20291 @code{References} headers.  Note that using this may lead to
20292 undeterministic scores of the articles in the thread.  (Using this match
20293 key will lead to creation of @file{ADAPT} files.)
20294 @end table
20295 @end enumerate
20296
20297 @cindex score file atoms
20298 @item mark
20299 The value of this entry should be a number.  Any articles with a score
20300 lower than this number will be marked as read.
20301
20302 @item expunge
20303 The value of this entry should be a number.  Any articles with a score
20304 lower than this number will be removed from the summary buffer.
20305
20306 @item mark-and-expunge
20307 The value of this entry should be a number.  Any articles with a score
20308 lower than this number will be marked as read and removed from the
20309 summary buffer.
20310
20311 @item thread-mark-and-expunge
20312 The value of this entry should be a number.  All articles that belong to
20313 a thread that has a total score below this number will be marked as read
20314 and removed from the summary buffer.  @code{gnus-thread-score-function}
20315 says how to compute the total score for a thread.
20316
20317 @item files
20318 The value of this entry should be any number of file names.  These files
20319 are assumed to be score files as well, and will be loaded the same way
20320 this one was.
20321
20322 @item exclude-files
20323 The clue of this entry should be any number of files.  These files will
20324 not be loaded, even though they would normally be so, for some reason or
20325 other.
20326
20327 @item eval
20328 The value of this entry will be @code{eval}el.  This element will be
20329 ignored when handling global score files.
20330
20331 @item read-only
20332 Read-only score files will not be updated or saved.  Global score files
20333 should feature this atom (@pxref{Global Score Files}).  (Note:
20334 @dfn{Global} here really means @dfn{global}; not your personal
20335 apply-to-all-groups score files.)
20336
20337 @item orphan
20338 The value of this entry should be a number.  Articles that do not have
20339 parents will get this number added to their scores.  Imagine you follow
20340 some high-volume newsgroup, like @samp{comp.lang.c}.  Most likely you
20341 will only follow a few of the threads, also want to see any new threads.
20342
20343 You can do this with the following two score file entries:
20344
20345 @example
20346         (orphan -500)
20347         (mark-and-expunge -100)
20348 @end example
20349
20350 When you enter the group the first time, you will only see the new
20351 threads.  You then raise the score of the threads that you find
20352 interesting (with @kbd{I T} or @kbd{I S}), and ignore (@kbd{C y}) the
20353 rest.  Next time you enter the group, you will see new articles in the
20354 interesting threads, plus any new threads.
20355
20356 I.e.---the orphan score atom is for high-volume groups where a few
20357 interesting threads which can't be found automatically by ordinary
20358 scoring rules exist.
20359
20360 @item adapt
20361 This entry controls the adaptive scoring.  If it is @code{t}, the
20362 default adaptive scoring rules will be used.  If it is @code{ignore}, no
20363 adaptive scoring will be performed on this group.  If it is a list, this
20364 list will be used as the adaptive scoring rules.  If it isn't present,
20365 or is something other than @code{t} or @code{ignore}, the default
20366 adaptive scoring rules will be used.  If you want to use adaptive
20367 scoring on most groups, you'd set @code{gnus-use-adaptive-scoring} to
20368 @code{t}, and insert an @code{(adapt ignore)} in the groups where you do
20369 not want adaptive scoring.  If you only want adaptive scoring in a few
20370 groups, you'd set @code{gnus-use-adaptive-scoring} to @code{nil}, and
20371 insert @code{(adapt t)} in the score files of the groups where you want
20372 it.
20373
20374 @item adapt-file
20375 All adaptive score entries will go to the file named by this entry.  It
20376 will also be applied when entering the group.  This atom might be handy
20377 if you want to adapt on several groups at once, using the same adaptive
20378 file for a number of groups.
20379
20380 @item local
20381 @cindex local variables
20382 The value of this entry should be a list of @code{(@var{var}
20383 @var{value})} pairs.  Each @var{var} will be made buffer-local to the
20384 current summary buffer, and set to the value specified.  This is a
20385 convenient, if somewhat strange, way of setting variables in some
20386 groups if you don't like hooks much.  Note that the @var{value} won't
20387 be evaluated.
20388 @end table
20389
20390
20391 @node Score File Editing
20392 @section Score File Editing
20393
20394 You normally enter all scoring commands from the summary buffer, but you
20395 might feel the urge to edit them by hand as well, so we've supplied you
20396 with a mode for that.
20397
20398 It's simply a slightly customized @code{emacs-lisp} mode, with these
20399 additional commands:
20400
20401 @table @kbd
20402
20403 @item C-c C-c
20404 @kindex C-c C-c (Score)
20405 @findex gnus-score-edit-done
20406 Save the changes you have made and return to the summary buffer
20407 (@code{gnus-score-edit-done}).
20408
20409 @item C-c C-d
20410 @kindex C-c C-d (Score)
20411 @findex gnus-score-edit-insert-date
20412 Insert the current date in numerical format
20413 (@code{gnus-score-edit-insert-date}).  This is really the day number, if
20414 you were wondering.
20415
20416 @item C-c C-p
20417 @kindex C-c C-p (Score)
20418 @findex gnus-score-pretty-print
20419 The adaptive score files are saved in an unformatted fashion.  If you
20420 intend to read one of these files, you want to @dfn{pretty print} it
20421 first.  This command (@code{gnus-score-pretty-print}) does that for
20422 you.
20423
20424 @end table
20425
20426 Type @kbd{M-x gnus-score-mode} to use this mode.
20427
20428 @vindex gnus-score-mode-hook
20429 @code{gnus-score-menu-hook} is run in score mode buffers.
20430
20431 In the summary buffer you can use commands like @kbd{V f}, @kbd{V e} and
20432 @kbd{V t} to begin editing score files.
20433
20434
20435 @node Adaptive Scoring
20436 @section Adaptive Scoring
20437 @cindex adaptive scoring
20438
20439 If all this scoring is getting you down, Gnus has a way of making it all
20440 happen automatically---as if by magic.  Or rather, as if by artificial
20441 stupidity, to be precise.
20442
20443 @vindex gnus-use-adaptive-scoring
20444 When you read an article, or mark an article as read, or kill an
20445 article, you leave marks behind.  On exit from the group, Gnus can sniff
20446 these marks and add score elements depending on what marks it finds.
20447 You turn on this ability by setting @code{gnus-use-adaptive-scoring} to
20448 @code{t} or @code{(line)}.  If you want score adaptively on separate
20449 words appearing in the subjects, you should set this variable to
20450 @code{(word)}.  If you want to use both adaptive methods, set this
20451 variable to @code{(word line)}.
20452
20453 @vindex gnus-default-adaptive-score-alist
20454 To give you complete control over the scoring process, you can customize
20455 the @code{gnus-default-adaptive-score-alist} variable.  For instance, it
20456 might look something like this:
20457
20458 @lisp
20459 (setq gnus-default-adaptive-score-alist
20460   '((gnus-unread-mark)
20461     (gnus-ticked-mark (from 4))
20462     (gnus-dormant-mark (from 5))
20463     (gnus-del-mark (from -4) (subject -1))
20464     (gnus-read-mark (from 4) (subject 2))
20465     (gnus-expirable-mark (from -1) (subject -1))
20466     (gnus-killed-mark (from -1) (subject -3))
20467     (gnus-kill-file-mark)
20468     (gnus-ancient-mark)
20469     (gnus-low-score-mark)
20470     (gnus-catchup-mark (from -1) (subject -1))))
20471 @end lisp
20472
20473 As you see, each element in this alist has a mark as a key (either a
20474 variable name or a ``real'' mark---a character).  Following this key is
20475 a arbitrary number of header/score pairs.  If there are no header/score
20476 pairs following the key, no adaptive scoring will be done on articles
20477 that have that key as the article mark.  For instance, articles with
20478 @code{gnus-unread-mark} in the example above will not get adaptive score
20479 entries.
20480
20481 Each article can have only one mark, so just a single of these rules
20482 will be applied to each article.
20483
20484 To take @code{gnus-del-mark} as an example---this alist says that all
20485 articles that have that mark (i.e., are marked with @samp{e}) will have a
20486 score entry added to lower based on the @code{From} header by -4, and
20487 lowered by @code{Subject} by -1.  Change this to fit your prejudices.
20488
20489 If you have marked 10 articles with the same subject with
20490 @code{gnus-del-mark}, the rule for that mark will be applied ten times.
20491 That means that that subject will get a score of ten times -1, which
20492 should be, unless I'm much mistaken, -10.
20493
20494 If you have auto-expirable (mail) groups (@pxref{Expiring Mail}), all
20495 the read articles will be marked with the @samp{E} mark.  This'll
20496 probably make adaptive scoring slightly impossible, so auto-expiring and
20497 adaptive scoring doesn't really mix very well.
20498
20499 The headers you can score on are @code{from}, @code{subject},
20500 @code{message-id}, @code{references}, @code{xref}, @code{lines},
20501 @code{chars} and @code{date}.  In addition, you can score on
20502 @code{followup}, which will create an adaptive score entry that matches
20503 on the @code{References} header using the @code{Message-ID} of the
20504 current article, thereby matching the following thread.
20505
20506 If you use this scheme, you should set the score file atom @code{mark}
20507 to something small---like -300, perhaps, to avoid having small random
20508 changes result in articles getting marked as read.
20509
20510 After using adaptive scoring for a week or so, Gnus should start to
20511 become properly trained and enhance the authors you like best, and kill
20512 the authors you like least, without you having to say so explicitly.
20513
20514 You can control what groups the adaptive scoring is to be performed on
20515 by using the score files (@pxref{Score File Format}).  This will also
20516 let you use different rules in different groups.
20517
20518 @vindex gnus-adaptive-file-suffix
20519 The adaptive score entries will be put into a file where the name is the
20520 group name with @code{gnus-adaptive-file-suffix} appended.  The default
20521 is @file{ADAPT}.
20522
20523 @vindex gnus-adaptive-pretty-print
20524 Adaptive score files can get huge and are not meant to be edited by
20525 human hands.  If @code{gnus-adaptive-pretty-print} is @code{nil} (the
20526 deafult) those files will not be written in a human readable way.
20527
20528 @vindex gnus-score-exact-adapt-limit
20529 When doing adaptive scoring, substring or fuzzy matching would probably
20530 give you the best results in most cases.  However, if the header one
20531 matches is short, the possibility for false positives is great, so if
20532 the length of the match is less than
20533 @code{gnus-score-exact-adapt-limit}, exact matching will be used.  If
20534 this variable is @code{nil}, exact matching will always be used to avoid
20535 this problem.
20536
20537 @vindex gnus-default-adaptive-word-score-alist
20538 As mentioned above, you can adapt either on individual words or entire
20539 headers.  If you adapt on words, the
20540 @code{gnus-default-adaptive-word-score-alist} variable says what score
20541 each instance of a word should add given a mark.
20542
20543 @lisp
20544 (setq gnus-default-adaptive-word-score-alist
20545       `((,gnus-read-mark . 30)
20546         (,gnus-catchup-mark . -10)
20547         (,gnus-killed-mark . -20)
20548         (,gnus-del-mark . -15)))
20549 @end lisp
20550
20551 This is the default value.  If you have adaption on words enabled, every
20552 word that appears in subjects of articles marked with
20553 @code{gnus-read-mark} will result in a score rule that increase the
20554 score with 30 points.
20555
20556 @vindex gnus-default-ignored-adaptive-words
20557 @vindex gnus-ignored-adaptive-words
20558 Words that appear in the @code{gnus-default-ignored-adaptive-words} list
20559 will be ignored.  If you wish to add more words to be ignored, use the
20560 @code{gnus-ignored-adaptive-words} list instead.
20561
20562 @vindex gnus-adaptive-word-length-limit
20563 Some may feel that short words shouldn't count when doing adaptive
20564 scoring.  If so, you may set @code{gnus-adaptive-word-length-limit} to
20565 an integer.  Words shorter than this number will be ignored.  This
20566 variable defaults to @code{nil}.
20567
20568 @vindex gnus-adaptive-word-syntax-table
20569 When the scoring is done, @code{gnus-adaptive-word-syntax-table} is the
20570 syntax table in effect.  It is similar to the standard syntax table, but
20571 it considers numbers to be non-word-constituent characters.
20572
20573 @vindex gnus-adaptive-word-minimum
20574 If @code{gnus-adaptive-word-minimum} is set to a number, the adaptive
20575 word scoring process will never bring down the score of an article to
20576 below this number.  The default is @code{nil}.
20577
20578 @vindex gnus-adaptive-word-no-group-words
20579 If @code{gnus-adaptive-word-no-group-words} is set to @code{t}, gnus
20580 won't adaptively word score any of the words in the group name.  Useful
20581 for groups like @samp{comp.editors.emacs}, where most of the subject
20582 lines contain the word @samp{emacs}.
20583
20584 After using this scheme for a while, it might be nice to write a
20585 @code{gnus-psychoanalyze-user} command to go through the rules and see
20586 what words you like and what words you don't like.  Or perhaps not.
20587
20588 Note that the adaptive word scoring thing is highly experimental and is
20589 likely to change in the future.  Initial impressions seem to indicate
20590 that it's totally useless as it stands.  Some more work (involving more
20591 rigorous statistical methods) will have to be done to make this useful.
20592
20593
20594 @node Home Score File
20595 @section Home Score File
20596
20597 The score file where new score file entries will go is called the
20598 @dfn{home score file}.  This is normally (and by default) the score file
20599 for the group itself.  For instance, the home score file for
20600 @samp{gnu.emacs.gnus} is @file{gnu.emacs.gnus.SCORE}.
20601
20602 However, this may not be what you want.  It is often convenient to share
20603 a common home score file among many groups---all @samp{emacs} groups
20604 could perhaps use the same home score file.
20605
20606 @vindex gnus-home-score-file
20607 The variable that controls this is @code{gnus-home-score-file}.  It can
20608 be:
20609
20610 @enumerate
20611 @item
20612 A string.  Then this file will be used as the home score file for all
20613 groups.
20614
20615 @item
20616 A function.  The result of this function will be used as the home score
20617 file.  The function will be called with the name of the group as the
20618 parameter.
20619
20620 @item
20621 A list.  The elements in this list can be:
20622
20623 @enumerate
20624 @item
20625 @code{(@var{regexp} @var{file-name})}.  If the @var{regexp} matches the
20626 group name, the @var{file-name} will be used as the home score file.
20627
20628 @item
20629 A function.  If the function returns non-@code{nil}, the result will
20630 be used as the home score file.  The function will be called with the
20631 name of the group as the parameter.
20632
20633 @item
20634 A string.  Use the string as the home score file.
20635 @end enumerate
20636
20637 The list will be traversed from the beginning towards the end looking
20638 for matches.
20639
20640 @end enumerate
20641
20642 So, if you want to use just a single score file, you could say:
20643
20644 @lisp
20645 (setq gnus-home-score-file
20646       "my-total-score-file.SCORE")
20647 @end lisp
20648
20649 If you want to use @file{gnu.SCORE} for all @samp{gnu} groups and
20650 @file{rec.SCORE} for all @samp{rec} groups (and so on), you can say:
20651
20652 @findex gnus-hierarchial-home-score-file
20653 @lisp
20654 (setq gnus-home-score-file
20655       'gnus-hierarchial-home-score-file)
20656 @end lisp
20657
20658 This is a ready-made function provided for your convenience.
20659 Other functions include
20660
20661 @table @code
20662 @item gnus-current-home-score-file
20663 @findex gnus-current-home-score-file
20664 Return the ``current'' regular score file.  This will make scoring
20665 commands add entry to the ``innermost'' matching score file.
20666
20667 @end table
20668
20669 If you want to have one score file for the @samp{emacs} groups and
20670 another for the @samp{comp} groups, while letting all other groups use
20671 their own home score files:
20672
20673 @lisp
20674 (setq gnus-home-score-file
20675       ;; @r{All groups that match the regexp @code{"\\.emacs"}}
20676       '(("\\.emacs" "emacs.SCORE")
20677         ;; @r{All the comp groups in one score file}
20678         ("^comp" "comp.SCORE")))
20679 @end lisp
20680
20681 @vindex gnus-home-adapt-file
20682 @code{gnus-home-adapt-file} works exactly the same way as
20683 @code{gnus-home-score-file}, but says what the home adaptive score file
20684 is instead.  All new adaptive file entries will go into the file
20685 specified by this variable, and the same syntax is allowed.
20686
20687 In addition to using @code{gnus-home-score-file} and
20688 @code{gnus-home-adapt-file}, you can also use group parameters
20689 (@pxref{Group Parameters}) and topic parameters (@pxref{Topic
20690 Parameters}) to achieve much the same.  Group and topic parameters take
20691 precedence over this variable.
20692
20693
20694 @node Followups To Yourself
20695 @section Followups To Yourself
20696
20697 Gnus offers two commands for picking out the @code{Message-ID} header in
20698 the current buffer.  Gnus will then add a score rule that scores using
20699 this @code{Message-ID} on the @code{References} header of other
20700 articles.  This will, in effect, increase the score of all articles that
20701 respond to the article in the current buffer.  Quite useful if you want
20702 to easily note when people answer what you've said.
20703
20704 @table @code
20705
20706 @item gnus-score-followup-article
20707 @findex gnus-score-followup-article
20708 This will add a score to articles that directly follow up your own
20709 article.
20710
20711 @item gnus-score-followup-thread
20712 @findex gnus-score-followup-thread
20713 This will add a score to all articles that appear in a thread ``below''
20714 your own article.
20715 @end table
20716
20717 @vindex message-sent-hook
20718 These two functions are both primarily meant to be used in hooks like
20719 @code{message-sent-hook}, like this:
20720 @lisp
20721 (add-hook 'message-sent-hook 'gnus-score-followup-thread)
20722 @end lisp
20723
20724
20725 If you look closely at your own @code{Message-ID}, you'll notice that
20726 the first two or three characters are always the same.  Here's two of
20727 mine:
20728
20729 @example
20730 <x6u3u47icf.fsf@@eyesore.no>
20731 <x6sp9o7ibw.fsf@@eyesore.no>
20732 @end example
20733
20734 So ``my'' ident on this machine is @samp{x6}.  This can be
20735 exploited---the following rule will raise the score on all followups to
20736 myself:
20737
20738 @lisp
20739 ("references"
20740  ("<x6[0-9a-z]+\\.fsf\\(_-_\\)?@@.*eyesore\\.no>"
20741   1000 nil r))
20742 @end lisp
20743
20744 Whether it's the first two or first three characters that are ``yours''
20745 is system-dependent.
20746
20747
20748 @node Scoring On Other Headers
20749 @section Scoring On Other Headers
20750 @cindex scoring on other headers
20751
20752 Gnus is quite fast when scoring the ``traditional''
20753 headers---@samp{From}, @samp{Subject} and so on.  However, scoring
20754 other headers requires writing a @code{head} scoring rule, which means
20755 that Gnus has to request every single article from the back end to find
20756 matches.  This takes a long time in big groups.
20757
20758 Now, there's not much you can do about this for news groups, but for
20759 mail groups, you have greater control.  In @ref{To From Newsgroups},
20760 it's explained in greater detail what this mechanism does, but here's
20761 a cookbook example for @code{nnml} on how to allow scoring on the
20762 @samp{To} and @samp{Cc} headers.
20763
20764 Put the following in your @file{~/.gnus.el} file.
20765
20766 @lisp
20767 (setq gnus-extra-headers '(To Cc Newsgroups Keywords)
20768       nnmail-extra-headers gnus-extra-headers)
20769 @end lisp
20770
20771 Restart Gnus and rebuild your @code{nnml} overview files with the
20772 @kbd{M-x nnml-generate-nov-databases} command.  This will take a long
20773 time if you have much mail.
20774
20775 Now you can score on @samp{To} and @samp{Cc} as ``extra headers'' like
20776 so: @kbd{I e s p To RET <your name> RET}.
20777
20778 See?  Simple.
20779
20780
20781 @node Scoring Tips
20782 @section Scoring Tips
20783 @cindex scoring tips
20784
20785 @table @dfn
20786
20787 @item Crossposts
20788 @cindex crossposts
20789 @cindex scoring crossposts
20790 If you want to lower the score of crossposts, the line to match on is
20791 the @code{Xref} header.
20792 @lisp
20793 ("xref" (" talk.politics.misc:" -1000))
20794 @end lisp
20795
20796 @item Multiple crossposts
20797 If you want to lower the score of articles that have been crossposted to
20798 more than, say, 3 groups:
20799 @lisp
20800 ("xref"
20801   ("[^:\n]+:[0-9]+ +[^:\n]+:[0-9]+ +[^:\n]+:[0-9]+"
20802    -1000 nil r))
20803 @end lisp
20804
20805 @item Matching on the body
20806 This is generally not a very good idea---it takes a very long time.
20807 Gnus actually has to fetch each individual article from the server.  But
20808 you might want to anyway, I guess.  Even though there are three match
20809 keys (@code{Head}, @code{Body} and @code{All}), you should choose one
20810 and stick with it in each score file.  If you use any two, each article
20811 will be fetched @emph{twice}.  If you want to match a bit on the
20812 @code{Head} and a bit on the @code{Body}, just use @code{All} for all
20813 the matches.
20814
20815 @item Marking as read
20816 You will probably want to mark articles that have scores below a certain
20817 number as read.  This is most easily achieved by putting the following
20818 in your @file{all.SCORE} file:
20819 @lisp
20820 ((mark -100))
20821 @end lisp
20822 You may also consider doing something similar with @code{expunge}.
20823
20824 @item Negated character classes
20825 If you say stuff like @code{[^abcd]*}, you may get unexpected results.
20826 That will match newlines, which might lead to, well, The Unknown.  Say
20827 @code{[^abcd\n]*} instead.
20828 @end table
20829
20830
20831 @node Reverse Scoring
20832 @section Reverse Scoring
20833 @cindex reverse scoring
20834
20835 If you want to keep just articles that have @samp{Sex with Emacs} in the
20836 subject header, and expunge all other articles, you could put something
20837 like this in your score file:
20838
20839 @lisp
20840 (("subject"
20841   ("Sex with Emacs" 2))
20842  (mark 1)
20843  (expunge 1))
20844 @end lisp
20845
20846 So, you raise all articles that match @samp{Sex with Emacs} and mark the
20847 rest as read, and expunge them to boot.
20848
20849
20850 @node Global Score Files
20851 @section Global Score Files
20852 @cindex global score files
20853
20854 Sure, other newsreaders have ``global kill files''.  These are usually
20855 nothing more than a single kill file that applies to all groups, stored
20856 in the user's home directory.  Bah!  Puny, weak newsreaders!
20857
20858 What I'm talking about here are Global Score Files.  Score files from
20859 all over the world, from users everywhere, uniting all nations in one
20860 big, happy score file union!  Ange-score!  New and untested!
20861
20862 @vindex gnus-global-score-files
20863 All you have to do to use other people's score files is to set the
20864 @code{gnus-global-score-files} variable.  One entry for each score file,
20865 or each score file directory.  Gnus will decide by itself what score
20866 files are applicable to which group.
20867
20868 To use the score file
20869 @file{/ftp@@ftp.gnus.org:/pub/larsi/ding/score/soc.motss.SCORE} and
20870 all score files in the @file{/ftp@@ftp.some-where:/pub/score} directory,
20871 say this:
20872
20873 @lisp
20874 (setq gnus-global-score-files
20875       '("/ftp@@ftp.gnus.org:/pub/larsi/ding/score/soc.motss.SCORE"
20876         "/ftp@@ftp.some-where:/pub/score/"))
20877 @end lisp
20878
20879 @findex gnus-score-search-global-directories
20880 @noindent
20881 Simple, eh?  Directory names must end with a @samp{/}.  These
20882 directories are typically scanned only once during each Gnus session.
20883 If you feel the need to manually re-scan the remote directories, you can
20884 use the @code{gnus-score-search-global-directories} command.
20885
20886 Note that, at present, using this option will slow down group entry
20887 somewhat.  (That is---a lot.)
20888
20889 If you want to start maintaining score files for other people to use,
20890 just put your score file up for anonymous ftp and announce it to the
20891 world.  Become a retro-moderator!  Participate in the retro-moderator
20892 wars sure to ensue, where retro-moderators battle it out for the
20893 sympathy of the people, luring them to use their score files on false
20894 premises!  Yay!  The net is saved!
20895
20896 Here are some tips for the would-be retro-moderator, off the top of my
20897 head:
20898
20899 @itemize @bullet
20900
20901 @item
20902 Articles heavily crossposted are probably junk.
20903 @item
20904 To lower a single inappropriate article, lower by @code{Message-ID}.
20905 @item
20906 Particularly brilliant authors can be raised on a permanent basis.
20907 @item
20908 Authors that repeatedly post off-charter for the group can safely be
20909 lowered out of existence.
20910 @item
20911 Set the @code{mark} and @code{expunge} atoms to obliterate the nastiest
20912 articles completely.
20913
20914 @item
20915 Use expiring score entries to keep the size of the file down.  You
20916 should probably have a long expiry period, though, as some sites keep
20917 old articles for a long time.
20918 @end itemize
20919
20920 @dots{} I wonder whether other newsreaders will support global score files
20921 in the future.  @emph{Snicker}.  Yup, any day now, newsreaders like Blue
20922 Wave, xrn and 1stReader are bound to implement scoring.  Should we start
20923 holding our breath yet?
20924
20925
20926 @node Kill Files
20927 @section Kill Files
20928 @cindex kill files
20929
20930 Gnus still supports those pesky old kill files.  In fact, the kill file
20931 entries can now be expiring, which is something I wrote before Daniel
20932 Quinlan thought of doing score files, so I've left the code in there.
20933
20934 In short, kill processing is a lot slower (and I do mean @emph{a lot})
20935 than score processing, so it might be a good idea to rewrite your kill
20936 files into score files.
20937
20938 Anyway, a kill file is a normal @code{emacs-lisp} file.  You can put any
20939 forms into this file, which means that you can use kill files as some
20940 sort of primitive hook function to be run on group entry, even though
20941 that isn't a very good idea.
20942
20943 Normal kill files look like this:
20944
20945 @lisp
20946 (gnus-kill "From" "Lars Ingebrigtsen")
20947 (gnus-kill "Subject" "ding")
20948 (gnus-expunge "X")
20949 @end lisp
20950
20951 This will mark every article written by me as read, and remove the
20952 marked articles from the summary buffer.  Very useful, you'll agree.
20953
20954 Other programs use a totally different kill file syntax.  If Gnus
20955 encounters what looks like a @code{rn} kill file, it will take a stab at
20956 interpreting it.
20957
20958 Two summary functions for editing a @sc{gnus} kill file:
20959
20960 @table @kbd
20961
20962 @item M-k
20963 @kindex M-k (Summary)
20964 @findex gnus-summary-edit-local-kill
20965 Edit this group's kill file (@code{gnus-summary-edit-local-kill}).
20966
20967 @item M-K
20968 @kindex M-K (Summary)
20969 @findex gnus-summary-edit-global-kill
20970 Edit the general kill file (@code{gnus-summary-edit-global-kill}).
20971 @end table
20972
20973 Two group mode functions for editing the kill files:
20974
20975 @table @kbd
20976
20977 @item M-k
20978 @kindex M-k (Group)
20979 @findex gnus-group-edit-local-kill
20980 Edit this group's kill file (@code{gnus-group-edit-local-kill}).
20981
20982 @item M-K
20983 @kindex M-K (Group)
20984 @findex gnus-group-edit-global-kill
20985 Edit the general kill file (@code{gnus-group-edit-global-kill}).
20986 @end table
20987
20988 Kill file variables:
20989
20990 @table @code
20991 @item gnus-kill-file-name
20992 @vindex gnus-kill-file-name
20993 A kill file for the group @samp{soc.motss} is normally called
20994 @file{soc.motss.KILL}.  The suffix appended to the group name to get
20995 this file name is detailed by the @code{gnus-kill-file-name} variable.
20996 The ``global'' kill file (not in the score file sense of ``global'', of
20997 course) is just called @file{KILL}.
20998
20999 @vindex gnus-kill-save-kill-file
21000 @item gnus-kill-save-kill-file
21001 If this variable is non-@code{nil}, Gnus will save the
21002 kill file after processing, which is necessary if you use expiring
21003 kills.
21004
21005 @item gnus-apply-kill-hook
21006 @vindex gnus-apply-kill-hook
21007 @findex gnus-apply-kill-file-unless-scored
21008 @findex gnus-apply-kill-file
21009 A hook called to apply kill files to a group.  It is
21010 @code{(gnus-apply-kill-file)} by default.  If you want to ignore the
21011 kill file if you have a score file for the same group, you can set this
21012 hook to @code{(gnus-apply-kill-file-unless-scored)}.  If you don't want
21013 kill files to be processed, you should set this variable to @code{nil}.
21014
21015 @item gnus-kill-file-mode-hook
21016 @vindex gnus-kill-file-mode-hook
21017 A hook called in kill-file mode buffers.
21018
21019 @end table
21020
21021
21022 @node Converting Kill Files
21023 @section Converting Kill Files
21024 @cindex kill files
21025 @cindex converting kill files
21026
21027 If you have loads of old kill files, you may want to convert them into
21028 score files.  If they are ``regular'', you can use
21029 the @file{gnus-kill-to-score.el} package; if not, you'll have to do it
21030 by hand.
21031
21032 The kill to score conversion package isn't included in Gnus by default.
21033 You can fetch it from
21034 @uref{http://www.stud.ifi.uio.no/~larsi/ding-various/gnus-kill-to-score.el}.
21035
21036 If your old kill files are very complex---if they contain more
21037 non-@code{gnus-kill} forms than not, you'll have to convert them by
21038 hand.  Or just let them be as they are.  Gnus will still use them as
21039 before.
21040
21041
21042 @node Advanced Scoring
21043 @section Advanced Scoring
21044
21045 Scoring on Subjects and From headers is nice enough, but what if you're
21046 really interested in what a person has to say only when she's talking
21047 about a particular subject?  Or what if you really don't want to
21048 read what person A has to say when she's following up to person B, but
21049 want to read what she says when she's following up to person C?
21050
21051 By using advanced scoring rules you may create arbitrarily complex
21052 scoring patterns.
21053
21054 @menu
21055 * Advanced Scoring Syntax::     A definition.
21056 * Advanced Scoring Examples::   What they look like.
21057 * Advanced Scoring Tips::       Getting the most out of it.
21058 @end menu
21059
21060
21061 @node Advanced Scoring Syntax
21062 @subsection Advanced Scoring Syntax
21063
21064 Ordinary scoring rules have a string as the first element in the rule.
21065 Advanced scoring rules have a list as the first element.  The second
21066 element is the score to be applied if the first element evaluated to a
21067 non-@code{nil} value.
21068
21069 These lists may consist of three logical operators, one redirection
21070 operator, and various match operators.
21071
21072 Logical operators:
21073
21074 @table @code
21075 @item &
21076 @itemx and
21077 This logical operator will evaluate each of its arguments until it finds
21078 one that evaluates to @code{false}, and then it'll stop.  If all arguments
21079 evaluate to @code{true} values, then this operator will return
21080 @code{true}.
21081
21082 @item |
21083 @itemx or
21084 This logical operator will evaluate each of its arguments until it finds
21085 one that evaluates to @code{true}.  If no arguments are @code{true},
21086 then this operator will return @code{false}.
21087
21088 @item !
21089 @itemx not
21090 @itemx Â¬
21091 This logical operator only takes a single argument.  It returns the
21092 logical negation of the value of its argument.
21093
21094 @end table
21095
21096 There is an @dfn{indirection operator} that will make its arguments
21097 apply to the ancestors of the current article being scored.  For
21098 instance, @code{1-} will make score rules apply to the parent of the
21099 current article.  @code{2-} will make score rules apply to the
21100 grandparent of the current article.  Alternatively, you can write
21101 @code{^^}, where the number of @code{^}s (carets) says how far back into
21102 the ancestry you want to go.
21103
21104 Finally, we have the match operators.  These are the ones that do the
21105 real work.  Match operators are header name strings followed by a match
21106 and a match type.  A typical match operator looks like @samp{("from"
21107 "Lars Ingebrigtsen" s)}.  The header names are the same as when using
21108 simple scoring, and the match types are also the same.
21109
21110
21111 @node Advanced Scoring Examples
21112 @subsection Advanced Scoring Examples
21113
21114 Please note that the following examples are score file rules.  To
21115 make a complete score file from them, surround them with another pair
21116 of parentheses.
21117
21118 Let's say you want to increase the score of articles written by Lars
21119 when he's talking about Gnus:
21120
21121 @example
21122 @group
21123 ((&
21124   ("from" "Lars Ingebrigtsen")
21125   ("subject" "Gnus"))
21126  1000)
21127 @end group
21128 @end example
21129
21130 Quite simple, huh?
21131
21132 When he writes long articles, he sometimes has something nice to say:
21133
21134 @example
21135 ((&
21136   ("from" "Lars Ingebrigtsen")
21137   (|
21138    ("subject" "Gnus")
21139    ("lines" 100 >)))
21140  1000)
21141 @end example
21142
21143 However, when he responds to things written by Reig Eigil Logge, you
21144 really don't want to read what he's written:
21145
21146 @example
21147 ((&
21148   ("from" "Lars Ingebrigtsen")
21149   (1- ("from" "Reig Eigir Logge")))
21150  -100000)
21151 @end example
21152
21153 Everybody that follows up Redmondo when he writes about disappearing
21154 socks should have their scores raised, but only when they talk about
21155 white socks.  However, when Lars talks about socks, it's usually not
21156 very interesting:
21157
21158 @example
21159 ((&
21160   (1-
21161    (&
21162     ("from" "redmondo@@.*no" r)
21163     ("body" "disappearing.*socks" t)))
21164   (! ("from" "Lars Ingebrigtsen"))
21165   ("body" "white.*socks"))
21166  1000)
21167 @end example
21168
21169 Suppose you're reading a high volume group and you're only interested
21170 in replies. The plan is to score down all articles that don't have
21171 subject that begin with "Re:", "Fw:" or "Fwd:" and then score up all
21172 parents of articles that have subjects that begin with reply marks.
21173
21174 @example
21175 ((! ("subject" "re:\\|fwd?:" r))
21176   -200)
21177 ((1- ("subject" "re:\\|fwd?:" r))
21178   200)
21179 @end example
21180
21181 The possibilities are endless.
21182
21183 @node Advanced Scoring Tips
21184 @subsection Advanced Scoring Tips
21185
21186 The @code{&} and @code{|} logical operators do short-circuit logic.
21187 That is, they stop processing their arguments when it's clear what the
21188 result of the operation will be.  For instance, if one of the arguments
21189 of an @code{&} evaluates to @code{false}, there's no point in evaluating
21190 the rest of the arguments.  This means that you should put slow matches
21191 (@samp{body}, @samp{header}) last and quick matches (@samp{from},
21192 @samp{subject}) first.
21193
21194 The indirection arguments (@code{1-} and so on) will make their
21195 arguments work on previous generations of the thread.  If you say
21196 something like:
21197
21198 @example
21199 ...
21200 (1-
21201  (1-
21202   ("from" "lars")))
21203 ...
21204 @end example
21205
21206 Then that means ``score on the from header of the grandparent of the
21207 current article''.  An indirection is quite fast, but it's better to say:
21208
21209 @example
21210 (1-
21211  (&
21212   ("from" "Lars")
21213   ("subject" "Gnus")))
21214 @end example
21215
21216 than it is to say:
21217
21218 @example
21219 (&
21220  (1- ("from" "Lars"))
21221  (1- ("subject" "Gnus")))
21222 @end example
21223
21224
21225 @node Score Decays
21226 @section Score Decays
21227 @cindex score decays
21228 @cindex decays
21229
21230 You may find that your scores have a tendency to grow without
21231 bounds, especially if you're using adaptive scoring.  If scores get too
21232 big, they lose all meaning---they simply max out and it's difficult to
21233 use them in any sensible way.
21234
21235 @vindex gnus-decay-scores
21236 @findex gnus-decay-score
21237 @vindex gnus-decay-score-function
21238 Gnus provides a mechanism for decaying scores to help with this problem.
21239 When score files are loaded and @code{gnus-decay-scores} is
21240 non-@code{nil}, Gnus will run the score files through the decaying
21241 mechanism thereby lowering the scores of all non-permanent score rules.
21242 If @code{gnus-decay-scores} is a regexp, only score files matching this
21243 regexp are treated.  E.g. you may set it to @samp{\\.ADAPT\\'} if only
21244 @emph{adaptive} score files should be decayed.  The decay itself if
21245 performed by the @code{gnus-decay-score-function} function, which is
21246 @code{gnus-decay-score} by default.  Here's the definition of that
21247 function:
21248
21249 @lisp
21250 (defun gnus-decay-score (score)
21251   "Decay SCORE according to `gnus-score-decay-constant'
21252 and `gnus-score-decay-scale'."
21253   (let ((n (- score
21254               (* (if (< score 0) -1 1)
21255                  (min (abs score)
21256                       (max gnus-score-decay-constant
21257                            (* (abs score)
21258                               gnus-score-decay-scale)))))))
21259     (if (and (featurep 'xemacs)
21260              ;; XEmacs' floor can handle only the floating point
21261              ;; number below the half of the maximum integer.
21262              (> (abs n) (lsh -1 -2)))
21263         (string-to-number
21264          (car (split-string (number-to-string n) "\\.")))
21265       (floor n))))
21266 @end lisp
21267
21268 @vindex gnus-score-decay-scale
21269 @vindex gnus-score-decay-constant
21270 @code{gnus-score-decay-constant} is 3 by default and
21271 @code{gnus-score-decay-scale} is 0.05.  This should cause the following:
21272
21273 @enumerate
21274 @item
21275 Scores between -3 and 3 will be set to 0 when this function is called.
21276
21277 @item
21278 Scores with magnitudes between 3 and 60 will be shrunk by 3.
21279
21280 @item
21281 Scores with magnitudes greater than 60 will be shrunk by 5% of the
21282 score.
21283 @end enumerate
21284
21285 If you don't like this decay function, write your own.  It is called
21286 with the score to be decayed as its only parameter, and it should return
21287 the new score, which should be an integer.
21288
21289 Gnus will try to decay scores once a day.  If you haven't run Gnus for
21290 four days, Gnus will decay the scores four times, for instance.
21291
21292 @iftex
21293 @iflatex
21294 @chapter Message
21295 @include message.texi
21296 @chapter Emacs MIME
21297 @include emacs-mime.texi
21298 @chapter Sieve
21299 @include sieve.texi
21300 @chapter PGG
21301 @include pgg.texi
21302 @chapter SASL
21303 @include sasl.texi
21304 @end iflatex
21305 @end iftex
21306
21307 @node Various
21308 @chapter Various
21309
21310 @menu
21311 * Process/Prefix::              A convention used by many treatment commands.
21312 * Interactive::                 Making Gnus ask you many questions.
21313 * Symbolic Prefixes::           How to supply some Gnus functions with options.
21314 * Formatting Variables::        You can specify what buffers should look like.
21315 * Window Layout::               Configuring the Gnus buffer windows.
21316 * Faces and Fonts::             How to change how faces look.
21317 * Compilation::                 How to speed Gnus up.
21318 * Mode Lines::                  Displaying information in the mode lines.
21319 * Highlighting and Menus::      Making buffers look all nice and cozy.
21320 * Buttons::                     Get tendinitis in ten easy steps!
21321 * Daemons::                     Gnus can do things behind your back.
21322 * NoCeM::                       How to avoid spam and other fatty foods.
21323 * Undo::                        Some actions can be undone.
21324 * Predicate Specifiers::        Specifying predicates.
21325 * Moderation::                  What to do if you're a moderator.
21326 * Fetching a Group::            Starting Gnus just to read a group.
21327 * Image Enhancements::          Modern versions of Emacs/XEmacs can display images.
21328 * Fuzzy Matching::              What's the big fuzz?
21329 * Thwarting Email Spam::        A how-to on avoiding unsolicited commercial email.
21330 * Other modes::                 Interaction with other modes.
21331 * Various Various::             Things that are really various.
21332 @end menu
21333
21334
21335 @node Process/Prefix
21336 @section Process/Prefix
21337 @cindex process/prefix convention
21338
21339 Many functions, among them functions for moving, decoding and saving
21340 articles, use what is known as the @dfn{Process/Prefix convention}.
21341
21342 This is a method for figuring out what articles the user wants the
21343 command to be performed on.
21344
21345 It goes like this:
21346
21347 If the numeric prefix is N, perform the operation on the next N
21348 articles, starting with the current one.  If the numeric prefix is
21349 negative, perform the operation on the previous N articles, starting
21350 with the current one.
21351
21352 @vindex transient-mark-mode
21353 If @code{transient-mark-mode} in non-@code{nil} and the region is
21354 active, all articles in the region will be worked upon.
21355
21356 If there is no numeric prefix, but some articles are marked with the
21357 process mark, perform the operation on the articles marked with
21358 the process mark.
21359
21360 If there is neither a numeric prefix nor any articles marked with the
21361 process mark, just perform the operation on the current article.
21362
21363 Quite simple, really, but it needs to be made clear so that surprises
21364 are avoided.
21365
21366 Commands that react to the process mark will push the current list of
21367 process marked articles onto a stack and will then clear all process
21368 marked articles.  You can restore the previous configuration with the
21369 @kbd{M P y} command (@pxref{Setting Process Marks}).
21370
21371 @vindex gnus-summary-goto-unread
21372 One thing that seems to shock & horrify lots of people is that, for
21373 instance, @kbd{3 d} does exactly the same as @kbd{d} @kbd{d} @kbd{d}.
21374 Since each @kbd{d} (which marks the current article as read) by default
21375 goes to the next unread article after marking, this means that @kbd{3 d}
21376 will mark the next three unread articles as read, no matter what the
21377 summary buffer looks like.  Set @code{gnus-summary-goto-unread} to
21378 @code{nil} for a more straightforward action.
21379
21380 Many commands do not use the process/prefix convention.  All commands
21381 that do explicitly say so in this manual.  To apply the process/prefix
21382 convention to commands that do not use it, you can use the @kbd{M-&}
21383 command.  For instance, to mark all the articles in the group as
21384 expirable, you could say @kbd{M P b M-& E}.
21385
21386
21387 @node Interactive
21388 @section Interactive
21389 @cindex interaction
21390
21391 @table @code
21392
21393 @item gnus-novice-user
21394 @vindex gnus-novice-user
21395 If this variable is non-@code{nil}, you are either a newcomer to the
21396 World of Usenet, or you are very cautious, which is a nice thing to be,
21397 really.  You will be given questions of the type ``Are you sure you want
21398 to do this?'' before doing anything dangerous.  This is @code{t} by
21399 default.
21400
21401 @item gnus-expert-user
21402 @vindex gnus-expert-user
21403 If this variable is non-@code{nil}, you will seldom be asked any
21404 questions by Gnus.  It will simply assume you know what you're doing, no
21405 matter how strange.
21406
21407 @item gnus-interactive-catchup
21408 @vindex gnus-interactive-catchup
21409 Require confirmation before catching up a group if non-@code{nil}.  It
21410 is @code{t} by default.
21411
21412 @item gnus-interactive-exit
21413 @vindex gnus-interactive-exit
21414 Require confirmation before exiting Gnus.  This variable is @code{t} by
21415 default.
21416 @end table
21417
21418
21419 @node Symbolic Prefixes
21420 @section Symbolic Prefixes
21421 @cindex symbolic prefixes
21422
21423 Quite a lot of Emacs commands react to the (numeric) prefix.  For
21424 instance, @kbd{C-u 4 C-f} moves point four characters forward, and
21425 @kbd{C-u 9 0 0 I s s p} adds a permanent @code{Subject} substring score
21426 rule of 900 to the current article.
21427
21428 This is all nice and well, but what if you want to give a command some
21429 additional information?  Well, what most commands do is interpret the
21430 ``raw'' prefix in some special way.  @kbd{C-u 0 C-x C-s} means that one
21431 doesn't want a backup file to be created when saving the current buffer,
21432 for instance.  But what if you want to save without making a backup
21433 file, and you want Emacs to flash lights and play a nice tune at the
21434 same time?  You can't, and you're probably perfectly happy that way.
21435
21436 @kindex M-i (Summary)
21437 @findex gnus-symbolic-argument
21438 I'm not, so I've added a second prefix---the @dfn{symbolic prefix}.  The
21439 prefix key is @kbd{M-i} (@code{gnus-symbolic-argument}), and the next
21440 character typed in is the value.  You can stack as many @kbd{M-i}
21441 prefixes as you want.  @kbd{M-i a C-M-u} means ``feed the @kbd{C-M-u}
21442 command the symbolic prefix @code{a}''.  @kbd{M-i a M-i b C-M-u} means
21443 ``feed the @kbd{C-M-u} command the symbolic prefixes @code{a} and
21444 @code{b}''.  You get the drift.
21445
21446 Typing in symbolic prefixes to commands that don't accept them doesn't
21447 hurt, but it doesn't do any good either.  Currently not many Gnus
21448 functions make use of the symbolic prefix.
21449
21450 If you're interested in how Gnus implements this, @pxref{Extended
21451 Interactive}.
21452
21453
21454 @node Formatting Variables
21455 @section Formatting Variables
21456 @cindex formatting variables
21457
21458 Throughout this manual you've probably noticed lots of variables called
21459 things like @code{gnus-group-line-format} and
21460 @code{gnus-summary-mode-line-format}.  These control how Gnus is to
21461 output lines in the various buffers.  There's quite a lot of them.
21462 Fortunately, they all use the same syntax, so there's not that much to
21463 be annoyed by.
21464
21465 Here's an example format spec (from the group buffer): @samp{%M%S%5y:
21466 %(%g%)\n}.  We see that it is indeed extremely ugly, and that there are
21467 lots of percentages everywhere.
21468
21469 @menu
21470 * Formatting Basics::           A formatting variable is basically a format string.
21471 * Mode Line Formatting::        Some rules about mode line formatting variables.
21472 * Advanced Formatting::         Modifying output in various ways.
21473 * User-Defined Specs::          Having Gnus call your own functions.
21474 * Formatting Fonts::            Making the formatting look colorful and nice.
21475 * Positioning Point::           Moving point to a position after an operation.
21476 * Tabulation::                  Tabulating your output.
21477 * Wide Characters::             Dealing with wide characters.
21478 @end menu
21479
21480 Currently Gnus uses the following formatting variables:
21481 @code{gnus-group-line-format}, @code{gnus-summary-line-format},
21482 @code{gnus-server-line-format}, @code{gnus-topic-line-format},
21483 @code{gnus-group-mode-line-format},
21484 @code{gnus-summary-mode-line-format},
21485 @code{gnus-article-mode-line-format},
21486 @code{gnus-server-mode-line-format}, and
21487 @code{gnus-summary-pick-line-format}.
21488
21489 All these format variables can also be arbitrary elisp forms.  In that
21490 case, they will be @code{eval}ed to insert the required lines.
21491
21492 @kindex M-x gnus-update-format
21493 @findex gnus-update-format
21494 Gnus includes a command to help you while creating your own format
21495 specs.  @kbd{M-x gnus-update-format} will @code{eval} the current form,
21496 update the spec in question and pop you to a buffer where you can
21497 examine the resulting Lisp code to be run to generate the line.
21498
21499
21500
21501 @node Formatting Basics
21502 @subsection Formatting Basics
21503
21504 Each @samp{%} element will be replaced by some string or other when the
21505 buffer in question is generated.  @samp{%5y} means ``insert the @samp{y}
21506 spec, and pad with spaces to get a 5-character field''.
21507
21508 As with normal C and Emacs Lisp formatting strings, the numerical
21509 modifier between the @samp{%} and the formatting type character will
21510 @dfn{pad} the output so that it is always at least that long.
21511 @samp{%5y} will make the field always (at least) five characters wide by
21512 padding with spaces to the left.  If you say @samp{%-5y}, it will pad to
21513 the right instead.
21514
21515 You may also wish to limit the length of the field to protect against
21516 particularly wide values.  For that you can say @samp{%4,6y}, which
21517 means that the field will never be more than 6 characters wide and never
21518 less than 4 characters wide.
21519
21520 Also Gnus supports some extended format specifications, such as
21521 @samp{%&user-date;}.
21522
21523
21524 @node Mode Line Formatting
21525 @subsection Mode Line Formatting
21526
21527 Mode line formatting variables (e.g.,
21528 @code{gnus-summary-mode-line-format}) follow the same rules as other,
21529 buffer line oriented formatting variables (@pxref{Formatting Basics})
21530 with the following two differences:
21531
21532 @enumerate
21533
21534 @item
21535 There must be no newline (@samp{\n}) at the end.
21536
21537 @item
21538 The special @samp{%%b} spec can be used to display the buffer name.
21539 Well, it's no spec at all, really---@samp{%%} is just a way to quote
21540 @samp{%} to allow it to pass through the formatting machinery unmangled,
21541 so that Emacs receives @samp{%b}, which is something the Emacs mode line
21542 display interprets to mean ``show the buffer name''.  For a full list of
21543 mode line specs Emacs understands, see the documentation of the
21544 @code{mode-line-format} variable.
21545
21546 @end enumerate
21547
21548
21549 @node Advanced Formatting
21550 @subsection Advanced Formatting
21551
21552 It is frequently useful to post-process the fields in some way.
21553 Padding, limiting, cutting off parts and suppressing certain values can
21554 be achieved by using @dfn{tilde modifiers}.  A typical tilde spec might
21555 look like @samp{%~(cut 3)~(ignore "0")y}.
21556
21557 These are the valid modifiers:
21558
21559 @table @code
21560 @item pad
21561 @itemx pad-left
21562 Pad the field to the left with spaces until it reaches the required
21563 length.
21564
21565 @item pad-right
21566 Pad the field to the right with spaces until it reaches the required
21567 length.
21568
21569 @item max
21570 @itemx max-left
21571 Cut off characters from the left until it reaches the specified length.
21572
21573 @item max-right
21574 Cut off characters from the right until it reaches the specified
21575 length.
21576
21577 @item cut
21578 @itemx cut-left
21579 Cut off the specified number of characters from the left.
21580
21581 @item cut-right
21582 Cut off the specified number of characters from the right.
21583
21584 @item ignore
21585 Return an empty string if the field is equal to the specified value.
21586
21587 @item form
21588 Use the specified form as the field value when the @samp{@@} spec is
21589 used.
21590
21591 Here's an example:
21592
21593 @lisp
21594 "~(form (current-time-string))@@"
21595 @end lisp
21596
21597 @end table
21598
21599 Let's take an example.  The @samp{%o} spec in the summary mode lines
21600 will return a date in compact ISO8601 format---@samp{19960809T230410}.
21601 This is quite a mouthful, so we want to shave off the century number and
21602 the time, leaving us with a six-character date.  That would be
21603 @samp{%~(cut-left 2)~(max-right 6)~(pad 6)o}.  (Cutting is done before
21604 maxing, and we need the padding to ensure that the date is never less
21605 than 6 characters to make it look nice in columns.)
21606
21607 Ignoring is done first; then cutting; then maxing; and then as the very
21608 last operation, padding.
21609
21610 If you use lots of these advanced thingies, you'll find that Gnus gets
21611 quite slow.  This can be helped enormously by running @kbd{M-x
21612 gnus-compile} when you are satisfied with the look of your lines.
21613 @xref{Compilation}.
21614
21615
21616 @node User-Defined Specs
21617 @subsection User-Defined Specs
21618
21619 All the specs allow for inserting user defined specifiers---@samp{u}.
21620 The next character in the format string should be a letter.  Gnus
21621 will call the function @code{gnus-user-format-function-}@samp{X}, where
21622 @samp{X} is the letter following @samp{%u}.  The function will be passed
21623 a single parameter---what the parameter means depends on what buffer
21624 it's being called from.  The function should return a string, which will
21625 be inserted into the buffer just like information from any other
21626 specifier.  This function may also be called with dummy values, so it
21627 should protect against that.
21628
21629 Also Gnus supports extended user-defined specs, such as @samp{%u&foo;}.
21630 Gnus will call the function @code{gnus-user-format-function-}@samp{foo}.
21631
21632 You can also use tilde modifiers (@pxref{Advanced Formatting} to achieve
21633 much the same without defining new functions.  Here's an example:
21634 @samp{%~(form (count-lines (point-min) (point)))@@}.  The form
21635 given here will be evaluated to yield the current line number, and then
21636 inserted.
21637
21638
21639 @node Formatting Fonts
21640 @subsection Formatting Fonts
21641
21642 There are specs for highlighting, and these are shared by all the format
21643 variables.  Text inside the @samp{%(} and @samp{%)} specifiers will get
21644 the special @code{mouse-face} property set, which means that it will be
21645 highlighted (with @code{gnus-mouse-face}) when you put the mouse pointer
21646 over it.
21647
21648 Text inside the @samp{%@{} and @samp{%@}} specifiers will have their
21649 normal faces set using @code{gnus-face-0}, which is @code{bold} by
21650 default.  If you say @samp{%1@{}, you'll get @code{gnus-face-1} instead,
21651 and so on.  Create as many faces as you wish.  The same goes for the
21652 @code{mouse-face} specs---you can say @samp{%3(hello%)} to have
21653 @samp{hello} mouse-highlighted with @code{gnus-mouse-face-3}.
21654
21655 Text inside the @samp{%<<} and @samp{%>>} specifiers will get the
21656 special @code{balloon-help} property set to
21657 @code{gnus-balloon-face-0}.  If you say @samp{%1<<}, you'll get
21658 @code{gnus-balloon-face-1} and so on.  The @code{gnus-balloon-face-*}
21659 variables should be either strings or symbols naming functions that
21660 return a string.  When the mouse passes over text with this property
21661 set, a balloon window will appear and display the string.  Please
21662 refer to @ref{Tooltips, ,Tooltips, emacs, The Emacs Manual},
21663 (in GNU Emacs) or the doc string of @code{balloon-help-mode} (in
21664 XEmacs) for more information on this.  (For technical reasons, the
21665 guillemets have been approximated as @samp{<<} and @samp{>>} in this
21666 paragraph.)
21667
21668 Here's an alternative recipe for the group buffer:
21669
21670 @lisp
21671 ;; @r{Create three face types.}
21672 (setq gnus-face-1 'bold)
21673 (setq gnus-face-3 'italic)
21674
21675 ;; @r{We want the article count to be in}
21676 ;; @r{a bold and green face.  So we create}
21677 ;; @r{a new face called @code{my-green-bold}.}
21678 (copy-face 'bold 'my-green-bold)
21679 ;; @r{Set the color.}
21680 (set-face-foreground 'my-green-bold "ForestGreen")
21681 (setq gnus-face-2 'my-green-bold)
21682
21683 ;; @r{Set the new & fancy format.}
21684 (setq gnus-group-line-format
21685       "%M%S%3@{%5y%@}%2[:%] %(%1@{%g%@}%)\n")
21686 @end lisp
21687
21688 I'm sure you'll be able to use this scheme to create totally unreadable
21689 and extremely vulgar displays.  Have fun!
21690
21691 Note that the @samp{%(} specs (and friends) do not make any sense on the
21692 mode-line variables.
21693
21694 @node Positioning Point
21695 @subsection Positioning Point
21696
21697 Gnus usually moves point to a pre-defined place on each line in most
21698 buffers.  By default, point move to the first colon character on the
21699 line.  You can customize this behavior in three different ways.
21700
21701 You can move the colon character to somewhere else on the line.
21702
21703 @findex gnus-goto-colon
21704 You can redefine the function that moves the point to the colon.  The
21705 function is called @code{gnus-goto-colon}.
21706
21707 But perhaps the most convenient way to deal with this, if you don't want
21708 to have a colon in your line, is to use the @samp{%*} specifier.  If you
21709 put a @samp{%*} somewhere in your format line definition, Gnus will
21710 place point there.
21711
21712
21713 @node Tabulation
21714 @subsection Tabulation
21715
21716 You can usually line up your displays by padding and cutting your
21717 strings.  However, when combining various strings of different size, it
21718 can often be more convenient to just output the strings, and then worry
21719 about lining up the following text afterwards.
21720
21721 To do that, Gnus supplies tabulator specs---@samp{%=}.  There are two
21722 different types---@dfn{hard tabulators} and @dfn{soft tabulators}.
21723
21724 @samp{%50=} will insert space characters to pad the line up to column
21725 50.  If the text is already past column 50, nothing will be inserted.
21726 This is the soft tabulator.
21727
21728 @samp{%-50=} will insert space characters to pad the line up to column
21729 50.  If the text is already past column 50, the excess text past column
21730 50 will be removed.  This is the hard tabulator.
21731
21732
21733 @node Wide Characters
21734 @subsection Wide Characters
21735
21736 Fixed width fonts in most countries have characters of the same width.
21737 Some countries, however, use Latin characters mixed with wider
21738 characters---most notable East Asian countries.
21739
21740 The problem is that when formatting, Gnus assumes that if a string is 10
21741 characters wide, it'll be 10 Latin characters wide on the screen.  In
21742 these countries, that's not true.
21743
21744 @vindex gnus-use-correct-string-widths
21745 To help fix this, you can set @code{gnus-use-correct-string-widths} to
21746 @code{t}.  This makes buffer generation slower, but the results will be
21747 prettier.  The default value under XEmacs is @code{t} but @code{nil}
21748 for Emacs.
21749
21750
21751 @node Window Layout
21752 @section Window Layout
21753 @cindex window layout
21754
21755 No, there's nothing here about X, so be quiet.
21756
21757 @vindex gnus-use-full-window
21758 If @code{gnus-use-full-window} non-@code{nil}, Gnus will delete all
21759 other windows and occupy the entire Emacs screen by itself.  It is
21760 @code{t} by default.
21761
21762 Setting this variable to @code{nil} kinda works, but there are
21763 glitches.  Use at your own peril.
21764
21765 @vindex gnus-buffer-configuration
21766 @code{gnus-buffer-configuration} describes how much space each Gnus
21767 buffer should be given.  Here's an excerpt of this variable:
21768
21769 @lisp
21770 ((group (vertical 1.0 (group 1.0 point)
21771                       (if gnus-carpal (group-carpal 4))))
21772  (article (vertical 1.0 (summary 0.25 point)
21773                         (article 1.0))))
21774 @end lisp
21775
21776 This is an alist.  The @dfn{key} is a symbol that names some action or
21777 other.  For instance, when displaying the group buffer, the window
21778 configuration function will use @code{group} as the key.  A full list of
21779 possible names is listed below.
21780
21781 The @dfn{value} (i.e., the @dfn{split}) says how much space each buffer
21782 should occupy.  To take the @code{article} split as an example -
21783
21784 @lisp
21785 (article (vertical 1.0 (summary 0.25 point)
21786                        (article 1.0)))
21787 @end lisp
21788
21789 This @dfn{split} says that the summary buffer should occupy 25% of upper
21790 half of the screen, and that it is placed over the article buffer.  As
21791 you may have noticed, 100% + 25% is actually 125% (yup, I saw y'all
21792 reaching for that calculator there).  However, the special number
21793 @code{1.0} is used to signal that this buffer should soak up all the
21794 rest of the space available after the rest of the buffers have taken
21795 whatever they need.  There should be only one buffer with the @code{1.0}
21796 size spec per split.
21797
21798 Point will be put in the buffer that has the optional third element
21799 @code{point}.  In a @code{frame} split, the last subsplit having a leaf
21800 split where the tag @code{frame-focus} is a member (i.e. is the third or
21801 fourth element in the list, depending on whether the @code{point} tag is
21802 present) gets focus.
21803
21804 Here's a more complicated example:
21805
21806 @lisp
21807 (article (vertical 1.0 (group 4)
21808                        (summary 0.25 point)
21809                        (if gnus-carpal (summary-carpal 4))
21810                        (article 1.0)))
21811 @end lisp
21812
21813 If the size spec is an integer instead of a floating point number,
21814 then that number will be used to say how many lines a buffer should
21815 occupy, not a percentage.
21816
21817 If the @dfn{split} looks like something that can be @code{eval}ed (to be
21818 precise---if the @code{car} of the split is a function or a subr), this
21819 split will be @code{eval}ed.  If the result is non-@code{nil}, it will
21820 be used as a split.  This means that there will be three buffers if
21821 @code{gnus-carpal} is @code{nil}, and four buffers if @code{gnus-carpal}
21822 is non-@code{nil}.
21823
21824 Not complicated enough for you?  Well, try this on for size:
21825
21826 @lisp
21827 (article (horizontal 1.0
21828              (vertical 0.5
21829                  (group 1.0)
21830                  (gnus-carpal 4))
21831              (vertical 1.0
21832                  (summary 0.25 point)
21833                  (summary-carpal 4)
21834                  (article 1.0))))
21835 @end lisp
21836
21837 Whoops.  Two buffers with the mystery 100% tag.  And what's that
21838 @code{horizontal} thingie?
21839
21840 If the first element in one of the split is @code{horizontal}, Gnus will
21841 split the window horizontally, giving you two windows side-by-side.
21842 Inside each of these strips you may carry on all you like in the normal
21843 fashion.  The number following @code{horizontal} says what percentage of
21844 the screen is to be given to this strip.
21845
21846 For each split, there @emph{must} be one element that has the 100% tag.
21847 The splitting is never accurate, and this buffer will eat any leftover
21848 lines from the splits.
21849
21850 To be slightly more formal, here's a definition of what a valid split
21851 may look like:
21852
21853 @example
21854 @group
21855 split      = frame | horizontal | vertical | buffer | form
21856 frame      = "(frame " size *split ")"
21857 horizontal = "(horizontal " size *split ")"
21858 vertical   = "(vertical " size *split ")"
21859 buffer     = "(" buf-name " " size *[ "point" ] *[ "frame-focus"] ")"
21860 size       = number | frame-params
21861 buf-name   = group | article | summary ...
21862 @end group
21863 @end example
21864
21865 The limitations are that the @code{frame} split can only appear as the
21866 top-level split.  @var{form} should be an Emacs Lisp form that should
21867 return a valid split.  We see that each split is fully recursive, and
21868 may contain any number of @code{vertical} and @code{horizontal} splits.
21869
21870 @vindex gnus-window-min-width
21871 @vindex gnus-window-min-height
21872 @cindex window height
21873 @cindex window width
21874 Finding the right sizes can be a bit complicated.  No window may be less
21875 than @code{gnus-window-min-height} (default 1) characters high, and all
21876 windows must be at least @code{gnus-window-min-width} (default 1)
21877 characters wide.  Gnus will try to enforce this before applying the
21878 splits.  If you want to use the normal Emacs window width/height limit,
21879 you can just set these two variables to @code{nil}.
21880
21881 If you're not familiar with Emacs terminology, @code{horizontal} and
21882 @code{vertical} splits may work the opposite way of what you'd expect.
21883 Windows inside a @code{horizontal} split are shown side-by-side, and
21884 windows within a @code{vertical} split are shown above each other.
21885
21886 @findex gnus-configure-frame
21887 If you want to experiment with window placement, a good tip is to call
21888 @code{gnus-configure-frame} directly with a split.  This is the function
21889 that does all the real work when splitting buffers.  Below is a pretty
21890 nonsensical configuration with 5 windows; two for the group buffer and
21891 three for the article buffer.  (I said it was nonsensical.)  If you
21892 @code{eval} the statement below, you can get an idea of how that would
21893 look straight away, without going through the normal Gnus channels.
21894 Play with it until you're satisfied, and then use
21895 @code{gnus-add-configuration} to add your new creation to the buffer
21896 configuration list.
21897
21898 @lisp
21899 (gnus-configure-frame
21900  '(horizontal 1.0
21901     (vertical 10
21902       (group 1.0)
21903       (article 0.3 point))
21904     (vertical 1.0
21905       (article 1.0)
21906       (horizontal 4
21907         (group 1.0)
21908         (article 10)))))
21909 @end lisp
21910
21911 You might want to have several frames as well.  No prob---just use the
21912 @code{frame} split:
21913
21914 @lisp
21915 (gnus-configure-frame
21916  '(frame 1.0
21917          (vertical 1.0
21918                    (summary 0.25 point frame-focus)
21919                    (article 1.0))
21920          (vertical ((height . 5) (width . 15)
21921                     (user-position . t)
21922                     (left . -1) (top . 1))
21923                    (picon 1.0))))
21924
21925 @end lisp
21926
21927 This split will result in the familiar summary/article window
21928 configuration in the first (or ``main'') frame, while a small additional
21929 frame will be created where picons will be shown.  As you can see,
21930 instead of the normal @code{1.0} top-level spec, each additional split
21931 should have a frame parameter alist as the size spec.
21932 @xref{Frame Parameters, , Frame Parameters, elisp, The GNU Emacs Lisp
21933 Reference Manual}.  Under XEmacs, a frame property list will be
21934 accepted, too---for instance, @code{(height 5 width 15 left -1 top 1)}
21935 is such a plist.
21936 The list of all possible keys for @code{gnus-buffer-configuration} can
21937 be found in its default value.
21938
21939 Note that the @code{message} key is used for both
21940 @code{gnus-group-mail} and @code{gnus-summary-mail-other-window}.  If
21941 it is desirable to distinguish between the two, something like this
21942 might be used:
21943
21944 @lisp
21945 (message (horizontal 1.0
21946                      (vertical 1.0 (message 1.0 point))
21947                      (vertical 0.24
21948                                (if (buffer-live-p gnus-summary-buffer)
21949                                    '(summary 0.5))
21950                                (group 1.0))))
21951 @end lisp
21952
21953 One common desire for a multiple frame split is to have a separate frame
21954 for composing mail and news while leaving the original frame intact.  To
21955 accomplish that, something like the following can be done:
21956
21957 @lisp
21958 (message
21959   (frame 1.0
21960          (if (not (buffer-live-p gnus-summary-buffer))
21961              (car (cdr (assoc 'group gnus-buffer-configuration)))
21962            (car (cdr (assoc 'summary gnus-buffer-configuration))))
21963          (vertical ((user-position . t) (top . 1) (left . 1)
21964                     (name . "Message"))
21965                    (message 1.0 point))))
21966 @end lisp
21967
21968 @findex gnus-add-configuration
21969 Since the @code{gnus-buffer-configuration} variable is so long and
21970 complicated, there's a function you can use to ease changing the config
21971 of a single setting: @code{gnus-add-configuration}.  If, for instance,
21972 you want to change the @code{article} setting, you could say:
21973
21974 @lisp
21975 (gnus-add-configuration
21976  '(article (vertical 1.0
21977                (group 4)
21978                (summary .25 point)
21979                (article 1.0))))
21980 @end lisp
21981
21982 You'd typically stick these @code{gnus-add-configuration} calls in your
21983 @file{~/.gnus.el} file or in some startup hook---they should be run after
21984 Gnus has been loaded.
21985
21986 @vindex gnus-always-force-window-configuration
21987 If all windows mentioned in the configuration are already visible, Gnus
21988 won't change the window configuration.  If you always want to force the
21989 ``right'' window configuration, you can set
21990 @code{gnus-always-force-window-configuration} to non-@code{nil}.
21991
21992 If you're using tree displays (@pxref{Tree Display}), and the tree
21993 window is displayed vertically next to another window, you may also want
21994 to fiddle with @code{gnus-tree-minimize-window} to avoid having the
21995 windows resized.
21996
21997 @subsection Example Window Configurations
21998
21999 @itemize @bullet
22000 @item
22001 Narrow left hand side occupied by group buffer.  Right hand side split
22002 between summary buffer (top one-sixth) and article buffer (bottom).
22003
22004 @ifinfo
22005 @example
22006 +---+---------+
22007 | G | Summary |
22008 | r +---------+
22009 | o |         |
22010 | u | Article |
22011 | p |         |
22012 +---+---------+
22013 @end example
22014 @end ifinfo
22015
22016 @lisp
22017 (gnus-add-configuration
22018  '(article
22019    (horizontal 1.0
22020                (vertical 25 (group 1.0))
22021                (vertical 1.0
22022                          (summary 0.16 point)
22023                          (article 1.0)))))
22024
22025 (gnus-add-configuration
22026  '(summary
22027    (horizontal 1.0
22028                (vertical 25 (group 1.0))
22029                (vertical 1.0 (summary 1.0 point)))))
22030 @end lisp
22031
22032 @end itemize
22033
22034
22035 @node Faces and Fonts
22036 @section Faces and Fonts
22037 @cindex faces
22038 @cindex fonts
22039 @cindex colors
22040
22041 Fiddling with fonts and faces used to be very difficult, but these days
22042 it is very simple.  You simply say @kbd{M-x customize-face}, pick out
22043 the face you want to alter, and alter it via the standard Customize
22044 interface.
22045
22046
22047 @node Compilation
22048 @section Compilation
22049 @cindex compilation
22050 @cindex byte-compilation
22051
22052 @findex gnus-compile
22053
22054 Remember all those line format specification variables?
22055 @code{gnus-summary-line-format}, @code{gnus-group-line-format}, and so
22056 on.  Now, Gnus will of course heed whatever these variables are, but,
22057 unfortunately, changing them will mean a quite significant slow-down.
22058 (The default values of these variables have byte-compiled functions
22059 associated with them, while the user-generated versions do not, of
22060 course.)
22061
22062 To help with this, you can run @kbd{M-x gnus-compile} after you've
22063 fiddled around with the variables and feel that you're (kind of)
22064 satisfied.  This will result in the new specs being byte-compiled, and
22065 you'll get top speed again.  Gnus will save these compiled specs in the
22066 @file{.newsrc.eld} file.  (User-defined functions aren't compiled by
22067 this function, though---you should compile them yourself by sticking
22068 them into the @file{~/.gnus.el} file and byte-compiling that file.)
22069
22070
22071 @node Mode Lines
22072 @section Mode Lines
22073 @cindex mode lines
22074
22075 @vindex gnus-updated-mode-lines
22076 @code{gnus-updated-mode-lines} says what buffers should keep their mode
22077 lines updated.  It is a list of symbols.  Supported symbols include
22078 @code{group}, @code{article}, @code{summary}, @code{server},
22079 @code{browse}, and @code{tree}.  If the corresponding symbol is present,
22080 Gnus will keep that mode line updated with information that may be
22081 pertinent.  If this variable is @code{nil}, screen refresh may be
22082 quicker.
22083
22084 @cindex display-time
22085
22086 @vindex gnus-mode-non-string-length
22087 By default, Gnus displays information on the current article in the mode
22088 lines of the summary and article buffers.  The information Gnus wishes
22089 to display (e.g. the subject of the article) is often longer than the
22090 mode lines, and therefore have to be cut off at some point.  The
22091 @code{gnus-mode-non-string-length} variable says how long the other
22092 elements on the line is (i.e., the non-info part).  If you put
22093 additional elements on the mode line (e.g. a clock), you should modify
22094 this variable:
22095
22096 @c Hook written by Francesco Potorti` <pot@cnuce.cnr.it>
22097 @lisp
22098 (add-hook 'display-time-hook
22099           (lambda () (setq gnus-mode-non-string-length
22100                            (+ 21
22101                               (if line-number-mode 5 0)
22102                               (if column-number-mode 4 0)
22103                               (length display-time-string)))))
22104 @end lisp
22105
22106 If this variable is @code{nil} (which is the default), the mode line
22107 strings won't be chopped off, and they won't be padded either.  Note
22108 that the default is unlikely to be desirable, as even the percentage
22109 complete in the buffer may be crowded off the mode line; the user should
22110 configure this variable appropriately for her configuration.
22111
22112
22113 @node Highlighting and Menus
22114 @section Highlighting and Menus
22115 @cindex visual
22116 @cindex highlighting
22117 @cindex menus
22118
22119 @vindex gnus-visual
22120 The @code{gnus-visual} variable controls most of the Gnus-prettifying
22121 aspects.  If @code{nil}, Gnus won't attempt to create menus or use fancy
22122 colors or fonts.  This will also inhibit loading the @file{gnus-vis.el}
22123 file.
22124
22125 This variable can be a list of visual properties that are enabled.  The
22126 following elements are valid, and are all included by default:
22127
22128 @table @code
22129 @item group-highlight
22130 Do highlights in the group buffer.
22131 @item summary-highlight
22132 Do highlights in the summary buffer.
22133 @item article-highlight
22134 Do highlights in the article buffer.
22135 @item highlight
22136 Turn on highlighting in all buffers.
22137 @item group-menu
22138 Create menus in the group buffer.
22139 @item summary-menu
22140 Create menus in the summary buffers.
22141 @item article-menu
22142 Create menus in the article buffer.
22143 @item browse-menu
22144 Create menus in the browse buffer.
22145 @item server-menu
22146 Create menus in the server buffer.
22147 @item score-menu
22148 Create menus in the score buffers.
22149 @item menu
22150 Create menus in all buffers.
22151 @end table
22152
22153 So if you only want highlighting in the article buffer and menus in all
22154 buffers, you could say something like:
22155
22156 @lisp
22157 (setq gnus-visual '(article-highlight menu))
22158 @end lisp
22159
22160 If you want highlighting only and no menus whatsoever, you'd say:
22161
22162 @lisp
22163 (setq gnus-visual '(highlight))
22164 @end lisp
22165
22166 If @code{gnus-visual} is @code{t}, highlighting and menus will be used
22167 in all Gnus buffers.
22168
22169 Other general variables that influence the look of all buffers include:
22170
22171 @table @code
22172 @item gnus-mouse-face
22173 @vindex gnus-mouse-face
22174 This is the face (i.e., font) used for mouse highlighting in Gnus.  No
22175 mouse highlights will be done if @code{gnus-visual} is @code{nil}.
22176
22177 @end table
22178
22179 There are hooks associated with the creation of all the different menus:
22180
22181 @table @code
22182
22183 @item gnus-article-menu-hook
22184 @vindex gnus-article-menu-hook
22185 Hook called after creating the article mode menu.
22186
22187 @item gnus-group-menu-hook
22188 @vindex gnus-group-menu-hook
22189 Hook called after creating the group mode menu.
22190
22191 @item gnus-summary-menu-hook
22192 @vindex gnus-summary-menu-hook
22193 Hook called after creating the summary mode menu.
22194
22195 @item gnus-server-menu-hook
22196 @vindex gnus-server-menu-hook
22197 Hook called after creating the server mode menu.
22198
22199 @item gnus-browse-menu-hook
22200 @vindex gnus-browse-menu-hook
22201 Hook called after creating the browse mode menu.
22202
22203 @item gnus-score-menu-hook
22204 @vindex gnus-score-menu-hook
22205 Hook called after creating the score mode menu.
22206
22207 @end table
22208
22209
22210 @node Buttons
22211 @section Buttons
22212 @cindex buttons
22213 @cindex mouse
22214 @cindex click
22215
22216 Those new-fangled @dfn{mouse} contraptions is very popular with the
22217 young, hep kids who don't want to learn the proper way to do things
22218 these days.  Why, I remember way back in the summer of '89, when I was
22219 using Emacs on a Tops 20 system.  Three hundred users on one single
22220 machine, and every user was running Simula compilers.  Bah!
22221
22222 Right.
22223
22224 @vindex gnus-carpal
22225 Well, you can make Gnus display bufferfuls of buttons you can click to
22226 do anything by setting @code{gnus-carpal} to @code{t}.  Pretty simple,
22227 really.  Tell the chiropractor I sent you.
22228
22229
22230 @table @code
22231
22232 @item gnus-carpal-mode-hook
22233 @vindex gnus-carpal-mode-hook
22234 Hook run in all carpal mode buffers.
22235
22236 @item gnus-carpal-button-face
22237 @vindex gnus-carpal-button-face
22238 Face used on buttons.
22239
22240 @item gnus-carpal-header-face
22241 @vindex gnus-carpal-header-face
22242 Face used on carpal buffer headers.
22243
22244 @item gnus-carpal-group-buffer-buttons
22245 @vindex gnus-carpal-group-buffer-buttons
22246 Buttons in the group buffer.
22247
22248 @item gnus-carpal-summary-buffer-buttons
22249 @vindex gnus-carpal-summary-buffer-buttons
22250 Buttons in the summary buffer.
22251
22252 @item gnus-carpal-server-buffer-buttons
22253 @vindex gnus-carpal-server-buffer-buttons
22254 Buttons in the server buffer.
22255
22256 @item gnus-carpal-browse-buffer-buttons
22257 @vindex gnus-carpal-browse-buffer-buttons
22258 Buttons in the browse buffer.
22259 @end table
22260
22261 All the @code{buttons} variables are lists.  The elements in these list
22262 are either cons cells where the @code{car} contains a text to be displayed and
22263 the @code{cdr} contains a function symbol, or a simple string.
22264
22265
22266 @node Daemons
22267 @section Daemons
22268 @cindex demons
22269 @cindex daemons
22270
22271 Gnus, being larger than any program ever written (allegedly), does lots
22272 of strange stuff that you may wish to have done while you're not
22273 present.  For instance, you may want it to check for new mail once in a
22274 while.  Or you may want it to close down all connections to all servers
22275 when you leave Emacs idle.  And stuff like that.
22276
22277 Gnus will let you do stuff like that by defining various
22278 @dfn{handlers}.  Each handler consists of three elements:  A
22279 @var{function}, a @var{time}, and an @var{idle} parameter.
22280
22281 Here's an example of a handler that closes connections when Emacs has
22282 been idle for thirty minutes:
22283
22284 @lisp
22285 (gnus-demon-close-connections nil 30)
22286 @end lisp
22287
22288 Here's a handler that scans for @acronym{PGP} headers every hour when
22289 Emacs is idle:
22290
22291 @lisp
22292 (gnus-demon-scan-pgp 60 t)
22293 @end lisp
22294
22295 This @var{time} parameter and that @var{idle} parameter work together
22296 in a strange, but wonderful fashion.  Basically, if @var{idle} is
22297 @code{nil}, then the function will be called every @var{time} minutes.
22298
22299 If @var{idle} is @code{t}, then the function will be called after
22300 @var{time} minutes only if Emacs is idle.  So if Emacs is never idle,
22301 the function will never be called.  But once Emacs goes idle, the
22302 function will be called every @var{time} minutes.
22303
22304 If @var{idle} is a number and @var{time} is a number, the function will
22305 be called every @var{time} minutes only when Emacs has been idle for
22306 @var{idle} minutes.
22307
22308 If @var{idle} is a number and @var{time} is @code{nil}, the function
22309 will be called once every time Emacs has been idle for @var{idle}
22310 minutes.
22311
22312 And if @var{time} is a string, it should look like @samp{07:31}, and
22313 the function will then be called once every day somewhere near that
22314 time.  Modified by the @var{idle} parameter, of course.
22315
22316 @vindex gnus-demon-timestep
22317 (When I say ``minute'' here, I really mean @code{gnus-demon-timestep}
22318 seconds.  This is 60 by default.  If you change that variable,
22319 all the timings in the handlers will be affected.)
22320
22321 So, if you want to add a handler, you could put something like this in
22322 your @file{~/.gnus.el} file:
22323
22324 @findex gnus-demon-add-handler
22325 @lisp
22326 (gnus-demon-add-handler 'gnus-demon-close-connections 30 t)
22327 @end lisp
22328
22329 @findex gnus-demon-add-nocem
22330 @findex gnus-demon-add-scanmail
22331 @findex gnus-demon-add-rescan
22332 @findex gnus-demon-add-scan-timestamps
22333 @findex gnus-demon-add-disconnection
22334 Some ready-made functions to do this have been created:
22335 @code{gnus-demon-add-nocem}, @code{gnus-demon-add-disconnection},
22336 @code{gnus-demon-add-nntp-close-connection},
22337 @code{gnus-demon-add-scan-timestamps}, @code{gnus-demon-add-rescan}, and
22338 @code{gnus-demon-add-scanmail}.  Just put those functions in your
22339 @file{~/.gnus.el} if you want those abilities.
22340
22341 @findex gnus-demon-init
22342 @findex gnus-demon-cancel
22343 @vindex gnus-demon-handlers
22344 If you add handlers to @code{gnus-demon-handlers} directly, you should
22345 run @code{gnus-demon-init} to make the changes take hold.  To cancel all
22346 daemons, you can use the @code{gnus-demon-cancel} function.
22347
22348 Note that adding daemons can be pretty naughty if you over do it.  Adding
22349 functions that scan all news and mail from all servers every two seconds
22350 is a sure-fire way of getting booted off any respectable system.  So
22351 behave.
22352
22353
22354 @node NoCeM
22355 @section NoCeM
22356 @cindex nocem
22357 @cindex spam
22358
22359 @dfn{Spamming} is posting the same article lots and lots of times.
22360 Spamming is bad.  Spamming is evil.
22361
22362 Spamming is usually canceled within a day or so by various anti-spamming
22363 agencies.  These agencies usually also send out @dfn{NoCeM} messages.
22364 NoCeM is pronounced ``no see-'em'', and means what the name
22365 implies---these are messages that make the offending articles, like, go
22366 away.
22367
22368 What use are these NoCeM messages if the articles are canceled anyway?
22369 Some sites do not honor cancel messages and some sites just honor cancels
22370 from a select few people.  Then you may wish to make use of the NoCeM
22371 messages, which are distributed in the @samp{alt.nocem.misc} newsgroup.
22372
22373 Gnus can read and parse the messages in this group automatically, and
22374 this will make spam disappear.
22375
22376 There are some variables to customize, of course:
22377
22378 @table @code
22379 @item gnus-use-nocem
22380 @vindex gnus-use-nocem
22381 Set this variable to @code{t} to set the ball rolling.  It is @code{nil}
22382 by default.
22383
22384 You can also set this variable to a positive number as a group level.
22385 In that case, Gnus scans NoCeM messages when checking new news if this
22386 value is not exceeding a group level that you specify as the prefix
22387 argument to some commands, e.g. @code{gnus},
22388 @code{gnus-group-get-new-news}, etc.  Otherwise, Gnus does not scan
22389 NoCeM messages if you specify a group level to those commands.  For
22390 example, if you use 1 or 2 on the mail groups and the levels on the news
22391 groups remain the default, 3 is the best choice.
22392
22393 @item gnus-nocem-groups
22394 @vindex gnus-nocem-groups
22395 Gnus will look for NoCeM messages in the groups in this list.  The
22396 default is
22397 @lisp
22398 ("news.lists.filters" "news.admin.net-abuse.bulletins"
22399  "alt.nocem.misc" "news.admin.net-abuse.announce")
22400 @end lisp
22401
22402 @item gnus-nocem-issuers
22403 @vindex gnus-nocem-issuers
22404 There are many people issuing NoCeM messages.  This list says what
22405 people you want to listen to.  The default is
22406 @lisp
22407 ("Automoose-1" "clewis@@ferret.ocunix.on.ca"
22408  "cosmo.roadkill" "SpamHippo" "hweede@@snafu.de")
22409 @end lisp
22410 fine, upstanding citizens all of them.
22411
22412 Known despammers that you can put in this list are listed at@*
22413 @uref{http://www.xs4all.nl/~rosalind/nocemreg/nocemreg.html}.
22414
22415 You do not have to heed NoCeM messages from all these people---just the
22416 ones you want to listen to.  You also don't have to accept all NoCeM
22417 messages from the people you like.  Each NoCeM message has a @dfn{type}
22418 header that gives the message a (more or less, usually less) rigorous
22419 definition.  Common types are @samp{spam}, @samp{spew}, @samp{mmf},
22420 @samp{binary}, and @samp{troll}.  To specify this, you have to use
22421 @code{(@var{issuer} @var{conditions} @dots{})} elements in the list.
22422 Each condition is either a string (which is a regexp that matches types
22423 you want to use) or a list on the form @code{(not @var{string})}, where
22424 @var{string} is a regexp that matches types you don't want to use.
22425
22426 For instance, if you want all NoCeM messages from Chris Lewis except his
22427 @samp{troll} messages, you'd say:
22428
22429 @lisp
22430 ("clewis@@ferret.ocunix.on.ca" ".*" (not "troll"))
22431 @end lisp
22432
22433 On the other hand, if you just want nothing but his @samp{spam} and
22434 @samp{spew} messages, you'd say:
22435
22436 @lisp
22437 ("clewis@@ferret.ocunix.on.ca" (not ".*") "spew" "spam")
22438 @end lisp
22439
22440 The specs are applied left-to-right.
22441
22442
22443 @item gnus-nocem-verifyer
22444 @vindex gnus-nocem-verifyer
22445 @findex pgg-verify
22446 This should be a function for verifying that the NoCeM issuer is who she
22447 says she is.  The default is @code{pgg-verify}, which returns
22448 non-@code{nil} if the verification is successful, otherwise (including
22449 the case the NoCeM message was not signed) returns @code{nil}.  If this
22450 is too slow and you don't care for verification (which may be dangerous),
22451 you can set this variable to @code{nil}.
22452
22453 Formerly the default was @code{mc-verify}, which is a Mailcrypt
22454 function.  While you can still use it, you can change it into
22455 @code{pgg-verify} running with GnuPG if you are willing to add the
22456 @acronym{PGP} public keys to GnuPG's keyring.
22457
22458 @item gnus-nocem-directory
22459 @vindex gnus-nocem-directory
22460 This is where Gnus will store its NoCeM cache files.  The default is@*
22461 @file{~/News/NoCeM/}.
22462
22463 @item gnus-nocem-expiry-wait
22464 @vindex gnus-nocem-expiry-wait
22465 The number of days before removing old NoCeM entries from the cache.
22466 The default is 15.  If you make it shorter Gnus will be faster, but you
22467 might then see old spam.
22468
22469 @item gnus-nocem-check-from
22470 @vindex gnus-nocem-check-from
22471 Non-@code{nil} means check for valid issuers in message bodies.
22472 Otherwise don't bother fetching articles unless their author matches a
22473 valid issuer; that is much faster if you are selective about the
22474 issuers.
22475
22476 @item gnus-nocem-check-article-limit
22477 @vindex gnus-nocem-check-article-limit
22478 If non-@code{nil}, the maximum number of articles to check in any NoCeM
22479 group.  NoCeM groups can be huge and very slow to process.
22480
22481 @end table
22482
22483 Using NoCeM could potentially be a memory hog.  If you have many living
22484 (i. e., subscribed or unsubscribed groups), your Emacs process will grow
22485 big.  If this is a problem, you should kill off all (or most) of your
22486 unsubscribed groups (@pxref{Subscription Commands}).
22487
22488
22489 @node Undo
22490 @section Undo
22491 @cindex undo
22492
22493 It is very useful to be able to undo actions one has done.  In normal
22494 Emacs buffers, it's easy enough---you just push the @code{undo} button.
22495 In Gnus buffers, however, it isn't that simple.
22496
22497 The things Gnus displays in its buffer is of no value whatsoever to
22498 Gnus---it's all just data designed to look nice to the user.
22499 Killing a group in the group buffer with @kbd{C-k} makes the line
22500 disappear, but that's just a side-effect of the real action---the
22501 removal of the group in question from the internal Gnus structures.
22502 Undoing something like that can't be done by the normal Emacs
22503 @code{undo} function.
22504
22505 Gnus tries to remedy this somewhat by keeping track of what the user
22506 does and coming up with actions that would reverse the actions the user
22507 takes.  When the user then presses the @code{undo} key, Gnus will run
22508 the code to reverse the previous action, or the previous actions.
22509 However, not all actions are easily reversible, so Gnus currently offers
22510 a few key functions to be undoable.  These include killing groups,
22511 yanking groups, and changing the list of read articles of groups.
22512 That's it, really.  More functions may be added in the future, but each
22513 added function means an increase in data to be stored, so Gnus will
22514 never be totally undoable.
22515
22516 @findex gnus-undo-mode
22517 @vindex gnus-use-undo
22518 @findex gnus-undo
22519 The undoability is provided by the @code{gnus-undo-mode} minor mode.  It
22520 is used if @code{gnus-use-undo} is non-@code{nil}, which is the
22521 default.  The @kbd{C-M-_} key performs the @code{gnus-undo}
22522 command, which should feel kinda like the normal Emacs @code{undo}
22523 command.
22524
22525
22526 @node Predicate Specifiers
22527 @section Predicate Specifiers
22528 @cindex predicate specifiers
22529
22530 Some Gnus variables are @dfn{predicate specifiers}.  This is a special
22531 form that allows flexible specification of predicates without having
22532 to type all that much.
22533
22534 These specifiers are lists consisting of functions, symbols and lists.
22535
22536 Here's an example:
22537
22538 @lisp
22539 (or gnus-article-unseen-p
22540     gnus-article-unread-p)
22541 @end lisp
22542
22543 The available symbols are @code{or}, @code{and} and @code{not}.  The
22544 functions all take one parameter.
22545
22546 @findex gnus-make-predicate
22547 Internally, Gnus calls @code{gnus-make-predicate} on these specifiers
22548 to create a function that can be called.  This input parameter to this
22549 function will be passed along to all the functions in the predicate
22550 specifier.
22551
22552
22553 @node Moderation
22554 @section Moderation
22555 @cindex moderation
22556
22557 If you are a moderator, you can use the @file{gnus-mdrtn.el} package.
22558 It is not included in the standard Gnus package.  Write a mail to
22559 @samp{larsi@@gnus.org} and state what group you moderate, and you'll
22560 get a copy.
22561
22562 The moderation package is implemented as a minor mode for summary
22563 buffers.  Put
22564
22565 @lisp
22566 (add-hook 'gnus-summary-mode-hook 'gnus-moderate)
22567 @end lisp
22568
22569 in your @file{~/.gnus.el} file.
22570
22571 If you are the moderator of @samp{rec.zoofle}, this is how it's
22572 supposed to work:
22573
22574 @enumerate
22575 @item
22576 You split your incoming mail by matching on
22577 @samp{Newsgroups:.*rec.zoofle}, which will put all the to-be-posted
22578 articles in some mail group---for instance, @samp{nnml:rec.zoofle}.
22579
22580 @item
22581 You enter that group once in a while and post articles using the @kbd{e}
22582 (edit-and-post) or @kbd{s} (just send unedited) commands.
22583
22584 @item
22585 If, while reading the @samp{rec.zoofle} newsgroup, you happen upon some
22586 articles that weren't approved by you, you can cancel them with the
22587 @kbd{c} command.
22588 @end enumerate
22589
22590 To use moderation mode in these two groups, say:
22591
22592 @lisp
22593 (setq gnus-moderated-list
22594       "^nnml:rec.zoofle$\\|^rec.zoofle$")
22595 @end lisp
22596
22597
22598 @node Fetching a Group
22599 @section Fetching a Group
22600 @cindex fetching a group
22601
22602 @findex gnus-fetch-group
22603 It is sometimes convenient to be able to just say ``I want to read this
22604 group and I don't care whether Gnus has been started or not''.  This is
22605 perhaps more useful for people who write code than for users, but the
22606 command @code{gnus-fetch-group} provides this functionality in any case.
22607 It takes the group name as a parameter.
22608
22609
22610 @node Image Enhancements
22611 @section Image Enhancements
22612
22613 XEmacs, as well as Emacs 21@footnote{Emacs 21 on MS Windows doesn't
22614 support images yet.}, is able to display pictures and stuff, so Gnus has
22615 taken advantage of that.
22616
22617 @menu
22618 * X-Face::                      Display a funky, teensy black-and-white image.
22619 * Face::                        Display a funkier, teensier colored image.
22620 * Smileys::                     Show all those happy faces the way they were meant to be shown.
22621 * Picons::                      How to display pictures of what you're reading.
22622 * XVarious::                    Other XEmacsy Gnusey variables.
22623 @end menu
22624
22625
22626 @node X-Face
22627 @subsection X-Face
22628 @cindex x-face
22629
22630 @code{X-Face} headers describe a 48x48 pixel black-and-white (1 bit
22631 depth) image that's supposed to represent the author of the message.
22632 It seems to be supported by an ever-growing number of mail and news
22633 readers.
22634
22635 @cindex x-face
22636 @findex gnus-article-display-x-face
22637 @vindex gnus-article-x-face-command
22638 @vindex gnus-article-x-face-too-ugly
22639 @iftex
22640 @iflatex
22641 \include{xface}
22642 @end iflatex
22643 @end iftex
22644 @c @anchor{X-Face}
22645
22646 Viewing an @code{X-Face} header either requires an Emacs that has
22647 @samp{compface} support (which most XEmacs versions has), or that you
22648 have suitable conversion or display programs installed.  If your Emacs
22649 has image support the default action is to display the face before the
22650 @code{From} header.  If there's no native @code{X-Face} support, Gnus
22651 will try to convert the @code{X-Face} header using external programs
22652 from the @code{pbmplus} package and friends.  For XEmacs it's faster if
22653 XEmacs has been compiled with @code{X-Face} support.  The default action
22654 under Emacs without image support is to fork off the @code{display}
22655 program.
22656
22657 On a GNU/Linux system, the @code{display} program is from the
22658 ImageMagick package.  For external conversion programs look for packages
22659 with names like @code{netpbm}, @code{libgr-progs} and @code{compface}.
22660
22661 The variable that controls this is the
22662 @code{gnus-article-x-face-command} variable.  If this variable is a
22663 string, this string will be executed in a sub-shell.  If it is a
22664 function, this function will be called with the face as the argument.
22665 If the @code{gnus-article-x-face-too-ugly} (which is a regexp) matches
22666 the @code{From} header, the face will not be shown.
22667
22668 (Note: @code{x-face} is used in the variable/function names, not
22669 @code{xface}).
22670
22671 @noindent
22672 Face and variable:
22673
22674 @table @code
22675 @item gnus-x-face
22676 @vindex gnus-x-face
22677 Face to show X-Face.  The colors from this face are used as the
22678 foreground and background colors of the displayed X-Faces.  The
22679 default colors are black and white.
22680
22681 @item gnus-face-properties-alist
22682 @vindex gnus-face-properties-alist
22683 Alist of image types and properties applied to Face (@pxref{Face}) and
22684 X-Face images.  The default value is @code{((pbm . (:face gnus-x-face))
22685 (png . nil))} for Emacs or @code{((xface . (:face gnus-x-face)))} for
22686 XEmacs.  Here are examples:
22687
22688 @lisp
22689 ;; Specify the altitude of Face and X-Face images in the From header.
22690 (setq gnus-face-properties-alist
22691       '((pbm . (:face gnus-x-face :ascent 80))
22692         (png . (:ascent 80))))
22693
22694 ;; Show Face and X-Face images as pressed buttons.
22695 (setq gnus-face-properties-alist
22696       '((pbm . (:face gnus-x-face :relief -2))
22697         (png . (:relief -2))))
22698 @end lisp
22699
22700 @pxref{Image Descriptors, ,Image Descriptors, elisp, The Emacs Lisp
22701 Reference Manual} for the valid properties for various image types.
22702 Currently, @code{pbm} is used for X-Face images and @code{png} is used
22703 for Face images in Emacs.  Only the @code{:face} property is effective
22704 on the @code{xface} image type in XEmacs if it is built with the
22705 @samp{libcompface} library.
22706 @end table
22707
22708 If you use posting styles, you can use an @code{x-face-file} entry in
22709 @code{gnus-posting-styles}, @xref{Posting Styles}.  If you don't, Gnus
22710 provides a few convenience functions and variables to allow easier
22711 insertion of X-Face headers in outgoing messages.  You also need the
22712 above mentioned ImageMagick, netpbm or other image conversion packages
22713 (depending the values of the variables below) for these functions.
22714
22715 @findex gnus-random-x-face
22716 @vindex gnus-convert-pbm-to-x-face-command
22717 @vindex gnus-x-face-directory
22718 @code{gnus-random-x-face} goes through all the @samp{pbm} files in
22719 @code{gnus-x-face-directory} and picks one at random, and then
22720 converts it to the X-Face format by using the
22721 @code{gnus-convert-pbm-to-x-face-command} shell command.  The
22722 @samp{pbm} files should be 48x48 pixels big.  It returns the X-Face
22723 header data as a string.
22724
22725 @findex gnus-insert-random-x-face-header
22726 @code{gnus-insert-random-x-face-header} calls
22727 @code{gnus-random-x-face} and inserts a @samp{X-Face} header with the
22728 randomly generated data.
22729
22730 @findex gnus-x-face-from-file
22731 @vindex gnus-convert-image-to-x-face-command
22732 @code{gnus-x-face-from-file} takes a GIF file as the parameter, and then
22733 converts the file to X-Face format by using the
22734 @code{gnus-convert-image-to-x-face-command} shell command.
22735
22736 Here's how you would typically use the first function.  Put something
22737 like the following in your @file{~/.gnus.el} file:
22738
22739 @lisp
22740 (setq message-required-news-headers
22741       (nconc message-required-news-headers
22742              (list '(X-Face . gnus-random-x-face))))
22743 @end lisp
22744
22745 Using the last function would be something like this:
22746
22747 @lisp
22748 (setq message-required-news-headers
22749       (nconc message-required-news-headers
22750              (list '(X-Face . (lambda ()
22751                                 (gnus-x-face-from-file
22752                                  "~/My-face.gif"))))))
22753 @end lisp
22754
22755
22756 @node Face
22757 @subsection Face
22758 @cindex face
22759
22760 @c #### FIXME: faces and x-faces' implementations should really be harmonized.
22761
22762 @code{Face} headers are essentially a funkier version of @code{X-Face}
22763 ones. They describe a 48x48 pixel colored image that's supposed to
22764 represent the author of the message.
22765
22766 @cindex face
22767 @findex gnus-article-display-face
22768 The contents of a @code{Face} header must be a base64 encoded PNG image.
22769 See @uref{http://quimby.gnus.org/circus/face/} for the precise
22770 specifications.
22771
22772 The @code{gnus-face-properties-alist} variable affects the appearance of
22773 displayed Face images.  @xref{X-Face}.
22774
22775 Viewing an @code{Face} header requires an Emacs that is able to display
22776 PNG images.
22777 @c Maybe add this:
22778 @c (if (featurep 'xemacs)
22779 @c     (featurep 'png)
22780 @c   (image-type-available-p 'png))
22781
22782 Gnus provides a few convenience functions and variables to allow
22783 easier insertion of Face headers in outgoing messages.
22784
22785 @findex gnus-convert-png-to-face
22786 @code{gnus-convert-png-to-face} takes a 48x48 PNG image, no longer than
22787 726 bytes long, and converts it to a face.
22788
22789 @findex gnus-face-from-file
22790 @vindex gnus-convert-image-to-face-command
22791 @code{gnus-face-from-file} takes a JPEG file as the parameter, and then
22792 converts the file to Face format by using the
22793 @code{gnus-convert-image-to-face-command} shell command.
22794
22795 Here's how you would typically use this function. Put something like the
22796 following in your @file{~/.gnus.el} file:
22797
22798 @lisp
22799 (setq message-required-news-headers
22800       (nconc message-required-news-headers
22801              (list '(Face . (lambda ()
22802                               (gnus-face-from-file "~/face.jpg"))))))
22803 @end lisp
22804
22805
22806 @node Smileys
22807 @subsection Smileys
22808 @cindex smileys
22809
22810 @iftex
22811 @iflatex
22812 \gnusfig{-3cm}{0.5cm}{\epsfig{figure=ps/BigFace,height=20cm}}
22813 \input{smiley}
22814 @end iflatex
22815 @end iftex
22816
22817 @dfn{Smiley} is a package separate from Gnus, but since Gnus is
22818 currently the only package that uses Smiley, it is documented here.
22819
22820 In short---to use Smiley in Gnus, put the following in your
22821 @file{~/.gnus.el} file:
22822
22823 @lisp
22824 (setq gnus-treat-display-smileys t)
22825 @end lisp
22826
22827 Smiley maps text smiley faces---@samp{:-)}, @samp{8-)}, @samp{:-(} and
22828 the like---to pictures and displays those instead of the text smiley
22829 faces.  The conversion is controlled by a list of regexps that matches
22830 text and maps that to file names.
22831
22832 @vindex smiley-regexp-alist
22833 The alist used is specified by the @code{smiley-regexp-alist}
22834 variable.  The first item in each element is the regexp to be matched;
22835 the second element is the regexp match group that is to be replaced by
22836 the picture; and the third element is the name of the file to be
22837 displayed.
22838
22839 The following variables customize where Smiley will look for these
22840 files:
22841
22842 @table @code
22843
22844 @item smiley-data-directory
22845 @vindex smiley-data-directory
22846 Where Smiley will look for smiley faces files.
22847
22848 @item gnus-smiley-file-types
22849 @vindex gnus-smiley-file-types
22850 List of suffixes on smiley file names to try.
22851
22852 @end table
22853
22854
22855 @node Picons
22856 @subsection Picons
22857
22858 @iftex
22859 @iflatex
22860 \include{picons}
22861 @end iflatex
22862 @end iftex
22863
22864 So@dots{}  You want to slow down your news reader even more!  This is a
22865 good way to do so.  It's also a great way to impress people staring
22866 over your shoulder as you read news.
22867
22868 What are Picons?  To quote directly from the Picons Web site:
22869
22870 @iftex
22871 @iflatex
22872 \margindex{}
22873 @end iflatex
22874 @end iftex
22875
22876 @quotation
22877 @dfn{Picons} is short for ``personal icons''.  They're small,
22878 constrained images used to represent users and domains on the net,
22879 organized into databases so that the appropriate image for a given
22880 e-mail address can be found.  Besides users and domains, there are picon
22881 databases for Usenet newsgroups and weather forecasts.  The picons are
22882 in either monochrome @code{XBM} format or color @code{XPM} and
22883 @code{GIF} formats.
22884 @end quotation
22885
22886 @vindex gnus-picon-databases
22887 For instructions on obtaining and installing the picons databases,
22888 point your Web browser at
22889 @uref{http://www.cs.indiana.edu/picons/ftp/index.html}.
22890
22891 If you are using Debian GNU/Linux, saying @samp{apt-get install
22892 picons.*} will install the picons where Gnus can find them.
22893
22894 To enable displaying picons, simply make sure that
22895 @code{gnus-picon-databases} points to the directory containing the
22896 Picons databases.
22897
22898 @vindex gnus-picon-style
22899 The variable @code{gnus-picon-style} controls how picons are displayed.
22900 If @code{inline}, the textual representation is replaced.  If
22901 @code{right}, picons are added right to the textual representation.
22902
22903 The following variables offer control over where things are located.
22904
22905 @table @code
22906
22907 @item gnus-picon-databases
22908 @vindex gnus-picon-databases
22909 The location of the picons database.  This is a list of directories
22910 containing the @file{news}, @file{domains}, @file{users} (and so on)
22911 subdirectories.  Defaults to @code{("/usr/lib/picon"
22912 "/usr/local/faces")}.
22913
22914 @item gnus-picon-news-directories
22915 @vindex gnus-picon-news-directories
22916 List of subdirectories to search in @code{gnus-picon-databases} for
22917 newsgroups faces.  @code{("news")} is the default.
22918
22919 @item gnus-picon-user-directories
22920 @vindex gnus-picon-user-directories
22921 List of subdirectories to search in @code{gnus-picon-databases} for user
22922 faces.  @code{("users" "usenix" "local" "misc")} is the default.
22923
22924 @item gnus-picon-domain-directories
22925 @vindex gnus-picon-domain-directories
22926 List of subdirectories to search in @code{gnus-picon-databases} for
22927 domain name faces.  Defaults to @code{("domains")}.  Some people may
22928 want to add @samp{"unknown"} to this list.
22929
22930 @item gnus-picon-file-types
22931 @vindex gnus-picon-file-types
22932 Ordered list of suffixes on picon file names to try.  Defaults to
22933 @code{("xpm" "gif" "xbm")} minus those not built-in your Emacs.
22934
22935 @end table
22936
22937
22938 @node XVarious
22939 @subsection Various XEmacs Variables
22940
22941 @table @code
22942 @item gnus-xmas-glyph-directory
22943 @vindex gnus-xmas-glyph-directory
22944 This is where Gnus will look for pictures.  Gnus will normally
22945 auto-detect this directory, but you may set it manually if you have an
22946 unusual directory structure.
22947
22948 @item gnus-xmas-modeline-glyph
22949 @vindex gnus-xmas-modeline-glyph
22950 A glyph displayed in all Gnus mode lines.  It is a tiny gnu head by
22951 default.
22952
22953 @end table
22954
22955 @subsubsection Toolbar
22956
22957 @table @code
22958
22959 @item gnus-use-toolbar
22960 @vindex gnus-use-toolbar
22961 This variable specifies the position to display the toolbar.  If
22962 @code{nil}, don't display toolbars.  If it is non-@code{nil}, it should
22963 be one of the symbols @code{default}, @code{top}, @code{bottom},
22964 @code{right}, and @code{left}.  @code{default} means to use the default
22965 toolbar, the rest mean to display the toolbar on the place which those
22966 names show.  The default is @code{default}.
22967
22968 @item gnus-toolbar-thickness
22969 @vindex gnus-toolbar-thickness
22970 Cons of the height and the width specifying the thickness of a toolbar.
22971 The height is used for the toolbar displayed on the top or the bottom,
22972 the width is used for the toolbar displayed on the right or the left.
22973 The default is that of the default toolbar.
22974
22975 @item gnus-group-toolbar
22976 @vindex gnus-group-toolbar
22977 The toolbar in the group buffer.
22978
22979 @item gnus-summary-toolbar
22980 @vindex gnus-summary-toolbar
22981 The toolbar in the summary buffer.
22982
22983 @item gnus-summary-mail-toolbar
22984 @vindex gnus-summary-mail-toolbar
22985 The toolbar in the summary buffer of mail groups.
22986
22987 @end table
22988
22989 @iftex
22990 @iflatex
22991 \margindex{}
22992 @end iflatex
22993 @end iftex
22994
22995
22996 @node Fuzzy Matching
22997 @section Fuzzy Matching
22998 @cindex fuzzy matching
22999
23000 Gnus provides @dfn{fuzzy matching} of @code{Subject} lines when doing
23001 things like scoring, thread gathering and thread comparison.
23002
23003 As opposed to regular expression matching, fuzzy matching is very fuzzy.
23004 It's so fuzzy that there's not even a definition of what @dfn{fuzziness}
23005 means, and the implementation has changed over time.
23006
23007 Basically, it tries to remove all noise from lines before comparing.
23008 @samp{Re: }, parenthetical remarks, white space, and so on, are filtered
23009 out of the strings before comparing the results.  This often leads to
23010 adequate results---even when faced with strings generated by text
23011 manglers masquerading as newsreaders.
23012
23013
23014 @node Thwarting Email Spam
23015 @section Thwarting Email Spam
23016 @cindex email spam
23017 @cindex spam
23018 @cindex UCE
23019 @cindex unsolicited commercial email
23020
23021 In these last days of the Usenet, commercial vultures are hanging about
23022 and grepping through news like crazy to find email addresses they can
23023 foist off their scams and products to.  As a reaction to this, many
23024 people have started putting nonsense addresses into their @code{From}
23025 lines.  I think this is counterproductive---it makes it difficult for
23026 people to send you legitimate mail in response to things you write, as
23027 well as making it difficult to see who wrote what.  This rewriting may
23028 perhaps be a bigger menace than the unsolicited commercial email itself
23029 in the end.
23030
23031 The biggest problem I have with email spam is that it comes in under
23032 false pretenses.  I press @kbd{g} and Gnus merrily informs me that I
23033 have 10 new emails.  I say ``Golly gee!  Happy is me!'' and select the
23034 mail group, only to find two pyramid schemes, seven advertisements
23035 (``New!  Miracle tonic for growing full, lustrous hair on your toes!'')
23036 and one mail asking me to repent and find some god.
23037
23038 This is annoying.  Here's what you can do about it.
23039
23040 @menu
23041 * The problem of spam::         Some background, and some solutions
23042 * Anti-Spam Basics::            Simple steps to reduce the amount of spam.
23043 * SpamAssassin::                How to use external anti-spam tools.
23044 * Hashcash::                    Reduce spam by burning CPU time.
23045 * Filtering Spam Using The Spam ELisp Package::
23046 * Filtering Spam Using Statistics with spam-stat::
23047 @end menu
23048
23049 @node The problem of spam
23050 @subsection The problem of spam
23051 @cindex email spam
23052 @cindex spam filtering approaches
23053 @cindex filtering approaches, spam
23054 @cindex UCE
23055 @cindex unsolicited commercial email
23056
23057 First, some background on spam.
23058
23059 If you have access to e-mail, you are familiar with spam (technically
23060 termed @acronym{UCE}, Unsolicited Commercial E-mail).  Simply put, it
23061 exists because e-mail delivery is very cheap compared to paper mail,
23062 so only a very small percentage of people need to respond to an UCE to
23063 make it worthwhile to the advertiser.  Ironically, one of the most
23064 common spams is the one offering a database of e-mail addresses for
23065 further spamming.  Senders of spam are usually called @emph{spammers},
23066 but terms like @emph{vermin}, @emph{scum}, @emph{sociopaths}, and
23067 @emph{morons} are in common use as well.
23068
23069 Spam comes from a wide variety of sources.  It is simply impossible to
23070 dispose of all spam without discarding useful messages.  A good
23071 example is the TMDA system, which requires senders
23072 unknown to you to confirm themselves as legitimate senders before
23073 their e-mail can reach you.  Without getting into the technical side
23074 of TMDA, a downside is clearly that e-mail from legitimate sources may
23075 be discarded if those sources can't or won't confirm themselves
23076 through the TMDA system.  Another problem with TMDA is that it
23077 requires its users to have a basic understanding of e-mail delivery
23078 and processing.
23079
23080 The simplest approach to filtering spam is filtering, at the mail
23081 server or when you sort through incoming mail.  If you get 200 spam
23082 messages per day from @samp{random-address@@vmadmin.com}, you block
23083 @samp{vmadmin.com}.  If you get 200 messages about @samp{VIAGRA}, you
23084 discard all messages with @samp{VIAGRA} in the message.  If you get
23085 lots of spam from Bulgaria, for example, you try to filter all mail
23086 from Bulgarian IPs.
23087
23088 This, unfortunately, is a great way to discard legitimate e-mail.  The
23089 risks of blocking a whole country (Bulgaria, Norway, Nigeria, China,
23090 etc.) or even a continent (Asia, Africa, Europe, etc.) from contacting
23091 you should be obvious, so don't do it if you have the choice.
23092
23093 In another instance, the very informative and useful RISKS digest has
23094 been blocked by overzealous mail filters because it @strong{contained}
23095 words that were common in spam messages.  Nevertheless, in isolated
23096 cases, with great care, direct filtering of mail can be useful.
23097
23098 Another approach to filtering e-mail is the distributed spam
23099 processing, for instance DCC implements such a system.  In essence,
23100 @var{N} systems around the world agree that a machine @var{X} in
23101 Ghana, Estonia, or California is sending out spam e-mail, and these
23102 @var{N} systems enter @var{X} or the spam e-mail from @var{X} into a
23103 database.  The criteria for spam detection vary---it may be the number
23104 of messages sent, the content of the messages, and so on.  When a user
23105 of the distributed processing system wants to find out if a message is
23106 spam, he consults one of those @var{N} systems.
23107
23108 Distributed spam processing works very well against spammers that send
23109 a large number of messages at once, but it requires the user to set up
23110 fairly complicated checks.  There are commercial and free distributed
23111 spam processing systems.  Distributed spam processing has its risks as
23112 well.  For instance legitimate e-mail senders have been accused of
23113 sending spam, and their web sites and mailing lists have been shut
23114 down for some time because of the incident.
23115
23116 The statistical approach to spam filtering is also popular.  It is
23117 based on a statistical analysis of previous spam messages.  Usually
23118 the analysis is a simple word frequency count, with perhaps pairs of
23119 words or 3-word combinations thrown into the mix.  Statistical
23120 analysis of spam works very well in most of the cases, but it can
23121 classify legitimate e-mail as spam in some cases.  It takes time to
23122 run the analysis, the full message must be analyzed, and the user has
23123 to store the database of spam analyses.  Statistical analysis on the
23124 server is gaining popularity.  This has the advantage of letting the
23125 user Just Read Mail, but has the disadvantage that it's harder to tell
23126 the server that it has misclassified mail.
23127
23128 Fighting spam is not easy, no matter what anyone says.  There is no
23129 magic switch that will distinguish Viagra ads from Mom's e-mails.
23130 Even people are having a hard time telling spam apart from non-spam,
23131 because spammers are actively looking to fool us into thinking they
23132 are Mom, essentially.  Spamming is irritating, irresponsible, and
23133 idiotic behavior from a bunch of people who think the world owes them
23134 a favor.  We hope the following sections will help you in fighting the
23135 spam plague.
23136
23137 @node Anti-Spam Basics
23138 @subsection Anti-Spam Basics
23139 @cindex email spam
23140 @cindex spam
23141 @cindex UCE
23142 @cindex unsolicited commercial email
23143
23144 One way of dealing with spam is having Gnus split out all spam into a
23145 @samp{spam} mail group (@pxref{Splitting Mail}).
23146
23147 First, pick one (1) valid mail address that you can be reached at, and
23148 put it in your @code{From} header of all your news articles.  (I've
23149 chosen @samp{larsi@@trym.ifi.uio.no}, but for many addresses on the form
23150 @samp{larsi+usenet@@ifi.uio.no} will be a better choice.  Ask your
23151 sysadmin whether your sendmail installation accepts keywords in the local
23152 part of the mail address.)
23153
23154 @lisp
23155 (setq message-default-news-headers
23156       "From: Lars Magne Ingebrigtsen <larsi@@trym.ifi.uio.no>\n")
23157 @end lisp
23158
23159 Then put the following split rule in @code{nnmail-split-fancy}
23160 (@pxref{Fancy Mail Splitting}):
23161
23162 @lisp
23163 (...
23164  (to "larsi@@trym.ifi.uio.no"
23165      (| ("subject" "re:.*" "misc")
23166         ("references" ".*@@.*" "misc")
23167         "spam"))
23168  ...)
23169 @end lisp
23170
23171 This says that all mail to this address is suspect, but if it has a
23172 @code{Subject} that starts with a @samp{Re:} or has a @code{References}
23173 header, it's probably ok.  All the rest goes to the @samp{spam} group.
23174 (This idea probably comes from Tim Pierce.)
23175
23176 In addition, many mail spammers talk directly to your @acronym{SMTP} server
23177 and do not include your email address explicitly in the @code{To}
23178 header.  Why they do this is unknown---perhaps it's to thwart this
23179 thwarting scheme?  In any case, this is trivial to deal with---you just
23180 put anything not addressed to you in the @samp{spam} group by ending
23181 your fancy split rule in this way:
23182
23183 @lisp
23184 (
23185  ...
23186  (to "larsi" "misc")
23187  "spam")
23188 @end lisp
23189
23190 In my experience, this will sort virtually everything into the right
23191 group.  You still have to check the @samp{spam} group from time to time to
23192 check for legitimate mail, though.  If you feel like being a good net
23193 citizen, you can even send off complaints to the proper authorities on
23194 each unsolicited commercial email---at your leisure.
23195
23196 This works for me.  It allows people an easy way to contact me (they can
23197 just press @kbd{r} in the usual way), and I'm not bothered at all with
23198 spam.  It's a win-win situation.  Forging @code{From} headers to point
23199 to non-existent domains is yucky, in my opinion.
23200
23201 Be careful with this approach.  Spammers are wise to it.
23202
23203
23204 @node SpamAssassin
23205 @subsection SpamAssassin, Vipul's Razor, DCC, etc
23206 @cindex SpamAssassin
23207 @cindex Vipul's Razor
23208 @cindex DCC
23209
23210 The days where the hints in the previous section were sufficient in
23211 avoiding spam are coming to an end.  There are many tools out there
23212 that claim to reduce the amount of spam you get.  This section could
23213 easily become outdated fast, as new products replace old, but
23214 fortunately most of these tools seem to have similar interfaces.  Even
23215 though this section will use SpamAssassin as an example, it should be
23216 easy to adapt it to most other tools.
23217
23218 Note that this section does not involve the @code{spam.el} package,
23219 which is discussed in the next section.  If you don't care for all
23220 the features of @code{spam.el}, you can make do with these simple
23221 recipes.
23222
23223 If the tool you are using is not installed on the mail server, you
23224 need to invoke it yourself.  Ideas on how to use the
23225 @code{:postscript} mail source parameter (@pxref{Mail Source
23226 Specifiers}) follow.
23227
23228 @lisp
23229 (setq mail-sources
23230       '((file :prescript "formail -bs spamassassin < /var/mail/%u")
23231         (pop :user "jrl"
23232              :server "pophost"
23233              :postscript
23234              "mv %t /tmp/foo; formail -bs spamc < /tmp/foo > %t")))
23235 @end lisp
23236
23237 Once you manage to process your incoming spool somehow, thus making
23238 the mail contain e.g.@: a header indicating it is spam, you are ready to
23239 filter it out.  Using normal split methods (@pxref{Splitting Mail}):
23240
23241 @lisp
23242 (setq nnmail-split-methods '(("spam"  "^X-Spam-Flag: YES")
23243                              ...))
23244 @end lisp
23245
23246 Or using fancy split methods (@pxref{Fancy Mail Splitting}):
23247
23248 @lisp
23249 (setq nnmail-split-methods 'nnmail-split-fancy
23250       nnmail-split-fancy '(| ("X-Spam-Flag" "YES" "spam")
23251                              ...))
23252 @end lisp
23253
23254 Some people might not like the idea of piping the mail through various
23255 programs using a @code{:prescript} (if some program is buggy, you
23256 might lose all mail).  If you are one of them, another solution is to
23257 call the external tools during splitting.  Example fancy split method:
23258
23259 @lisp
23260 (setq nnmail-split-fancy '(| (: kevin-spamassassin)
23261                              ...))
23262 (defun kevin-spamassassin ()
23263   (save-excursion
23264     (save-restriction
23265       (widen)
23266       (if (eq 1 (call-process-region (point-min) (point-max)
23267                                      "spamc" nil nil nil "-c"))
23268           "spam"))))
23269 @end lisp
23270
23271 Note that with the nnimap back end, message bodies will not be
23272 downloaded by default.  You need to set
23273 @code{nnimap-split-download-body} to @code{t} to do that
23274 (@pxref{Splitting in IMAP}).
23275
23276 That is about it.  As some spam is likely to get through anyway, you
23277 might want to have a nifty function to call when you happen to read
23278 spam.  And here is the nifty function:
23279
23280 @lisp
23281  (defun my-gnus-raze-spam ()
23282   "Submit SPAM to Vipul's Razor, then mark it as expirable."
23283   (interactive)
23284   (gnus-summary-show-raw-article)
23285   (gnus-summary-save-in-pipe "razor-report -f -d")
23286   (gnus-summary-mark-as-expirable 1))
23287 @end lisp
23288
23289 @node Hashcash
23290 @subsection Hashcash
23291 @cindex hashcash
23292
23293 A novel technique to fight spam is to require senders to do something
23294 costly and demonstrably unique for each message they send.  This has
23295 the obvious drawback that you cannot rely on everyone in the world
23296 using this technique, since it is not part of the Internet standards,
23297 but it may be useful in smaller communities.
23298
23299 While the tools in the previous section work well in practice, they
23300 work only because the tools are constantly maintained and updated as
23301 new form of spam appears.  This means that a small percentage of spam
23302 will always get through.  It also means that somewhere, someone needs
23303 to read lots of spam to update these tools.  Hashcash avoids that, but
23304 instead prefers that everyone you contact through e-mail supports the
23305 scheme.  You can view the two approaches as pragmatic vs dogmatic.
23306 The approaches have their own advantages and disadvantages, but as
23307 often in the real world, a combination of them is stronger than either
23308 one of them separately.
23309
23310 @cindex X-Hashcash
23311 The ``something costly'' is to burn CPU time, more specifically to
23312 compute a hash collision up to a certain number of bits.  The
23313 resulting hashcash cookie is inserted in a @samp{X-Hashcash:} header.
23314 For more details, and for the external application @code{hashcash} you
23315 need to install to use this feature, see
23316 @uref{http://www.hashcash.org/}.  Even more information can be found
23317 at @uref{http://www.camram.org/}.
23318
23319 If you wish to generate hashcash for each message you send, you can
23320 customize @code{message-generate-hashcash} (@pxref{Mail Headers, ,Mail
23321 Headers,message, The Message Manual}), as in:
23322
23323 @lisp
23324 (setq message-generate-hashcash t)
23325 @end lisp
23326
23327 You will need to set up some additional variables as well:
23328
23329 @table @code
23330
23331 @item hashcash-default-payment
23332 @vindex hashcash-default-payment
23333 This variable indicates the default number of bits the hash collision
23334 should consist of.  By default this is 20.  Suggested useful values
23335 include 17 to 29.
23336
23337 @item hashcash-payment-alist
23338 @vindex hashcash-payment-alist
23339 Some receivers may require you to spend burn more CPU time than the
23340 default.  This variable contains a list of @samp{(@var{addr}
23341 @var{amount})} cells, where @var{addr} is the receiver (email address
23342 or newsgroup) and @var{amount} is the number of bits in the collision
23343 that is needed.  It can also contain @samp{(@var{addr} @var{string}
23344 @var{amount})} cells, where the @var{string} is the string to use
23345 (normally the email address or newsgroup name is used).
23346
23347 @item hashcash-path
23348 @vindex hashcash-path
23349 Where the @code{hashcash} binary is installed.  This variable should
23350 be automatically set by @code{executable-find}, but if it's @code{nil}
23351 (usually because the @code{hashcash} binary is not in your path)
23352 you'll get a warning when you check hashcash payments and an error
23353 when you generate hashcash payments.
23354
23355 @end table
23356
23357 Gnus can verify hashcash cookies, although this can also be done by
23358 hand customized mail filtering scripts.  To verify a hashcash cookie
23359 in a message, use the @code{mail-check-payment} function in the
23360 @code{hashcash.el} library.  You can also use the @code{spam.el}
23361 package with the @code{spam-use-hashcash} back end to validate hashcash
23362 cookies in incoming mail and filter mail accordingly (@pxref{Anti-spam
23363 Hashcash Payments}).
23364
23365 @node Filtering Spam Using The Spam ELisp Package
23366 @subsection Filtering Spam Using The Spam ELisp Package
23367 @cindex spam filtering
23368 @cindex spam
23369
23370 The idea behind @code{spam.el} is to have a control center for spam detection
23371 and filtering in Gnus.  To that end, @code{spam.el} does two things: it
23372 filters new mail, and it analyzes mail known to be spam or ham.
23373 @dfn{Ham} is the name used throughout @code{spam.el} to indicate
23374 non-spam messages.
23375
23376 Make sure you read the section on the @code{spam.el} sequence of
23377 events.  See @xref{Spam ELisp Package Sequence of Events}.
23378
23379 @cindex spam-initialize
23380 To use @code{spam.el}, you @strong{must} run the function
23381 @code{spam-initialize} to autoload @file{spam.el} and to install the
23382 @code{spam.el} hooks.  There is one exception: if you use the
23383 @code{spam-use-stat} (@pxref{spam-stat spam filtering}) setting, you
23384 should turn it on before @code{spam-initialize}:
23385
23386 @example
23387 (setq spam-use-stat t) ;; if needed
23388 (spam-initialize)
23389 @end example
23390
23391 So, what happens when you load @file{spam.el}?
23392
23393 First, some hooks will get installed by @code{spam-initialize}.  There
23394 are some hooks for @code{spam-stat} so it can save its databases, and
23395 there are hooks so interesting things will happen when you enter and
23396 leave a group.  More on the sequence of events later (@pxref{Spam
23397 ELisp Package Sequence of Events}).
23398
23399 You get the following keyboard commands:
23400
23401 @table @kbd
23402
23403 @item M-d
23404 @itemx M s x
23405 @itemx S x
23406 @kindex M-d
23407 @kindex S x
23408 @kindex M s x
23409 @findex gnus-summary-mark-as-spam
23410 @code{gnus-summary-mark-as-spam}.
23411
23412 Mark current article as spam, showing it with the @samp{$} mark.
23413 Whenever you see a spam article, make sure to mark its summary line
23414 with @kbd{M-d} before leaving the group.  This is done automatically
23415 for unread articles in @emph{spam} groups.
23416
23417 @item M s t
23418 @itemx S t
23419 @kindex M s t
23420 @kindex S t
23421 @findex spam-bogofilter-score
23422 @code{spam-bogofilter-score}.
23423
23424 You must have Bogofilter installed for that command to work properly.
23425
23426 @xref{Bogofilter}.
23427
23428 @end table
23429
23430 Also, when you load @file{spam.el}, you will be able to customize its
23431 variables.  Try @code{customize-group} on the @samp{spam} variable
23432 group.
23433
23434 @menu
23435 * Spam ELisp Package Sequence of Events::
23436 * Spam ELisp Package Filtering of Incoming Mail::
23437 * Spam ELisp Package Global Variables::
23438 * Spam ELisp Package Sorting and Score Display in Summary Buffer::
23439 * Spam ELisp Package Configuration Examples::
23440 * Blacklists and Whitelists::
23441 * BBDB Whitelists::
23442 * Gmane Spam Reporting::
23443 * Anti-spam Hashcash Payments::
23444 * Blackholes::
23445 * Regular Expressions Header Matching::
23446 * Bogofilter::
23447 * SpamAssassin back end::
23448 * ifile spam filtering::
23449 * spam-stat spam filtering::
23450 * SpamOracle::
23451 * Extending the Spam ELisp package::
23452 @end menu
23453
23454 @node Spam ELisp Package Sequence of Events
23455 @subsubsection Spam ELisp Package Sequence of Events
23456 @cindex spam filtering
23457 @cindex spam filtering sequence of events
23458 @cindex spam
23459 You must read this section to understand how @code{spam.el} works.
23460 Do not skip, speed-read, or glance through this section.
23461
23462 There are two @emph{contact points}, if you will, between
23463 @code{spam.el} and the rest of Gnus: checking new mail for spam, and
23464 leaving a group.
23465
23466 Getting new mail in Gnus is done in one of two ways.  You can either
23467 split your incoming mail or you can classify new articles as ham or
23468 spam when you enter the group.
23469
23470 Splitting incoming mail is better suited to mail back ends such as
23471 @code{nnml} or @code{nnimap} where new mail appears in a single file
23472 called a @dfn{Spool File}.  See @xref{Spam ELisp Package Filtering of
23473 Incoming Mail}.
23474
23475 @vindex gnus-spam-autodetect
23476 @vindex gnus-spam-autodetect-methods
23477 For back ends such as @code{nntp} there is no incoming mail spool, so
23478 an alternate mechanism must be used.  This may also happen for
23479 back ends where the server is in charge of splitting incoming mail, and
23480 Gnus does not do further splitting.  The @code{spam-autodetect} and
23481 @code{spam-autodetect-methods} group parameters (accessible with
23482 @kbd{G c} and @kbd{G p} as usual), and the corresponding variables
23483 @code{gnus-spam-autodetect} and @code{gnus-spam-autodetect-methods}
23484 (accessible with @kbd{M-x customize-variable} as usual) can help.
23485
23486 When @code{spam-autodetect} is used (you can turn it on for a
23487 group/topic or wholesale by regular expression matches, as needed), it
23488 hooks into the process of entering a group.  Thus, entering a group
23489 with unseen or unread articles becomes the substitute for checking
23490 incoming mail.  Whether only unseen articles or all unread articles
23491 will be processed is determined by the
23492 @code{spam-autodetect-recheck-messages}.  When set to @code{t}, unread
23493 messages will be rechecked.  You should probably stick with the
23494 default of only checking unseen messages.
23495
23496 @code{spam-autodetect} grants the user at once more and less control
23497 of spam filtering.  The user will have more control over each group's
23498 spam methods, so for instance the @samp{ding} group may have
23499 @code{spam-use-BBDB} as the autodetection method, while the
23500 @samp{suspect} group may have the @code{spam-use-blacklist} and
23501 @code{spam-use-bogofilter} methods enabled.  Every article detected to
23502 be spam will be marked with the spam mark @samp{$} and processed on
23503 exit from the group as normal spam.  The user has less control over
23504 the @emph{sequence} of checks, as he might with @code{spam-split}.
23505
23506 When the newly split mail goes into groups, or messages are
23507 autodetected to be ham or spam, those groups must be exited (after
23508 entering, if needed) for further spam processing to happen.  It
23509 matters whether the group is considered a ham group, a spam group, or
23510 is unclassified, based on its @code{spam-content} parameter
23511 (@pxref{Spam ELisp Package Global Variables}).  Spam groups have the
23512 additional characteristic that, when entered, any unseen or unread
23513 articles (depending on the @code{spam-mark-only-unseen-as-spam}
23514 variable) will be marked as spam.  Thus, mail split into a spam group
23515 gets automatically marked as spam when you enter the group.
23516
23517 Thus, when you exit a group, the @code{spam-processors} are applied,
23518 if any are set, and the processed mail is moved to the
23519 @code{ham-process-destination} or the @code{spam-process-destination}
23520 depending on the article's classification.  If the
23521 @code{ham-process-destination} or the @code{spam-process-destination},
23522 whichever is appropriate, are @code{nil}, the article is left in the
23523 current group.
23524
23525 If a spam is found in any group (this can be changed to only non-spam
23526 groups with @code{spam-move-spam-nonspam-groups-only}), it is
23527 processed by the active @code{spam-processors} (@pxref{Spam ELisp
23528 Package Global Variables}) when the group is exited.  Furthermore, the
23529 spam is moved to the @code{spam-process-destination} (@pxref{Spam
23530 ELisp Package Global Variables}) for further training or deletion.
23531 You have to load the @code{gnus-registry.el} package and enable the
23532 @code{spam-log-to-registry} variable if you want spam to be processed
23533 no more than once.  Thus, spam is detected and processed everywhere,
23534 which is what most people want.  If the
23535 @code{spam-process-destination} is @code{nil}, the spam is marked as
23536 expired, which is usually the right thing to do.
23537
23538 If spam can not be moved---because of a read-only back end such as
23539 @acronym{NNTP}, for example, it will be copied.
23540
23541 If a ham mail is found in a ham group, as determined by the
23542 @code{ham-marks} parameter, it is processed as ham by the active ham
23543 @code{spam-processor} when the group is exited.  With the variables
23544 @code{spam-process-ham-in-spam-groups} and
23545 @code{spam-process-ham-in-nonham-groups} the behavior can be further
23546 altered so ham found anywhere can be processed.  You have to load the
23547 @code{gnus-registry.el} package and enable the
23548 @code{spam-log-to-registry} variable if you want ham to be processed
23549 no more than once.  Thus, ham is detected and processed only when
23550 necessary, which is what most people want.  More on this in
23551 @xref{Spam ELisp Package Configuration Examples}.
23552
23553 If ham can not be moved---because of a read-only back end such as
23554 @acronym{NNTP}, for example, it will be copied.
23555
23556 If all this seems confusing, don't worry.  Soon it will be as natural
23557 as typing Lisp one-liners on a neural interface@dots{} err, sorry, that's
23558 50 years in the future yet.  Just trust us, it's not so bad.
23559
23560 @node Spam ELisp Package Filtering of Incoming Mail
23561 @subsubsection Spam ELisp Package Filtering of Incoming Mail
23562 @cindex spam filtering
23563 @cindex spam filtering incoming mail
23564 @cindex spam
23565
23566 To use the @code{spam.el} facilities for incoming mail filtering, you
23567 must add the following to your fancy split list
23568 @code{nnmail-split-fancy} or @code{nnimap-split-fancy}:
23569
23570 @example
23571 (: spam-split)
23572 @end example
23573
23574 Note that the fancy split may be called @code{nnmail-split-fancy} or
23575 @code{nnimap-split-fancy}, depending on whether you use the nnmail or
23576 nnimap back ends to retrieve your mail.
23577
23578 Also, @code{spam-split} will not modify incoming mail in any way.
23579
23580 The @code{spam-split} function will process incoming mail and send the
23581 mail considered to be spam into the group name given by the variable
23582 @code{spam-split-group}.  By default that group name is @samp{spam},
23583 but you can customize @code{spam-split-group}.  Make sure the contents
23584 of @code{spam-split-group} are an @emph{unqualified} group name, for
23585 instance in an @code{nnimap} server @samp{your-server} the value
23586 @samp{spam} will turn out to be @samp{nnimap+your-server:spam}.  The
23587 value @samp{nnimap+server:spam}, therefore, is wrong and will
23588 actually give you the group
23589 @samp{nnimap+your-server:nnimap+server:spam} which may or may not
23590 work depending on your server's tolerance for strange group names.
23591
23592 You can also give @code{spam-split} a parameter,
23593 e.g. @code{spam-use-regex-headers} or @code{"maybe-spam"}.  Why is
23594 this useful?
23595
23596 Take these split rules (with @code{spam-use-regex-headers} and
23597 @code{spam-use-blackholes} set):
23598
23599 @example
23600  nnimap-split-fancy '(|
23601                       (any "ding" "ding")
23602                       (: spam-split)
23603                       ;; @r{default mailbox}
23604                       "mail")
23605 @end example
23606
23607 Now, the problem is that you want all ding messages to make it to the
23608 ding folder.  But that will let obvious spam (for example, spam
23609 detected by SpamAssassin, and @code{spam-use-regex-headers}) through,
23610 when it's sent to the ding list.  On the other hand, some messages to
23611 the ding list are from a mail server in the blackhole list, so the
23612 invocation of @code{spam-split} can't be before the ding rule.
23613
23614 You can let SpamAssassin headers supersede ding rules, but all other
23615 @code{spam-split} rules (including a second invocation of the
23616 regex-headers check) will be after the ding rule:
23617
23618 @example
23619 nnimap-split-fancy
23620       '(|
23621         ;; @r{all spam detected by @code{spam-use-regex-headers} goes to @samp{regex-spam}}
23622         (: spam-split "regex-spam" 'spam-use-regex-headers)
23623         (any "ding" "ding")
23624         ;; @r{all other spam detected by spam-split goes to @code{spam-split-group}}
23625         (: spam-split)
23626         ;; @r{default mailbox}
23627         "mail")
23628 @end example
23629
23630 This lets you invoke specific @code{spam-split} checks depending on
23631 your particular needs, and to target the results of those checks to a
23632 particular spam group.  You don't have to throw all mail into all the
23633 spam tests.  Another reason why this is nice is that messages to
23634 mailing lists you have rules for don't have to have resource-intensive
23635 blackhole checks performed on them.  You could also specify different
23636 spam checks for your nnmail split vs. your nnimap split.  Go crazy.
23637
23638 You should still have specific checks such as
23639 @code{spam-use-regex-headers} set to @code{t}, even if you
23640 specifically invoke @code{spam-split} with the check.  The reason is
23641 that when loading @file{spam.el}, some conditional loading is done
23642 depending on what @code{spam-use-xyz} variables you have set.  This
23643 is usually not critical, though.
23644
23645 @emph{Note for IMAP users}
23646
23647 The boolean variable @code{nnimap-split-download-body} needs to be
23648 set, if you want to split based on the whole message instead of just
23649 the headers.  By default, the nnimap back end will only retrieve the
23650 message headers.  If you use a @emph{statistical} filter,
23651 e.g. @code{spam-check-bogofilter}, @code{spam-check-ifile}, or
23652 @code{spam-check-stat} (the splitters that can benefit from the full
23653 message body), this variable will be set automatically.  It is not set
23654 for non-statistical back ends by default because it will slow
23655 @acronym{IMAP} down.
23656
23657 @xref{Splitting in IMAP}.
23658
23659 @node Spam ELisp Package Global Variables
23660 @subsubsection Spam ELisp Package Global Variables
23661 @cindex spam filtering
23662 @cindex spam filtering variables
23663 @cindex spam variables
23664 @cindex spam
23665
23666 @vindex gnus-spam-process-newsgroups
23667 The concepts of ham processors and spam processors are very important.
23668 Ham processors and spam processors for a group can be set with the
23669 @code{spam-process} group parameter, or the
23670 @code{gnus-spam-process-newsgroups} variable.  Ham processors take
23671 mail known to be non-spam (@emph{ham}) and process it in some way so
23672 that later similar mail will also be considered non-spam.  Spam
23673 processors take mail known to be spam and process it so similar spam
23674 will be detected later.
23675
23676 The format of the spam or ham processor entry used to be a symbol,
23677 but now it is a @sc{cons} cell.  See the individual spam processor entries
23678 for more information.
23679
23680 @vindex gnus-spam-newsgroup-contents
23681 Gnus learns from the spam you get.  You have to collect your spam in
23682 one or more spam groups, and set or customize the variable
23683 @code{spam-junk-mailgroups} as appropriate.  You can also declare
23684 groups to contain spam by setting their group parameter
23685 @code{spam-contents} to @code{gnus-group-spam-classification-spam}, or
23686 by customizing the corresponding variable
23687 @code{gnus-spam-newsgroup-contents}.  The @code{spam-contents} group
23688 parameter and the @code{gnus-spam-newsgroup-contents} variable can
23689 also be used to declare groups as @emph{ham} groups if you set their
23690 classification to @code{gnus-group-spam-classification-ham}.  If
23691 groups are not classified by means of @code{spam-junk-mailgroups},
23692 @code{spam-contents}, or @code{gnus-spam-newsgroup-contents}, they are
23693 considered @emph{unclassified}.  All groups are unclassified by
23694 default.
23695
23696 @vindex gnus-spam-mark
23697 @cindex $
23698 In spam groups, all messages are considered to be spam by default:
23699 they get the @samp{$} mark (@code{gnus-spam-mark}) when you enter the
23700 group.  If you have seen a message, had it marked as spam, then
23701 unmarked it, it won't be marked as spam when you enter the group
23702 thereafter.  You can disable that behavior, so all unread messages
23703 will get the @samp{$} mark, if you set the
23704 @code{spam-mark-only-unseen-as-spam} parameter to @code{nil}.  You
23705 should remove the @samp{$} mark when you are in the group summary
23706 buffer for every message that is not spam after all.  To remove the
23707 @samp{$} mark, you can use @kbd{M-u} to ``unread'' the article, or
23708 @kbd{d} for declaring it read the non-spam way.  When you leave a
23709 group, all spam-marked (@samp{$}) articles are sent to a spam
23710 processor which will study them as spam samples.
23711
23712 Messages may also be deleted in various other ways, and unless
23713 @code{ham-marks} group parameter gets overridden below, marks @samp{R}
23714 and @samp{r} for default read or explicit delete, marks @samp{X} and
23715 @samp{K} for automatic or explicit kills, as well as mark @samp{Y} for
23716 low scores, are all considered to be associated with articles which
23717 are not spam.  This assumption might be false, in particular if you
23718 use kill files or score files as means for detecting genuine spam, you
23719 should then adjust the @code{ham-marks} group parameter.
23720
23721 @defvar ham-marks
23722 You can customize this group or topic parameter to be the list of
23723 marks you want to consider ham.  By default, the list contains the
23724 deleted, read, killed, kill-filed, and low-score marks (the idea is
23725 that these articles have been read, but are not spam).  It can be
23726 useful to also include the tick mark in the ham marks.  It is not
23727 recommended to make the unread mark a ham mark, because it normally
23728 indicates a lack of classification.  But you can do it, and we'll be
23729 happy for you.
23730 @end defvar
23731
23732 @defvar spam-marks
23733 You can customize this group or topic parameter to be the list of
23734 marks you want to consider spam.  By default, the list contains only
23735 the spam mark.  It is not recommended to change that, but you can if
23736 you really want to.
23737 @end defvar
23738
23739 When you leave @emph{any} group, regardless of its
23740 @code{spam-contents} classification, all spam-marked articles are sent
23741 to a spam processor, which will study these as spam samples.  If you
23742 explicit kill a lot, you might sometimes end up with articles marked
23743 @samp{K} which you never saw, and which might accidentally contain
23744 spam.  Best is to make sure that real spam is marked with @samp{$},
23745 and nothing else.
23746
23747 @vindex gnus-ham-process-destinations
23748 When you leave a @emph{spam} group, all spam-marked articles are
23749 marked as expired after processing with the spam processor.  This is
23750 not done for @emph{unclassified} or @emph{ham} groups.  Also, any
23751 @strong{ham} articles in a spam group will be moved to a location
23752 determined by either the @code{ham-process-destination} group
23753 parameter or a match in the @code{gnus-ham-process-destinations}
23754 variable, which is a list of regular expressions matched with group
23755 names (it's easiest to customize this variable with @kbd{M-x
23756 customize-variable @key{RET} gnus-ham-process-destinations}).  Each
23757 group name list is a standard Lisp list, if you prefer to customize
23758 the variable manually.  If the @code{ham-process-destination}
23759 parameter is not set, ham articles are left in place.  If the
23760 @code{spam-mark-ham-unread-before-move-from-spam-group} parameter is
23761 set, the ham articles are marked as unread before being moved.
23762
23763 If ham can not be moved---because of a read-only back end such as
23764 @acronym{NNTP}, for example, it will be copied.
23765
23766 Note that you can use multiples destinations per group or regular
23767 expression!  This enables you to send your ham to a regular mail
23768 group and to a @emph{ham training} group.
23769
23770 When you leave a @emph{ham} group, all ham-marked articles are sent to
23771 a ham processor, which will study these as non-spam samples.
23772
23773 @vindex spam-process-ham-in-spam-groups
23774 By default the variable @code{spam-process-ham-in-spam-groups} is
23775 @code{nil}.  Set it to @code{t} if you want ham found in spam groups
23776 to be processed.  Normally this is not done, you are expected instead
23777 to send your ham to a ham group and process it there.
23778
23779 @vindex spam-process-ham-in-nonham-groups
23780 By default the variable @code{spam-process-ham-in-nonham-groups} is
23781 @code{nil}.  Set it to @code{t} if you want ham found in non-ham (spam
23782 or unclassified) groups to be processed.  Normally this is not done,
23783 you are expected instead to send your ham to a ham group and process
23784 it there.
23785
23786 @vindex gnus-spam-process-destinations
23787 When you leave a @emph{ham} or @emph{unclassified} group, all
23788 @strong{spam} articles are moved to a location determined by either
23789 the @code{spam-process-destination} group parameter or a match in the
23790 @code{gnus-spam-process-destinations} variable, which is a list of
23791 regular expressions matched with group names (it's easiest to
23792 customize this variable with @kbd{M-x customize-variable @key{RET}
23793 gnus-spam-process-destinations}).  Each group name list is a standard
23794 Lisp list, if you prefer to customize the variable manually.  If the
23795 @code{spam-process-destination} parameter is not set, the spam
23796 articles are only expired.  The group name is fully qualified, meaning
23797 that if you see @samp{nntp:servername} before the group name in the
23798 group buffer then you need it here as well.
23799
23800 If spam can not be moved---because of a read-only back end such as
23801 @acronym{NNTP}, for example, it will be copied.
23802
23803 Note that you can use multiples destinations per group or regular
23804 expression!  This enables you to send your spam to multiple @emph{spam
23805 training} groups.
23806
23807 @vindex spam-log-to-registry
23808 The problem with processing ham and spam is that Gnus doesn't track
23809 this processing by default.  Enable the @code{spam-log-to-registry}
23810 variable so @code{spam.el} will use @code{gnus-registry.el} to track
23811 what articles have been processed, and avoid processing articles
23812 multiple times.  Keep in mind that if you limit the number of registry
23813 entries, this won't work as well as it does without a limit.
23814
23815 @vindex spam-mark-only-unseen-as-spam
23816 Set this variable if you want only unseen articles in spam groups to
23817 be marked as spam.  By default, it is set.  If you set it to
23818 @code{nil}, unread articles will also be marked as spam.
23819
23820 @vindex spam-mark-ham-unread-before-move-from-spam-group
23821 Set this variable if you want ham to be unmarked before it is moved
23822 out of the spam group.  This is very useful when you use something
23823 like the tick mark @samp{!} to mark ham---the article will be placed
23824 in your @code{ham-process-destination}, unmarked as if it came fresh
23825 from the mail server.
23826
23827 @vindex spam-autodetect-recheck-messages
23828 When autodetecting spam, this variable tells @code{spam.el} whether
23829 only unseen articles or all unread articles should be checked for
23830 spam.  It is recommended that you leave it off.
23831
23832 @node Spam ELisp Package Sorting and Score Display in Summary Buffer
23833 @subsubsection Spam ELisp Package Sorting and Score Display in Summary Buffer
23834 @cindex spam scoring
23835 @cindex spam sorting
23836 @cindex spam score summary buffer
23837 @cindex spam sort summary buffer
23838 @cindex spam
23839
23840 You can display the spam score of articles in your summary buffer, and
23841 you can sort articles by their spam score.
23842
23843 First you need to decide which back end you will be using.  If you use
23844 the @code{spam-use-spamassassin},
23845 @code{spam-use-spamassassin-headers}, or @code{spam-use-regex-headers}
23846 back end, the @code{X-Spam-Status} header will be used.  If you use
23847 @code{spam-use-bogofilter}, the @code{X-Bogosity} header will be used.
23848 If you use @code{spam-use-crm114}, any header that matches the CRM114
23849 score format will be used.  As long as you set the appropriate back end
23850 variable to t @emph{before} you load @file{spam.el}, you will be
23851 fine.  @code{spam.el} will automatically add the right header to the
23852 internal Gnus list of required headers.
23853
23854 To show the spam score in your summary buffer, add this line to your
23855 @code{gnus.el} file (note @code{spam.el} does not do that by default
23856 so it won't override any existing @code{S} formats you may have).
23857
23858 @lisp
23859 (defalias 'gnus-user-format-function-S 'spam-user-format-function-S)
23860 @end lisp
23861
23862 Now just set your summary line format to use @code{%uS}.  Here's an
23863 example that formats the spam score in a 5-character field:
23864
23865 @lisp
23866 (setq gnus-summary-line-format
23867  "%U%R %10&user-date; $%5uS %6k  %B %(%4L: %*%-25,25a%) %s \n")
23868 @end lisp
23869
23870 Finally, to sort by spam status, either do it globally:
23871
23872 @lisp
23873 (setq
23874  gnus-show-threads nil
23875  gnus-article-sort-functions
23876   '(spam-article-sort-by-spam-status))
23877 @end lisp
23878
23879 or per group (@pxref{Sorting the Summary Buffer}).
23880
23881 @node Spam ELisp Package Configuration Examples
23882 @subsubsection Spam ELisp Package Configuration Examples
23883 @cindex spam filtering
23884 @cindex spam filtering configuration examples
23885 @cindex spam configuration examples
23886 @cindex spam
23887
23888 @subsubheading Ted's setup
23889
23890 From Ted Zlatanov <tzz@@lifelogs.com>.
23891 @example
23892 ;; @r{for @code{gnus-registry-split-fancy-with-parent} and spam autodetection}
23893 ;; @r{see @file{gnus-registry.el} for more information}
23894 (gnus-registry-initialize)
23895 (spam-initialize)
23896
23897 ;; @r{I like @kbd{C-s} for marking spam}
23898 (define-key gnus-summary-mode-map "\C-s" 'gnus-summary-mark-as-spam)
23899
23900 (setq
23901  spam-log-to-registry t     ; @r{for spam autodetection}
23902  spam-use-BBDB t
23903  spam-use-regex-headers t   ; @r{catch X-Spam-Flag (SpamAssassin)}
23904  ;; @r{all groups with @samp{spam} in the name contain spam}
23905  gnus-spam-newsgroup-contents
23906   '(("spam" gnus-group-spam-classification-spam))
23907  ;; @r{see documentation for these}
23908  spam-move-spam-nonspam-groups-only nil
23909  spam-mark-only-unseen-as-spam t
23910  spam-mark-ham-unread-before-move-from-spam-group t
23911  nnimap-split-rule 'nnimap-split-fancy
23912  ;; @r{understand what this does before you copy it to your own setup!}
23913  nnimap-split-fancy '(|
23914                       ;; @r{trace references to parents and put in their group}
23915                       (: gnus-registry-split-fancy-with-parent)
23916                       ;; @r{this will catch server-side SpamAssassin tags}
23917                       (: spam-split 'spam-use-regex-headers)
23918                       (any "ding" "ding")
23919                       ;; @r{note that spam by default will go to @samp{spam}}
23920                       (: spam-split)
23921                       ;; @r{default mailbox}
23922                       "mail"))
23923
23924 ;; @r{my parameters, set with @kbd{G p}}
23925
23926 ;; @r{all nnml groups, and all nnimap groups except}
23927 ;; @r{@samp{nnimap+mail.lifelogs.com:train} and}
23928 ;; @r{@samp{nnimap+mail.lifelogs.com:spam}: any spam goes to nnimap training,}
23929 ;; @r{because it must have been detected manually}
23930
23931 ((spam-process-destination . "nnimap+mail.lifelogs.com:train"))
23932
23933 ;; @r{all @acronym{NNTP} groups}
23934 ;; @r{autodetect spam with the blacklist and ham with the BBDB}
23935 ((spam-autodetect-methods spam-use-blacklist spam-use-BBDB)
23936 ;; @r{send all spam to the training group}
23937  (spam-process-destination . "nnimap+mail.lifelogs.com:train"))
23938
23939 ;; @r{only some @acronym{NNTP} groups, where I want to autodetect spam}
23940 ((spam-autodetect . t))
23941
23942 ;; @r{my nnimap @samp{nnimap+mail.lifelogs.com:spam} group}
23943
23944 ;; @r{this is a spam group}
23945 ((spam-contents gnus-group-spam-classification-spam)
23946
23947  ;; @r{any spam (which happens when I enter for all unseen messages,}
23948  ;; @r{because of the @code{gnus-spam-newsgroup-contents} setting above), goes to}
23949  ;; @r{@samp{nnimap+mail.lifelogs.com:train} unless I mark it as ham}
23950
23951  (spam-process-destination "nnimap+mail.lifelogs.com:train")
23952
23953  ;; @r{any ham goes to my @samp{nnimap+mail.lifelogs.com:mail} folder, but}
23954  ;; @r{also to my @samp{nnimap+mail.lifelogs.com:trainham} folder for training}
23955
23956  (ham-process-destination "nnimap+mail.lifelogs.com:mail"
23957                           "nnimap+mail.lifelogs.com:trainham")
23958  ;; @r{in this group, only @samp{!} marks are ham}
23959  (ham-marks
23960   (gnus-ticked-mark))
23961  ;; @r{remembers senders in the blacklist on the way out---this is}
23962  ;; @r{definitely not needed, it just makes me feel better}
23963  (spam-process (gnus-group-spam-exit-processor-blacklist)))
23964
23965 ;; @r{Later, on the @acronym{IMAP} server I use the @samp{train} group for training}
23966 ;; @r{SpamAssassin to recognize spam, and the @samp{trainham} group fora}
23967 ;; @r{recognizing ham---but Gnus has nothing to do with it.}
23968
23969 @end example
23970
23971 @subsubheading Using @code{spam.el} on an IMAP server with a statistical filter on the server
23972 From Reiner Steib <reiner.steib@@gmx.de>.
23973
23974 My provider has set up bogofilter (in combination with @acronym{DCC}) on
23975 the mail server (@acronym{IMAP}).  Recognized spam goes to
23976 @samp{spam.detected}, the rest goes through the normal filter rules,
23977 i.e. to @samp{some.folder} or to @samp{INBOX}.  Training on false
23978 positives or negatives is done by copying or moving the article to
23979 @samp{training.ham} or @samp{training.spam} respectively.  A cron job on
23980 the server feeds those to bogofilter with the suitable ham or spam
23981 options and deletes them from the @samp{training.ham} and
23982 @samp{training.spam} folders.
23983
23984 With the following entries in @code{gnus-parameters}, @code{spam.el}
23985 does most of the job for me:
23986
23987 @lisp
23988    ("nnimap:spam\\.detected"
23989     (gnus-article-sort-functions '(gnus-article-sort-by-chars))
23990     (ham-process-destination "nnimap:INBOX" "nnimap:training.ham")
23991     (spam-contents gnus-group-spam-classification-spam))
23992    ("nnimap:\\(INBOX\\|other-folders\\)"
23993     (spam-process-destination . "nnimap:training.spam")
23994     (spam-contents gnus-group-spam-classification-ham))
23995 @end lisp
23996
23997 @itemize
23998
23999 @item @b{The Spam folder:}
24000
24001 In the folder @samp{spam.detected}, I have to check for false positives
24002 (i.e. legitimate mails, that were wrongly judged as spam by
24003 bogofilter or DCC).
24004
24005 Because of the @code{gnus-group-spam-classification-spam} entry, all
24006 messages are marked as spam (with @code{$}).  When I find a false
24007 positive, I mark the message with some other ham mark (@code{ham-marks},
24008 @ref{Spam ELisp Package Global Variables}).  On group exit, those
24009 messages are copied to both groups, @samp{INBOX} (where I want to have
24010 the article) and @samp{training.ham} (for training bogofilter) and
24011 deleted from the @samp{spam.detected} folder.
24012
24013 The @code{gnus-article-sort-by-chars} entry simplifies detection of
24014 false positives for me.  I receive lots of worms (sweN, @dots{}), that all
24015 have a similar size.  Grouping them by size (i.e. chars) makes finding
24016 other false positives easier.  (Of course worms aren't @i{spam}
24017 (@acronym{UCE}, @acronym{UBE}) strictly speaking.  Anyhow, bogofilter is
24018 an excellent tool for filtering those unwanted mails for me.)
24019
24020 @item @b{Ham folders:}
24021
24022 In my ham folders, I just hit @kbd{S x}
24023 (@code{gnus-summary-mark-as-spam}) whenever I see an unrecognized spam
24024 mail (false negative).  On group exit, those messages are moved to
24025 @samp{training.spam}.
24026 @end itemize
24027
24028 @subsubheading Reporting spam articles in Gmane groups with @code{spam-report.el}
24029
24030 From Reiner Steib <reiner.steib@@gmx.de>.
24031
24032 With following entry in @code{gnus-parameters}, @kbd{S x}
24033 (@code{gnus-summary-mark-as-spam}) marks articles in @code{gmane.*}
24034 groups as spam and reports the to Gmane at group exit:
24035
24036 @lisp
24037    ("^gmane\\."
24038     (spam-process (gnus-group-spam-exit-processor-report-gmane)))
24039 @end lisp
24040
24041 Additionally, I use @code{(setq spam-report-gmane-use-article-number nil)}
24042 because I don't read the groups directly from news.gmane.org, but
24043 through my local news server (leafnode).  I.e. the article numbers are
24044 not the same as on news.gmane.org, thus @code{spam-report.el} has to check
24045 the @code{X-Report-Spam} header to find the correct number.
24046
24047 @node Blacklists and Whitelists
24048 @subsubsection Blacklists and Whitelists
24049 @cindex spam filtering
24050 @cindex whitelists, spam filtering
24051 @cindex blacklists, spam filtering
24052 @cindex spam
24053
24054 @defvar spam-use-blacklist
24055
24056 Set this variable to @code{t} if you want to use blacklists when
24057 splitting incoming mail.  Messages whose senders are in the blacklist
24058 will be sent to the @code{spam-split-group}.  This is an explicit
24059 filter, meaning that it acts only on mail senders @emph{declared} to
24060 be spammers.
24061
24062 @end defvar
24063
24064 @defvar spam-use-whitelist
24065
24066 Set this variable to @code{t} if you want to use whitelists when
24067 splitting incoming mail.  Messages whose senders are not in the
24068 whitelist will be sent to the next spam-split rule.  This is an
24069 explicit filter, meaning that unless someone is in the whitelist, their
24070 messages are not assumed to be spam or ham.
24071
24072 @end defvar
24073
24074 @defvar spam-use-whitelist-exclusive
24075
24076 Set this variable to @code{t} if you want to use whitelists as an
24077 implicit filter, meaning that every message will be considered spam
24078 unless the sender is in the whitelist.  Use with care.
24079
24080 @end defvar
24081
24082 @defvar gnus-group-spam-exit-processor-blacklist
24083
24084 Add this symbol to a group's @code{spam-process} parameter by
24085 customizing the group parameters or the
24086 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
24087 added to a group's @code{spam-process} parameter, the senders of
24088 spam-marked articles will be added to the blacklist.
24089
24090 @emph{WARNING}
24091
24092 Instead of the obsolete
24093 @code{gnus-group-spam-exit-processor-blacklist}, it is recommended
24094 that you use @code{(spam spam-use-blacklist)}.  Everything will work
24095 the same way, we promise.
24096
24097 @end defvar
24098
24099 @defvar gnus-group-ham-exit-processor-whitelist
24100
24101 Add this symbol to a group's @code{spam-process} parameter by
24102 customizing the group parameters or the
24103 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
24104 added to a group's @code{spam-process} parameter, the senders of
24105 ham-marked articles in @emph{ham} groups will be added to the
24106 whitelist.
24107
24108 @emph{WARNING}
24109
24110 Instead of the obsolete
24111 @code{gnus-group-ham-exit-processor-whitelist}, it is recommended
24112 that you use @code{(ham spam-use-whitelist)}.  Everything will work
24113 the same way, we promise.
24114
24115 @end defvar
24116
24117 Blacklists are lists of regular expressions matching addresses you
24118 consider to be spam senders.  For instance, to block mail from any
24119 sender at @samp{vmadmin.com}, you can put @samp{vmadmin.com} in your
24120 blacklist.  You start out with an empty blacklist.  Blacklist entries
24121 use the Emacs regular expression syntax.
24122
24123 Conversely, whitelists tell Gnus what addresses are considered
24124 legitimate.  All messages from whitelisted addresses are considered
24125 non-spam.  Also see @ref{BBDB Whitelists}.  Whitelist entries use the
24126 Emacs regular expression syntax.
24127
24128 The blacklist and whitelist file locations can be customized with the
24129 @code{spam-directory} variable (@file{~/News/spam} by default), or
24130 the @code{spam-whitelist} and @code{spam-blacklist} variables
24131 directly.  The whitelist and blacklist files will by default be in the
24132 @code{spam-directory} directory, named @file{whitelist} and
24133 @file{blacklist} respectively.
24134
24135 @node BBDB Whitelists
24136 @subsubsection BBDB Whitelists
24137 @cindex spam filtering
24138 @cindex BBDB whitelists, spam filtering
24139 @cindex BBDB, spam filtering
24140 @cindex spam
24141
24142 @defvar spam-use-BBDB
24143
24144 Analogous to @code{spam-use-whitelist} (@pxref{Blacklists and
24145 Whitelists}), but uses the BBDB as the source of whitelisted
24146 addresses, without regular expressions.  You must have the BBDB loaded
24147 for @code{spam-use-BBDB} to work properly.  Messages whose senders are
24148 not in the BBDB will be sent to the next spam-split rule.  This is an
24149 explicit filter, meaning that unless someone is in the BBDB, their
24150 messages are not assumed to be spam or ham.
24151
24152 @end defvar
24153
24154 @defvar spam-use-BBDB-exclusive
24155
24156 Set this variable to @code{t} if you want to use the BBDB as an
24157 implicit filter, meaning that every message will be considered spam
24158 unless the sender is in the BBDB.  Use with care.  Only sender
24159 addresses in the BBDB will be allowed through; all others will be
24160 classified as spammers.
24161
24162 While @code{spam-use-BBDB-exclusive} @emph{can} be used as an alias
24163 for @code{spam-use-BBDB} as far as @code{spam.el} is concerned, it is
24164 @emph{not} a separate back end.  If you set
24165 @code{spam-use-BBDB-exclusive} to t, @emph{all} your BBDB splitting
24166 will be exclusive.
24167
24168 @end defvar
24169
24170 @defvar gnus-group-ham-exit-processor-BBDB
24171
24172 Add this symbol to a group's @code{spam-process} parameter by
24173 customizing the group parameters or the
24174 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
24175 added to a group's @code{spam-process} parameter, the senders of
24176 ham-marked articles in @emph{ham} groups will be added to the
24177 BBDB.
24178
24179 @emph{WARNING}
24180
24181 Instead of the obsolete
24182 @code{gnus-group-ham-exit-processor-BBDB}, it is recommended
24183 that you use @code{(ham spam-use-BBDB)}.  Everything will work
24184 the same way, we promise.
24185
24186 @end defvar
24187
24188 @node Gmane Spam Reporting
24189 @subsubsection Gmane Spam Reporting
24190 @cindex spam reporting
24191 @cindex Gmane, spam reporting
24192 @cindex Gmane, spam reporting
24193 @cindex spam
24194
24195 @defvar gnus-group-spam-exit-processor-report-gmane
24196
24197 Add this symbol to a group's @code{spam-process} parameter by
24198 customizing the group parameters or the
24199 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
24200 added to a group's @code{spam-process} parameter, the spam-marked
24201 articles groups will be reported to the Gmane administrators via a
24202 HTTP request.
24203
24204 Gmane can be found at @uref{http://gmane.org}.
24205
24206 @emph{WARNING}
24207
24208 Instead of the obsolete
24209 @code{gnus-group-spam-exit-processor-report-gmane}, it is recommended
24210 that you use @code{(spam spam-use-gmane)}.  Everything will work the
24211 same way, we promise.
24212
24213 @end defvar
24214
24215 @defvar spam-report-gmane-use-article-number
24216
24217 This variable is @code{t} by default.  Set it to @code{nil} if you are
24218 running your own news server, for instance, and the local article
24219 numbers don't correspond to the Gmane article numbers.  When
24220 @code{spam-report-gmane-use-article-number} is @code{nil},
24221 @code{spam-report.el} will fetch the number from the article headers.
24222
24223 @end defvar
24224
24225 @defvar spam-report-user-mail-address
24226
24227 Mail address exposed in the User-Agent spam reports to Gmane.  It allows
24228 the Gmane administrators to contact you in case of misreports.  The
24229 default is @code{user-mail-address}.
24230
24231 @end defvar
24232
24233 @node Anti-spam Hashcash Payments
24234 @subsubsection Anti-spam Hashcash Payments
24235 @cindex spam filtering
24236 @cindex hashcash, spam filtering
24237 @cindex spam
24238
24239 @defvar spam-use-hashcash
24240
24241 Similar to @code{spam-use-whitelist} (@pxref{Blacklists and
24242 Whitelists}), but uses hashcash tokens for whitelisting messages
24243 instead of the sender address.  Messages without a hashcash payment
24244 token will be sent to the next spam-split rule.  This is an explicit
24245 filter, meaning that unless a hashcash token is found, the messages
24246 are not assumed to be spam or ham.
24247
24248 @end defvar
24249
24250 @node Blackholes
24251 @subsubsection Blackholes
24252 @cindex spam filtering
24253 @cindex blackholes, spam filtering
24254 @cindex spam
24255
24256 @defvar spam-use-blackholes
24257
24258 This option is disabled by default.  You can let Gnus consult the
24259 blackhole-type distributed spam processing systems (DCC, for instance)
24260 when you set this option.  The variable @code{spam-blackhole-servers}
24261 holds the list of blackhole servers Gnus will consult.  The current
24262 list is fairly comprehensive, but make sure to let us know if it
24263 contains outdated servers.
24264
24265 The blackhole check uses the @code{dig.el} package, but you can tell
24266 @code{spam.el} to use @code{dns.el} instead for better performance if
24267 you set @code{spam-use-dig} to @code{nil}.  It is not recommended at
24268 this time to set @code{spam-use-dig} to @code{nil} despite the
24269 possible performance improvements, because some users may be unable to
24270 use it, but you can try it and see if it works for you.
24271
24272 @end defvar
24273
24274 @defvar spam-blackhole-servers
24275
24276 The list of servers to consult for blackhole checks.
24277
24278 @end defvar
24279
24280 @defvar spam-blackhole-good-server-regex
24281
24282 A regular expression for IPs that should not be checked against the
24283 blackhole server list.  When set to @code{nil}, it has no effect.
24284
24285 @end defvar
24286
24287 @defvar spam-use-dig
24288
24289 Use the @code{dig.el} package instead of the @code{dns.el} package.
24290 The default setting of @code{t} is recommended.
24291
24292 @end defvar
24293
24294 Blackhole checks are done only on incoming mail.  There is no spam or
24295 ham processor for blackholes.
24296
24297 @node Regular Expressions Header Matching
24298 @subsubsection Regular Expressions Header Matching
24299 @cindex spam filtering
24300 @cindex regular expressions header matching, spam filtering
24301 @cindex spam
24302
24303 @defvar spam-use-regex-headers
24304
24305 This option is disabled by default.  You can let Gnus check the
24306 message headers against lists of regular expressions when you set this
24307 option.  The variables @code{spam-regex-headers-spam} and
24308 @code{spam-regex-headers-ham} hold the list of regular expressions.
24309 Gnus will check against the message headers to determine if the
24310 message is spam or ham, respectively.
24311
24312 @end defvar
24313
24314 @defvar spam-regex-headers-spam
24315
24316 The list of regular expressions that, when matched in the headers of
24317 the message, positively identify it as spam.
24318
24319 @end defvar
24320
24321 @defvar spam-regex-headers-ham
24322
24323 The list of regular expressions that, when matched in the headers of
24324 the message, positively identify it as ham.
24325
24326 @end defvar
24327
24328 Regular expression header checks are done only on incoming mail.
24329 There is no specific spam or ham processor for regular expressions.
24330
24331 @node Bogofilter
24332 @subsubsection Bogofilter
24333 @cindex spam filtering
24334 @cindex bogofilter, spam filtering
24335 @cindex spam
24336
24337 @defvar spam-use-bogofilter
24338
24339 Set this variable if you want @code{spam-split} to use Eric Raymond's
24340 speedy Bogofilter.
24341
24342 With a minimum of care for associating the @samp{$} mark for spam
24343 articles only, Bogofilter training all gets fairly automatic.  You
24344 should do this until you get a few hundreds of articles in each
24345 category, spam or not.  The command @kbd{S t} in summary mode, either
24346 for debugging or for curiosity, shows the @emph{spamicity} score of
24347 the current article (between 0.0 and 1.0).
24348
24349 Bogofilter determines if a message is spam based on a specific
24350 threshold.  That threshold can be customized, consult the Bogofilter
24351 documentation.
24352
24353 If the @code{bogofilter} executable is not in your path, Bogofilter
24354 processing will be turned off.
24355
24356 You should not enable this if you use @code{spam-use-bogofilter-headers}.
24357
24358 @end defvar
24359
24360 @defvar spam-use-bogofilter-headers
24361
24362 Set this variable if you want @code{spam-split} to use Eric Raymond's
24363 speedy Bogofilter, looking only at the message headers.  It works
24364 similarly to @code{spam-use-bogofilter}, but the @code{X-Bogosity} header
24365 must be in the message already.  Normally you would do this with a
24366 procmail recipe or something similar; consult the Bogofilter
24367 installation documents for details.
24368
24369 You should not enable this if you use @code{spam-use-bogofilter}.
24370
24371 @end defvar
24372
24373 @defvar gnus-group-spam-exit-processor-bogofilter
24374 Add this symbol to a group's @code{spam-process} parameter by
24375 customizing the group parameters or the
24376 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
24377 added to a group's @code{spam-process} parameter, spam-marked articles
24378 will be added to the Bogofilter spam database.
24379
24380 @emph{WARNING}
24381
24382 Instead of the obsolete
24383 @code{gnus-group-spam-exit-processor-bogofilter}, it is recommended
24384 that you use @code{(spam spam-use-bogofilter)}.  Everything will work
24385 the same way, we promise.
24386 @end defvar
24387
24388 @defvar gnus-group-ham-exit-processor-bogofilter
24389 Add this symbol to a group's @code{spam-process} parameter by
24390 customizing the group parameters or the
24391 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
24392 added to a group's @code{spam-process} parameter, the ham-marked
24393 articles in @emph{ham} groups will be added to the Bogofilter database
24394 of non-spam messages.
24395
24396 @emph{WARNING}
24397
24398 Instead of the obsolete
24399 @code{gnus-group-ham-exit-processor-bogofilter}, it is recommended
24400 that you use @code{(ham spam-use-bogofilter)}.  Everything will work
24401 the same way, we promise.
24402 @end defvar
24403
24404 @defvar spam-bogofilter-database-directory
24405
24406 This is the directory where Bogofilter will store its databases.  It
24407 is not specified by default, so Bogofilter will use its own default
24408 database directory.
24409
24410 @end defvar
24411
24412 The Bogofilter mail classifier is similar to @command{ifile} in intent and
24413 purpose.  A ham and a spam processor are provided, plus the
24414 @code{spam-use-bogofilter} and @code{spam-use-bogofilter-headers}
24415 variables to indicate to spam-split that Bogofilter should either be
24416 used, or has already been used on the article.  The 0.9.2.1 version of
24417 Bogofilter was used to test this functionality.
24418
24419 @node SpamAssassin back end
24420 @subsubsection SpamAssassin back end
24421 @cindex spam filtering
24422 @cindex spamassassin, spam filtering
24423 @cindex spam
24424
24425 @defvar spam-use-spamassassin
24426
24427 Set this variable if you want @code{spam-split} to use SpamAssassin.
24428
24429 SpamAssassin assigns a score to each article based on a set of rules
24430 and tests, including a Bayesian filter.  The Bayesian filter can be
24431 trained by associating the @samp{$} mark for spam articles.  The
24432 spam score can be viewed by using the command @kbd{S t} in summary
24433 mode.
24434
24435 If you set this variable, each article will be processed by
24436 SpamAssassin when @code{spam-split} is called.  If your mail is
24437 preprocessed by SpamAssassin, and you want to just use the
24438 SpamAssassin headers, set @code{spam-use-spamassassin-headers}
24439 instead.
24440
24441 You should not enable this is you use
24442 @code{spam-use-spamassassin-headers}.
24443
24444 @end defvar
24445
24446 @defvar spam-use-spamassassin-headers
24447
24448 Set this variable if your mail is preprocessed by SpamAssassin and
24449 want @code{spam-split} to split based on the SpamAssassin headers.
24450
24451 You should not enable this is you use @code{spam-use-spamassassin}.
24452
24453 @end defvar
24454
24455 @defvar spam-spamassassin-path
24456
24457 This variable points to the SpamAssassin executable.  If you have
24458 @code{spamd} running, you can set this variable to the @code{spamc}
24459 executable for faster processing.  See the SpamAssassin documentation
24460 for more information on @code{spamd}/@code{spamc}.
24461
24462 @end defvar
24463
24464 SpamAssassin is a powerful and flexible spam filter that uses a wide
24465 variety of tests to identify spam.  A ham and a spam processors are
24466 provided, plus the @code{spam-use-spamassassin} and
24467 @code{spam-use-spamassassin-headers} variables to indicate to
24468 spam-split that SpamAssassin should be either used, or has already
24469 been used on the article.  The 2.63 version of SpamAssassin was used
24470 to test this functionality.
24471
24472 @node ifile spam filtering
24473 @subsubsection ifile spam filtering
24474 @cindex spam filtering
24475 @cindex ifile, spam filtering
24476 @cindex spam
24477
24478 @defvar spam-use-ifile
24479
24480 Enable this variable if you want @code{spam-split} to use @command{ifile}, a
24481 statistical analyzer similar to Bogofilter.
24482
24483 @end defvar
24484
24485 @defvar spam-ifile-all-categories
24486
24487 Enable this variable if you want @code{spam-use-ifile} to give you all
24488 the ifile categories, not just spam/non-spam.  If you use this, make
24489 sure you train ifile as described in its documentation.
24490
24491 @end defvar
24492
24493 @defvar spam-ifile-spam-category
24494
24495 This is the category of spam messages as far as ifile is concerned.
24496 The actual string used is irrelevant, but you probably want to leave
24497 the default value of @samp{spam}.
24498 @end defvar
24499
24500 @defvar spam-ifile-database-path
24501
24502 This is the filename for the ifile database.  It is not specified by
24503 default, so ifile will use its own default database name.
24504
24505 @end defvar
24506
24507 The ifile mail classifier is similar to Bogofilter in intent and
24508 purpose.  A ham and a spam processor are provided, plus the
24509 @code{spam-use-ifile} variable to indicate to spam-split that ifile
24510 should be used.  The 1.2.1 version of ifile was used to test this
24511 functionality.
24512
24513 @node spam-stat spam filtering
24514 @subsubsection spam-stat spam filtering
24515 @cindex spam filtering
24516 @cindex spam-stat, spam filtering
24517 @cindex spam-stat
24518 @cindex spam
24519
24520 @xref{Filtering Spam Using Statistics with spam-stat}.
24521
24522 @defvar spam-use-stat
24523
24524 Enable this variable if you want @code{spam-split} to use
24525 spam-stat.el, an Emacs Lisp statistical analyzer.
24526
24527 @end defvar
24528
24529 @defvar gnus-group-spam-exit-processor-stat
24530 Add this symbol to a group's @code{spam-process} parameter by
24531 customizing the group parameters or the
24532 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
24533 added to a group's @code{spam-process} parameter, the spam-marked
24534 articles will be added to the spam-stat database of spam messages.
24535
24536 @emph{WARNING}
24537
24538 Instead of the obsolete
24539 @code{gnus-group-spam-exit-processor-stat}, it is recommended
24540 that you use @code{(spam spam-use-stat)}.  Everything will work
24541 the same way, we promise.
24542 @end defvar
24543
24544 @defvar gnus-group-ham-exit-processor-stat
24545 Add this symbol to a group's @code{spam-process} parameter by
24546 customizing the group parameters or the
24547 @code{gnus-spam-process-newsgroups} variable.  When this symbol is
24548 added to a group's @code{spam-process} parameter, the ham-marked
24549 articles in @emph{ham} groups will be added to the spam-stat database
24550 of non-spam messages.
24551
24552 @emph{WARNING}
24553
24554 Instead of the obsolete
24555 @code{gnus-group-ham-exit-processor-stat}, it is recommended
24556 that you use @code{(ham spam-use-stat)}.  Everything will work
24557 the same way, we promise.
24558 @end defvar
24559
24560 This enables @code{spam.el} to cooperate with @file{spam-stat.el}.
24561 @file{spam-stat.el} provides an internal (Lisp-only) spam database,
24562 which unlike ifile or Bogofilter does not require external programs.
24563 A spam and a ham processor, and the @code{spam-use-stat} variable for
24564 @code{spam-split} are provided.
24565
24566 @node SpamOracle
24567 @subsubsection Using SpamOracle with Gnus
24568 @cindex spam filtering
24569 @cindex SpamOracle
24570 @cindex spam
24571
24572 An easy way to filter out spam is to use SpamOracle.  SpamOracle is an
24573 statistical mail filtering tool written by Xavier Leroy and needs to be
24574 installed separately.
24575
24576 There are several ways to use SpamOracle with Gnus.  In all cases, your
24577 mail is piped through SpamOracle in its @emph{mark} mode.  SpamOracle will
24578 then enter an @samp{X-Spam} header indicating whether it regards the
24579 mail as a spam mail or not.
24580
24581 One possibility is to run SpamOracle as a @code{:prescript} from the
24582 @xref{Mail Source Specifiers}, (@pxref{SpamAssassin}).  This method has
24583 the advantage that the user can see the @emph{X-Spam} headers.
24584
24585 The easiest method is to make @code{spam.el} (@pxref{Filtering Spam
24586 Using The Spam ELisp Package}) call SpamOracle.
24587
24588 @vindex spam-use-spamoracle
24589 To enable SpamOracle usage by @code{spam.el}, set the variable
24590 @code{spam-use-spamoracle} to @code{t} and configure the
24591 @code{nnmail-split-fancy} or @code{nnimap-split-fancy} as described in
24592 the section @xref{Filtering Spam Using The Spam ELisp Package}.  In
24593 this example the @samp{INBOX} of an nnimap server is filtered using
24594 SpamOracle.  Mails recognized as spam mails will be moved to
24595 @code{spam-split-group}, @samp{Junk} in this case.  Ham messages stay
24596 in @samp{INBOX}:
24597
24598 @example
24599 (setq spam-use-spamoracle t
24600       spam-split-group "Junk"
24601       nnimap-split-inbox '("INBOX")
24602       nnimap-split-rule 'nnimap-split-fancy
24603       nnimap-split-fancy '(| (: spam-split) "INBOX"))
24604 @end example
24605
24606 @defvar spam-use-spamoracle
24607 Set to @code{t} if you want Gnus to enable spam filtering using
24608 SpamOracle.
24609 @end defvar
24610
24611 @defvar spam-spamoracle-binary
24612 Gnus uses the SpamOracle binary called @file{spamoracle} found in the
24613 user's PATH.  Using the variable @code{spam-spamoracle-binary}, this
24614 can be customized.
24615 @end defvar
24616
24617 @defvar spam-spamoracle-database
24618 By default, SpamOracle uses the file @file{~/.spamoracle.db} as a database to
24619 store its analyses.  This is controlled by the variable
24620 @code{spam-spamoracle-database} which defaults to @code{nil}.  That means
24621 the default SpamOracle database will be used.  In case you want your
24622 database to live somewhere special, set
24623 @code{spam-spamoracle-database} to this path.
24624 @end defvar
24625
24626 SpamOracle employs a statistical algorithm to determine whether a
24627 message is spam or ham.  In order to get good results, meaning few
24628 false hits or misses, SpamOracle needs training.  SpamOracle learns the
24629 characteristics of your spam mails.  Using the @emph{add} mode
24630 (training mode) one has to feed good (ham) and spam mails to
24631 SpamOracle.  This can be done by pressing @kbd{|} in the Summary buffer
24632 and pipe the mail to a SpamOracle process or using @code{spam.el}'s
24633 spam- and ham-processors, which is much more convenient.  For a
24634 detailed description of spam- and ham-processors, @xref{Filtering Spam
24635 Using The Spam ELisp Package}.
24636
24637 @defvar gnus-group-spam-exit-processor-spamoracle
24638 Add this symbol to a group's @code{spam-process} parameter by
24639 customizing the group parameter or the
24640 @code{gnus-spam-process-newsgroups} variable.  When this symbol is added
24641 to a group's @code{spam-process} parameter, spam-marked articles will be
24642 sent to SpamOracle as spam samples.
24643
24644 @emph{WARNING}
24645
24646 Instead of the obsolete
24647 @code{gnus-group-spam-exit-processor-spamoracle}, it is recommended
24648 that you use @code{(spam spam-use-spamoracle)}.  Everything will work
24649 the same way, we promise.
24650 @end defvar
24651
24652 @defvar gnus-group-ham-exit-processor-spamoracle
24653 Add this symbol to a group's @code{spam-process} parameter by
24654 customizing the group parameter or the
24655 @code{gnus-spam-process-newsgroups} variable.  When this symbol is added
24656 to a group's @code{spam-process} parameter, the ham-marked articles in
24657 @emph{ham} groups will be sent to the SpamOracle as samples of ham
24658 messages.
24659
24660 @emph{WARNING}
24661
24662 Instead of the obsolete
24663 @code{gnus-group-ham-exit-processor-spamoracle}, it is recommended
24664 that you use @code{(ham spam-use-spamoracle)}.  Everything will work
24665 the same way, we promise.
24666 @end defvar
24667
24668 @emph{Example:} These are the Group Parameters of a group that has been
24669 classified as a ham group, meaning that it should only contain ham
24670 messages.
24671 @example
24672  ((spam-contents gnus-group-spam-classification-ham)
24673   (spam-process ((ham spam-use-spamoracle)
24674                  (spam spam-use-spamoracle))))
24675 @end example
24676 For this group the @code{spam-use-spamoracle} is installed for both
24677 ham and spam processing.  If the group contains spam message
24678 (e.g. because SpamOracle has not had enough sample messages yet) and
24679 the user marks some messages as spam messages, these messages will be
24680 processed by SpamOracle.  The processor sends the messages to
24681 SpamOracle as new samples for spam.
24682
24683 @node Extending the Spam ELisp package
24684 @subsubsection Extending the Spam ELisp package
24685 @cindex spam filtering
24686 @cindex spam elisp package, extending
24687 @cindex extending the spam elisp package
24688
24689 Say you want to add a new back end called blackbox.  For filtering
24690 incoming mail, provide the following:
24691
24692 @enumerate
24693
24694 @item
24695 Code
24696
24697 @lisp
24698 (defvar spam-use-blackbox nil
24699   "True if blackbox should be used.")
24700 @end lisp
24701
24702 Write @code{spam-check-blackbox} if Blackbox can check incoming mail.
24703
24704 Write @code{spam-blackbox-register-routine} and
24705 @code{spam-blackbox-unregister-routine} using the bogofilter
24706 register/unregister routines as a start, or other restister/unregister
24707 routines more appropriate to Blackbox, if Blackbox can
24708 register/unregister spam and ham.
24709
24710 @item
24711 Functionality
24712
24713 The @code{spam-check-blackbox} function should return @samp{nil} or
24714 @code{spam-split-group}, observing the other conventions.  See the
24715 existing @code{spam-check-*} functions for examples of what you can
24716 do, and stick to the template unless you fully understand the reasons
24717 why you aren't.
24718
24719 @end enumerate
24720
24721 For processing spam and ham messages, provide the following:
24722
24723 @enumerate
24724
24725 @item
24726 Code
24727
24728 Note you don't have to provide a spam or a ham processor.  Only
24729 provide them if Blackbox supports spam or ham processing.
24730
24731 Also, ham and spam processors are being phased out as single
24732 variables.  Instead the form @code{(spam spam-use-blackbox)} or
24733 @code{(ham spam-use-blackbox)} is favored.  For now, spam/ham
24734 processor variables are still around but they won't be for long.
24735
24736 @lisp
24737 (defvar gnus-group-spam-exit-processor-blackbox "blackbox-spam"
24738   "The Blackbox summary exit spam processor.
24739 Only applicable to spam groups.")
24740
24741 (defvar gnus-group-ham-exit-processor-blackbox "blackbox-ham"
24742   "The whitelist summary exit ham processor.
24743 Only applicable to non-spam (unclassified and ham) groups.")
24744
24745 @end lisp
24746
24747 @item
24748 Gnus parameters
24749
24750 Add
24751 @lisp
24752 (const :tag "Spam: Blackbox" (spam spam-use-blackbox))
24753 (const :tag "Ham: Blackbox"  (ham spam-use-blackbox))
24754 @end lisp
24755 to the @code{spam-process} group parameter in @code{gnus.el}.  Make
24756 sure you do it twice, once for the parameter and once for the
24757 variable customization.
24758
24759 Add
24760 @lisp
24761 (variable-item spam-use-blackbox)
24762 @end lisp
24763 to the @code{spam-autodetect-methods} group parameter in
24764 @code{gnus.el} if Blackbox can check incoming mail for spam contents.
24765
24766 Finally, use the appropriate @code{spam-install-*-backend} function in
24767 @code{spam.el}.  Here are the available functions.
24768
24769
24770 @enumerate
24771
24772 @item
24773 @code{spam-install-backend-alias}
24774
24775 This function will simply install an alias for a back end that does
24776 everything like the original back end.  It is currently only used to
24777 make @code{spam-use-BBDB-exclusive} act like @code{spam-use-BBDB}.
24778
24779 @item
24780 @code{spam-install-nocheck-backend}
24781
24782 This function installs a back end that has no check function, but can
24783 register/unregister ham or spam.  The @code{spam-use-gmane} back end is
24784 such a back end.
24785
24786 @item
24787 @code{spam-install-checkonly-backend}
24788
24789 This function will install a back end that can only check incoming mail
24790 for spam contents.  It can't register or unregister messages.
24791 @code{spam-use-blackholes} and @code{spam-use-hashcash} are such
24792 back ends.
24793
24794 @item
24795 @code{spam-install-statistical-checkonly-backend}
24796
24797 This function installs a statistical back end (one which requires the
24798 full body of a message to check it) that can only check incoming mail
24799 for contents.  @code{spam-use-regex-body} is such a filter.
24800
24801 @item
24802 @code{spam-install-statistical-backend}
24803
24804 This function install a statistical back end with incoming checks and
24805 registration/unregistration routines.  @code{spam-use-bogofilter} is
24806 set up this way.
24807
24808 @item
24809 @code{spam-install-backend}
24810
24811 This is the most normal back end installation, where a back end that can
24812 check and register/unregister messages is set up without statistical
24813 abilities.  The @code{spam-use-BBDB} is such a back end.
24814
24815 @item
24816 @code{spam-install-mover-backend}
24817
24818 Mover back ends are internal to @code{spam.el} and specifically move
24819 articles around when the summary is exited.  You will very probably
24820 never install such a back end.
24821 @end enumerate
24822
24823 @end enumerate
24824
24825
24826 @node Filtering Spam Using Statistics with spam-stat
24827 @subsection Filtering Spam Using Statistics with spam-stat
24828 @cindex Paul Graham
24829 @cindex Graham, Paul
24830 @cindex naive Bayesian spam filtering
24831 @cindex Bayesian spam filtering, naive
24832 @cindex spam filtering, naive Bayesian
24833
24834 Paul Graham has written an excellent essay about spam filtering using
24835 statistics: @uref{http://www.paulgraham.com/spam.html,A Plan for
24836 Spam}.  In it he describes the inherent deficiency of rule-based
24837 filtering as used by SpamAssassin, for example: Somebody has to write
24838 the rules, and everybody else has to install these rules.  You are
24839 always late.  It would be much better, he argues, to filter mail based
24840 on whether it somehow resembles spam or non-spam.  One way to measure
24841 this is word distribution.  He then goes on to describe a solution
24842 that checks whether a new mail resembles any of your other spam mails
24843 or not.
24844
24845 The basic idea is this:  Create a two collections of your mail, one
24846 with spam, one with non-spam.  Count how often each word appears in
24847 either collection, weight this by the total number of mails in the
24848 collections, and store this information in a dictionary.  For every
24849 word in a new mail, determine its probability to belong to a spam or a
24850 non-spam mail.  Use the 15 most conspicuous words, compute the total
24851 probability of the mail being spam.  If this probability is higher
24852 than a certain threshold, the mail is considered to be spam.
24853
24854 Gnus supports this kind of filtering.  But it needs some setting up.
24855 First, you need two collections of your mail, one with spam, one with
24856 non-spam.  Then you need to create a dictionary using these two
24857 collections, and save it.  And last but not least, you need to use
24858 this dictionary in your fancy mail splitting rules.
24859
24860 @menu
24861 * Creating a spam-stat dictionary::
24862 * Splitting mail using spam-stat::
24863 * Low-level interface to the spam-stat dictionary::
24864 @end menu
24865
24866 @node Creating a spam-stat dictionary
24867 @subsubsection Creating a spam-stat dictionary
24868
24869 Before you can begin to filter spam based on statistics, you must
24870 create these statistics based on two mail collections, one with spam,
24871 one with non-spam.  These statistics are then stored in a dictionary
24872 for later use.  In order for these statistics to be meaningful, you
24873 need several hundred emails in both collections.
24874
24875 Gnus currently supports only the nnml back end for automated dictionary
24876 creation.  The nnml back end stores all mails in a directory, one file
24877 per mail.  Use the following:
24878
24879 @defun spam-stat-process-spam-directory
24880 Create spam statistics for every file in this directory.  Every file
24881 is treated as one spam mail.
24882 @end defun
24883
24884 @defun spam-stat-process-non-spam-directory
24885 Create non-spam statistics for every file in this directory.  Every
24886 file is treated as one non-spam mail.
24887 @end defun
24888
24889 Usually you would call @code{spam-stat-process-spam-directory} on a
24890 directory such as @file{~/Mail/mail/spam} (this usually corresponds
24891 the the group @samp{nnml:mail.spam}), and you would call
24892 @code{spam-stat-process-non-spam-directory} on a directory such as
24893 @file{~/Mail/mail/misc} (this usually corresponds the the group
24894 @samp{nnml:mail.misc}).
24895
24896 When you are using @acronym{IMAP}, you won't have the mails available
24897 locally, so that will not work.  One solution is to use the Gnus Agent
24898 to cache the articles.  Then you can use directories such as
24899 @file{"~/News/agent/nnimap/mail.yourisp.com/personal_spam"} for
24900 @code{spam-stat-process-spam-directory}.  @xref{Agent as Cache}.
24901
24902 @defvar spam-stat
24903 This variable holds the hash-table with all the statistics---the
24904 dictionary we have been talking about.  For every word in either
24905 collection, this hash-table stores a vector describing how often the
24906 word appeared in spam and often it appeared in non-spam mails.
24907 @end defvar
24908
24909 If you want to regenerate the statistics from scratch, you need to
24910 reset the dictionary.
24911
24912 @defun spam-stat-reset
24913 Reset the @code{spam-stat} hash-table, deleting all the statistics.
24914 @end defun
24915
24916 When you are done, you must save the dictionary.  The dictionary may
24917 be rather large.  If you will not update the dictionary incrementally
24918 (instead, you will recreate it once a month, for example), then you
24919 can reduce the size of the dictionary by deleting all words that did
24920 not appear often enough or that do not clearly belong to only spam or
24921 only non-spam mails.
24922
24923 @defun spam-stat-reduce-size
24924 Reduce the size of the dictionary.  Use this only if you do not want
24925 to update the dictionary incrementally.
24926 @end defun
24927
24928 @defun spam-stat-save
24929 Save the dictionary.
24930 @end defun
24931
24932 @defvar spam-stat-file
24933 The filename used to store the dictionary.  This defaults to
24934 @file{~/.spam-stat.el}.
24935 @end defvar
24936
24937 @node Splitting mail using spam-stat
24938 @subsubsection Splitting mail using spam-stat
24939
24940 In order to use @code{spam-stat} to split your mail, you need to add the
24941 following to your @file{~/.gnus.el} file:
24942
24943 @lisp
24944 (require 'spam-stat)
24945 (spam-stat-load)
24946 @end lisp
24947
24948 This will load the necessary Gnus code, and the dictionary you
24949 created.
24950
24951 Next, you need to adapt your fancy splitting rules:  You need to
24952 determine how to use @code{spam-stat}.  The following examples are for
24953 the nnml back end.  Using the nnimap back end works just as well.  Just
24954 use @code{nnimap-split-fancy} instead of @code{nnmail-split-fancy}.
24955
24956 In the simplest case, you only have two groups, @samp{mail.misc} and
24957 @samp{mail.spam}.  The following expression says that mail is either
24958 spam or it should go into @samp{mail.misc}.  If it is spam, then
24959 @code{spam-stat-split-fancy} will return @samp{mail.spam}.
24960
24961 @lisp
24962 (setq nnmail-split-fancy
24963       `(| (: spam-stat-split-fancy)
24964           "mail.misc"))
24965 @end lisp
24966
24967 @defvar spam-stat-split-fancy-spam-group
24968 The group to use for spam.  Default is @samp{mail.spam}.
24969 @end defvar
24970
24971 If you also filter mail with specific subjects into other groups, use
24972 the following expression.  Only mails not matching the regular
24973 expression are considered potential spam.
24974
24975 @lisp
24976 (setq nnmail-split-fancy
24977       `(| ("Subject" "\\bspam-stat\\b" "mail.emacs")
24978           (: spam-stat-split-fancy)
24979           "mail.misc"))
24980 @end lisp
24981
24982 If you want to filter for spam first, then you must be careful when
24983 creating the dictionary.  Note that @code{spam-stat-split-fancy} must
24984 consider both mails in @samp{mail.emacs} and in @samp{mail.misc} as
24985 non-spam, therefore both should be in your collection of non-spam
24986 mails, when creating the dictionary!
24987
24988 @lisp
24989 (setq nnmail-split-fancy
24990       `(| (: spam-stat-split-fancy)
24991           ("Subject" "\\bspam-stat\\b" "mail.emacs")
24992           "mail.misc"))
24993 @end lisp
24994
24995 You can combine this with traditional filtering.  Here, we move all
24996 HTML-only mails into the @samp{mail.spam.filtered} group.  Note that since
24997 @code{spam-stat-split-fancy} will never see them, the mails in
24998 @samp{mail.spam.filtered} should be neither in your collection of spam mails,
24999 nor in your collection of non-spam mails, when creating the
25000 dictionary!
25001
25002 @lisp
25003 (setq nnmail-split-fancy
25004       `(| ("Content-Type" "text/html" "mail.spam.filtered")
25005           (: spam-stat-split-fancy)
25006           ("Subject" "\\bspam-stat\\b" "mail.emacs")
25007           "mail.misc"))
25008 @end lisp
25009
25010
25011 @node Low-level interface to the spam-stat dictionary
25012 @subsubsection Low-level interface to the spam-stat dictionary
25013
25014 The main interface to using @code{spam-stat}, are the following functions:
25015
25016 @defun spam-stat-buffer-is-spam
25017 Called in a buffer, that buffer is considered to be a new spam mail.
25018 Use this for new mail that has not been processed before.
25019 @end defun
25020
25021 @defun spam-stat-buffer-is-no-spam
25022 Called in a buffer, that buffer is considered to be a new non-spam
25023 mail.  Use this for new mail that has not been processed before.
25024 @end defun
25025
25026 @defun spam-stat-buffer-change-to-spam
25027 Called in a buffer, that buffer is no longer considered to be normal
25028 mail but spam.  Use this to change the status of a mail that has
25029 already been processed as non-spam.
25030 @end defun
25031
25032 @defun spam-stat-buffer-change-to-non-spam
25033 Called in a buffer, that buffer is no longer considered to be spam but
25034 normal mail.  Use this to change the status of a mail that has already
25035 been processed as spam.
25036 @end defun
25037
25038 @defun spam-stat-save
25039 Save the hash table to the file.  The filename used is stored in the
25040 variable @code{spam-stat-file}.
25041 @end defun
25042
25043 @defun spam-stat-load
25044 Load the hash table from a file.  The filename used is stored in the
25045 variable @code{spam-stat-file}.
25046 @end defun
25047
25048 @defun spam-stat-score-word
25049 Return the spam score for a word.
25050 @end defun
25051
25052 @defun spam-stat-score-buffer
25053 Return the spam score for a buffer.
25054 @end defun
25055
25056 @defun spam-stat-split-fancy
25057 Use this function for fancy mail splitting.  Add the rule @samp{(:
25058 spam-stat-split-fancy)} to @code{nnmail-split-fancy}
25059 @end defun
25060
25061 Make sure you load the dictionary before using it.  This requires the
25062 following in your @file{~/.gnus.el} file:
25063
25064 @lisp
25065 (require 'spam-stat)
25066 (spam-stat-load)
25067 @end lisp
25068
25069 Typical test will involve calls to the following functions:
25070
25071 @smallexample
25072 Reset: (setq spam-stat (make-hash-table :test 'equal))
25073 Learn spam: (spam-stat-process-spam-directory "~/Mail/mail/spam")
25074 Learn non-spam: (spam-stat-process-non-spam-directory "~/Mail/mail/misc")
25075 Save table: (spam-stat-save)
25076 File size: (nth 7 (file-attributes spam-stat-file))
25077 Number of words: (hash-table-count spam-stat)
25078 Test spam: (spam-stat-test-directory "~/Mail/mail/spam")
25079 Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc")
25080 Reduce table size: (spam-stat-reduce-size)
25081 Save table: (spam-stat-save)
25082 File size: (nth 7 (file-attributes spam-stat-file))
25083 Number of words: (hash-table-count spam-stat)
25084 Test spam: (spam-stat-test-directory "~/Mail/mail/spam")
25085 Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc")
25086 @end smallexample
25087
25088 Here is how you would create your dictionary:
25089
25090 @smallexample
25091 Reset: (setq spam-stat (make-hash-table :test 'equal))
25092 Learn spam: (spam-stat-process-spam-directory "~/Mail/mail/spam")
25093 Learn non-spam: (spam-stat-process-non-spam-directory "~/Mail/mail/misc")
25094 Repeat for any other non-spam group you need...
25095 Reduce table size: (spam-stat-reduce-size)
25096 Save table: (spam-stat-save)
25097 @end smallexample
25098
25099 @node Other modes
25100 @section Interaction with other modes
25101
25102 @subsection Dired
25103 @cindex dired
25104
25105 @code{gnus-dired-minor-mode} provided some useful functions for dired
25106 buffers.  It is enabled with
25107 @lisp
25108 (add-hook 'dired-mode-hook 'turn-on-gnus-dired-mode)
25109 @end lisp
25110
25111 @table @kbd
25112 @item C-c C-m C-a
25113 @findex gnus-dired-attach
25114 Send dired's marked files as an attachment (@code{gnus-dired-attach}).
25115 You will be prompted for a message buffer.
25116
25117 @item C-c C-m C-l
25118 @findex gnus-dired-find-file-mailcap
25119 Visit a file according to the appropriate mailcap entry
25120 (@code{gnus-dired-find-file-mailcap}).  With prefix, open file in a new
25121 buffer.
25122
25123 @item C-c C-m C-p
25124 @findex gnus-dired-print
25125 Print file according to the mailcap entry (@code{gnus-dired-print}).  If
25126 there is no print command, print in a PostScript image.
25127 @end table
25128
25129 @node Various Various
25130 @section Various Various
25131 @cindex mode lines
25132 @cindex highlights
25133
25134 @table @code
25135
25136 @item gnus-home-directory
25137 @vindex gnus-home-directory
25138 All Gnus file and directory variables will be initialized from this
25139 variable, which defaults to @file{~/}.
25140
25141 @item gnus-directory
25142 @vindex gnus-directory
25143 Most Gnus storage file and directory variables will be initialized from
25144 this variable, which defaults to the @env{SAVEDIR} environment
25145 variable, or @file{~/News/} if that variable isn't set.
25146
25147 Note that Gnus is mostly loaded when the @file{~/.gnus.el} file is read.
25148 This means that other directory variables that are initialized from this
25149 variable won't be set properly if you set this variable in
25150 @file{~/.gnus.el}.  Set this variable in @file{.emacs} instead.
25151
25152 @item gnus-default-directory
25153 @vindex gnus-default-directory
25154 Not related to the above variable at all---this variable says what the
25155 default directory of all Gnus buffers should be.  If you issue commands
25156 like @kbd{C-x C-f}, the prompt you'll get starts in the current buffer's
25157 default directory.  If this variable is @code{nil} (which is the
25158 default), the default directory will be the default directory of the
25159 buffer you were in when you started Gnus.
25160
25161 @item gnus-verbose
25162 @vindex gnus-verbose
25163 This variable is an integer between zero and ten.  The higher the value,
25164 the more messages will be displayed.  If this variable is zero, Gnus
25165 will never flash any messages, if it is seven (which is the default),
25166 most important messages will be shown, and if it is ten, Gnus won't ever
25167 shut up, but will flash so many messages it will make your head swim.
25168
25169 @item gnus-verbose-backends
25170 @vindex gnus-verbose-backends
25171 This variable works the same way as @code{gnus-verbose}, but it applies
25172 to the Gnus back ends instead of Gnus proper.
25173
25174 @item nnheader-max-head-length
25175 @vindex nnheader-max-head-length
25176 When the back ends read straight heads of articles, they all try to read
25177 as little as possible.  This variable (default 8192) specifies
25178 the absolute max length the back ends will try to read before giving up
25179 on finding a separator line between the head and the body.  If this
25180 variable is @code{nil}, there is no upper read bound.  If it is
25181 @code{t}, the back ends won't try to read the articles piece by piece,
25182 but read the entire articles.  This makes sense with some versions of
25183 @code{ange-ftp} or @code{efs}.
25184
25185 @item nnheader-head-chop-length
25186 @vindex nnheader-head-chop-length
25187 This variable (default 2048) says how big a piece of each article to
25188 read when doing the operation described above.
25189
25190 @item nnheader-file-name-translation-alist
25191 @vindex nnheader-file-name-translation-alist
25192 @cindex file names
25193 @cindex invalid characters in file names
25194 @cindex characters in file names
25195 This is an alist that says how to translate characters in file names.
25196 For instance, if @samp{:} is invalid as a file character in file names
25197 on your system (you OS/2 user you), you could say something like:
25198
25199 @lisp
25200 @group
25201 (setq nnheader-file-name-translation-alist
25202       '((?: . ?_)))
25203 @end group
25204 @end lisp
25205
25206 In fact, this is the default value for this variable on OS/2 and MS
25207 Windows (phooey) systems.
25208
25209 @item gnus-hidden-properties
25210 @vindex gnus-hidden-properties
25211 This is a list of properties to use to hide ``invisible'' text.  It is
25212 @code{(invisible t intangible t)} by default on most systems, which
25213 makes invisible text invisible and intangible.
25214
25215 @item gnus-parse-headers-hook
25216 @vindex gnus-parse-headers-hook
25217 A hook called before parsing headers.  It can be used, for instance, to
25218 gather statistics on the headers fetched, or perhaps you'd like to prune
25219 some headers.  I don't see why you'd want that, though.
25220
25221 @item gnus-shell-command-separator
25222 @vindex gnus-shell-command-separator
25223 String used to separate two shell commands.  The default is @samp{;}.
25224
25225 @item gnus-invalid-group-regexp
25226 @vindex gnus-invalid-group-regexp
25227
25228 Regexp to match ``invalid'' group names when querying user for a group
25229 name.  The default value catches some @strong{really} invalid group
25230 names who could possibly mess up Gnus internally (like allowing
25231 @samp{:} in a group name, which is normally used to delimit method and
25232 group).
25233
25234 @acronym{IMAP} users might want to allow @samp{/} in group names though.
25235
25236
25237 @end table
25238
25239 @node The End
25240 @chapter The End
25241
25242 Well, that's the manual---you can get on with your life now.  Keep in
25243 touch.  Say hello to your cats from me.
25244
25245 My @strong{ghod}---I just can't stand goodbyes.  Sniffle.
25246
25247 Ol' Charles Reznikoff said it pretty well, so I leave the floor to him:
25248
25249 @quotation
25250 @strong{Te Deum}
25251
25252 @sp 1
25253 Not because of victories @*
25254 I sing,@*
25255 having none,@*
25256 but for the common sunshine,@*
25257 the breeze,@*
25258 the largess of the spring.
25259
25260 @sp 1
25261 Not for victory@*
25262 but for the day's work done@*
25263 as well as I was able;@*
25264 not for a seat upon the dais@*
25265 but at the common table.@*
25266 @end quotation
25267
25268
25269 @node Appendices
25270 @chapter Appendices
25271
25272 @menu
25273 * XEmacs::                      Requirements for installing under XEmacs.
25274 * History::                     How Gnus got where it is today.
25275 * On Writing Manuals::          Why this is not a beginner's guide.
25276 * Terminology::                 We use really difficult, like, words here.
25277 * Customization::               Tailoring Gnus to your needs.
25278 * Troubleshooting::             What you might try if things do not work.
25279 * Gnus Reference Guide::        Rilly, rilly technical stuff.
25280 * Emacs for Heathens::          A short introduction to Emacsian terms.
25281 * Frequently Asked Questions::  The Gnus FAQ
25282 @end menu
25283
25284
25285 @node XEmacs
25286 @section XEmacs
25287 @cindex XEmacs
25288 @cindex installing under XEmacs
25289
25290 XEmacs is distributed as a collection of packages.  You should install
25291 whatever packages the Gnus XEmacs package requires.  The current
25292 requirements are @samp{gnus}, @samp{mail-lib}, @samp{xemacs-base},
25293 @samp{eterm}, @samp{sh-script}, @samp{net-utils}, @samp{os-utils},
25294 @samp{dired}, @samp{mh-e}, @samp{sieve}, @samp{ps-print}, @samp{W3},
25295 @samp{pgg}, @samp{mailcrypt}, @samp{ecrypto}, and @samp{sasl}.
25296
25297
25298 @node History
25299 @section History
25300
25301 @cindex history
25302 @sc{gnus} was written by Masanobu @sc{Umeda}.  When autumn crept up in
25303 '94, Lars Magne Ingebrigtsen grew bored and decided to rewrite Gnus.
25304
25305 If you want to investigate the person responsible for this outrage,
25306 you can point your (feh!) web browser to
25307 @uref{http://quimby.gnus.org/}.  This is also the primary
25308 distribution point for the new and spiffy versions of Gnus, and is
25309 known as The Site That Destroys Newsrcs And Drives People Mad.
25310
25311 During the first extended alpha period of development, the new Gnus was
25312 called ``(ding) Gnus''.  @dfn{(ding)} is, of course, short for
25313 @dfn{ding is not Gnus}, which is a total and utter lie, but who cares?
25314 (Besides, the ``Gnus'' in this abbreviation should probably be
25315 pronounced ``news'' as @sc{Umeda} intended, which makes it a more
25316 appropriate name, don't you think?)
25317
25318 In any case, after spending all that energy on coming up with a new and
25319 spunky name, we decided that the name was @emph{too} spunky, so we
25320 renamed it back again to ``Gnus''.  But in mixed case.  ``Gnus'' vs.
25321 ``@sc{gnus}''.  New vs. old.
25322
25323 @menu
25324 * Gnus Versions::               What Gnus versions have been released.
25325 * Other Gnus Versions::         Other Gnus versions that also have been released.
25326 * Why?::                        What's the point of Gnus?
25327 * Compatibility::               Just how compatible is Gnus with @sc{gnus}?
25328 * Conformity::                  Gnus tries to conform to all standards.
25329 * Emacsen::                     Gnus can be run on a few modern Emacsen.
25330 * Gnus Development::            How Gnus is developed.
25331 * Contributors::                Oodles of people.
25332 * New Features::                Pointers to some of the new stuff in Gnus.
25333 @end menu
25334
25335
25336 @node Gnus Versions
25337 @subsection Gnus Versions
25338 @cindex ding Gnus
25339 @cindex September Gnus
25340 @cindex Red Gnus
25341 @cindex Quassia Gnus
25342 @cindex Pterodactyl Gnus
25343 @cindex Oort Gnus
25344 @cindex No Gnus
25345 @cindex Gnus versions
25346
25347 The first ``proper'' release of Gnus 5 was done in November 1995 when it
25348 was included in the Emacs 19.30 distribution (132 (ding) Gnus releases
25349 plus 15 Gnus 5.0 releases).
25350
25351 In May 1996 the next Gnus generation (aka. ``September Gnus'' (after 99
25352 releases)) was released under the name ``Gnus 5.2'' (40 releases).
25353
25354 On July 28th 1996 work on Red Gnus was begun, and it was released on
25355 January 25th 1997 (after 84 releases) as ``Gnus 5.4'' (67 releases).
25356
25357 On September 13th 1997, Quassia Gnus was started and lasted 37 releases.
25358 It was released as ``Gnus 5.6'' on March 8th 1998 (46 releases).
25359
25360 Gnus 5.6 begat Pterodactyl Gnus on August 29th 1998 and was released as
25361 ``Gnus 5.8'' (after 99 releases and a CVS repository) on December 3rd
25362 1999.
25363
25364 On the 26th of October 2000, Oort Gnus was begun and was released as
25365 Gnus 5.10 on May 1st 2003 (24 releases).
25366
25367 On the January 4th 2004, No Gnus was begun.
25368
25369 If you happen upon a version of Gnus that has a prefixed name --
25370 ``(ding) Gnus'', ``September Gnus'', ``Red Gnus'', ``Quassia Gnus'',
25371 ``Pterodactyl Gnus'', ``Oort Gnus'', ``No Gnus'' -- don't panic.
25372 Don't let it know that you're frightened.  Back away.  Slowly.  Whatever
25373 you do, don't run.  Walk away, calmly, until you're out of its reach.
25374 Find a proper released version of Gnus and snuggle up to that instead.
25375
25376
25377 @node Other Gnus Versions
25378 @subsection Other Gnus Versions
25379 @cindex Semi-gnus
25380
25381 In addition to the versions of Gnus which have had their releases
25382 coordinated by Lars, one major development has been Semi-gnus from
25383 Japan.  It's based on a library called @acronym{SEMI}, which provides
25384 @acronym{MIME} capabilities.
25385
25386 These Gnusae are based mainly on Gnus 5.6 and Pterodactyl Gnus.
25387 Collectively, they are called ``Semi-gnus'', and different strains are
25388 called T-gnus, ET-gnus, Nana-gnus and Chaos.  These provide powerful
25389 @acronym{MIME} and multilingualization things, especially important for
25390 Japanese users.
25391
25392
25393 @node Why?
25394 @subsection Why?
25395
25396 What's the point of Gnus?
25397
25398 I want to provide a ``rad'', ``happening'', ``way cool'' and ``hep''
25399 newsreader, that lets you do anything you can think of.  That was my
25400 original motivation, but while working on Gnus, it has become clear to
25401 me that this generation of newsreaders really belong in the stone age.
25402 Newsreaders haven't developed much since the infancy of the net.  If the
25403 volume continues to rise with the current rate of increase, all current
25404 newsreaders will be pretty much useless.  How do you deal with
25405 newsgroups that have thousands of new articles each day?  How do you
25406 keep track of millions of people who post?
25407
25408 Gnus offers no real solutions to these questions, but I would very much
25409 like to see Gnus being used as a testing ground for new methods of
25410 reading and fetching news.  Expanding on @sc{Umeda}-san's wise decision
25411 to separate the newsreader from the back ends, Gnus now offers a simple
25412 interface for anybody who wants to write new back ends for fetching mail
25413 and news from different sources.  I have added hooks for customizations
25414 everywhere I could imagine it being useful.  By doing so, I'm inviting
25415 every one of you to explore and invent.
25416
25417 May Gnus never be complete.  @kbd{C-u 100 M-x all-hail-emacs} and
25418 @kbd{C-u 100 M-x all-hail-xemacs}.
25419
25420
25421 @node Compatibility
25422 @subsection Compatibility
25423
25424 @cindex compatibility
25425 Gnus was designed to be fully compatible with @sc{gnus}.  Almost all key
25426 bindings have been kept.  More key bindings have been added, of course,
25427 but only in one or two obscure cases have old bindings been changed.
25428
25429 Our motto is:
25430 @quotation
25431 @cartouche
25432 @center In a cloud bones of steel.
25433 @end cartouche
25434 @end quotation
25435
25436 All commands have kept their names.  Some internal functions have changed
25437 their names.
25438
25439 The @code{gnus-uu} package has changed drastically.  @xref{Decoding
25440 Articles}.
25441
25442 One major compatibility question is the presence of several summary
25443 buffers.  All variables relevant while reading a group are
25444 buffer-local to the summary buffer they belong in.  Although many
25445 important variables have their values copied into their global
25446 counterparts whenever a command is executed in the summary buffer, this
25447 change might lead to incorrect values being used unless you are careful.
25448
25449 All code that relies on knowledge of @sc{gnus} internals will probably
25450 fail.  To take two examples: Sorting @code{gnus-newsrc-alist} (or
25451 changing it in any way, as a matter of fact) is strictly verboten.  Gnus
25452 maintains a hash table that points to the entries in this alist (which
25453 speeds up many functions), and changing the alist directly will lead to
25454 peculiar results.
25455
25456 @cindex hilit19
25457 @cindex highlighting
25458 Old hilit19 code does not work at all.  In fact, you should probably
25459 remove all hilit code from all Gnus hooks
25460 (@code{gnus-group-prepare-hook} and @code{gnus-summary-prepare-hook}).
25461 Gnus provides various integrated functions for highlighting.  These are
25462 faster and more accurate.  To make life easier for everybody, Gnus will
25463 by default remove all hilit calls from all hilit hooks.  Uncleanliness!
25464 Away!
25465
25466 Packages like @code{expire-kill} will no longer work.  As a matter of
25467 fact, you should probably remove all old @sc{gnus} packages (and other
25468 code) when you start using Gnus.  More likely than not, Gnus already
25469 does what you have written code to make @sc{gnus} do.  (Snicker.)
25470
25471 Even though old methods of doing things are still supported, only the
25472 new methods are documented in this manual.  If you detect a new method of
25473 doing something while reading this manual, that does not mean you have
25474 to stop doing it the old way.
25475
25476 Gnus understands all @sc{gnus} startup files.
25477
25478 @kindex M-x gnus-bug
25479 @findex gnus-bug
25480 @cindex reporting bugs
25481 @cindex bugs
25482 Overall, a casual user who hasn't written much code that depends on
25483 @sc{gnus} internals should suffer no problems.  If problems occur,
25484 please let me know by issuing that magic command @kbd{M-x gnus-bug}.
25485
25486 @vindex gnus-bug-create-help-buffer
25487 If you are in the habit of sending bug reports @emph{very} often, you
25488 may find the helpful help buffer annoying after a while.  If so, set
25489 @code{gnus-bug-create-help-buffer} to @code{nil} to avoid having it pop
25490 up at you.
25491
25492
25493 @node Conformity
25494 @subsection Conformity
25495
25496 No rebels without a clue here, ma'am.  We conform to all standards known
25497 to (wo)man.  Except for those standards and/or conventions we disagree
25498 with, of course.
25499
25500 @table @strong
25501
25502 @item RFC (2)822
25503 @cindex RFC 822
25504 @cindex RFC 2822
25505 There are no known breaches of this standard.
25506
25507 @item RFC 1036
25508 @cindex RFC 1036
25509 There are no known breaches of this standard, either.
25510
25511 @item Son-of-RFC 1036
25512 @cindex Son-of-RFC 1036
25513 We do have some breaches to this one.
25514
25515 @table @emph
25516
25517 @item X-Newsreader
25518 @itemx User-Agent
25519 These are considered to be ``vanity headers'', while I consider them
25520 to be consumer information.  After seeing so many badly formatted
25521 articles coming from @code{tin} and @code{Netscape} I know not to use
25522 either of those for posting articles.  I would not have known that if
25523 it wasn't for the @code{X-Newsreader} header.
25524 @end table
25525
25526 @item USEFOR
25527 @cindex USEFOR
25528 USEFOR is an IETF working group writing a successor to RFC 1036, based
25529 on Son-of-RFC 1036.  They have produced a number of drafts proposing
25530 various changes to the format of news articles.  The Gnus towers will
25531 look into implementing the changes when the draft is accepted as an RFC.
25532
25533 @item MIME - RFC 2045-2049 etc
25534 @cindex @acronym{MIME}
25535 All the various @acronym{MIME} RFCs are supported.
25536
25537 @item Disposition Notifications - RFC 2298
25538 Message Mode is able to request notifications from the receiver.
25539
25540 @item PGP - RFC 1991 and RFC 2440
25541 @cindex RFC 1991
25542 @cindex RFC 2440
25543 RFC 1991 is the original @acronym{PGP} message specification,
25544 published as an informational RFC.  RFC 2440 was the follow-up, now
25545 called Open PGP, and put on the Standards Track.  Both document a
25546 non-@acronym{MIME} aware @acronym{PGP} format.  Gnus supports both
25547 encoding (signing and encryption) and decoding (verification and
25548 decryption).
25549
25550 @item PGP/MIME - RFC 2015/3156
25551 RFC 2015 (superseded by 3156 which references RFC 2440 instead of RFC
25552 1991) describes the @acronym{MIME}-wrapping around the RFC 1991/2440 format.
25553 Gnus supports both encoding and decoding.
25554
25555 @item S/MIME - RFC 2633
25556 RFC 2633 describes the @acronym{S/MIME} format.
25557
25558 @item IMAP - RFC 1730/2060, RFC 2195, RFC 2086, RFC 2359, RFC 2595, RFC 1731
25559 RFC 1730 is @acronym{IMAP} version 4, updated somewhat by RFC 2060
25560 (@acronym{IMAP} 4 revision 1).  RFC 2195 describes CRAM-MD5
25561 authentication for @acronym{IMAP}.  RFC 2086 describes access control
25562 lists (ACLs) for @acronym{IMAP}.  RFC 2359 describes a @acronym{IMAP}
25563 protocol enhancement.  RFC 2595 describes the proper @acronym{TLS}
25564 integration (STARTTLS) with @acronym{IMAP}.  RFC 1731 describes the
25565 GSSAPI/Kerberos4 mechanisms for @acronym{IMAP}.
25566
25567 @end table
25568
25569 If you ever notice Gnus acting non-compliant with regards to the texts
25570 mentioned above, don't hesitate to drop a note to Gnus Towers and let us
25571 know.
25572
25573
25574 @node Emacsen
25575 @subsection Emacsen
25576 @cindex Emacsen
25577 @cindex XEmacs
25578 @cindex Mule
25579 @cindex Emacs
25580
25581 Gnus should work on:
25582
25583 @itemize @bullet
25584
25585 @item
25586 Emacs 21.1 and up.
25587
25588 @item
25589 XEmacs 21.4 and up.
25590
25591 @end itemize
25592
25593 This Gnus version will absolutely not work on any Emacsen older than
25594 that.  Not reliably, at least.  Older versions of Gnus may work on older
25595 Emacs versions.
25596
25597 There are some vague differences between Gnus on the various
25598 platforms---XEmacs features more graphics (a logo and a toolbar)---but
25599 other than that, things should look pretty much the same under all
25600 Emacsen.
25601
25602
25603 @node Gnus Development
25604 @subsection Gnus Development
25605
25606 Gnus is developed in a two-phased cycle.  The first phase involves much
25607 discussion on the @samp{ding@@gnus.org} mailing list, where people
25608 propose changes and new features, post patches and new back ends.  This
25609 phase is called the @dfn{alpha} phase, since the Gnusae released in this
25610 phase are @dfn{alpha releases}, or (perhaps more commonly in other
25611 circles) @dfn{snapshots}.  During this phase, Gnus is assumed to be
25612 unstable and should not be used by casual users.  Gnus alpha releases
25613 have names like ``Red Gnus'' and ``Quassia Gnus''.
25614
25615 After futzing around for 50-100 alpha releases, Gnus is declared
25616 @dfn{frozen}, and only bug fixes are applied.  Gnus loses the prefix,
25617 and is called things like ``Gnus 5.6.32'' instead.  Normal people are
25618 supposed to be able to use these, and these are mostly discussed on the
25619 @samp{gnu.emacs.gnus} newsgroup.
25620
25621 @cindex Incoming*
25622 @vindex mail-source-delete-incoming
25623 Some variable defaults differ between alpha Gnusae and released Gnusae.
25624 In particular, @code{mail-source-delete-incoming} defaults to @code{nil} in
25625 alpha Gnusae and @code{t} in released Gnusae.  This is to prevent
25626 lossage of mail if an alpha release hiccups while handling the mail.
25627
25628 The division of discussion between the ding mailing list and the Gnus
25629 newsgroup is not purely based on publicity concerns.  It's true that
25630 having people write about the horrible things that an alpha Gnus release
25631 can do (sometimes) in a public forum may scare people off, but more
25632 importantly, talking about new experimental features that have been
25633 introduced may confuse casual users.  New features are frequently
25634 introduced, fiddled with, and judged to be found wanting, and then
25635 either discarded or totally rewritten.  People reading the mailing list
25636 usually keep up with these rapid changes, while people on the newsgroup
25637 can't be assumed to do so.
25638
25639
25640
25641 @node Contributors
25642 @subsection Contributors
25643 @cindex contributors
25644
25645 The new Gnus version couldn't have been done without the help of all the
25646 people on the (ding) mailing list.  Every day for over a year I have
25647 gotten billions of nice bug reports from them, filling me with joy,
25648 every single one of them.  Smooches.  The people on the list have been
25649 tried beyond endurance, what with my ``oh, that's a neat idea <type
25650 type>, yup, I'll release it right away <ship off> no wait, that doesn't
25651 work at all <type type>, yup, I'll ship that one off right away <ship
25652 off> no, wait, that absolutely does not work'' policy for releases.
25653 Micro$oft---bah.  Amateurs.  I'm @emph{much} worse.  (Or is that
25654 ``worser''? ``much worser''?  ``worsest''?)
25655
25656 I would like to take this opportunity to thank the Academy for@dots{}  oops,
25657 wrong show.
25658
25659 @itemize @bullet
25660
25661 @item
25662 Masanobu @sc{Umeda}---the writer of the original @sc{gnus}.
25663
25664 @item
25665 Shenghuo Zhu---uudecode.el, mm-uu.el, rfc1843.el, webmail.el,
25666 nnwarchive and many, many other things connected with @acronym{MIME} and
25667 other types of en/decoding, as well as general bug fixing, new
25668 functionality and stuff.
25669
25670 @item
25671 Per Abrahamsen---custom, scoring, highlighting and @sc{soup} code (as
25672 well as numerous other things).
25673
25674 @item
25675 Luis Fernandes---design and graphics.
25676
25677 @item
25678 Joe Reiss---creator of the smiley faces.
25679
25680 @item
25681 Justin Sheehy---the @acronym{FAQ} maintainer.
25682
25683 @item
25684 Erik Naggum---help, ideas, support, code and stuff.
25685
25686 @item
25687 Wes Hardaker---@file{gnus-picon.el} and the manual section on
25688 @dfn{picons} (@pxref{Picons}).
25689
25690 @item
25691 Kim-Minh Kaplan---further work on the picon code.
25692
25693 @item
25694 Brad Miller---@file{gnus-gl.el} and the GroupLens manual section.
25695
25696 @item
25697 Sudish Joseph---innumerable bug fixes.
25698
25699 @item
25700 Ilja Weis---@file{gnus-topic.el}.
25701
25702 @item
25703 Steven L. Baur---lots and lots and lots of bugs detections and fixes.
25704
25705 @item
25706 Vladimir Alexiev---the refcard and reference booklets.
25707
25708 @item
25709 Felix Lee & Jamie Zawinski---I stole some pieces from the XGnus
25710 distribution by Felix Lee and JWZ.
25711
25712 @item
25713 Scott Byer---@file{nnfolder.el} enhancements & rewrite.
25714
25715 @item
25716 Peter Mutsaers---orphan article scoring code.
25717
25718 @item
25719 Ken Raeburn---POP mail support.
25720
25721 @item
25722 Hallvard B Furuseth---various bits and pieces, especially dealing with
25723 .newsrc files.
25724
25725 @item
25726 Brian Edmonds---@file{gnus-bbdb.el}.
25727
25728 @item
25729 David Moore---rewrite of @file{nnvirtual.el} and many other things.
25730
25731 @item
25732 Kevin Davidson---came up with the name @dfn{ding}, so blame him.
25733
25734 @item
25735 Fran@,{c}ois Pinard---many, many interesting and thorough bug reports, as
25736 well as autoconf support.
25737
25738 @end itemize
25739
25740 This manual was proof-read by Adrian Aichner, with Ricardo Nassif, Mark
25741 Borges, and Jost Krieger proof-reading parts of the manual.
25742
25743 The following people have contributed many patches and suggestions:
25744
25745 Christopher Davis,
25746 Andrew Eskilsson,
25747 Kai Grossjohann,
25748 Kevin Greiner,
25749 Jesper Harder,
25750 Paul Jarc,
25751 Simon Josefsson,
25752 David K@aa{}gedal,
25753 Richard Pieri,
25754 Fabrice Popineau,
25755 Daniel Quinlan,
25756 Michael Shields,
25757 Reiner Steib,
25758 Jason L. Tibbitts, III,
25759 Jack Vinson,
25760 Katsumi Yamaoka, @c Yamaoka
25761 and
25762 Teodor Zlatanov.
25763
25764 Also thanks to the following for patches and stuff:
25765
25766 Jari Aalto,
25767 Adrian Aichner,
25768 Vladimir Alexiev,
25769 Russ Allbery,
25770 Peter Arius,
25771 Matt Armstrong,
25772 Marc Auslander,
25773 Miles Bader,
25774 Alexei V. Barantsev,
25775 Frank Bennett,
25776 Robert Bihlmeyer,
25777 Chris Bone,
25778 Mark Borges,
25779 Mark Boyns,
25780 Lance A. Brown,
25781 Rob Browning,
25782 Kees de Bruin,
25783 Martin Buchholz,
25784 Joe Buehler,
25785 Kevin Buhr,
25786 Alastair Burt,
25787 Joao Cachopo,
25788 Zlatko Calusic,
25789 Massimo Campostrini,
25790 Castor,
25791 David Charlap,
25792 Dan Christensen,
25793 Kevin Christian,
25794 Jae-you Chung, @c ?
25795 James H. Cloos, Jr.,
25796 Laura Conrad,
25797 Michael R. Cook,
25798 Glenn Coombs,
25799 Andrew J. Cosgriff,
25800 Neil Crellin,
25801 Frank D. Cringle,
25802 Geoffrey T. Dairiki,
25803 Andre Deparade,
25804 Ulrik Dickow,
25805 Dave Disser,
25806 Rui-Tao Dong, @c ?
25807 Joev Dubach,
25808 Michael Welsh Duggan,
25809 Dave Edmondson,
25810 Paul Eggert,
25811 Mark W. Eichin,
25812 Karl Eichwalder,
25813 Enami Tsugutomo, @c Enami
25814 Michael Ernst,
25815 Luc Van Eycken,
25816 Sam Falkner,
25817 Nelson Jose dos Santos Ferreira,
25818 Sigbjorn Finne,
25819 Sven Fischer,
25820 Paul Fisher,
25821 Decklin Foster,
25822 Gary D. Foster,
25823 Paul Franklin,
25824 Guy Geens,
25825 Arne Georg Gleditsch,
25826 David S. Goldberg,
25827 Michelangelo Grigni,
25828 Dale Hagglund,
25829 D. Hall,
25830 Magnus Hammerin,
25831 Kenichi Handa, @c Handa
25832 Raja R. Harinath,
25833 Yoshiki Hayashi, @c Hayashi
25834 P. E. Jareth Hein,
25835 Hisashige Kenji, @c Hisashige
25836 Scott Hofmann,
25837 Marc Horowitz,
25838 Gunnar Horrigmo,
25839 Richard Hoskins,
25840 Brad Howes,
25841 Miguel de Icaza,
25842 Fran@,{c}ois Felix Ingrand,
25843 Tatsuya Ichikawa, @c Ichikawa
25844 Ishikawa Ichiro, @c Ishikawa
25845 Lee Iverson,
25846 Iwamuro Motonori, @c Iwamuro
25847 Rajappa Iyer,
25848 Andreas Jaeger,
25849 Adam P. Jenkins,
25850 Randell Jesup,
25851 Fred Johansen,
25852 Gareth Jones,
25853 Greg Klanderman,
25854 Karl Kleinpaste,
25855 Michael Klingbeil,
25856 Peter Skov Knudsen,
25857 Shuhei Kobayashi, @c Kobayashi
25858 Petr Konecny,
25859 Koseki Yoshinori, @c Koseki
25860 Thor Kristoffersen,
25861 Jens Lautenbacher,
25862 Martin Larose,
25863 Seokchan Lee, @c Lee
25864 Joerg Lenneis,
25865 Carsten Leonhardt,
25866 James LewisMoss,
25867 Christian Limpach,
25868 Markus Linnala,
25869 Dave Love,
25870 Mike McEwan,
25871 Tonny Madsen,
25872 Shlomo Mahlab,
25873 Nat Makarevitch,
25874 Istvan Marko,
25875 David Martin,
25876 Jason R. Mastaler,
25877 Gordon Matzigkeit,
25878 Timo Metzemakers,
25879 Richard Mlynarik,
25880 Lantz Moore,
25881 Morioka Tomohiko, @c Morioka
25882 Erik Toubro Nielsen,
25883 Hrvoje Niksic,
25884 Andy Norman,
25885 Fred Oberhauser,
25886 C. R. Oldham,
25887 Alexandre Oliva,
25888 Ken Olstad,
25889 Masaharu Onishi, @c Onishi
25890 Hideki Ono, @c Ono
25891 Ettore Perazzoli,
25892 William Perry,
25893 Stephen Peters,
25894 Jens-Ulrik Holger Petersen,
25895 Ulrich Pfeifer,
25896 Matt Pharr,
25897 Andy Piper,
25898 John McClary Prevost,
25899 Bill Pringlemeir,
25900 Mike Pullen,
25901 Jim Radford,
25902 Colin Rafferty,
25903 Lasse Rasinen,
25904 Lars Balker Rasmussen,
25905 Joe Reiss,
25906 Renaud Rioboo,
25907 Roland B. Roberts,
25908 Bart Robinson,
25909 Christian von Roques,
25910 Markus Rost,
25911 Jason Rumney,
25912 Wolfgang Rupprecht,
25913 Jay Sachs,
25914 Dewey M. Sasser,
25915 Conrad Sauerwald,
25916 Loren Schall,
25917 Dan Schmidt,
25918 Ralph Schleicher,
25919 Philippe Schnoebelen,
25920 Andreas Schwab,
25921 Randal L. Schwartz,
25922 Danny Siu,
25923 Matt Simmons,
25924 Paul D. Smith,
25925 Jeff Sparkes,
25926 Toby Speight,
25927 Michael Sperber,
25928 Darren Stalder,
25929 Richard Stallman,
25930 Greg Stark,
25931 Sam Steingold,
25932 Paul Stevenson,
25933 Jonas Steverud,
25934 Paul Stodghill,
25935 Kiyokazu Suto, @c Suto
25936 Kurt Swanson,
25937 Samuel Tardieu,
25938 Teddy,
25939 Chuck Thompson,
25940 Tozawa Akihiko, @c Tozawa
25941 Philippe Troin,
25942 James Troup,
25943 Trung Tran-Duc,
25944 Jack Twilley,
25945 Aaron M. Ucko,
25946 Aki Vehtari,
25947 Didier Verna,
25948 Vladimir Volovich,
25949 Jan Vroonhof,
25950 Stefan Waldherr,
25951 Pete Ware,
25952 Barry A. Warsaw,
25953 Christoph Wedler,
25954 Joe Wells,
25955 Lee Willis,
25956 and
25957 Lloyd Zusman.
25958
25959
25960 For a full overview of what each person has done, the ChangeLogs
25961 included in the Gnus alpha distributions should give ample reading
25962 (550kB and counting).
25963
25964 Apologies to everybody that I've forgotten, of which there are many, I'm
25965 sure.
25966
25967 Gee, that's quite a list of people.  I guess that must mean that there
25968 actually are people who are using Gnus.  Who'd'a thunk it!
25969
25970
25971 @node New Features
25972 @subsection New Features
25973 @cindex new features
25974
25975 @menu
25976 * ding Gnus::                   New things in Gnus 5.0/5.1, the first new Gnus.
25977 * September Gnus::              The Thing Formally Known As Gnus 5.2/5.3.
25978 * Red Gnus::                    Third time best---Gnus 5.4/5.5.
25979 * Quassia Gnus::                Two times two is four, or Gnus 5.6/5.7.
25980 * Pterodactyl Gnus::            Pentad also starts with P, AKA Gnus 5.8/5.9.
25981 * Oort Gnus::                   It's big.  It's far out.  Gnus 5.10/5.11.
25982 * No Gnus::                     Very punny.
25983 @end menu
25984
25985 These lists are, of course, just @emph{short} overviews of the
25986 @emph{most} important new features.  No, really.  There are tons more.
25987 Yes, we have feeping creaturism in full effect.
25988
25989 @node ding Gnus
25990 @subsubsection (ding) Gnus
25991
25992 New features in Gnus 5.0/5.1:
25993
25994 @itemize @bullet
25995
25996 @item
25997 The look of all buffers can be changed by setting format-like variables
25998 (@pxref{Group Buffer Format} and @pxref{Summary Buffer Format}).
25999
26000 @item
26001 Local spool and several @acronym{NNTP} servers can be used at once
26002 (@pxref{Select Methods}).
26003
26004 @item
26005 You can combine groups into virtual groups (@pxref{Virtual Groups}).
26006
26007 @item
26008 You can read a number of different mail formats (@pxref{Getting Mail}).
26009 All the mail back ends implement a convenient mail expiry scheme
26010 (@pxref{Expiring Mail}).
26011
26012 @item
26013 Gnus can use various strategies for gathering threads that have lost
26014 their roots (thereby gathering loose sub-threads into one thread) or it
26015 can go back and retrieve enough headers to build a complete thread
26016 (@pxref{Customizing Threading}).
26017
26018 @item
26019 Killed groups can be displayed in the group buffer, and you can read
26020 them as well (@pxref{Listing Groups}).
26021
26022 @item
26023 Gnus can do partial group updates---you do not have to retrieve the
26024 entire active file just to check for new articles in a few groups
26025 (@pxref{The Active File}).
26026
26027 @item
26028 Gnus implements a sliding scale of subscribedness to groups
26029 (@pxref{Group Levels}).
26030
26031 @item
26032 You can score articles according to any number of criteria
26033 (@pxref{Scoring}).  You can even get Gnus to find out how to score
26034 articles for you (@pxref{Adaptive Scoring}).
26035
26036 @item
26037 Gnus maintains a dribble buffer that is auto-saved the normal Emacs
26038 manner, so it should be difficult to lose much data on what you have
26039 read if your machine should go down (@pxref{Auto Save}).
26040
26041 @item
26042 Gnus now has its own startup file (@file{~/.gnus.el}) to avoid
26043 cluttering up the @file{.emacs} file.
26044
26045 @item
26046 You can set the process mark on both groups and articles and perform
26047 operations on all the marked items (@pxref{Process/Prefix}).
26048
26049 @item
26050 You can grep through a subset of groups and create a group from the
26051 results (@pxref{Kibozed Groups}).
26052
26053 @item
26054 You can list subsets of groups according to, well, anything
26055 (@pxref{Listing Groups}).
26056
26057 @item
26058 You can browse foreign servers and subscribe to groups from those
26059 servers (@pxref{Browse Foreign Server}).
26060
26061 @item
26062 Gnus can fetch articles, asynchronously, on a second connection to the
26063 server (@pxref{Asynchronous Fetching}).
26064
26065 @item
26066 You can cache articles locally (@pxref{Article Caching}).
26067
26068 @item
26069 The uudecode functions have been expanded and generalized
26070 (@pxref{Decoding Articles}).
26071
26072 @item
26073 You can still post uuencoded articles, which was a little-known feature
26074 of @sc{gnus}' past (@pxref{Uuencoding and Posting}).
26075
26076 @item
26077 Fetching parents (and other articles) now actually works without
26078 glitches (@pxref{Finding the Parent}).
26079
26080 @item
26081 Gnus can fetch @acronym{FAQ}s and group descriptions (@pxref{Group Information}).
26082
26083 @item
26084 Digests (and other files) can be used as the basis for groups
26085 (@pxref{Document Groups}).
26086
26087 @item
26088 Articles can be highlighted and customized (@pxref{Customizing
26089 Articles}).
26090
26091 @item
26092 URLs and other external references can be buttonized (@pxref{Article
26093 Buttons}).
26094
26095 @item
26096 You can do lots of strange stuff with the Gnus window & frame
26097 configuration (@pxref{Window Layout}).
26098
26099 @item
26100 You can click on buttons instead of using the keyboard
26101 (@pxref{Buttons}).
26102
26103 @end itemize
26104
26105
26106 @node September Gnus
26107 @subsubsection September Gnus
26108
26109 @iftex
26110 @iflatex
26111 \gnusfig{-28cm}{0cm}{\epsfig{figure=ps/september,height=20cm}}
26112 @end iflatex
26113 @end iftex
26114
26115 New features in Gnus 5.2/5.3:
26116
26117 @itemize @bullet
26118
26119 @item
26120 A new message composition mode is used.  All old customization variables
26121 for @code{mail-mode}, @code{rnews-reply-mode} and @code{gnus-msg} are
26122 now obsolete.
26123
26124 @item
26125 Gnus is now able to generate @dfn{sparse} threads---threads where
26126 missing articles are represented by empty nodes (@pxref{Customizing
26127 Threading}).
26128
26129 @lisp
26130 (setq gnus-build-sparse-threads 'some)
26131 @end lisp
26132
26133 @item
26134 Outgoing articles are stored on a special archive server
26135 (@pxref{Archived Messages}).
26136
26137 @item
26138 Partial thread regeneration now happens when articles are
26139 referred.
26140
26141 @item
26142 Gnus can make use of GroupLens predictions.
26143
26144 @item
26145 Picons (personal icons) can be displayed under XEmacs (@pxref{Picons}).
26146
26147 @item
26148 A @code{trn}-like tree buffer can be displayed (@pxref{Tree Display}).
26149
26150 @lisp
26151 (setq gnus-use-trees t)
26152 @end lisp
26153
26154 @item
26155 An @code{nn}-like pick-and-read minor mode is available for the summary
26156 buffers (@pxref{Pick and Read}).
26157
26158 @lisp
26159 (add-hook 'gnus-summary-mode-hook 'gnus-pick-mode)
26160 @end lisp
26161
26162 @item
26163 In binary groups you can use a special binary minor mode (@pxref{Binary
26164 Groups}).
26165
26166 @item
26167 Groups can be grouped in a folding topic hierarchy (@pxref{Group
26168 Topics}).
26169
26170 @lisp
26171 (add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
26172 @end lisp
26173
26174 @item
26175 Gnus can re-send and bounce mail (@pxref{Summary Mail Commands}).
26176
26177 @item
26178 Groups can now have a score, and bubbling based on entry frequency
26179 is possible (@pxref{Group Score}).
26180
26181 @lisp
26182 (add-hook 'gnus-summary-exit-hook 'gnus-summary-bubble-group)
26183 @end lisp
26184
26185 @item
26186 Groups can be process-marked, and commands can be performed on
26187 groups of groups (@pxref{Marking Groups}).
26188
26189 @item
26190 Caching is possible in virtual groups.
26191
26192 @item
26193 @code{nndoc} now understands all kinds of digests, mail boxes, rnews
26194 news batches, ClariNet briefs collections, and just about everything
26195 else (@pxref{Document Groups}).
26196
26197 @item
26198 Gnus has a new back end (@code{nnsoup}) to create/read SOUP packets
26199 (@pxref{SOUP}).
26200
26201 @item
26202 The Gnus cache is much faster.
26203
26204 @item
26205 Groups can be sorted according to many criteria (@pxref{Sorting
26206 Groups}).
26207
26208 @item
26209 New group parameters have been introduced to set list-addresses and
26210 expiry times (@pxref{Group Parameters}).
26211
26212 @item
26213 All formatting specs allow specifying faces to be used
26214 (@pxref{Formatting Fonts}).
26215
26216 @item
26217 There are several more commands for setting/removing/acting on process
26218 marked articles on the @kbd{M P} submap (@pxref{Setting Process Marks}).
26219
26220 @item
26221 The summary buffer can be limited to show parts of the available
26222 articles based on a wide range of criteria.  These commands have been
26223 bound to keys on the @kbd{/} submap (@pxref{Limiting}).
26224
26225 @item
26226 Articles can be made persistent with the @kbd{*} command
26227 (@pxref{Persistent Articles}).
26228
26229 @item
26230 All functions for hiding article elements are now toggles.
26231
26232 @item
26233 Article headers can be buttonized (@pxref{Article Washing}).
26234
26235 @item
26236 All mail back ends support fetching articles by @code{Message-ID}.
26237
26238 @item
26239 Duplicate mail can now be treated properly (@pxref{Duplicates}).
26240
26241 @item
26242 All summary mode commands are available directly from the article
26243 buffer (@pxref{Article Keymap}).
26244
26245 @item
26246 Frames can be part of @code{gnus-buffer-configuration} (@pxref{Window
26247 Layout}).
26248
26249 @item
26250 Mail can be re-scanned by a daemonic process (@pxref{Daemons}).
26251 @iftex
26252 @iflatex
26253 \marginpar[\mbox{}\hfill\epsfig{figure=ps/fseptember,height=5cm}]{\epsfig{figure=ps/fseptember,height=5cm}}
26254 @end iflatex
26255 @end iftex
26256
26257 @item
26258 Gnus can make use of NoCeM files to weed out spam (@pxref{NoCeM}).
26259
26260 @lisp
26261 (setq gnus-use-nocem t)
26262 @end lisp
26263
26264 @item
26265 Groups can be made permanently visible (@pxref{Listing Groups}).
26266
26267 @lisp
26268 (setq gnus-permanently-visible-groups "^nnml:")
26269 @end lisp
26270
26271 @item
26272 Many new hooks have been introduced to make customizing easier.
26273
26274 @item
26275 Gnus respects the @code{Mail-Copies-To} header.
26276
26277 @item
26278 Threads can be gathered by looking at the @code{References} header
26279 (@pxref{Customizing Threading}).
26280
26281 @lisp
26282 (setq gnus-summary-thread-gathering-function
26283       'gnus-gather-threads-by-references)
26284 @end lisp
26285
26286 @item
26287 Read articles can be stored in a special backlog buffer to avoid
26288 refetching (@pxref{Article Backlog}).
26289
26290 @lisp
26291 (setq gnus-keep-backlog 50)
26292 @end lisp
26293
26294 @item
26295 A clean copy of the current article is always stored in a separate
26296 buffer to allow easier treatment.
26297
26298 @item
26299 Gnus can suggest where to save articles (@pxref{Saving Articles}).
26300
26301 @item
26302 Gnus doesn't have to do as much prompting when saving (@pxref{Saving
26303 Articles}).
26304
26305 @lisp
26306 (setq gnus-prompt-before-saving t)
26307 @end lisp
26308
26309 @item
26310 @code{gnus-uu} can view decoded files asynchronously while fetching
26311 articles (@pxref{Other Decode Variables}).
26312
26313 @lisp
26314 (setq gnus-uu-grabbed-file-functions 'gnus-uu-grab-view)
26315 @end lisp
26316
26317 @item
26318 Filling in the article buffer now works properly on cited text
26319 (@pxref{Article Washing}).
26320
26321 @item
26322 Hiding cited text adds buttons to toggle hiding, and how much
26323 cited text to hide is now customizable (@pxref{Article Hiding}).
26324
26325 @lisp
26326 (setq gnus-cited-lines-visible 2)
26327 @end lisp
26328
26329 @item
26330 Boring headers can be hidden (@pxref{Article Hiding}).
26331
26332 @item
26333 Default scoring values can now be set from the menu bar.
26334
26335 @item
26336 Further syntax checking of outgoing articles have been added.
26337
26338 @end itemize
26339
26340
26341 @node Red Gnus
26342 @subsubsection Red Gnus
26343
26344 New features in Gnus 5.4/5.5:
26345
26346 @iftex
26347 @iflatex
26348 \gnusfig{-5.5cm}{-4cm}{\epsfig{figure=ps/red,height=20cm}}
26349 @end iflatex
26350 @end iftex
26351
26352 @itemize @bullet
26353
26354 @item
26355 @file{nntp.el} has been totally rewritten in an asynchronous fashion.
26356
26357 @item
26358 Article prefetching functionality has been moved up into
26359 Gnus (@pxref{Asynchronous Fetching}).
26360
26361 @item
26362 Scoring can now be performed with logical operators like @code{and},
26363 @code{or}, @code{not}, and parent redirection (@pxref{Advanced
26364 Scoring}).
26365
26366 @item
26367 Article washing status can be displayed in the
26368 article mode line (@pxref{Misc Article}).
26369
26370 @item
26371 @file{gnus.el} has been split into many smaller files.
26372
26373 @item
26374 Suppression of duplicate articles based on Message-ID can be done
26375 (@pxref{Duplicate Suppression}).
26376
26377 @lisp
26378 (setq gnus-suppress-duplicates t)
26379 @end lisp
26380
26381 @item
26382 New variables for specifying what score and adapt files are to be
26383 considered home score and adapt files (@pxref{Home Score File}) have
26384 been added.
26385
26386 @item
26387 @code{nndoc} was rewritten to be easily extendable (@pxref{Document
26388 Server Internals}).
26389
26390 @item
26391 Groups can inherit group parameters from parent topics (@pxref{Topic
26392 Parameters}).
26393
26394 @item
26395 Article editing has been revamped and is now actually usable.
26396
26397 @item
26398 Signatures can be recognized in more intelligent fashions
26399 (@pxref{Article Signature}).
26400
26401 @item
26402 Summary pick mode has been made to look more @code{nn}-like.  Line
26403 numbers are displayed and the @kbd{.} command can be used to pick
26404 articles (@code{Pick and Read}).
26405
26406 @item
26407 Commands for moving the @file{.newsrc.eld} from one server to
26408 another have been added (@pxref{Changing Servers}).
26409
26410 @item
26411 There's a way now to specify that ``uninteresting'' fields be suppressed
26412 when generating lines in buffers (@pxref{Advanced Formatting}).
26413
26414 @item
26415 Several commands in the group buffer can be undone with @kbd{C-M-_}
26416 (@pxref{Undo}).
26417
26418 @item
26419 Scoring can be done on words using the new score type @code{w}
26420 (@pxref{Score File Format}).
26421
26422 @item
26423 Adaptive scoring can be done on a Subject word-by-word basis
26424 (@pxref{Adaptive Scoring}).
26425
26426 @lisp
26427 (setq gnus-use-adaptive-scoring '(word))
26428 @end lisp
26429
26430 @item
26431 Scores can be decayed (@pxref{Score Decays}).
26432
26433 @lisp
26434 (setq gnus-decay-scores t)
26435 @end lisp
26436
26437 @item
26438 Scoring can be performed using a regexp on the Date header.  The Date is
26439 normalized to compact ISO 8601 format first (@pxref{Score File Format}).
26440
26441 @item
26442 A new command has been added to remove all data on articles from
26443 the native server (@pxref{Changing Servers}).
26444
26445 @item
26446 A new command for reading collections of documents
26447 (@code{nndoc} with @code{nnvirtual} on top) has been added---@kbd{C-M-d}
26448 (@pxref{Really Various Summary Commands}).
26449
26450 @item
26451 Process mark sets can be pushed and popped (@pxref{Setting Process
26452 Marks}).
26453
26454 @item
26455 A new mail-to-news back end makes it possible to post even when the @acronym{NNTP}
26456 server doesn't allow posting (@pxref{Mail-To-News Gateways}).
26457
26458 @item
26459 A new back end for reading searches from Web search engines
26460 (@dfn{DejaNews}, @dfn{Alta Vista}, @dfn{InReference}) has been added
26461 (@pxref{Web Searches}).
26462
26463 @item
26464 Groups inside topics can now be sorted using the standard sorting
26465 functions, and each topic can be sorted independently (@pxref{Topic
26466 Sorting}).
26467
26468 @item
26469 Subsets of the groups can be sorted independently (@code{Sorting
26470 Groups}).
26471
26472 @item
26473 Cached articles can be pulled into the groups (@pxref{Summary Generation
26474 Commands}).
26475 @iftex
26476 @iflatex
26477 \marginpar[\mbox{}\hfill\epsfig{figure=ps/fred,width=3cm}]{\epsfig{figure=ps/fred,width=3cm}}
26478 @end iflatex
26479 @end iftex
26480
26481 @item
26482 Score files are now applied in a more reliable order (@pxref{Score
26483 Variables}).
26484
26485 @item
26486 Reports on where mail messages end up can be generated (@pxref{Splitting
26487 Mail}).
26488
26489 @item
26490 More hooks and functions have been added to remove junk from incoming
26491 mail before saving the mail (@pxref{Washing Mail}).
26492
26493 @item
26494 Emphasized text can be properly fontisized:
26495
26496 @end itemize
26497
26498
26499 @node Quassia Gnus
26500 @subsubsection Quassia Gnus
26501
26502 New features in Gnus 5.6:
26503
26504 @itemize @bullet
26505
26506 @item
26507 New functionality for using Gnus as an offline newsreader has been
26508 added.  A plethora of new commands and modes have been added.
26509 @xref{Gnus Unplugged}, for the full story.
26510
26511 @item
26512 The @code{nndraft} back end has returned, but works differently than
26513 before.  All Message buffers are now also articles in the @code{nndraft}
26514 group, which is created automatically.
26515
26516 @item
26517 @code{gnus-alter-header-function} can now be used to alter header
26518 values.
26519
26520 @item
26521 @code{gnus-summary-goto-article} now accept Message-ID's.
26522
26523 @item
26524 A new Message command for deleting text in the body of a message
26525 outside the region: @kbd{C-c C-v}.
26526
26527 @item
26528 You can now post to component group in @code{nnvirtual} groups with
26529 @kbd{C-u C-c C-c}.
26530
26531 @item
26532  @code{nntp-rlogin-program}---new variable to ease customization.
26533
26534 @item
26535 @code{C-u C-c C-c} in @code{gnus-article-edit-mode} will now inhibit
26536 re-highlighting of the article buffer.
26537
26538 @item
26539 New element in @code{gnus-boring-article-headers}---@code{long-to}.
26540
26541 @item
26542 @kbd{M-i} symbolic prefix command.  @xref{Symbolic Prefixes}, for
26543 details.
26544
26545 @item
26546 @kbd{L} and @kbd{I} in the summary buffer now take the symbolic prefix
26547 @kbd{a} to add the score rule to the @file{all.SCORE} file.
26548
26549 @item
26550 @code{gnus-simplify-subject-functions} variable to allow greater
26551 control over simplification.
26552
26553 @item
26554 @kbd{A T}---new command for fetching the current thread.
26555
26556 @item
26557 @kbd{/ T}---new command for including the current thread in the
26558 limit.
26559
26560 @item
26561 @kbd{M-RET} is a new Message command for breaking cited text.
26562
26563 @item
26564 @samp{\\1}-expressions are now valid in @code{nnmail-split-methods}.
26565
26566 @item
26567 The @code{custom-face-lookup} function has been removed.
26568 If you used this function in your initialization files, you must
26569 rewrite them to use @code{face-spec-set} instead.
26570
26571 @item
26572 Canceling now uses the current select method.  Symbolic prefix
26573 @kbd{a} forces normal posting method.
26574
26575 @item
26576 New command to translate M******** sm*rtq**t*s into proper
26577 text---@kbd{W d}.
26578
26579 @item
26580 For easier debugging of @code{nntp}, you can set
26581 @code{nntp-record-commands} to a non-@code{nil} value.
26582
26583 @item
26584 @code{nntp} now uses @file{~/.authinfo}, a @file{.netrc}-like file, for
26585 controlling where and how to send @sc{authinfo} to @acronym{NNTP} servers.
26586
26587 @item
26588 A command for editing group parameters from the summary buffer
26589 has been added.
26590
26591 @item
26592 A history of where mails have been split is available.
26593
26594 @item
26595 A new article date command has been added---@code{article-date-iso8601}.
26596
26597 @item
26598 Subjects can be simplified when threading by setting
26599 @code{gnus-score-thread-simplify}.
26600
26601 @item
26602 A new function for citing in Message has been
26603 added---@code{message-cite-original-without-signature}.
26604
26605 @item
26606 @code{article-strip-all-blank-lines}---new article command.
26607
26608 @item
26609 A new Message command to kill to the end of the article has
26610 been added.
26611
26612 @item
26613 A minimum adaptive score can be specified by using the
26614 @code{gnus-adaptive-word-minimum} variable.
26615
26616 @item
26617 The ``lapsed date'' article header can be kept continually
26618 updated by the @code{gnus-start-date-timer} command.
26619
26620 @item
26621 Web listserv archives can be read with the @code{nnlistserv} back end.
26622
26623 @item
26624 Old dejanews archives can now be read by @code{nnweb}.
26625
26626 @end itemize
26627
26628 @node Pterodactyl Gnus
26629 @subsubsection Pterodactyl Gnus
26630
26631 New features in Gnus 5.8:
26632
26633 @itemize @bullet
26634
26635 @item
26636 The mail-fetching functions have changed.  See the manual for the
26637 many details.  In particular, all procmail fetching variables are gone.
26638
26639 If you used procmail like in
26640
26641 @lisp
26642 (setq nnmail-use-procmail t)
26643 (setq nnmail-spool-file 'procmail)
26644 (setq nnmail-procmail-directory "~/mail/incoming/")
26645 (setq nnmail-procmail-suffix "\\.in")
26646 @end lisp
26647
26648 this now has changed to
26649
26650 @lisp
26651 (setq mail-sources
26652       '((directory :path "~/mail/incoming/"
26653                    :suffix ".in")))
26654 @end lisp
26655
26656 @xref{Mail Source Specifiers}.
26657
26658 @item
26659 Gnus is now a @acronym{MIME}-capable reader.  This affects many parts of
26660 Gnus, and adds a slew of new commands.  See the manual for details.
26661
26662 @item
26663 Gnus has also been multilingualized.  This also affects too
26664 many parts of Gnus to summarize here, and adds many new variables.
26665
26666 @item
26667 @code{gnus-auto-select-first} can now be a function to be
26668 called to position point.
26669
26670 @item
26671 The user can now decide which extra headers should be included in
26672 summary buffers and @acronym{NOV} files.
26673
26674 @item
26675 @code{gnus-article-display-hook} has been removed.  Instead, a number
26676 of variables starting with @code{gnus-treat-} have been added.
26677
26678 @item
26679 The Gnus posting styles have been redone again and now works in a
26680 subtly different manner.
26681
26682 @item
26683 New web-based back ends have been added: @code{nnslashdot},
26684 @code{nnwarchive} and @code{nnultimate}.  nnweb has been revamped,
26685 again, to keep up with ever-changing layouts.
26686
26687 @item
26688 Gnus can now read @acronym{IMAP} mail via @code{nnimap}.
26689
26690 @end itemize
26691
26692 @node Oort Gnus
26693 @subsubsection Oort Gnus
26694 @cindex Oort Gnus
26695
26696 New features in Gnus 5.10:
26697
26698 @itemize @bullet
26699
26700 @item
26701 @kbd{F} (@code{gnus-article-followup-with-original}) and @kbd{R}
26702 (@code{gnus-article-reply-with-original}) only yank the text in the
26703 region if the region is active.
26704
26705 @item
26706 @code{gnus-group-read-ephemeral-group} can be called interactively,
26707 using @kbd{G M}.
26708
26709 @item
26710 In draft groups, @kbd{e} is now bound to @code{gnus-draft-edit-message}.
26711 Use @kbd{B w} for @code{gnus-summary-edit-article} instead.
26712
26713 @item
26714 The revised Gnus @acronym{FAQ} is included in the manual,
26715 @xref{Frequently Asked Questions}.
26716
26717 @item
26718 Upgrading from previous (stable) version if you have used Oort.
26719
26720 If you have tried Oort (the unstable Gnus branch leading to this
26721 release) but went back to a stable version, be careful when upgrading to
26722 this version.  In particular, you will probably want to remove all
26723 @file{.marks} (nnml) and @file{.mrk} (nnfolder) files, so that flags are
26724 read from your @file{.newsrc.eld} instead of from the
26725 @file{.marks}/@file{.mrk} file where this release store flags.  See a
26726 later entry for more information about marks.  Note that downgrading
26727 isn't save in general.
26728
26729 @item
26730 Article Buttons
26731
26732 More buttons for URLs, mail addresses, Message-IDs, Info links, man
26733 pages and Emacs or Gnus related references.  @xref{Article Buttons}.  The
26734 variables @code{gnus-button-@var{*}-level} can be used to control the
26735 appearance of all article buttons.  @xref{Article Button Levels}.
26736
26737 @item
26738 Dired integration
26739
26740 @code{gnus-dired-minor-mode} (see @ref{Other modes}) installs key
26741 bindings in dired buffers to send a file as an attachment, open a file
26742 using the appropriate mailcap entry, and print a file using the mailcap
26743 entry.
26744
26745 @item
26746 Gnus can display RSS newsfeeds as a newsgroup.  @xref{RSS}.
26747
26748 @item
26749 Single-part yenc encoded attachments can be decoded.
26750
26751 @item
26752 Picons
26753
26754 The picons code has been reimplemented to work in GNU Emacs---some of
26755 the previous options have been removed or renamed.
26756
26757 Picons are small ``personal icons'' representing users, domain and
26758 newsgroups, which can be displayed in the Article buffer.
26759 @xref{Picons}.
26760
26761 @item
26762 If the new option @code{gnus-treat-body-boundary} is non-@code{nil}, a
26763 boundary line is drawn at the end of the headers.
26764
26765 @item
26766 Retrieval of charters and control messages
26767
26768 There are new commands for fetching newsgroup charters (@kbd{H c}) and
26769 control messages (@kbd{H C}).
26770
26771 @item
26772 Delayed articles
26773
26774 You can delay the sending of a message with @kbd{C-c C-j} in the Message
26775 buffer.  The messages are delivered at specified time.  This is useful
26776 for sending yourself reminders.  @xref{Delayed Articles}.
26777
26778 @item
26779 If @code{auto-compression-mode} is enabled, attachments are automatically
26780 decompressed when activated.
26781
26782 @item
26783 If the new option @code{nnml-use-compressed-files} is non-@code{nil},
26784 the nnml back end allows compressed message files.
26785
26786 @item
26787 Signed article headers (X-PGP-Sig) can be verified with @kbd{W p}.
26788
26789 @item
26790 The Summary Buffer uses an arrow in the fringe to indicate the current
26791 article.  Use @code{(setq gnus-summary-display-arrow nil)} to disable it.
26792
26793 @item
26794 Warn about email replies to news
26795
26796 Do you often find yourself replying to news by email by mistake?  Then
26797 the new option @code{gnus-confirm-mail-reply-to-news} is just the thing for
26798 you.
26799
26800 @item
26801 If the new option @code{gnus-summary-display-while-building} is
26802 non-@code{nil}, the summary buffer is shown and updated as it's being
26803 built.
26804
26805 @item
26806 The new @code{recent} mark @samp{.} indicates newly arrived messages (as
26807 opposed to old but unread messages).
26808
26809 @item
26810 The new option @code{gnus-gcc-mark-as-read} automatically marks
26811 Gcc articles as read.
26812
26813 @item
26814 The nndoc back end now supports mailman digests and exim bounces.
26815
26816 @item
26817 Gnus supports RFC 2369 mailing list headers, and adds a number of
26818 related commands in mailing list groups.  @xref{Mailing List}.
26819
26820 @item
26821 The Date header can be displayed in a format that can be read aloud
26822 in English.  @xref{Article Date}.
26823
26824 @item
26825 The envelope sender address can be customized when using Sendmail.
26826 @xref{Mail Variables, Mail Variables,, message, Message Manual}.
26827
26828 @item
26829 diffs are automatically highlighted in groups matching
26830 @code{mm-uu-diff-groups-regexp}
26831
26832 @item
26833 @acronym{TLS} wrapper shipped with Gnus
26834
26835 @acronym{TLS}/@acronym{SSL} is now supported in @acronym{IMAP} and
26836 @acronym{NNTP} via @file{tls.el} and GNUTLS.  The old
26837 @acronym{TLS}/@acronym{SSL} support via (external third party)
26838 @file{ssl.el} and OpenSSL still works.
26839
26840 @item
26841 New @file{make.bat} for compiling and installing Gnus under MS Windows
26842
26843 Use @file{make.bat} if you want to install Gnus under MS Windows, the
26844 first argument to the batch-program should be the directory where
26845 @file{xemacs.exe} respectively @file{emacs.exe} is located, iff you want
26846 to install Gnus after compiling it, give @file{make.bat} @code{/copy} as
26847 the second parameter.
26848
26849 @file{make.bat} has been rewritten from scratch, it now features
26850 automatic recognition of XEmacs and GNU Emacs, generates
26851 @file{gnus-load.el}, checks if errors occur while compilation and
26852 generation of info files and reports them at the end of the build
26853 process.  It now uses @code{makeinfo} if it is available and falls
26854 back to @file{infohack.el} otherwise.  @file{make.bat} should now
26855 install all files which are necessary to run Gnus and be generally a
26856 complete replacement for the @code{configure; make; make install}
26857 cycle used under Unix systems.
26858
26859 The new @file{make.bat} makes @file{make-x.bat} superfluous, so it has
26860 been removed.
26861
26862 @item
26863 Support for non-@acronym{ASCII} domain names
26864
26865 Message supports non-@acronym{ASCII} domain names in From:, To: and
26866 Cc: and will query you whether to perform encoding when you try to
26867 send a message.  The variable @code{message-use-idna} controls this.
26868 Gnus will also decode non-@acronym{ASCII} domain names in From:, To:
26869 and Cc: when you view a message.  The variable @code{gnus-use-idna}
26870 controls this.
26871
26872 @item
26873 Better handling of Microsoft citation styles
26874
26875 Gnus now tries to recognize the mangled header block that some Microsoft
26876 mailers use to indicate that the rest of the message is a citation, even
26877 though it is not quoted in any way.  The variable
26878 @code{gnus-cite-unsightly-citation-regexp} matches the start of these
26879 citations.
26880
26881 @item
26882 @code{gnus-article-skip-boring}
26883
26884 If you set @code{gnus-article-skip-boring} to @code{t}, then Gnus will
26885 not scroll down to show you a page that contains only boring text,
26886 which by default means cited text and signature.  You can customize
26887 what is skippable using @code{gnus-article-boring-faces}.
26888
26889 This feature is especially useful if you read many articles that
26890 consist of a little new content at the top with a long, untrimmed
26891 message cited below.
26892
26893 @item
26894 The format spec @code{%C} for positioning point has changed to @code{%*}.
26895
26896 @item
26897 The new variable @code{gnus-parameters} can be used to set group parameters.
26898
26899 Earlier this was done only via @kbd{G p} (or @kbd{G c}), which stored
26900 the parameters in @file{~/.newsrc.eld}, but via this variable you can
26901 enjoy the powers of customize, and simplified backups since you set the
26902 variable in @file{~/.gnus.el} instead of @file{~/.newsrc.eld}.  The
26903 variable maps regular expressions matching group names to group
26904 parameters, a'la:
26905 @lisp
26906 (setq gnus-parameters
26907       '(("mail\\..*"
26908          (gnus-show-threads nil)
26909          (gnus-use-scoring nil))
26910         ("^nnimap:\\(foo.bar\\)$"
26911          (to-group . "\\1"))))
26912 @end lisp
26913
26914 @item
26915 Smileys (@samp{:-)}, @samp{;-)} etc) are now iconized for Emacs too.
26916
26917 Put @code{(setq gnus-treat-display-smileys nil)} in @file{~/.gnus.el} to
26918 disable it.
26919
26920 @item
26921 Gnus no longer generate the Sender: header automatically.
26922
26923 Earlier it was generated iff the user configurable email address was
26924 different from the Gnus guessed default user address.  As the guessing
26925 algorithm is rarely correct these days, and (more controversially) the
26926 only use of the Sender: header was to check if you are entitled to
26927 cancel/supersede news (which is now solved by Cancel Locks instead,
26928 see another entry), generation of the header has been disabled by
26929 default.  See the variables @code{message-required-headers},
26930 @code{message-required-news-headers}, and
26931 @code{message-required-mail-headers}.
26932
26933 @item
26934 Features from third party @file{message-utils.el} added to @file{message.el}.
26935
26936 Message now asks if you wish to remove @samp{(was: <old subject>)} from
26937 subject lines (see @code{message-subject-trailing-was-query}).  @kbd{C-c
26938 M-m} and @kbd{C-c M-f} inserts markers indicating included text.
26939 @kbd{C-c C-f a} adds a X-No-Archive: header.  @kbd{C-c C-f x} inserts
26940 appropriate headers and a note in the body for cross-postings and
26941 followups (see the variables @code{message-cross-post-@var{*}}).
26942
26943 @item
26944 References and X-Draft-From headers are no longer generated when you
26945 start composing messages and @code{message-generate-headers-first} is
26946 @code{nil}.
26947
26948 @item
26949 Improved anti-spam features.
26950
26951 Gnus is now able to take out spam from your mail and news streams
26952 using a wide variety of programs and filter rules.  Among the supported
26953 methods are RBL blocklists, bogofilter and white/blacklists.  Hooks
26954 for easy use of external packages such as SpamAssassin and Hashcash
26955 are also new.  @xref{Thwarting Email Spam}.
26956
26957 @item
26958 Easy inclusion of X-Faces headers.
26959
26960 @item
26961 Face headers handling.
26962
26963 @item
26964 In the summary buffer, the new command @kbd{/ N} inserts new messages
26965 and @kbd{/ o} inserts old messages.
26966
26967 @item
26968 Gnus decodes morse encoded messages if you press @kbd{W m}.
26969
26970 @item
26971 Unread count correct in nnimap groups.
26972
26973 The estimated number of unread articles in the group buffer should now
26974 be correct for nnimap groups.  This is achieved by calling
26975 @code{nnimap-fixup-unread-after-getting-new-news} from the
26976 @code{gnus-setup-news-hook} (called on startup) and
26977 @code{gnus-after-getting-new-news-hook}. (called after getting new
26978 mail).  If you have modified those variables from the default, you may
26979 want to add @code{nnimap-fixup-unread-after-getting-new-news} again.  If
26980 you were happy with the estimate and want to save some (minimal) time
26981 when getting new mail, remove the function.
26982
26983 @item
26984 Group Carbon Copy (GCC) quoting
26985
26986 To support groups that contains SPC and other weird characters, groups
26987 are quoted before they are placed in the Gcc: header.  This means
26988 variables such as @code{gnus-message-archive-group} should no longer
26989 contain quote characters to make groups containing SPC work.  Also, if
26990 you are using the string @samp{nnml:foo, nnml:bar} (indicating Gcc
26991 into two groups) you must change it to return the list
26992 @code{("nnml:foo" "nnml:bar")}, otherwise the Gcc: line will be quoted
26993 incorrectly.  Note that returning the string @samp{nnml:foo, nnml:bar}
26994 was incorrect earlier, it just didn't generate any problems since it
26995 was inserted directly.
26996
26997 @item
26998 @file{~/News/overview/} not used.
26999
27000 As a result of the following change, the @file{~/News/overview/}
27001 directory is not used any more.  You can safely delete the entire
27002 hierarchy.
27003
27004 @item
27005 @code{gnus-agent}
27006
27007 The Gnus Agent has seen a major updated and is now enabled by default,
27008 and all nntp and nnimap servers from @code{gnus-select-method} and
27009 @code{gnus-secondary-select-method} are agentized by default.  Earlier
27010 only the server in @code{gnus-select-method} was agentized by the
27011 default, and the agent was disabled by default.  When the agent is
27012 enabled, headers are now also retrieved from the Agent cache instead
27013 of the back ends when possible.  Earlier this only happened in the
27014 unplugged state.  You can enroll or remove servers with @kbd{J a} and
27015 @kbd{J r} in the server buffer.  Gnus will not download articles into
27016 the Agent cache, unless you instruct it to do so, though, by using
27017 @kbd{J u} or @kbd{J s} from the Group buffer.  You revert to the old
27018 behavior of having the Agent disabled with @code{(setq gnus-agent
27019 nil)}.  Note that putting @code{(gnus-agentize)} in @file{~/.gnus.el}
27020 is not needed any more.
27021
27022 @item
27023 @code{gnus-summary-line-format}
27024
27025 The default value changed to @samp{%U%R%z%I%(%[%4L: %-23,23f%]%)
27026 %s\n}.  Moreover @code{gnus-extra-headers},
27027 @code{nnmail-extra-headers} and @code{gnus-ignored-from-addresses}
27028 changed their default so that the users name will be replaced by the
27029 recipient's name or the group name posting to for @acronym{NNTP}
27030 groups.
27031
27032 @item
27033 @file{deuglify.el} (@code{gnus-article-outlook-deuglify-article})
27034
27035 A new file from Raymond Scholz @email{rscholz@@zonix.de} for deuglifying
27036 broken Outlook (Express) articles.
27037
27038 @c FIXME: `gnus-load' is mentioned in README, which is not included in
27039 @c CVS.  We should find a better place for this item.
27040 @item
27041 @code{(require 'gnus-load)}
27042
27043 If you use a stand-alone Gnus distribution, you'd better add
27044 @code{(require 'gnus-load)} into your @file{~/.emacs} after adding the Gnus
27045 lisp directory into load-path.
27046
27047 File @file{gnus-load.el} contains autoload commands, functions and variables,
27048 some of which may not be included in distributions of Emacsen.
27049
27050 @item
27051 @code{gnus-slave-unplugged}
27052
27053 A new command which starts Gnus offline in slave mode.
27054
27055 @item
27056 @code{message-insinuate-rmail}
27057
27058 Adding @code{(message-insinuate-rmail)} and @code{(setq
27059 mail-user-agent 'gnus-user-agent)} in @file{.emacs} convinces Rmail to
27060 compose, reply and forward messages in message-mode, where you can
27061 enjoy the power of @acronym{MML}.
27062
27063 @item
27064 @code{message-minibuffer-local-map}
27065
27066 The line below enables BBDB in resending a message:
27067 @lisp
27068 (define-key message-minibuffer-local-map [(tab)]
27069   'bbdb-complete-name)
27070 @end lisp
27071
27072 @item
27073 Externalizing and deleting of attachments.
27074
27075 If @code{gnus-gcc-externalize-attachments} or
27076 @code{message-fcc-externalize-attachments} is non-@code{nil}, attach
27077 local files as external parts.
27078
27079 The command @code{gnus-mime-save-part-and-strip} (bound to @kbd{C-o}
27080 on @acronym{MIME} buttons) saves a part and replaces the part with an
27081 external one.  @code{gnus-mime-delete-part} (bound to @kbd{d} on
27082 @acronym{MIME} buttons) removes a part.  It works only on back ends
27083 that support editing.
27084
27085 @item
27086 @code{gnus-default-charset}
27087
27088 The default value is determined from the
27089 @code{current-language-environment} variable, instead of
27090 @code{iso-8859-1}.  Also the @samp{.*} item in
27091 @code{gnus-group-charset-alist} is removed.
27092
27093 @item
27094 @code{gnus-posting-styles}
27095
27096 Add a new format of match like
27097 @lisp
27098 ((header "to" "larsi.*org")
27099  (Organization "Somewhere, Inc."))
27100 @end lisp
27101 The old format like the lines below is obsolete, but still accepted.
27102 @lisp
27103 (header "to" "larsi.*org"
27104         (Organization "Somewhere, Inc."))
27105 @end lisp
27106
27107 @item
27108 @code{message-ignored-news-headers} and @code{message-ignored-mail-headers}
27109
27110 @samp{X-Draft-From} and @samp{X-Gnus-Agent-Meta-Information} have been
27111 added into these two variables.  If you customized those, perhaps you
27112 need add those two headers too.
27113
27114 @item
27115 Gnus reads the @acronym{NOV} and articles in the Agent if plugged.
27116
27117 If one reads an article while plugged, and the article already exists
27118 in the Agent, it won't get downloaded once more.  @code{(setq
27119 gnus-agent-cache nil)} reverts to the old behavior.
27120
27121 @item
27122 Gnus supports the ``format=flowed'' (RFC 2646) parameter.  On
27123 composing messages, it is enabled by @code{use-hard-newlines}.
27124 Decoding format=flowed was present but not documented in earlier
27125 versions.
27126
27127 @item
27128 The option @code{mm-fill-flowed} can be used to disable treatment of
27129 ``format=flowed'' messages.  Also, flowed text is disabled when sending
27130 inline PGP signed messages.  (New in Gnus 5.10.7)
27131
27132 @item
27133 Gnus supports the generation of RFC 2298 Disposition Notification requests.
27134
27135 This is invoked with the @kbd{C-c M-n} key binding from message mode.
27136
27137 @item
27138 Gnus supports Maildir groups.
27139
27140 Gnus includes a new back end @file{nnmaildir.el}.  @xref{Maildir}.
27141
27142 @item
27143 Printing capabilities are enhanced.
27144
27145 Gnus supports Muttprint natively with @kbd{O P} from the Summary and
27146 Article buffers.  Also, each individual @acronym{MIME} part can be
27147 printed using @kbd{p} on the @acronym{MIME} button.
27148
27149 @item
27150 Message supports the Importance: (RFC 2156) header.
27151
27152 In the message buffer, @kbd{C-c C-f C-i} or @kbd{C-c C-u} cycles through
27153 the valid values.
27154
27155 @item
27156 Gnus supports Cancel Locks in News.
27157
27158 This means a header @samp{Cancel-Lock} is inserted in news posting.  It is
27159 used to determine if you wrote an article or not (for canceling and
27160 superseding).  Gnus generates a random password string the first time
27161 you post a message, and saves it in your @file{~/.emacs} using the Custom
27162 system.  While the variable is called @code{canlock-password}, it is not
27163 security sensitive data.  Publishing your canlock string on the web
27164 will not allow anyone to be able to anything she could not already do.
27165 The behavior can be changed by customizing @code{message-insert-canlock}.
27166
27167 @item
27168 Gnus supports server-side mail filtering using Sieve.
27169
27170 Sieve rules can be added as Group Parameters for groups, and the
27171 complete Sieve script is generated using @kbd{D g} from the Group
27172 buffer, and then uploaded to the server using @kbd{C-c C-l} in the
27173 generated Sieve buffer.  @xref{Sieve Commands}, and the new Sieve
27174 manual @ref{Top, , Top, sieve, Emacs Sieve}.
27175
27176 @item
27177 Extended format specs.
27178
27179 Format spec @samp{%&user-date;} is added into
27180 @code{gnus-summary-line-format-alist}.  Also, user defined extended
27181 format specs are supported.  The extended format specs look like
27182 @samp{%u&foo;}, which invokes function
27183 @code{gnus-user-format-function-@var{foo}}.  Because @samp{&} is used as the
27184 escape character, old user defined format @samp{%u&} is no longer supported.
27185
27186 @item
27187 @kbd{/ *} (@code{gnus-summary-limit-include-cached}) is rewritten.
27188
27189 It was aliased to @kbd{Y c}
27190 (@code{gnus-summary-insert-cached-articles}).  The new function filters
27191 out other articles.
27192
27193 @item
27194 Some limiting commands accept a @kbd{C-u} prefix to negate the match.
27195
27196 If @kbd{C-u} is used on subject, author or extra headers, i.e., @kbd{/
27197 s}, @kbd{/ a}, and @kbd{/ x}
27198 (@code{gnus-summary-limit-to-@{subject,author,extra@}}) respectively, the
27199 result will be to display all articles that do not match the expression.
27200
27201 @item
27202 Group names are treated as UTF-8 by default.
27203
27204 This is supposedly what USEFOR wanted to migrate to.  See
27205 @code{gnus-group-name-charset-group-alist} and
27206 @code{gnus-group-name-charset-method-alist} for customization.
27207
27208 @item
27209 The nnml and nnfolder back ends store marks for each groups.
27210
27211 This makes it possible to take backup of nnml/nnfolder servers/groups
27212 separately of @file{~/.newsrc.eld}, while preserving marks.  It also
27213 makes it possible to share articles and marks between users (without
27214 sharing the @file{~/.newsrc.eld} file) within e.g. a department.  It
27215 works by storing the marks stored in @file{~/.newsrc.eld} in a per-group
27216 file @file{.marks} (for nnml) and @file{@var{groupname}.mrk} (for
27217 nnfolder, named @var{groupname}).  If the nnml/nnfolder is moved to
27218 another machine, Gnus will automatically use the @file{.marks} or
27219 @file{.mrk} file instead of the information in @file{~/.newsrc.eld}.
27220 The new server variables @code{nnml-marks-is-evil} and
27221 @code{nnfolder-marks-is-evil} can be used to disable this feature.
27222
27223 @item
27224 The menu bar item (in Group and Summary buffer) named ``Misc'' has
27225 been renamed to ``Gnus''.
27226
27227 @item
27228 The menu bar item (in Message mode) named ``@acronym{MML}'' has been
27229 renamed to ``Attachments''.  Note that this menu also contains security
27230 related stuff, like signing and encryption (@pxref{Security, Security,,
27231 message, Message Manual}).
27232
27233 @item
27234 @code{gnus-group-charset-alist} and
27235 @code{gnus-group-ignored-charsets-alist}.
27236
27237 The regexps in these variables are compared with full group names
27238 instead of real group names in 5.8.  Users who customize these
27239 variables should change those regexps accordingly.  For example:
27240 @lisp
27241 ("^han\\>" euc-kr) -> ("\\(^\\|:\\)han\\>" euc-kr)
27242 @end lisp
27243
27244 @item
27245 Gnus supports @acronym{PGP} (RFC 1991/2440), @acronym{PGP/MIME} (RFC
27246 2015/3156) and @acronym{S/MIME} (RFC 2630-2633).
27247
27248 It needs an external @acronym{S/MIME} and OpenPGP implementation, but no
27249 additional Lisp libraries.  This add several menu items to the
27250 Attachments menu, and @kbd{C-c RET} key bindings, when composing
27251 messages.  This also obsoletes @code{gnus-article-hide-pgp-hook}.
27252
27253 @item
27254 Gnus inlines external parts (message/external).
27255
27256 @item
27257 @acronym{MML} (Mime compose) prefix changed from @kbd{M-m} to @kbd{C-c
27258 C-m}.
27259
27260 This change was made to avoid conflict with the standard binding of
27261 @code{back-to-indentation}, which is also useful in message mode.
27262
27263 @item
27264 The default for @code{message-forward-show-mml} changed to symbol @code{best}.
27265
27266 The behavior for the @code{best} value is to show @acronym{MML} (i.e.,
27267 convert to @acronym{MIME}) when appropriate.  @acronym{MML} will not be
27268 used when forwarding signed or encrypted messages, as the conversion
27269 invalidate the digital signature.
27270 @end itemize
27271
27272 @node No Gnus
27273 @subsubsection No Gnus
27274 @cindex No Gnus
27275
27276 New features in No Gnus:
27277 @c FIXME: Gnus 5.12?
27278
27279 @include gnus-news.texi
27280
27281 @iftex
27282
27283 @page
27284 @node The Manual
27285 @section The Manual
27286 @cindex colophon
27287 @cindex manual
27288
27289 This manual was generated from a TeXinfo file and then run through
27290 either @code{texi2dvi}
27291 @iflatex
27292 or my own home-brewed TeXinfo to \LaTeX\ transformer,
27293 and then run through @code{latex} and @code{dvips}
27294 @end iflatex
27295 to get what you hold in your hands now.
27296
27297 The following conventions have been used:
27298
27299 @enumerate
27300
27301 @item
27302 This is a @samp{string}
27303
27304 @item
27305 This is a @kbd{keystroke}
27306
27307 @item
27308 This is a @file{file}
27309
27310 @item
27311 This is a @code{symbol}
27312
27313 @end enumerate
27314
27315 So if I were to say ``set @code{flargnoze} to @samp{yes}'', that would
27316 mean:
27317
27318 @lisp
27319 (setq flargnoze "yes")
27320 @end lisp
27321
27322 If I say ``set @code{flumphel} to @code{yes}'', that would mean:
27323
27324 @lisp
27325 (setq flumphel 'yes)
27326 @end lisp
27327
27328 @samp{yes} and @code{yes} are two @emph{very} different things---don't
27329 ever get them confused.
27330
27331 @iflatex
27332 @c @head
27333 Of course, everything in this manual is of vital interest, so you should
27334 read it all.  Several times.  However, if you feel like skimming the
27335 manual, look for that gnu head you should see in the margin over
27336 there---it means that what's being discussed is of more importance than
27337 the rest of the stuff.  (On the other hand, if everything is infinitely
27338 important, how can anything be more important than that?  Just one more
27339 of the mysteries of this world, I guess.)
27340 @end iflatex
27341
27342 @end iftex
27343
27344
27345 @node On Writing Manuals
27346 @section On Writing Manuals
27347
27348 I guess most manuals are written after-the-fact; documenting a program
27349 that's already there.  This is not how this manual is written.  When
27350 implementing something, I write the manual entry for that something
27351 straight away.  I then see that it's difficult to explain the
27352 functionality, so I write how it's supposed to be, and then I change the
27353 implementation.  Writing the documentation and writing the code goes
27354 hand in hand.
27355
27356 This, of course, means that this manual has no, or little, flow.  It
27357 documents absolutely everything in Gnus, but often not where you're
27358 looking for it.  It is a reference manual, and not a guide to how to get
27359 started with Gnus.
27360
27361 That would be a totally different book, that should be written using the
27362 reference manual as source material.  It would look quite differently.
27363
27364
27365 @page
27366 @node Terminology
27367 @section Terminology
27368
27369 @cindex terminology
27370 @table @dfn
27371
27372 @item news
27373 @cindex news
27374 This is what you are supposed to use this thing for---reading news.
27375 News is generally fetched from a nearby @acronym{NNTP} server, and is
27376 generally publicly available to everybody.  If you post news, the entire
27377 world is likely to read just what you have written, and they'll all
27378 snigger mischievously.  Behind your back.
27379
27380 @item mail
27381 @cindex mail
27382 Everything that's delivered to you personally is mail.  Some news/mail
27383 readers (like Gnus) blur the distinction between mail and news, but
27384 there is a difference.  Mail is private.  News is public.  Mailing is
27385 not posting, and replying is not following up.
27386
27387 @item reply
27388 @cindex reply
27389 Send a mail to the person who has written what you are reading.
27390
27391 @item follow up
27392 @cindex follow up
27393 Post an article to the current newsgroup responding to the article you
27394 are reading.
27395
27396 @item back end
27397 @cindex back end
27398 Gnus considers mail and news to be mostly the same, really.  The only
27399 difference is how to access the actual articles.  News articles are
27400 commonly fetched via the protocol @acronym{NNTP}, whereas mail
27401 messages could be read from a file on the local disk.  The internal
27402 architecture of Gnus thus comprises a ``front end'' and a number of
27403 ``back ends''.  Internally, when you enter a group (by hitting
27404 @key{RET}, say), you thereby invoke a function in the front end in
27405 Gnus.  The front end then ``talks'' to a back end and says things like
27406 ``Give me the list of articles in the foo group'' or ``Show me article
27407 number 4711''.
27408
27409 So a back end mainly defines either a protocol (the @code{nntp} back
27410 end accesses news via @acronym{NNTP}, the @code{nnimap} back end
27411 accesses mail via @acronym{IMAP}) or a file format and directory
27412 layout (the @code{nnspool} back end accesses news via the common
27413 ``spool directory'' format, the @code{nnml} back end access mail via a
27414 file format and directory layout that's quite similar).
27415
27416 Gnus does not handle the underlying media, so to speak---this is all
27417 done by the back ends.  A back end is a collection of functions to
27418 access the articles.
27419
27420 However, sometimes the term ``back end'' is also used where ``server''
27421 would have been more appropriate.  And then there is the term ``select
27422 method'' which can mean either.  The Gnus terminology can be quite
27423 confusing.
27424
27425 @item native
27426 @cindex native
27427 Gnus will always use one method (and back end) as the @dfn{native}, or
27428 default, way of getting news.
27429
27430 @item foreign
27431 @cindex foreign
27432 You can also have any number of foreign groups active at the same time.
27433 These are groups that use non-native non-secondary back ends for getting
27434 news.
27435
27436 @item secondary
27437 @cindex secondary
27438 Secondary back ends are somewhere half-way between being native and being
27439 foreign, but they mostly act like they are native.
27440
27441 @item article
27442 @cindex article
27443 A message that has been posted as news.
27444
27445 @item mail message
27446 @cindex mail message
27447 A message that has been mailed.
27448
27449 @item message
27450 @cindex message
27451 A mail message or news article
27452
27453 @item head
27454 @cindex head
27455 The top part of a message, where administrative information (etc.) is
27456 put.
27457
27458 @item body
27459 @cindex body
27460 The rest of an article.  Everything not in the head is in the
27461 body.
27462
27463 @item header
27464 @cindex header
27465 A line from the head of an article.
27466
27467 @item headers
27468 @cindex headers
27469 A collection of such lines, or a collection of heads.  Or even a
27470 collection of @acronym{NOV} lines.
27471
27472 @item @acronym{NOV}
27473 @cindex @acronym{NOV}
27474 When Gnus enters a group, it asks the back end for the headers of all
27475 unread articles in the group.  Most servers support the News OverView
27476 format, which is more compact and much faster to read and parse than the
27477 normal @sc{head} format.
27478
27479 @item level
27480 @cindex levels
27481 Each group is subscribed at some @dfn{level} or other (1-9).  The ones
27482 that have a lower level are ``more'' subscribed than the groups with a
27483 higher level.  In fact, groups on levels 1-5 are considered
27484 @dfn{subscribed}; 6-7 are @dfn{unsubscribed}; 8 are @dfn{zombies}; and 9
27485 are @dfn{killed}.  Commands for listing groups and scanning for new
27486 articles will all use the numeric prefix as @dfn{working level}.
27487
27488 @item killed groups
27489 @cindex killed groups
27490 No information on killed groups is stored or updated, which makes killed
27491 groups much easier to handle than subscribed groups.
27492
27493 @item zombie groups
27494 @cindex zombie groups
27495 Just like killed groups, only slightly less dead.
27496
27497 @item active file
27498 @cindex active file
27499 The news server has to keep track of what articles it carries, and what
27500 groups exist.  All this information in stored in the active file, which
27501 is rather large, as you might surmise.
27502
27503 @item bogus groups
27504 @cindex bogus groups
27505 A group that exists in the @file{.newsrc} file, but isn't known to the
27506 server (i.e.,  it isn't in the active file), is a @emph{bogus group}.
27507 This means that the group probably doesn't exist (any more).
27508
27509 @item activating
27510 @cindex activating groups
27511 The act of asking the server for info on a group and computing the
27512 number of unread articles is called @dfn{activating the group}.
27513 Un-activated groups are listed with @samp{*} in the group buffer.
27514
27515 @item spool
27516 @cindex spool
27517 News servers store their articles locally in one fashion or other.
27518 One old-fashioned storage method is to have just one file per
27519 article.  That's called a ``traditional spool''.
27520
27521 @item server
27522 @cindex server
27523 A machine one can connect to and get news (or mail) from.
27524
27525 @item select method
27526 @cindex select method
27527 A structure that specifies the back end, the server and the virtual
27528 server settings.
27529
27530 @item virtual server
27531 @cindex virtual server
27532 A named select method.  Since a select method defines all there is to
27533 know about connecting to a (physical) server, taking the thing as a
27534 whole is a virtual server.
27535
27536 @item washing
27537 @cindex washing
27538 Taking a buffer and running it through a filter of some sort.  The
27539 result will (more often than not) be cleaner and more pleasing than the
27540 original.
27541
27542 @item ephemeral groups
27543 @cindex ephemeral groups
27544 @cindex temporary groups
27545 Most groups store data on what articles you have read.  @dfn{Ephemeral}
27546 groups are groups that will have no data stored---when you exit the
27547 group, it'll disappear into the aether.
27548
27549 @item solid groups
27550 @cindex solid groups
27551 This is the opposite of ephemeral groups.  All groups listed in the
27552 group buffer are solid groups.
27553
27554 @item sparse articles
27555 @cindex sparse articles
27556 These are article placeholders shown in the summary buffer when
27557 @code{gnus-build-sparse-threads} has been switched on.
27558
27559 @item threading
27560 @cindex threading
27561 To put responses to articles directly after the articles they respond
27562 to---in a hierarchical fashion.
27563
27564 @item root
27565 @cindex root
27566 @cindex thread root
27567 The first article in a thread is the root.  It is the ancestor of all
27568 articles in the thread.
27569
27570 @item parent
27571 @cindex parent
27572 An article that has responses.
27573
27574 @item child
27575 @cindex child
27576 An article that responds to a different article---its parent.
27577
27578 @item digest
27579 @cindex digest
27580 A collection of messages in one file.  The most common digest format is
27581 specified by RFC 1153.
27582
27583 @item splitting
27584 @cindex splitting, terminolgy
27585 @cindex mail sorting
27586 @cindex mail filtering (splitting)
27587 The action of sorting your emails according to certain rules. Sometimes
27588 incorrectly called mail filtering.
27589
27590 @end table
27591
27592
27593 @page
27594 @node Customization
27595 @section Customization
27596 @cindex general customization
27597
27598 All variables are properly documented elsewhere in this manual.  This
27599 section is designed to give general pointers on how to customize Gnus
27600 for some quite common situations.
27601
27602 @menu
27603 * Slow/Expensive Connection::   You run a local Emacs and get the news elsewhere.
27604 * Slow Terminal Connection::    You run a remote Emacs.
27605 * Little Disk Space::           You feel that having large setup files is icky.
27606 * Slow Machine::                You feel like buying a faster machine.
27607 @end menu
27608
27609
27610 @node Slow/Expensive Connection
27611 @subsection Slow/Expensive NNTP Connection
27612
27613 If you run Emacs on a machine locally, and get your news from a machine
27614 over some very thin strings, you want to cut down on the amount of data
27615 Gnus has to get from the @acronym{NNTP} server.
27616
27617 @table @code
27618
27619 @item gnus-read-active-file
27620 Set this to @code{nil}, which will inhibit Gnus from requesting the
27621 entire active file from the server.  This file is often very large.  You
27622 also have to set @code{gnus-check-new-newsgroups} and
27623 @code{gnus-check-bogus-newsgroups} to @code{nil} to make sure that Gnus
27624 doesn't suddenly decide to fetch the active file anyway.
27625
27626 @item gnus-nov-is-evil
27627 This one has to be @code{nil}.  If not, grabbing article headers from
27628 the @acronym{NNTP} server will not be very fast.  Not all @acronym{NNTP} servers
27629 support @sc{xover}; Gnus will detect this by itself.
27630 @end table
27631
27632
27633 @node Slow Terminal Connection
27634 @subsection Slow Terminal Connection
27635
27636 Let's say you use your home computer for dialing up the system that runs
27637 Emacs and Gnus.  If your modem is slow, you want to reduce (as much as
27638 possible) the amount of data sent over the wires.
27639
27640 @table @code
27641
27642 @item gnus-auto-center-summary
27643 Set this to @code{nil} to inhibit Gnus from re-centering the summary
27644 buffer all the time.  If it is @code{vertical}, do only vertical
27645 re-centering.  If it is neither @code{nil} nor @code{vertical}, do both
27646 horizontal and vertical recentering.
27647
27648 @item gnus-visible-headers
27649 Cut down on the headers included in the articles to the
27650 minimum.  You can, in fact, make do without them altogether---most of the
27651 useful data is in the summary buffer, anyway.  Set this variable to
27652 @samp{^NEVVVVER} or @samp{From:}, or whatever you feel you need.
27653
27654 Use the following to enable all the available hiding features:
27655 @lisp
27656 (setq gnus-treat-hide-headers 'head
27657       gnus-treat-hide-signature t
27658       gnus-treat-hide-citation t)
27659 @end lisp
27660
27661 @item gnus-use-full-window
27662 By setting this to @code{nil}, you can make all the windows smaller.
27663 While this doesn't really cut down much generally, it means that you
27664 have to see smaller portions of articles before deciding that you didn't
27665 want to read them anyway.
27666
27667 @item gnus-thread-hide-subtree
27668 If this is non-@code{nil}, all threads in the summary buffer will be
27669 hidden initially.
27670
27671
27672 @item gnus-updated-mode-lines
27673 If this is @code{nil}, Gnus will not put information in the buffer mode
27674 lines, which might save some time.
27675 @end table
27676
27677
27678 @node Little Disk Space
27679 @subsection Little Disk Space
27680 @cindex disk space
27681
27682 The startup files can get rather large, so you may want to cut their
27683 sizes a bit if you are running out of space.
27684
27685 @table @code
27686
27687 @item gnus-save-newsrc-file
27688 If this is @code{nil}, Gnus will never save @file{.newsrc}---it will
27689 only save @file{.newsrc.eld}.  This means that you will not be able to
27690 use any other newsreaders than Gnus.  This variable is @code{t} by
27691 default.
27692
27693 @item gnus-read-newsrc-file
27694 If this is @code{nil}, Gnus will never read @file{.newsrc}---it will
27695 only read @file{.newsrc.eld}.  This means that you will not be able to
27696 use any other newsreaders than Gnus.  This variable is @code{t} by
27697 default.
27698
27699 @item gnus-save-killed-list
27700 If this is @code{nil}, Gnus will not save the list of dead groups.  You
27701 should also set @code{gnus-check-new-newsgroups} to @code{ask-server}
27702 and @code{gnus-check-bogus-newsgroups} to @code{nil} if you set this
27703 variable to @code{nil}.  This variable is @code{t} by default.
27704
27705 @end table
27706
27707
27708 @node Slow Machine
27709 @subsection Slow Machine
27710 @cindex slow machine
27711
27712 If you have a slow machine, or are just really impatient, there are a
27713 few things you can do to make Gnus run faster.
27714
27715 Set @code{gnus-check-new-newsgroups} and
27716 @code{gnus-check-bogus-newsgroups} to @code{nil} to make startup faster.
27717
27718 Set @code{gnus-show-threads}, @code{gnus-use-cross-reference} and
27719 @code{gnus-nov-is-evil} to @code{nil} to make entering and exiting the
27720 summary buffer faster.
27721
27722
27723 @page
27724 @node Troubleshooting
27725 @section Troubleshooting
27726 @cindex troubleshooting
27727
27728 Gnus works @emph{so} well straight out of the box---I can't imagine any
27729 problems, really.
27730
27731 Ahem.
27732
27733 @enumerate
27734
27735 @item
27736 Make sure your computer is switched on.
27737
27738 @item
27739 Make sure that you really load the current Gnus version.  If you have
27740 been running @sc{gnus}, you need to exit Emacs and start it up again before
27741 Gnus will work.
27742
27743 @item
27744 Try doing an @kbd{M-x gnus-version}.  If you get something that looks
27745 like @samp{Gnus v5.10.6} you have the right files loaded.  Otherwise
27746 you have some old @file{.el} files lying around.  Delete these.
27747
27748 @item
27749 Read the help group (@kbd{G h} in the group buffer) for a
27750 @acronym{FAQ} and a how-to.
27751
27752 @item
27753 @vindex max-lisp-eval-depth
27754 Gnus works on many recursive structures, and in some extreme (and very
27755 rare) cases Gnus may recurse down ``too deeply'' and Emacs will beep at
27756 you.  If this happens to you, set @code{max-lisp-eval-depth} to 500 or
27757 something like that.
27758 @end enumerate
27759
27760 If all else fails, report the problem as a bug.
27761
27762 @cindex bugs
27763 @cindex reporting bugs
27764
27765 @kindex M-x gnus-bug
27766 @findex gnus-bug
27767 If you find a bug in Gnus, you can report it with the @kbd{M-x gnus-bug}
27768 command.  @kbd{M-x set-variable RET debug-on-error RET t RET}, and send
27769 me the backtrace.  I will fix bugs, but I can only fix them if you send
27770 me a precise description as to how to reproduce the bug.
27771
27772 You really can never be too detailed in a bug report.  Always use the
27773 @kbd{M-x gnus-bug} command when you make bug reports, even if it creates
27774 a 10Kb mail each time you use it, and even if you have sent me your
27775 environment 500 times before.  I don't care.  I want the full info each
27776 time.
27777
27778 It is also important to remember that I have no memory whatsoever.  If
27779 you send a bug report, and I send you a reply, and then you just send
27780 back ``No, it's not! Moron!'', I will have no idea what you are
27781 insulting me about.  Always over-explain everything.  It's much easier
27782 for all of us---if I don't have all the information I need, I will just
27783 mail you and ask for more info, and everything takes more time.
27784
27785 If the problem you're seeing is very visual, and you can't quite explain
27786 it, copy the Emacs window to a file (with @code{xwd}, for instance), put
27787 it somewhere it can be reached, and include the URL of the picture in
27788 the bug report.
27789
27790 @cindex patches
27791 If you would like to contribute a patch to fix bugs or make
27792 improvements, please produce the patch using @samp{diff -u}.
27793
27794 @cindex edebug
27795 If you want to debug your problem further before reporting, possibly
27796 in order to solve the problem yourself and send a patch, you can use
27797 edebug.  Debugging Lisp code is documented in the Elisp manual
27798 (@pxref{Debugging, , Debugging Lisp Programs, elisp, The GNU Emacs
27799 Lisp Reference Manual}).  To get you started with edebug, consider if
27800 you discover some weird behavior when pressing @kbd{c}, the first
27801 step is to do @kbd{C-h k c} and click on the hyperlink (Emacs only) in
27802 the documentation buffer that leads you to the function definition,
27803 then press @kbd{M-x edebug-defun RET} with point inside that function,
27804 return to Gnus and press @kbd{c} to invoke the code.  You will be
27805 placed in the lisp buffer and can single step using @kbd{SPC} and
27806 evaluate expressions using @kbd{M-:} or inspect variables using
27807 @kbd{C-h v}, abort execution with @kbd{q}, and resume execution with
27808 @kbd{c} or @kbd{g}.
27809
27810 @cindex elp
27811 @cindex profile
27812 @cindex slow
27813 Sometimes, a problem do not directly generate an elisp error but
27814 manifests itself by causing Gnus to be very slow.  In these cases, you
27815 can use @kbd{M-x toggle-debug-on-quit} and press @kbd{C-g} when things are
27816 slow, and then try to analyze the backtrace (repeating the procedure
27817 helps isolating the real problem areas).
27818
27819 A fancier approach is to use the elisp profiler, ELP.  The profiler is
27820 (or should be) fully documented elsewhere, but to get you started
27821 there are a few steps that need to be followed.  First, instrument the
27822 part of Gnus you are interested in for profiling, e.g. @kbd{M-x
27823 elp-instrument-package RET gnus} or @kbd{M-x elp-instrument-package
27824 RET message}.  Then perform the operation that is slow and press
27825 @kbd{M-x elp-results}.  You will then see which operations that takes
27826 time, and can debug them further.  If the entire operation takes much
27827 longer than the time spent in the slowest function in the profiler
27828 output, you probably profiled the wrong part of Gnus.  To reset
27829 profiling statistics, use @kbd{M-x elp-reset-all}.  @kbd{M-x
27830 elp-restore-all} is supposed to remove profiling, but given the
27831 complexities and dynamic code generation in Gnus, it might not always
27832 work perfectly.
27833
27834 @cindex gnu.emacs.gnus
27835 @cindex ding mailing list
27836 If you just need help, you are better off asking on
27837 @samp{gnu.emacs.gnus}.  I'm not very helpful.  You can also ask on
27838 @email{ding@@gnus.org, the ding mailing list}.  Write to
27839 @email{ding-request@@gnus.org} to subscribe.
27840
27841
27842 @page
27843 @node Gnus Reference Guide
27844 @section Gnus Reference Guide
27845
27846 It is my hope that other people will figure out smart stuff that Gnus
27847 can do, and that other people will write those smart things as well.  To
27848 facilitate that I thought it would be a good idea to describe the inner
27849 workings of Gnus.  And some of the not-so-inner workings, while I'm at
27850 it.
27851
27852 You can never expect the internals of a program not to change, but I
27853 will be defining (in some details) the interface between Gnus and its
27854 back ends (this is written in stone), the format of the score files
27855 (ditto), data structures (some are less likely to change than others)
27856 and general methods of operation.
27857
27858 @menu
27859 * Gnus Utility Functions::      Common functions and variable to use.
27860 * Back End Interface::          How Gnus communicates with the servers.
27861 * Score File Syntax::           A BNF definition of the score file standard.
27862 * Headers::                     How Gnus stores headers internally.
27863 * Ranges::                      A handy format for storing mucho numbers.
27864 * Group Info::                  The group info format.
27865 * Extended Interactive::        Symbolic prefixes and stuff.
27866 * Emacs/XEmacs Code::           Gnus can be run under all modern Emacsen.
27867 * Various File Formats::        Formats of files that Gnus use.
27868 @end menu
27869
27870
27871 @node Gnus Utility Functions
27872 @subsection Gnus Utility Functions
27873 @cindex Gnus utility functions
27874 @cindex utility functions
27875 @cindex functions
27876 @cindex internal variables
27877
27878 When writing small functions to be run from hooks (and stuff), it's
27879 vital to have access to the Gnus internal functions and variables.
27880 Below is a list of the most common ones.
27881
27882 @table @code
27883
27884 @item gnus-newsgroup-name
27885 @vindex gnus-newsgroup-name
27886 This variable holds the name of the current newsgroup.
27887
27888 @item gnus-find-method-for-group
27889 @findex gnus-find-method-for-group
27890 A function that returns the select method for @var{group}.
27891
27892 @item gnus-group-real-name
27893 @findex gnus-group-real-name
27894 Takes a full (prefixed) Gnus group name, and returns the unprefixed
27895 name.
27896
27897 @item gnus-group-prefixed-name
27898 @findex gnus-group-prefixed-name
27899 Takes an unprefixed group name and a select method, and returns the full
27900 (prefixed) Gnus group name.
27901
27902 @item gnus-get-info
27903 @findex gnus-get-info
27904 Returns the group info list for @var{group}.
27905
27906 @item gnus-group-unread
27907 @findex gnus-group-unread
27908 The number of unread articles in @var{group}, or @code{t} if that is
27909 unknown.
27910
27911 @item gnus-active
27912 @findex gnus-active
27913 The active entry for @var{group}.
27914
27915 @item gnus-set-active
27916 @findex gnus-set-active
27917 Set the active entry for @var{group}.
27918
27919 @item gnus-add-current-to-buffer-list
27920 @findex gnus-add-current-to-buffer-list
27921 Adds the current buffer to the list of buffers to be killed on Gnus
27922 exit.
27923
27924 @item gnus-continuum-version
27925 @findex gnus-continuum-version
27926 Takes a Gnus version string as a parameter and returns a floating point
27927 number.  Earlier versions will always get a lower number than later
27928 versions.
27929
27930 @item gnus-group-read-only-p
27931 @findex gnus-group-read-only-p
27932 Says whether @var{group} is read-only or not.
27933
27934 @item gnus-news-group-p
27935 @findex gnus-news-group-p
27936 Says whether @var{group} came from a news back end.
27937
27938 @item gnus-ephemeral-group-p
27939 @findex gnus-ephemeral-group-p
27940 Says whether @var{group} is ephemeral or not.
27941
27942 @item gnus-server-to-method
27943 @findex gnus-server-to-method
27944 Returns the select method corresponding to @var{server}.
27945
27946 @item gnus-server-equal
27947 @findex gnus-server-equal
27948 Says whether two virtual servers are equal.
27949
27950 @item gnus-group-native-p
27951 @findex gnus-group-native-p
27952 Says whether @var{group} is native or not.
27953
27954 @item gnus-group-secondary-p
27955 @findex gnus-group-secondary-p
27956 Says whether @var{group} is secondary or not.
27957
27958 @item gnus-group-foreign-p
27959 @findex gnus-group-foreign-p
27960 Says whether @var{group} is foreign or not.
27961
27962 @item gnus-group-find-parameter
27963 @findex gnus-group-find-parameter
27964 Returns the parameter list of @var{group}.  If given a second parameter,
27965 returns the value of that parameter for @var{group}.
27966
27967 @item gnus-group-set-parameter
27968 @findex gnus-group-set-parameter
27969 Takes three parameters; @var{group}, @var{parameter} and @var{value}.
27970
27971 @item gnus-narrow-to-body
27972 @findex gnus-narrow-to-body
27973 Narrows the current buffer to the body of the article.
27974
27975 @item gnus-check-backend-function
27976 @findex gnus-check-backend-function
27977 Takes two parameters, @var{function} and @var{group}.  If the back end
27978 @var{group} comes from supports @var{function}, return non-@code{nil}.
27979
27980 @lisp
27981 (gnus-check-backend-function "request-scan" "nnml:misc")
27982 @result{} t
27983 @end lisp
27984
27985 @item gnus-read-method
27986 @findex gnus-read-method
27987 Prompts the user for a select method.
27988
27989 @end table
27990
27991
27992 @node Back End Interface
27993 @subsection Back End Interface
27994
27995 Gnus doesn't know anything about @acronym{NNTP}, spools, mail or virtual
27996 groups.  It only knows how to talk to @dfn{virtual servers}.  A virtual
27997 server is a @dfn{back end} and some @dfn{back end variables}.  As examples
27998 of the first, we have @code{nntp}, @code{nnspool} and @code{nnmbox}.  As
27999 examples of the latter we have @code{nntp-port-number} and
28000 @code{nnmbox-directory}.
28001
28002 When Gnus asks for information from a back end---say @code{nntp}---on
28003 something, it will normally include a virtual server name in the
28004 function parameters.  (If not, the back end should use the ``current''
28005 virtual server.)  For instance, @code{nntp-request-list} takes a virtual
28006 server as its only (optional) parameter.  If this virtual server hasn't
28007 been opened, the function should fail.
28008
28009 Note that a virtual server name has no relation to some physical server
28010 name.  Take this example:
28011
28012 @lisp
28013 (nntp "odd-one"
28014       (nntp-address "ifi.uio.no")
28015       (nntp-port-number 4324))
28016 @end lisp
28017
28018 Here the virtual server name is @samp{odd-one} while the name of
28019 the physical server is @samp{ifi.uio.no}.
28020
28021 The back ends should be able to switch between several virtual servers.
28022 The standard back ends implement this by keeping an alist of virtual
28023 server environments that they pull down/push up when needed.
28024
28025 There are two groups of interface functions: @dfn{required functions},
28026 which must be present, and @dfn{optional functions}, which Gnus will
28027 always check for presence before attempting to call 'em.
28028
28029 All these functions are expected to return data in the buffer
28030 @code{nntp-server-buffer} (@samp{ *nntpd*}), which is somewhat
28031 unfortunately named, but we'll have to live with it.  When I talk about
28032 @dfn{resulting data}, I always refer to the data in that buffer.  When I
28033 talk about @dfn{return value}, I talk about the function value returned by
28034 the function call.  Functions that fail should return @code{nil} as the
28035 return value.
28036
28037 Some back ends could be said to be @dfn{server-forming} back ends, and
28038 some might be said not to be.  The latter are back ends that generally
28039 only operate on one group at a time, and have no concept of ``server''
28040 ---they have a group, and they deliver info on that group and nothing
28041 more.
28042
28043 Gnus identifies each message by way of group name and article number.  A
28044 few remarks about these article numbers might be useful.  First of all,
28045 the numbers are positive integers.  Secondly, it is normally not
28046 possible for later articles to ``re-use'' older article numbers without
28047 confusing Gnus.  That is, if a group has ever contained a message
28048 numbered 42, then no other message may get that number, or Gnus will get
28049 mightily confused.@footnote{See the function
28050 @code{nnchoke-request-update-info}, @ref{Optional Back End Functions}.}
28051 Third, article numbers must be assigned in order of arrival in the
28052 group; this is not necessarily the same as the date of the message.
28053
28054 The previous paragraph already mentions all the ``hard'' restrictions that
28055 article numbers must fulfill.  But it seems that it might be useful to
28056 assign @emph{consecutive} article numbers, for Gnus gets quite confused
28057 if there are holes in the article numbering sequence.  However, due to
28058 the ``no-reuse'' restriction, holes cannot be avoided altogether.  It's
28059 also useful for the article numbers to start at 1 to avoid running out
28060 of numbers as long as possible.
28061
28062 Note that by convention, back ends are named @code{nnsomething}, but
28063 Gnus also comes with some @code{nnnotbackends}, such as
28064 @file{nnheader.el}, @file{nnmail.el} and @file{nnoo.el}.
28065
28066 In the examples and definitions I will refer to the imaginary back end
28067 @code{nnchoke}.
28068
28069 @cindex @code{nnchoke}
28070
28071 @menu
28072 * Required Back End Functions::  Functions that must be implemented.
28073 * Optional Back End Functions::  Functions that need not be implemented.
28074 * Error Messaging::             How to get messages and report errors.
28075 * Writing New Back Ends::       Extending old back ends.
28076 * Hooking New Back Ends Into Gnus::  What has to be done on the Gnus end.
28077 * Mail-like Back Ends::         Some tips on mail back ends.
28078 @end menu
28079
28080
28081 @node Required Back End Functions
28082 @subsubsection Required Back End Functions
28083
28084 @table @code
28085
28086 @item (nnchoke-retrieve-headers ARTICLES &optional GROUP SERVER FETCH-OLD)
28087
28088 @var{articles} is either a range of article numbers or a list of
28089 @code{Message-ID}s.  Current back ends do not fully support either---only
28090 sequences (lists) of article numbers, and most back ends do not support
28091 retrieval of @code{Message-ID}s.  But they should try for both.
28092
28093 The result data should either be HEADs or @acronym{NOV} lines, and the result
28094 value should either be @code{headers} or @code{nov} to reflect this.
28095 This might later be expanded to @code{various}, which will be a mixture
28096 of HEADs and @acronym{NOV} lines, but this is currently not supported by Gnus.
28097
28098 If @var{fetch-old} is non-@code{nil} it says to try fetching ``extra
28099 headers'', in some meaning of the word.  This is generally done by
28100 fetching (at most) @var{fetch-old} extra headers less than the smallest
28101 article number in @code{articles}, and filling the gaps as well.  The
28102 presence of this parameter can be ignored if the back end finds it
28103 cumbersome to follow the request.  If this is non-@code{nil} and not a
28104 number, do maximum fetches.
28105
28106 Here's an example HEAD:
28107
28108 @example
28109 221 1056 Article retrieved.
28110 Path: ifi.uio.no!sturles
28111 From: sturles@@ifi.uio.no (Sturle Sunde)
28112 Newsgroups: ifi.discussion
28113 Subject: Re: Something very droll
28114 Date: 27 Oct 1994 14:02:57 +0100
28115 Organization: Dept. of Informatics, University of Oslo, Norway
28116 Lines: 26
28117 Message-ID: <38o8e1$a0o@@holmenkollen.ifi.uio.no>
28118 References: <38jdmq$4qu@@visbur.ifi.uio.no>
28119 NNTP-Posting-Host: holmenkollen.ifi.uio.no
28120 .
28121 @end example
28122
28123 So a @code{headers} return value would imply that there's a number of
28124 these in the data buffer.
28125
28126 Here's a BNF definition of such a buffer:
28127
28128 @example
28129 headers        = *head
28130 head           = error / valid-head
28131 error-message  = [ "4" / "5" ] 2number " " <error message> eol
28132 valid-head     = valid-message *header "." eol
28133 valid-message  = "221 " <number> " Article retrieved." eol
28134 header         = <text> eol
28135 @end example
28136
28137 @cindex BNF
28138 (The version of BNF used here is the one used in RFC822.)
28139
28140 If the return value is @code{nov}, the data buffer should contain
28141 @dfn{network overview database} lines.  These are basically fields
28142 separated by tabs.
28143
28144 @example
28145 nov-buffer = *nov-line
28146 nov-line   = field 7*8[ <TAB> field ] eol
28147 field      = <text except TAB>
28148 @end example
28149
28150 For a closer look at what should be in those fields,
28151 @pxref{Headers}.
28152
28153
28154 @item (nnchoke-open-server SERVER &optional DEFINITIONS)
28155
28156 @var{server} is here the virtual server name.  @var{definitions} is a
28157 list of @code{(VARIABLE VALUE)} pairs that define this virtual server.
28158
28159 If the server can't be opened, no error should be signaled.  The back end
28160 may then choose to refuse further attempts at connecting to this
28161 server.  In fact, it should do so.
28162
28163 If the server is opened already, this function should return a
28164 non-@code{nil} value.  There should be no data returned.
28165
28166
28167 @item (nnchoke-close-server &optional SERVER)
28168
28169 Close connection to @var{server} and free all resources connected
28170 to it.  Return @code{nil} if the server couldn't be closed for some
28171 reason.
28172
28173 There should be no data returned.
28174
28175
28176 @item (nnchoke-request-close)
28177
28178 Close connection to all servers and free all resources that the back end
28179 have reserved.  All buffers that have been created by that back end
28180 should be killed.  (Not the @code{nntp-server-buffer}, though.)  This
28181 function is generally only called when Gnus is shutting down.
28182
28183 There should be no data returned.
28184
28185
28186 @item (nnchoke-server-opened &optional SERVER)
28187
28188 If @var{server} is the current virtual server, and the connection to the
28189 physical server is alive, then this function should return a
28190 non-@code{nil} value.  This function should under no circumstances
28191 attempt to reconnect to a server we have lost connection to.
28192
28193 There should be no data returned.
28194
28195
28196 @item (nnchoke-status-message &optional SERVER)
28197
28198 This function should return the last error message from @var{server}.
28199
28200 There should be no data returned.
28201
28202
28203 @item (nnchoke-request-article ARTICLE &optional GROUP SERVER TO-BUFFER)
28204
28205 The result data from this function should be the article specified by
28206 @var{article}.  This might either be a @code{Message-ID} or a number.
28207 It is optional whether to implement retrieval by @code{Message-ID}, but
28208 it would be nice if that were possible.
28209
28210 If @var{to-buffer} is non-@code{nil}, the result data should be returned
28211 in this buffer instead of the normal data buffer.  This is to make it
28212 possible to avoid copying large amounts of data from one buffer to
28213 another, while Gnus mainly requests articles to be inserted directly
28214 into its article buffer.
28215
28216 If it is at all possible, this function should return a cons cell where
28217 the @code{car} is the group name the article was fetched from, and the @code{cdr} is
28218 the article number.  This will enable Gnus to find out what the real
28219 group and article numbers are when fetching articles by
28220 @code{Message-ID}.  If this isn't possible, @code{t} should be returned
28221 on successful article retrieval.
28222
28223
28224 @item (nnchoke-request-group GROUP &optional SERVER FAST)
28225
28226 Get data on @var{group}.  This function also has the side effect of
28227 making @var{group} the current group.
28228
28229 If @var{fast}, don't bother to return useful data, just make @var{group}
28230 the current group.
28231
28232 Here's an example of some result data and a definition of the same:
28233
28234 @example
28235 211 56 1000 1059 ifi.discussion
28236 @end example
28237
28238 The first number is the status, which should be 211.  Next is the
28239 total number of articles in the group, the lowest article number, the
28240 highest article number, and finally the group name.  Note that the total
28241 number of articles may be less than one might think while just
28242 considering the highest and lowest article numbers, but some articles
28243 may have been canceled.  Gnus just discards the total-number, so
28244 whether one should take the bother to generate it properly (if that is a
28245 problem) is left as an exercise to the reader.  If the group contains no
28246 articles, the lowest article number should be reported as 1 and the
28247 highest as 0.
28248
28249 @example
28250 group-status = [ error / info ] eol
28251 error        = [ "4" / "5" ] 2<number> " " <Error message>
28252 info         = "211 " 3* [ <number> " " ] <string>
28253 @end example
28254
28255
28256 @item (nnchoke-close-group GROUP &optional SERVER)
28257
28258 Close @var{group} and free any resources connected to it.  This will be
28259 a no-op on most back ends.
28260
28261 There should be no data returned.
28262
28263
28264 @item (nnchoke-request-list &optional SERVER)
28265
28266 Return a list of all groups available on @var{server}.  And that means
28267 @emph{all}.
28268
28269 Here's an example from a server that only carries two groups:
28270
28271 @example
28272 ifi.test 0000002200 0000002000 y
28273 ifi.discussion 3324 3300 n
28274 @end example
28275
28276 On each line we have a group name, then the highest article number in
28277 that group, the lowest article number, and finally a flag.  If the group
28278 contains no articles, the lowest article number should be reported as 1
28279 and the highest as 0.
28280
28281 @example
28282 active-file = *active-line
28283 active-line = name " " <number> " " <number> " " flags eol
28284 name        = <string>
28285 flags       = "n" / "y" / "m" / "x" / "j" / "=" name
28286 @end example
28287
28288 The flag says whether the group is read-only (@samp{n}), is moderated
28289 (@samp{m}), is dead (@samp{x}), is aliased to some other group
28290 (@samp{=other-group}) or none of the above (@samp{y}).
28291
28292
28293 @item (nnchoke-request-post &optional SERVER)
28294
28295 This function should post the current buffer.  It might return whether
28296 the posting was successful or not, but that's not required.  If, for
28297 instance, the posting is done asynchronously, it has generally not been
28298 completed by the time this function concludes.  In that case, this
28299 function should set up some kind of sentinel to beep the user loud and
28300 clear if the posting could not be completed.
28301
28302 There should be no result data from this function.
28303
28304 @end table
28305
28306
28307 @node Optional Back End Functions
28308 @subsubsection Optional Back End Functions
28309
28310 @table @code
28311
28312 @item (nnchoke-retrieve-groups GROUPS &optional SERVER)
28313
28314 @var{groups} is a list of groups, and this function should request data
28315 on all those groups.  How it does it is of no concern to Gnus, but it
28316 should attempt to do this in a speedy fashion.
28317
28318 The return value of this function can be either @code{active} or
28319 @code{group}, which says what the format of the result data is.  The
28320 former is in the same format as the data from
28321 @code{nnchoke-request-list}, while the latter is a buffer full of lines
28322 in the same format as @code{nnchoke-request-group} gives.
28323
28324 @example
28325 group-buffer = *active-line / *group-status
28326 @end example
28327
28328
28329 @item (nnchoke-request-update-info GROUP INFO &optional SERVER)
28330
28331 A Gnus group info (@pxref{Group Info}) is handed to the back end for
28332 alterations.  This comes in handy if the back end really carries all
28333 the information (as is the case with virtual and imap groups).  This
28334 function should destructively alter the info to suit its needs, and
28335 should return a non-@code{nil} value (exceptionally,
28336 @code{nntp-request-update-info} always returns @code{nil} not to waste
28337 the network resources).
28338
28339 There should be no result data from this function.
28340
28341
28342 @item (nnchoke-request-type GROUP &optional ARTICLE)
28343
28344 When the user issues commands for ``sending news'' (@kbd{F} in the
28345 summary buffer, for instance), Gnus has to know whether the article the
28346 user is following up on is news or mail.  This function should return
28347 @code{news} if @var{article} in @var{group} is news, @code{mail} if it
28348 is mail and @code{unknown} if the type can't be decided.  (The
28349 @var{article} parameter is necessary in @code{nnvirtual} groups which
28350 might very well combine mail groups and news groups.)  Both @var{group}
28351 and @var{article} may be @code{nil}.
28352
28353 There should be no result data from this function.
28354
28355
28356 @item (nnchoke-request-set-mark GROUP ACTION &optional SERVER)
28357
28358 Set/remove/add marks on articles.  Normally Gnus handles the article
28359 marks (such as read, ticked, expired etc) internally, and store them in
28360 @file{~/.newsrc.eld}.  Some back ends (such as @acronym{IMAP}) however carry
28361 all information about the articles on the server, so Gnus need to
28362 propagate the mark information to the server.
28363
28364 @var{action} is a list of mark setting requests, having this format:
28365
28366 @example
28367 (RANGE ACTION MARK)
28368 @end example
28369
28370 @var{range} is a range of articles you wish to update marks on.
28371 @var{action} is @code{add} or @code{del}, used to add marks or remove
28372 marks (preserving all marks not mentioned).  @var{mark} is a list of
28373 marks; where each mark is a symbol.  Currently used marks are
28374 @code{read}, @code{tick}, @code{reply}, @code{expire}, @code{killed},
28375 @code{dormant}, @code{save}, @code{download}, @code{unsend},
28376 @code{forward} and @code{recent}, but your back end should, if
28377 possible, not limit itself to these.
28378
28379 Given contradictory actions, the last action in the list should be the
28380 effective one.  That is, if your action contains a request to add the
28381 @code{tick} mark on article 1 and, later in the list, a request to
28382 remove the mark on the same article, the mark should in fact be removed.
28383
28384 An example action list:
28385
28386 @example
28387 (((5 12 30) 'del '(tick))
28388  ((10 . 90) 'add '(read expire))
28389  ((92 94) 'del '(read)))
28390 @end example
28391
28392 The function should return a range of articles it wasn't able to set the
28393 mark on (currently not used for anything).
28394
28395 There should be no result data from this function.
28396
28397 @item (nnchoke-request-update-mark GROUP ARTICLE MARK)
28398
28399 If the user tries to set a mark that the back end doesn't like, this
28400 function may change the mark.  Gnus will use whatever this function
28401 returns as the mark for @var{article} instead of the original
28402 @var{mark}.  If the back end doesn't care, it must return the original
28403 @var{mark}, and not @code{nil} or any other type of garbage.
28404
28405 The only use for this I can see is what @code{nnvirtual} does with
28406 it---if a component group is auto-expirable, marking an article as read
28407 in the virtual group should result in the article being marked as
28408 expirable.
28409
28410 There should be no result data from this function.
28411
28412
28413 @item (nnchoke-request-scan &optional GROUP SERVER)
28414
28415 This function may be called at any time (by Gnus or anything else) to
28416 request that the back end check for incoming articles, in one way or
28417 another.  A mail back end will typically read the spool file or query
28418 the @acronym{POP} server when this function is invoked.  The
28419 @var{group} doesn't have to be heeded---if the back end decides that
28420 it is too much work just scanning for a single group, it may do a
28421 total scan of all groups.  It would be nice, however, to keep things
28422 local if that's practical.
28423
28424 There should be no result data from this function.
28425
28426
28427 @item (nnchoke-request-group-description GROUP &optional SERVER)
28428
28429 The result data from this function should be a description of
28430 @var{group}.
28431
28432 @example
28433 description-line = name <TAB> description eol
28434 name             = <string>
28435 description      = <text>
28436 @end example
28437
28438 @item (nnchoke-request-list-newsgroups &optional SERVER)
28439
28440 The result data from this function should be the description of all
28441 groups available on the server.
28442
28443 @example
28444 description-buffer = *description-line
28445 @end example
28446
28447
28448 @item (nnchoke-request-newgroups DATE &optional SERVER)
28449
28450 The result data from this function should be all groups that were
28451 created after @samp{date}, which is in normal human-readable date format
28452 (i.e., the date format used in mail and news headers, and returned by
28453 the function @code{message-make-date} by default).  The data should be
28454 in the active buffer format.
28455
28456 It is okay for this function to return ``too many'' groups; some back ends
28457 might find it cheaper to return the full list of groups, rather than
28458 just the new groups.  But don't do this for back ends with many groups.
28459 Normally, if the user creates the groups herself, there won't be too
28460 many groups, so @code{nnml} and the like are probably safe.  But for
28461 back ends like @code{nntp}, where the groups have been created by the
28462 server, it is quite likely that there can be many groups.
28463
28464
28465 @item (nnchoke-request-create-group GROUP &optional SERVER)
28466
28467 This function should create an empty group with name @var{group}.
28468
28469 There should be no return data.
28470
28471
28472 @item (nnchoke-request-expire-articles ARTICLES &optional GROUP SERVER FORCE)
28473
28474 This function should run the expiry process on all articles in the
28475 @var{articles} range (which is currently a simple list of article
28476 numbers.)  It is left up to the back end to decide how old articles
28477 should be before they are removed by this function.  If @var{force} is
28478 non-@code{nil}, all @var{articles} should be deleted, no matter how new
28479 they are.
28480
28481 This function should return a list of articles that it did not/was not
28482 able to delete.
28483
28484 There should be no result data returned.
28485
28486
28487 @item (nnchoke-request-move-article ARTICLE GROUP SERVER ACCEPT-FORM &optional LAST)
28488
28489 This function should move @var{article} (which is a number) from
28490 @var{group} by calling @var{accept-form}.
28491
28492 This function should ready the article in question for moving by
28493 removing any header lines it has added to the article, and generally
28494 should ``tidy up'' the article.  Then it should @code{eval}
28495 @var{accept-form} in the buffer where the ``tidy'' article is.  This
28496 will do the actual copying.  If this @code{eval} returns a
28497 non-@code{nil} value, the article should be removed.
28498
28499 If @var{last} is @code{nil}, that means that there is a high likelihood
28500 that there will be more requests issued shortly, so that allows some
28501 optimizations.
28502
28503 The function should return a cons where the @code{car} is the group name and
28504 the @code{cdr} is the article number that the article was entered as.
28505
28506 There should be no data returned.
28507
28508
28509 @item (nnchoke-request-accept-article GROUP &optional SERVER LAST)
28510
28511 This function takes the current buffer and inserts it into @var{group}.
28512 If @var{last} in @code{nil}, that means that there will be more calls to
28513 this function in short order.
28514
28515 The function should return a cons where the @code{car} is the group name and
28516 the @code{cdr} is the article number that the article was entered as.
28517
28518 The group should exist before the back end is asked to accept the
28519 article for that group.
28520
28521 There should be no data returned.
28522
28523
28524 @item (nnchoke-request-replace-article ARTICLE GROUP BUFFER)
28525
28526 This function should remove @var{article} (which is a number) from
28527 @var{group} and insert @var{buffer} there instead.
28528
28529 There should be no data returned.
28530
28531
28532 @item (nnchoke-request-delete-group GROUP FORCE &optional SERVER)
28533
28534 This function should delete @var{group}.  If @var{force}, it should
28535 really delete all the articles in the group, and then delete the group
28536 itself.  (If there is such a thing as ``the group itself''.)
28537
28538 There should be no data returned.
28539
28540
28541 @item (nnchoke-request-rename-group GROUP NEW-NAME &optional SERVER)
28542
28543 This function should rename @var{group} into @var{new-name}.  All
28544 articles in @var{group} should move to @var{new-name}.
28545
28546 There should be no data returned.
28547
28548 @end table
28549
28550
28551 @node Error Messaging
28552 @subsubsection Error Messaging
28553
28554 @findex nnheader-report
28555 @findex nnheader-get-report
28556 The back ends should use the function @code{nnheader-report} to report
28557 error conditions---they should not raise errors when they aren't able to
28558 perform a request.  The first argument to this function is the back end
28559 symbol, and the rest are interpreted as arguments to @code{format} if
28560 there are multiple of them, or just a string if there is one of them.
28561 This function must always returns @code{nil}.
28562
28563 @lisp
28564 (nnheader-report 'nnchoke "You did something totally bogus")
28565
28566 (nnheader-report 'nnchoke "Could not request group %s" group)
28567 @end lisp
28568
28569 Gnus, in turn, will call @code{nnheader-get-report} when it gets a
28570 @code{nil} back from a server, and this function returns the most
28571 recently reported message for the back end in question.  This function
28572 takes one argument---the server symbol.
28573
28574 Internally, these functions access @var{back-end}@code{-status-string},
28575 so the @code{nnchoke} back end will have its error message stored in
28576 @code{nnchoke-status-string}.
28577
28578
28579 @node Writing New Back Ends
28580 @subsubsection Writing New Back Ends
28581
28582 Many back ends are quite similar.  @code{nnml} is just like
28583 @code{nnspool}, but it allows you to edit the articles on the server.
28584 @code{nnmh} is just like @code{nnml}, but it doesn't use an active file,
28585 and it doesn't maintain overview databases.  @code{nndir} is just like
28586 @code{nnml}, but it has no concept of ``groups'', and it doesn't allow
28587 editing articles.
28588
28589 It would make sense if it were possible to ``inherit'' functions from
28590 back ends when writing new back ends.  And, indeed, you can do that if you
28591 want to.  (You don't have to if you don't want to, of course.)
28592
28593 All the back ends declare their public variables and functions by using a
28594 package called @code{nnoo}.
28595
28596 To inherit functions from other back ends (and allow other back ends to
28597 inherit functions from the current back end), you should use the
28598 following macros:
28599
28600 @table @code
28601
28602 @item nnoo-declare
28603 This macro declares the first parameter to be a child of the subsequent
28604 parameters.  For instance:
28605
28606 @lisp
28607 (nnoo-declare nndir
28608   nnml nnmh)
28609 @end lisp
28610
28611 @code{nndir} has declared here that it intends to inherit functions from
28612 both @code{nnml} and @code{nnmh}.
28613
28614 @item defvoo
28615 This macro is equivalent to @code{defvar}, but registers the variable as
28616 a public server variable.  Most state-oriented variables should be
28617 declared with @code{defvoo} instead of @code{defvar}.
28618
28619 In addition to the normal @code{defvar} parameters, it takes a list of
28620 variables in the parent back ends to map the variable to when executing
28621 a function in those back ends.
28622
28623 @lisp
28624 (defvoo nndir-directory nil
28625   "Where nndir will look for groups."
28626   nnml-current-directory nnmh-current-directory)
28627 @end lisp
28628
28629 This means that @code{nnml-current-directory} will be set to
28630 @code{nndir-directory} when an @code{nnml} function is called on behalf
28631 of @code{nndir}.  (The same with @code{nnmh}.)
28632
28633 @item nnoo-define-basics
28634 This macro defines some common functions that almost all back ends should
28635 have.
28636
28637 @lisp
28638 (nnoo-define-basics nndir)
28639 @end lisp
28640
28641 @item deffoo
28642 This macro is just like @code{defun} and takes the same parameters.  In
28643 addition to doing the normal @code{defun} things, it registers the
28644 function as being public so that other back ends can inherit it.
28645
28646 @item nnoo-map-functions
28647 This macro allows mapping of functions from the current back end to
28648 functions from the parent back ends.
28649
28650 @lisp
28651 (nnoo-map-functions nndir
28652   (nnml-retrieve-headers 0 nndir-current-group 0 0)
28653   (nnmh-request-article 0 nndir-current-group 0 0))
28654 @end lisp
28655
28656 This means that when @code{nndir-retrieve-headers} is called, the first,
28657 third, and fourth parameters will be passed on to
28658 @code{nnml-retrieve-headers}, while the second parameter is set to the
28659 value of @code{nndir-current-group}.
28660
28661 @item nnoo-import
28662 This macro allows importing functions from back ends.  It should be the
28663 last thing in the source file, since it will only define functions that
28664 haven't already been defined.
28665
28666 @lisp
28667 (nnoo-import nndir
28668   (nnmh
28669    nnmh-request-list
28670    nnmh-request-newgroups)
28671   (nnml))
28672 @end lisp
28673
28674 This means that calls to @code{nndir-request-list} should just be passed
28675 on to @code{nnmh-request-list}, while all public functions from
28676 @code{nnml} that haven't been defined in @code{nndir} yet should be
28677 defined now.
28678
28679 @end table
28680
28681 Below is a slightly shortened version of the @code{nndir} back end.
28682
28683 @lisp
28684 ;;; @r{nndir.el --- single directory newsgroup access for Gnus}
28685 ;; @r{Copyright (C) 1995,96 Free Software Foundation, Inc.}
28686
28687 ;;; @r{Code:}
28688
28689 (require 'nnheader)
28690 (require 'nnmh)
28691 (require 'nnml)
28692 (require 'nnoo)
28693 (eval-when-compile (require 'cl))
28694
28695 (nnoo-declare nndir
28696   nnml nnmh)
28697
28698 (defvoo nndir-directory nil
28699   "Where nndir will look for groups."
28700   nnml-current-directory nnmh-current-directory)
28701
28702 (defvoo nndir-nov-is-evil nil
28703   "*Non-nil means that nndir will never retrieve NOV headers."
28704   nnml-nov-is-evil)
28705
28706 (defvoo nndir-current-group ""
28707   nil
28708   nnml-current-group nnmh-current-group)
28709 (defvoo nndir-top-directory nil nil nnml-directory nnmh-directory)
28710 (defvoo nndir-get-new-mail nil nil nnml-get-new-mail nnmh-get-new-mail)
28711
28712 (defvoo nndir-status-string "" nil nnmh-status-string)
28713 (defconst nndir-version "nndir 1.0")
28714
28715 ;;; @r{Interface functions.}
28716
28717 (nnoo-define-basics nndir)
28718
28719 (deffoo nndir-open-server (server &optional defs)
28720   (setq nndir-directory
28721         (or (cadr (assq 'nndir-directory defs))
28722             server))
28723   (unless (assq 'nndir-directory defs)
28724     (push `(nndir-directory ,server) defs))
28725   (push `(nndir-current-group
28726           ,(file-name-nondirectory
28727             (directory-file-name nndir-directory)))
28728         defs)
28729   (push `(nndir-top-directory
28730           ,(file-name-directory (directory-file-name nndir-directory)))
28731         defs)
28732   (nnoo-change-server 'nndir server defs))
28733
28734 (nnoo-map-functions nndir
28735   (nnml-retrieve-headers 0 nndir-current-group 0 0)
28736   (nnmh-request-article 0 nndir-current-group 0 0)
28737   (nnmh-request-group nndir-current-group 0 0)
28738   (nnmh-close-group nndir-current-group 0))
28739
28740 (nnoo-import nndir
28741   (nnmh
28742    nnmh-status-message
28743    nnmh-request-list
28744    nnmh-request-newgroups))
28745
28746 (provide 'nndir)
28747 @end lisp
28748
28749
28750 @node Hooking New Back Ends Into Gnus
28751 @subsubsection Hooking New Back Ends Into Gnus
28752
28753 @vindex gnus-valid-select-methods
28754 @findex gnus-declare-backend
28755 Having Gnus start using your new back end is rather easy---you just
28756 declare it with the @code{gnus-declare-backend} functions.  This will
28757 enter the back end into the @code{gnus-valid-select-methods} variable.
28758
28759 @code{gnus-declare-backend} takes two parameters---the back end name and
28760 an arbitrary number of @dfn{abilities}.
28761
28762 Here's an example:
28763
28764 @lisp
28765 (gnus-declare-backend "nnchoke" 'mail 'respool 'address)
28766 @end lisp
28767
28768 The above line would then go in the @file{nnchoke.el} file.
28769
28770 The abilities can be:
28771
28772 @table @code
28773 @item mail
28774 This is a mailish back end---followups should (probably) go via mail.
28775 @item post
28776 This is a newsish back end---followups should (probably) go via news.
28777 @item post-mail
28778 This back end supports both mail and news.
28779 @item none
28780 This is neither a post nor mail back end---it's something completely
28781 different.
28782 @item respool
28783 It supports respooling---or rather, it is able to modify its source
28784 articles and groups.
28785 @item address
28786 The name of the server should be in the virtual server name.  This is
28787 true for almost all back ends.
28788 @item prompt-address
28789 The user should be prompted for an address when doing commands like
28790 @kbd{B} in the group buffer.  This is true for back ends like
28791 @code{nntp}, but not @code{nnmbox}, for instance.
28792 @end table
28793
28794
28795 @node Mail-like Back Ends
28796 @subsubsection Mail-like Back Ends
28797
28798 One of the things that separate the mail back ends from the rest of the
28799 back ends is the heavy dependence by most of the mail back ends on
28800 common functions in @file{nnmail.el}.  For instance, here's the
28801 definition of @code{nnml-request-scan}:
28802
28803 @lisp
28804 (deffoo nnml-request-scan (&optional group server)
28805   (setq nnml-article-file-alist nil)
28806   (nnmail-get-new-mail 'nnml 'nnml-save-nov nnml-directory group))
28807 @end lisp
28808
28809 It simply calls @code{nnmail-get-new-mail} with a few parameters,
28810 and @code{nnmail} takes care of all the moving and splitting of the
28811 mail.
28812
28813 This function takes four parameters.
28814
28815 @table @var
28816 @item method
28817 This should be a symbol to designate which back end is responsible for
28818 the call.
28819
28820 @item exit-function
28821 This function should be called after the splitting has been performed.
28822
28823 @item temp-directory
28824 Where the temporary files should be stored.
28825
28826 @item group
28827 This optional argument should be a group name if the splitting is to be
28828 performed for one group only.
28829 @end table
28830
28831 @code{nnmail-get-new-mail} will call @var{back-end}@code{-save-mail} to
28832 save each article.  @var{back-end}@code{-active-number} will be called to
28833 find the article number assigned to this article.
28834
28835 The function also uses the following variables:
28836 @var{back-end}@code{-get-new-mail} (to see whether to get new mail for
28837 this back end); and @var{back-end}@code{-group-alist} and
28838 @var{back-end}@code{-active-file} to generate the new active file.
28839 @var{back-end}@code{-group-alist} should be a group-active alist, like
28840 this:
28841
28842 @example
28843 (("a-group" (1 . 10))
28844  ("some-group" (34 . 39)))
28845 @end example
28846
28847
28848 @node Score File Syntax
28849 @subsection Score File Syntax
28850
28851 Score files are meant to be easily parseable, but yet extremely
28852 mallable.  It was decided that something that had the same read syntax
28853 as an Emacs Lisp list would fit that spec.
28854
28855 Here's a typical score file:
28856
28857 @lisp
28858 (("summary"
28859   ("win95" -10000 nil s)
28860   ("Gnus"))
28861  ("from"
28862   ("Lars" -1000))
28863  (mark -100))
28864 @end lisp
28865
28866 BNF definition of a score file:
28867
28868 @example
28869 score-file      = "" / "(" *element ")"
28870 element         = rule / atom
28871 rule            = string-rule / number-rule / date-rule
28872 string-rule     = "(" quote string-header quote space *string-match ")"
28873 number-rule     = "(" quote number-header quote space *number-match ")"
28874 date-rule       = "(" quote date-header quote space *date-match ")"
28875 quote           = <ascii 34>
28876 string-header   = "subject" / "from" / "references" / "message-id" /
28877                   "xref" / "body" / "head" / "all" / "followup"
28878 number-header   = "lines" / "chars"
28879 date-header     = "date"
28880 string-match    = "(" quote <string> quote [ "" / [ space score [ "" /
28881                   space date [ "" / [ space string-match-t ] ] ] ] ] ")"
28882 score           = "nil" / <integer>
28883 date            = "nil" / <natural number>
28884 string-match-t  = "nil" / "s" / "substring" / "S" / "Substring" /
28885                   "r" / "regex" / "R" / "Regex" /
28886                   "e" / "exact" / "E" / "Exact" /
28887                   "f" / "fuzzy" / "F" / "Fuzzy"
28888 number-match    = "(" <integer> [ "" / [ space score [ "" /
28889                   space date [ "" / [ space number-match-t ] ] ] ] ] ")"
28890 number-match-t  = "nil" / "=" / "<" / ">" / ">=" / "<="
28891 date-match      = "(" quote <string> quote [ "" / [ space score [ "" /
28892                   space date [ "" / [ space date-match-t ] ] ] ] ")"
28893 date-match-t    = "nil" / "at" / "before" / "after"
28894 atom            = "(" [ required-atom / optional-atom ] ")"
28895 required-atom   = mark / expunge / mark-and-expunge / files /
28896                   exclude-files / read-only / touched
28897 optional-atom   = adapt / local / eval
28898 mark            = "mark" space nil-or-number
28899 nil-or-number   = "nil" / <integer>
28900 expunge         = "expunge" space nil-or-number
28901 mark-and-expunge = "mark-and-expunge" space nil-or-number
28902 files           = "files" *[ space <string> ]
28903 exclude-files   = "exclude-files" *[ space <string> ]
28904 read-only       = "read-only" [ space "nil" / space "t" ]
28905 adapt        = "adapt" [ space "ignore" / space "t" / space adapt-rule ]
28906 adapt-rule      = "(" *[ <string> *[ "(" <string> <integer> ")" ] ")"
28907 local           = "local" *[ space "(" <string> space <form> ")" ]
28908 eval            = "eval" space <form>
28909 space           = *[ " " / <TAB> / <NEWLINE> ]
28910 @end example
28911
28912 Any unrecognized elements in a score file should be ignored, but not
28913 discarded.
28914
28915 As you can see, white space is needed, but the type and amount of white
28916 space is irrelevant.  This means that formatting of the score file is
28917 left up to the programmer---if it's simpler to just spew it all out on
28918 one looong line, then that's ok.
28919
28920 The meaning of the various atoms are explained elsewhere in this
28921 manual (@pxref{Score File Format}).
28922
28923
28924 @node Headers
28925 @subsection Headers
28926
28927 Internally Gnus uses a format for storing article headers that
28928 corresponds to the @acronym{NOV} format in a mysterious fashion.  One could
28929 almost suspect that the author looked at the @acronym{NOV} specification and
28930 just shamelessly @emph{stole} the entire thing, and one would be right.
28931
28932 @dfn{Header} is a severely overloaded term.  ``Header'' is used in
28933 RFC 1036 to talk about lines in the head of an article (e.g.,
28934 @code{From}).  It is used by many people as a synonym for
28935 ``head''---``the header and the body''.  (That should be avoided, in my
28936 opinion.)  And Gnus uses a format internally that it calls ``header'',
28937 which is what I'm talking about here.  This is a 9-element vector,
28938 basically, with each header (ouch) having one slot.
28939
28940 These slots are, in order: @code{number}, @code{subject}, @code{from},
28941 @code{date}, @code{id}, @code{references}, @code{chars}, @code{lines},
28942 @code{xref}, and @code{extra}.  There are macros for accessing and
28943 setting these slots---they all have predictable names beginning with
28944 @code{mail-header-} and @code{mail-header-set-}, respectively.
28945
28946 All these slots contain strings, except the @code{extra} slot, which
28947 contains an alist of header/value pairs (@pxref{To From Newsgroups}).
28948
28949
28950 @node Ranges
28951 @subsection Ranges
28952
28953 @sc{gnus} introduced a concept that I found so useful that I've started
28954 using it a lot and have elaborated on it greatly.
28955
28956 The question is simple: If you have a large amount of objects that are
28957 identified by numbers (say, articles, to take a @emph{wild} example)
28958 that you want to qualify as being ``included'', a normal sequence isn't
28959 very useful.  (A 200,000 length sequence is a bit long-winded.)
28960
28961 The solution is as simple as the question: You just collapse the
28962 sequence.
28963
28964 @example
28965 (1 2 3 4 5 6 10 11 12)
28966 @end example
28967
28968 is transformed into
28969
28970 @example
28971 ((1 . 6) (10 . 12))
28972 @end example
28973
28974 To avoid having those nasty @samp{(13 . 13)} elements to denote a
28975 lonesome object, a @samp{13} is a valid element:
28976
28977 @example
28978 ((1 . 6) 7 (10 . 12))
28979 @end example
28980
28981 This means that comparing two ranges to find out whether they are equal
28982 is slightly tricky:
28983
28984 @example
28985 ((1 . 5) 7 8 (10 . 12))
28986 @end example
28987
28988 and
28989
28990 @example
28991 ((1 . 5) (7 . 8) (10 . 12))
28992 @end example
28993
28994 are equal.  In fact, any non-descending list is a range:
28995
28996 @example
28997 (1 2 3 4 5)
28998 @end example
28999
29000 is a perfectly valid range, although a pretty long-winded one.  This is
29001 also valid:
29002
29003 @example
29004 (1 . 5)
29005 @end example
29006
29007 and is equal to the previous range.
29008
29009 Here's a BNF definition of ranges.  Of course, one must remember the
29010 semantic requirement that the numbers are non-descending.  (Any number
29011 of repetition of the same number is allowed, but apt to disappear in
29012 range handling.)
29013
29014 @example
29015 range           = simple-range / normal-range
29016 simple-range    = "(" number " . " number ")"
29017 normal-range    = "(" start-contents ")"
29018 contents        = "" / simple-range *[ " " contents ] /
29019                   number *[ " " contents ]
29020 @end example
29021
29022 Gnus currently uses ranges to keep track of read articles and article
29023 marks.  I plan on implementing a number of range operators in C if The
29024 Powers That Be are willing to let me.  (I haven't asked yet, because I
29025 need to do some more thinking on what operators I need to make life
29026 totally range-based without ever having to convert back to normal
29027 sequences.)
29028
29029
29030 @node Group Info
29031 @subsection Group Info
29032
29033 Gnus stores all permanent info on groups in a @dfn{group info} list.
29034 This list is from three to six elements (or more) long and exhaustively
29035 describes the group.
29036
29037 Here are two example group infos; one is a very simple group while the
29038 second is a more complex one:
29039
29040 @example
29041 ("no.group" 5 ((1 . 54324)))
29042
29043 ("nnml:my.mail" 3 ((1 . 5) 9 (20 . 55))
29044                 ((tick (15 . 19)) (replied 3 6 (19 . 3)))
29045                 (nnml "")
29046                 ((auto-expire . t) (to-address . "ding@@gnus.org")))
29047 @end example
29048
29049 The first element is the @dfn{group name}---as Gnus knows the group,
29050 anyway.  The second element is the @dfn{subscription level}, which
29051 normally is a small integer.  (It can also be the @dfn{rank}, which is a
29052 cons cell where the @code{car} is the level and the @code{cdr} is the
29053 score.)  The third element is a list of ranges of read articles.  The
29054 fourth element is a list of lists of article marks of various kinds.
29055 The fifth element is the select method (or virtual server, if you like).
29056 The sixth element is a list of @dfn{group parameters}, which is what
29057 this section is about.
29058
29059 Any of the last three elements may be missing if they are not required.
29060 In fact, the vast majority of groups will normally only have the first
29061 three elements, which saves quite a lot of cons cells.
29062
29063 Here's a BNF definition of the group info format:
29064
29065 @example
29066 info          = "(" group space ralevel space read
29067                 [ "" / [ space marks-list [ "" / [ space method [ "" /
29068                 space parameters ] ] ] ] ] ")"
29069 group         = quote <string> quote
29070 ralevel       = rank / level
29071 level         = <integer in the range of 1 to inf>
29072 rank          = "(" level "." score ")"
29073 score         = <integer in the range of 1 to inf>
29074 read          = range
29075 marks-lists   = nil / "(" *marks ")"
29076 marks         = "(" <string> range ")"
29077 method        = "(" <string> *elisp-forms ")"
29078 parameters    = "(" *elisp-forms ")"
29079 @end example
29080
29081 Actually that @samp{marks} rule is a fib.  A @samp{marks} is a
29082 @samp{<string>} consed on to a @samp{range}, but that's a bitch to say
29083 in pseudo-BNF.
29084
29085 If you have a Gnus info and want to access the elements, Gnus offers a
29086 series of macros for getting/setting these elements.
29087
29088 @table @code
29089 @item gnus-info-group
29090 @itemx gnus-info-set-group
29091 @findex gnus-info-group
29092 @findex gnus-info-set-group
29093 Get/set the group name.
29094
29095 @item gnus-info-rank
29096 @itemx gnus-info-set-rank
29097 @findex gnus-info-rank
29098 @findex gnus-info-set-rank
29099 Get/set the group rank (@pxref{Group Score}).
29100
29101 @item gnus-info-level
29102 @itemx gnus-info-set-level
29103 @findex gnus-info-level
29104 @findex gnus-info-set-level
29105 Get/set the group level.
29106
29107 @item gnus-info-score
29108 @itemx gnus-info-set-score
29109 @findex gnus-info-score
29110 @findex gnus-info-set-score
29111 Get/set the group score (@pxref{Group Score}).
29112
29113 @item gnus-info-read
29114 @itemx gnus-info-set-read
29115 @findex gnus-info-read
29116 @findex gnus-info-set-read
29117 Get/set the ranges of read articles.
29118
29119 @item gnus-info-marks
29120 @itemx gnus-info-set-marks
29121 @findex gnus-info-marks
29122 @findex gnus-info-set-marks
29123 Get/set the lists of ranges of marked articles.
29124
29125 @item gnus-info-method
29126 @itemx gnus-info-set-method
29127 @findex gnus-info-method
29128 @findex gnus-info-set-method
29129 Get/set the group select method.
29130
29131 @item gnus-info-params
29132 @itemx gnus-info-set-params
29133 @findex gnus-info-params
29134 @findex gnus-info-set-params
29135 Get/set the group parameters.
29136 @end table
29137
29138 All the getter functions take one parameter---the info list.  The setter
29139 functions take two parameters---the info list and the new value.
29140
29141 The last three elements in the group info aren't mandatory, so it may be
29142 necessary to extend the group info before setting the element.  If this
29143 is necessary, you can just pass on a non-@code{nil} third parameter to
29144 the three final setter functions to have this happen automatically.
29145
29146
29147 @node Extended Interactive
29148 @subsection Extended Interactive
29149 @cindex interactive
29150 @findex gnus-interactive
29151
29152 Gnus extends the standard Emacs @code{interactive} specification
29153 slightly to allow easy use of the symbolic prefix (@pxref{Symbolic
29154 Prefixes}).  Here's an example of how this is used:
29155
29156 @lisp
29157 (defun gnus-summary-increase-score (&optional score symp)
29158   (interactive (gnus-interactive "P\ny"))
29159   ...
29160   )
29161 @end lisp
29162
29163 The best thing to do would have been to implement
29164 @code{gnus-interactive} as a macro which would have returned an
29165 @code{interactive} form, but this isn't possible since Emacs checks
29166 whether a function is interactive or not by simply doing an @code{assq}
29167 on the lambda form.  So, instead we have @code{gnus-interactive}
29168 function that takes a string and returns values that are usable to
29169 @code{interactive}.
29170
29171 This function accepts (almost) all normal @code{interactive} specs, but
29172 adds a few more.
29173
29174 @table @samp
29175 @item y
29176 @vindex gnus-current-prefix-symbol
29177 The current symbolic prefix---the @code{gnus-current-prefix-symbol}
29178 variable.
29179
29180 @item Y
29181 @vindex gnus-current-prefix-symbols
29182 A list of the current symbolic prefixes---the
29183 @code{gnus-current-prefix-symbol} variable.
29184
29185 @item A
29186 The current article number---the @code{gnus-summary-article-number}
29187 function.
29188
29189 @item H
29190 The current article header---the @code{gnus-summary-article-header}
29191 function.
29192
29193 @item g
29194 The current group name---the @code{gnus-group-group-name}
29195 function.
29196
29197 @end table
29198
29199
29200 @node Emacs/XEmacs Code
29201 @subsection Emacs/XEmacs Code
29202 @cindex XEmacs
29203 @cindex Emacsen
29204
29205 While Gnus runs under Emacs, XEmacs and Mule, I decided that one of the
29206 platforms must be the primary one.  I chose Emacs.  Not because I don't
29207 like XEmacs or Mule, but because it comes first alphabetically.
29208
29209 This means that Gnus will byte-compile under Emacs with nary a warning,
29210 while XEmacs will pump out gigabytes of warnings while byte-compiling.
29211 As I use byte-compilation warnings to help me root out trivial errors in
29212 Gnus, that's very useful.
29213
29214 I've also consistently used Emacs function interfaces, but have used
29215 Gnusey aliases for the functions.  To take an example:  Emacs defines a
29216 @code{run-at-time} function while XEmacs defines a @code{start-itimer}
29217 function.  I then define a function called @code{gnus-run-at-time} that
29218 takes the same parameters as the Emacs @code{run-at-time}.  When running
29219 Gnus under Emacs, the former function is just an alias for the latter.
29220 However, when running under XEmacs, the former is an alias for the
29221 following function:
29222
29223 @lisp
29224 (defun gnus-xmas-run-at-time (time repeat function &rest args)
29225   (start-itimer
29226    "gnus-run-at-time"
29227    `(lambda ()
29228       (,function ,@@args))
29229    time repeat))
29230 @end lisp
29231
29232 This sort of thing has been done for bunches of functions.  Gnus does
29233 not redefine any native Emacs functions while running under XEmacs---it
29234 does this @code{defalias} thing with Gnus equivalents instead.  Cleaner
29235 all over.
29236
29237 In the cases where the XEmacs function interface was obviously cleaner,
29238 I used it instead.  For example @code{gnus-region-active-p} is an alias
29239 for @code{region-active-p} in XEmacs, whereas in Emacs it is a function.
29240
29241 Of course, I could have chosen XEmacs as my native platform and done
29242 mapping functions the other way around.  But I didn't.  The performance
29243 hit these indirections impose on Gnus under XEmacs should be slight.
29244
29245
29246 @node Various File Formats
29247 @subsection Various File Formats
29248
29249 @menu
29250 * Active File Format::          Information on articles and groups available.
29251 * Newsgroups File Format::      Group descriptions.
29252 @end menu
29253
29254
29255 @node Active File Format
29256 @subsubsection Active File Format
29257
29258 The active file lists all groups available on the server in
29259 question.  It also lists the highest and lowest current article numbers
29260 in each group.
29261
29262 Here's an excerpt from a typical active file:
29263
29264 @example
29265 soc.motss 296030 293865 y
29266 alt.binaries.pictures.fractals 3922 3913 n
29267 comp.sources.unix 1605 1593 m
29268 comp.binaries.ibm.pc 5097 5089 y
29269 no.general 1000 900 y
29270 @end example
29271
29272 Here's a pseudo-BNF definition of this file:
29273
29274 @example
29275 active      = *group-line
29276 group-line  = group spc high-number spc low-number spc flag <NEWLINE>
29277 group       = <non-white-space string>
29278 spc         = " "
29279 high-number = <non-negative integer>
29280 low-number  = <positive integer>
29281 flag        = "y" / "n" / "m" / "j" / "x" / "=" group
29282 @end example
29283
29284 For a full description of this file, see the manual pages for
29285 @samp{innd}, in particular @samp{active(5)}.
29286
29287
29288 @node Newsgroups File Format
29289 @subsubsection Newsgroups File Format
29290
29291 The newsgroups file lists groups along with their descriptions.  Not all
29292 groups on the server have to be listed,  and not all groups in the file
29293 have to exist on the server.  The file is meant purely as information to
29294 the user.
29295
29296 The format is quite simple; a group name, a tab, and the description.
29297 Here's the definition:
29298
29299 @example
29300 newsgroups    = *line
29301 line          = group tab description <NEWLINE>
29302 group         = <non-white-space string>
29303 tab           = <TAB>
29304 description   = <string>
29305 @end example
29306
29307
29308 @page
29309 @node Emacs for Heathens
29310 @section Emacs for Heathens
29311
29312 Believe it or not, but some people who use Gnus haven't really used
29313 Emacs much before they embarked on their journey on the Gnus Love Boat.
29314 If you are one of those unfortunates whom ``@kbd{C-M-a}'', ``kill the
29315 region'', and ``set @code{gnus-flargblossen} to an alist where the key
29316 is a regexp that is used for matching on the group name'' are magical
29317 phrases with little or no meaning, then this appendix is for you.  If
29318 you are already familiar with Emacs, just ignore this and go fondle your
29319 cat instead.
29320
29321 @menu
29322 * Keystrokes::                  Entering text and executing commands.
29323 * Emacs Lisp::                  The built-in Emacs programming language.
29324 @end menu
29325
29326
29327 @node Keystrokes
29328 @subsection Keystrokes
29329
29330 @itemize @bullet
29331 @item
29332 Q: What is an experienced Emacs user?
29333
29334 @item
29335 A: A person who wishes that the terminal had pedals.
29336 @end itemize
29337
29338 Yes, when you use Emacs, you are apt to use the control key, the shift
29339 key and the meta key a lot.  This is very annoying to some people
29340 (notably @code{vi}le users), and the rest of us just love the hell out
29341 of it.  Just give up and submit.  Emacs really does stand for
29342 ``Escape-Meta-Alt-Control-Shift'', and not ``Editing Macros'', as you
29343 may have heard from other disreputable sources (like the Emacs author).
29344
29345 The shift keys are normally located near your pinky fingers, and are
29346 normally used to get capital letters and stuff.  You probably use it all
29347 the time.  The control key is normally marked ``CTRL'' or something like
29348 that.  The meta key is, funnily enough, never marked as such on any
29349 keyboard.  The one I'm currently at has a key that's marked ``Alt'',
29350 which is the meta key on this keyboard.  It's usually located somewhere
29351 to the left hand side of the keyboard, usually on the bottom row.
29352
29353 Now, us Emacs people don't say ``press the meta-control-m key'',
29354 because that's just too inconvenient.  We say ``press the @kbd{C-M-m}
29355 key''.  @kbd{M-} is the prefix that means ``meta'' and ``C-'' is the
29356 prefix that means ``control''.  So ``press @kbd{C-k}'' means ``press
29357 down the control key, and hold it down while you press @kbd{k}''.
29358 ``Press @kbd{C-M-k}'' means ``press down and hold down the meta key and
29359 the control key and then press @kbd{k}''.  Simple, ay?
29360
29361 This is somewhat complicated by the fact that not all keyboards have a
29362 meta key.  In that case you can use the ``escape'' key.  Then @kbd{M-k}
29363 means ``press escape, release escape, press @kbd{k}''.  That's much more
29364 work than if you have a meta key, so if that's the case, I respectfully
29365 suggest you get a real keyboard with a meta key.  You can't live without
29366 it.
29367
29368
29369
29370 @node Emacs Lisp
29371 @subsection Emacs Lisp
29372
29373 Emacs is the King of Editors because it's really a Lisp interpreter.
29374 Each and every key you tap runs some Emacs Lisp code snippet, and since
29375 Emacs Lisp is an interpreted language, that means that you can configure
29376 any key to run any arbitrary code.  You just, like, do it.
29377
29378 Gnus is written in Emacs Lisp, and is run as a bunch of interpreted
29379 functions.  (These are byte-compiled for speed, but it's still
29380 interpreted.)  If you decide that you don't like the way Gnus does
29381 certain things, it's trivial to have it do something a different way.
29382 (Well, at least if you know how to write Lisp code.)  However, that's
29383 beyond the scope of this manual, so we are simply going to talk about
29384 some common constructs that you normally use in your @file{~/.gnus.el}
29385 file to customize Gnus.  (You can also use the @file{~/.emacs} file, but
29386 in order to set things of Gnus up, it is much better to use the
29387 @file{~/.gnus.el} file, @xref{Startup Files}.)
29388
29389 If you want to set the variable @code{gnus-florgbnize} to four (4), you
29390 write the following:
29391
29392 @lisp
29393 (setq gnus-florgbnize 4)
29394 @end lisp
29395
29396 This function (really ``special form'') @code{setq} is the one that can
29397 set a variable to some value.  This is really all you need to know.  Now
29398 you can go and fill your @file{~/.gnus.el} file with lots of these to
29399 change how Gnus works.
29400
29401 If you have put that thing in your @file{~/.gnus.el} file, it will be
29402 read and @code{eval}ed (which is Lisp-ese for ``run'') the next time you
29403 start Gnus.  If you want to change the variable right away, simply say
29404 @kbd{C-x C-e} after the closing parenthesis.  That will @code{eval} the
29405 previous ``form'', which is a simple @code{setq} statement here.
29406
29407 Go ahead---just try it, if you're located at your Emacs.  After you
29408 @kbd{C-x C-e}, you will see @samp{4} appear in the echo area, which
29409 is the return value of the form you @code{eval}ed.
29410
29411 Some pitfalls:
29412
29413 If the manual says ``set @code{gnus-read-active-file} to @code{some}'',
29414 that means:
29415
29416 @lisp
29417 (setq gnus-read-active-file 'some)
29418 @end lisp
29419
29420 On the other hand, if the manual says ``set @code{gnus-nntp-server} to
29421 @samp{nntp.ifi.uio.no}'', that means:
29422
29423 @lisp
29424 (setq gnus-nntp-server "nntp.ifi.uio.no")
29425 @end lisp
29426
29427 So be careful not to mix up strings (the latter) with symbols (the
29428 former).  The manual is unambiguous, but it can be confusing.
29429
29430 @page
29431 @include gnus-faq.texi
29432
29433 @node Index
29434 @chapter Index
29435 @printindex cp
29436
29437 @node Key Index
29438 @chapter Key Index
29439 @printindex ky
29440
29441 @summarycontents
29442 @contents
29443 @bye
29444
29445 @iftex
29446 @iflatex
29447 \end{document}
29448 @end iflatex
29449 @end iftex
29450
29451 @c Local Variables:
29452 @c mode: texinfo
29453 @c coding: iso-8859-1
29454 @c End:
29455
29456 @ignore
29457    arch-tag: c9fa47e7-78ca-4681-bda9-9fef45d1c819
29458 @end ignore