The Gnus Newsreader
*******************

You can read news (and mail) from within Emacs by using Gnus.  The news can be gotten by any nefarious means you can think of---NNTP, local spool or your mbox file.  All at the same time, if you want to push your luck.

This manual corresponds to No Gnus v0.11.

Copyright © 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.

     Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover texts being ``A GNU Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the license is included in the section entitled ``GNU Free Documentation License''.

     (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and modify this GNU manual.  Buying copies from the FSF supports it in developing GNU and promoting software freedom.''

Starting Gnus
*************

If you haven't used Emacs much before using Gnus, read Emacs for Heathens first.

If your system administrator has set things up properly, starting Gnus and reading news is extremely easy---you just type M-x gnus in your Emacs.  If not, you should customize the variable gnus-select-method as described in Finding the News.  For a minimal setup for posting should also customize the variables user-full-name and user-mail-address.

If you want to start Gnus in a different frame, you can use the command M-x gnus-other-frame instead.

If things do not go smoothly at startup, you have to twiddle some variables in your ~/.gnus.el file.  This file is similar to ~/.emacs, but is read when Gnus starts.

If you puzzle at any terms used in this manual, please refer to the terminology section (see Terminology).

Finding the News
================

First of all, you should know that there is a special buffer called *Server* that lists all the servers Gnus knows about.  You can press ^ from the Group buffer to see it.  In the Server buffer, you can press RET on a defined server to see all the groups it serves (subscribed or not!).  You can also add or delete servers, edit a foreign server's definition, agentize or de-agentize a server, and do many other neat things.  See Server Buffer. See Foreign Groups.  See Agent Basics.

The gnus-select-method variable says where Gnus should look for news.  This variable should be a list where the first element says how and the second element says where.  This method is your native method.  All groups not fetched with this method are foreign groups.

For instance, if the news.somewhere.edu NNTP server is where you want to get your daily dosage of news from, you'd say:

     (setq gnus-select-method '(nntp "news.somewhere.edu"))

If you want to read directly from the local spool, say:

     (setq gnus-select-method '(nnspool ""))

If you can use a local spool, you probably should, as it will almost certainly be much faster.  But do not use the local spool if your server is running Leafnode (which is a simple, standalone private news server); in this case, use (nntp "localhost").

If this variable is not set, Gnus will take a look at the NNTPSERVER environment variable.  If that variable isn't set, Gnus will see whether gnus-nntpserver-file (/etc/nntpserver by default) has any opinions on the matter. If that fails as well, Gnus will try to use the machine running Emacs as an NNTP server.  That's a long shot, though.

However, if you use one NNTP server regularly and are just interested in a couple of groups from a different server, you would be better served by using the B command in the group buffer.  It will let you have a look at what groups are available, and you can subscribe to any of the groups you want to.  This also makes .newsrc maintenance much tidier.  See Foreign Groups.

A slightly different approach to foreign groups is to set the gnus-secondary-select-methods variable.  The select methods listed in this variable are in many ways just as native as the gnus-select-method server.  They will also be queried for active files during startup (if that's required), and new newsgroups that appear on these servers will be subscribed (or not) just as native groups are.

For instance, if you use the nnmbox back end to read your mail, you would typically set this variable to

     (setq gnus-secondary-select-methods '((nnmbox "")))

Note: the NNTP back end stores marks in marks files (see NNTP marks).  This feature makes it easy to share marks between several Gnus installations, but may slow down things a bit when fetching new articles.  See NNTP marks, for more information.

The First Time
==============

If no startup files exist (see Startup Files), Gnus will try to determine what groups should be subscribed by default.

If the variable gnus-default-subscribed-newsgroups is set, Gnus will subscribe you to just those groups in that list, leaving the rest killed.  Your system administrator should have set this variable to something useful.

Since she hasn't, Gnus will just subscribe you to a few arbitrarily picked groups (i.e., *.newusers).  (Arbitrary is defined here as whatever Lars thinks you should read.)

You'll also be subscribed to the Gnus documentation group, which should help you with most common problems.

If gnus-default-subscribed-newsgroups is t, Gnus will just use the normal functions for handling new groups, and not do anything special.

The Server is Down
==================

If the default server is down, Gnus will understandably have some problems starting.  However, if you have some mail groups in addition to the news groups, you may want to start Gnus anyway.

Gnus, being the trusting sort of program, will ask whether to proceed without a native select method if that server can't be contacted.  This will happen whether the server doesn't actually exist (i.e., you have given the wrong address) or the server has just momentarily taken ill for some reason or other.  If you decide to continue and have no foreign groups, you'll find it difficult to actually do anything in the group buffer.  But, hey, that's your problem.  Blllrph!

If you know that the server is definitely down, or you just want to read your mail without bothering with the server at all, you can use the gnus-no-server command to start Gnus.  That might come in handy if you're in a hurry as well.  This command will not attempt to contact your primary server---instead, it will just activate all groups on level 1 and 2.  (You should preferably keep no native groups on those two levels.) Also see Group Levels.

Slave Gnusae
============

You might want to run more than one Emacs with more than one Gnus at the same time.  If you are using different .newsrc files (e.g., if you are using the two different Gnusae to read from two different servers), that is no problem whatsoever.  You just do it.

The problem appears when you want to run two Gnusae that use the same .newsrc file.

To work around that problem some, we here at the Think-Tank at the Gnus Towers have come up with a new concept: Masters and slaves.  (We have applied for a patent on this concept, and have taken out a copyright on those words.  If you wish to use those words in conjunction with each other, you have to send $1 per usage instance to me.  Usage of the patent (Master/Slave Relationships In Computer Applications) will be much more expensive, of course.)

Anyway, you start one Gnus up the normal way with M-x gnus (or however you do it).  Each subsequent slave Gnusae should be started with M-x gnus-slave.  These slaves won't save normal .newsrc files, but instead save slave files that contain information only on what groups have been read in the slave session.  When a master Gnus starts, it will read (and delete) these slave files, incorporating all information from them.  (The slave files will be read in the sequence they were created, so the latest changes will have precedence.)

Information from the slave files has, of course, precedence over the information in the normal (i.e., master) .newsrc file.

If the .newsrc* files have not been saved in the master when the slave starts, you may be prompted as to whether to read an auto-save file.  If you answer ``yes'', the unsaved changes to the master will be incorporated into the slave.  If you answer ``no'', the slave may see some messages as unread that have been read in the master.

New Groups
==========

If you are satisfied that you really never want to see any new groups, you can set gnus-check-new-newsgroups to nil.  This will also save you some time at startup.  Even if this variable is nil, you can always subscribe to the new groups just by pressing U in the group buffer (see Group Maintenance).  This variable is ask-server by default.  If you set this variable to always, then Gnus will query the back ends for new groups even when you do the g command (see Scanning New Messages).

Checking New Groups
-------------------

Gnus normally determines whether a group is new or not by comparing the list of groups from the active file(s) with the lists of subscribed and dead groups.  This isn't a particularly fast method.  If gnus-check-new-newsgroups is ask-server, Gnus will ask the server for new groups since the last time.  This is both faster and cheaper.  This also means that you can get rid of the list of killed groups altogether, so you may set gnus-save-killed-list to nil, which will save time both at startup, at exit, and all over. Saves disk space, too.  Why isn't this the default, then? Unfortunately, not all servers support this command.

I bet I know what you're thinking now: How do I find out whether my server supports ask-server?  No?  Good, because I don't have a fail-safe answer.  I would suggest just setting this variable to ask-server and see whether any new groups appear within the next few days.  If any do, then it works.  If none do, then it doesn't work.  I could write a function to make Gnus guess whether the server supports ask-server, but it would just be a guess.  So I won't. You could telnet to the server and say HELP and see whether it lists NEWGROUPS among the commands it understands.  If it does, then it might work.  (But there are servers that lists NEWGROUPS without supporting the function properly.)

This variable can also be a list of select methods.  If so, Gnus will issue an ask-server command to each of the select methods, and subscribe them (or not) using the normal methods.  This might be handy if you are monitoring a few servers for new groups.  A side effect is that startup will take much longer, so you can meditate while waiting. Use the mantra ``dingnusdingnusdingnus'' to achieve permanent bliss.

Subscription Methods
--------------------

What Gnus does when it encounters a new group is determined by the gnus-subscribe-newsgroup-method variable.

This variable should contain a function.  This function will be called with the name of the new group as the only parameter.

Some handy pre-fab functions are:

gnus-subscribe-zombies
     Make all new groups zombies.  This is the default.  You can browse the zombies later (with A z) and either kill them all off properly (with S z), or subscribe to them (with u).

gnus-subscribe-randomly
     Subscribe all new groups in arbitrary order.  This really means that all new groups will be added at ``the top'' of the group buffer.

gnus-subscribe-alphabetically
     Subscribe all new groups in alphabetical order.

gnus-subscribe-hierarchically
     Subscribe all new groups hierarchically.  The difference between this function and gnus-subscribe-alphabetically is slight. gnus-subscribe-alphabetically will subscribe new groups in a strictly alphabetical fashion, while this function will enter groups into its hierarchy.  So if you want to have the rec hierarchy before the comp hierarchy, this function will not mess that configuration up.  Or something like that.

gnus-subscribe-interactively
     Subscribe new groups interactively.  This means that Gnus will ask you about all new groups.  The groups you choose to subscribe to will be subscribed hierarchically.

gnus-subscribe-killed
     Kill all new groups.

gnus-subscribe-topics
     Put the groups into the topic that has a matching subscribe topic parameter (see Topic Parameters).  For instance, a subscribe topic parameter that looks like

          "nnml"

     will mean that all groups that match that regex will be subscribed under that topic.

     If no topics match the groups, the groups will be subscribed in the top-level topic.

A closely related variable is gnus-subscribe-hierarchical-interactive.  (That's quite a mouthful.)  If this variable is non-nil, Gnus will ask you in a hierarchical fashion whether to subscribe to new groups or not.  Gnus will ask you for each sub-hierarchy whether you want to descend the hierarchy or not.

One common mistake is to set the variable a few paragraphs above (gnus-subscribe-newsgroup-method) to gnus-subscribe-hierarchical-interactive.  This is an error.  This will not work.  This is ga-ga.  So don't do it.

Filtering New Groups
--------------------

A nice and portable way to control which new newsgroups should be subscribed (or ignored) is to put an options line at the start of the .newsrc file.  Here's an example:

     options -n !alt.all !rec.all sci.all

This line obviously belongs to a serious-minded intellectual scientific person (or she may just be plain old boring), because it says that all groups that have names beginning with alt and rec should be ignored, and all groups with names beginning with sci should be subscribed.  Gnus will not use the normal subscription method for subscribing these groups. gnus-subscribe-options-newsgroup-method is used instead.  This variable defaults to gnus-subscribe-alphabetically.

If you don't want to mess with your .newsrc file, you can just set the two variables gnus-options-subscribe and gnus-options-not-subscribe.  These two variables do exactly the same as the .newsrc options -n trick.  Both are regexps, and if the new group matches the former, it will be unconditionally subscribed, and if it matches the latter, it will be ignored.

Yet another variable that meddles here is gnus-auto-subscribed-groups.  It works exactly like gnus-options-subscribe, and is therefore really superfluous, but I thought it would be nice to have two of these.  This variable is more meant for setting some ground rules, while the other variable is used more for user fiddling.  By default this variable makes all new groups that come from mail back ends (nnml, nnbabyl, nnfolder, nnmbox, nnmh, and nnmaildir) subscribed.  If you don't like that, just set this variable to nil.

New groups that match this regexp are subscribed using gnus-subscribe-options-newsgroup-method.

Changing Servers
================

Sometimes it is necessary to move from one NNTP server to another. This happens very rarely, but perhaps you change jobs, or one server is very flaky and you want to use another.

Changing the server is pretty easy, right?  You just change gnus-select-method to point to the new server?

Wrong!

Article numbers are not (in any way) kept synchronized between different NNTP servers, and the only way Gnus keeps track of what articles you have read is by keeping track of article numbers.  So when you change gnus-select-method, your .newsrc file becomes worthless.

You can use the M-x gnus-group-clear-data-on-native-groups command to clear out all data that you have on your native groups. Use with caution.

Clear the data from the current group only---nix out marks and the list of read articles (gnus-group-clear-data).

After changing servers, you must move the cache hierarchy away, since the cached articles will have wrong article numbers, which will affect which articles Gnus thinks are read. gnus-group-clear-data-on-native-groups will ask you if you want to have it done automatically; for gnus-group-clear-data, you can use M-x gnus-cache-move-cache (but beware, it will move the cache for all groups).

Startup Files
=============

Most common Unix news readers use a shared startup file called .newsrc.  This file contains all the information about what groups are subscribed, and which articles in these groups have been read.

Things got a bit more complicated with GNUS.  In addition to keeping the .newsrc file updated, it also used a file called .newsrc.el for storing all the information that didn't fit into the .newsrc file.  (Actually, it also duplicated everything in the .newsrc file.)  GNUS would read whichever one of these files was the most recently saved, which enabled people to swap between GNUS and other newsreaders.

That was kinda silly, so Gnus went one better: In addition to the .newsrc and .newsrc.el files, Gnus also has a file called .newsrc.eld.  It will read whichever of these files that are most recent, but it will never write a .newsrc.el file.  You should never delete the .newsrc.eld file---it contains much information not stored in the .newsrc file.

You can turn off writing the .newsrc file by setting gnus-save-newsrc-file to nil, which means you can delete the file and save some space, as well as exiting from Gnus faster. However, this will make it impossible to use other newsreaders than Gnus.  But hey, who would want to, right?  Similarly, setting gnus-read-newsrc-file to nil makes Gnus ignore the .newsrc file and any .newsrc-SERVER files, which can be convenient if you use a different news reader occasionally, and you want to read a different subset of the available groups with that news reader.

If gnus-save-killed-list (default t) is nil, Gnus will not save the list of killed groups to the startup file.  This will save both time (when starting and quitting) and space (on disk).  It will also mean that Gnus has no record of what groups are new or old, so the automatic new groups subscription methods become meaningless. You should always set gnus-check-new-newsgroups to nil or ask-server if you set this variable to nil (see New Groups).  This variable can also be a regular expression.  If that's the case, remove all groups that do not match this regexp before saving.  This can be useful in certain obscure situations that involve several servers where not all servers support ask-server.

The gnus-startup-file variable says where the startup files are. The default value is ~/.newsrc, with the Gnus (El Dingo) startup file being whatever that one is, with a .eld appended. If you want version control for this file, set gnus-backup-startup-file.  It respects the same values as the version-control variable.

gnus-save-newsrc-hook is called before saving any of the newsrc files, while gnus-save-quick-newsrc-hook is called just before saving the .newsrc.eld file, and gnus-save-standard-newsrc-hook is called just before saving the .newsrc file.  The latter two are commonly used to turn version control on or off.  Version control is on by default when saving the startup files.  If you want to turn backup creation off, say something like:

     (defun turn-off-backup ()
       (set (make-local-variable 'backup-inhibited) t))

     (add-hook 'gnus-save-quick-newsrc-hook 'turn-off-backup)
     (add-hook 'gnus-save-standard-newsrc-hook 'turn-off-backup)

When Gnus starts, it will read the gnus-site-init-file (.../site-lisp/gnus-init by default) and gnus-init-file (~/.gnus by default) files.  These are normal Emacs Lisp files and can be used to avoid cluttering your ~/.emacs and site-init files with Gnus stuff.  Gnus will also check for files with the same names as these, but with .elc and .el suffixes.  In other words, if you have set gnus-init-file to ~/.gnus, it will look for ~/.gnus.elc, ~/.gnus.el, and finally ~/.gnus (in this order).  If Emacs was invoked with the -q or --no-init-file options (see Initial Options (The Emacs Manual)), Gnus doesn't read gnus-init-file.

Auto Save
=========

Whenever you do something that changes the Gnus data (reading articles, catching up, killing/subscribing groups), the change is added to a special dribble buffer.  This buffer is auto-saved the normal Emacs way.  If your Emacs should crash before you have saved the .newsrc files, all changes you have made can be recovered from this file.

If Gnus detects this file at startup, it will ask the user whether to read it.  The auto save file is deleted whenever the real startup file is saved.

If gnus-use-dribble-file is nil, Gnus won't create and maintain a dribble buffer.  The default is t.

Gnus will put the dribble file(s) in gnus-dribble-directory.  If this variable is nil, which it is by default, Gnus will dribble into the directory where the .newsrc file is located.  (This is normally the user's home directory.)  The dribble file will get the same file permissions as the .newsrc file.

If gnus-always-read-dribble-file is non-nil, Gnus will read the dribble file on startup without querying the user.

The Active File
===============

When Gnus starts, or indeed whenever it tries to determine whether new articles have arrived, it reads the active file.  This is a very large file that lists all the active groups and articles on the server.

Before examining the active file, Gnus deletes all lines that match the regexp gnus-ignored-newsgroups.  This is done primarily to reject any groups with bogus names, but you can use this variable to make Gnus ignore hierarchies you aren't ever interested in.  However, this is not recommended.  In fact, it's highly discouraged.  Instead, see New Groups for an overview of other variables that can be used instead.

The active file can be rather Huge, so if you have a slow network, you can set gnus-read-active-file to nil to prevent Gnus from reading the active file.  This variable is some by default.

Gnus will try to make do by getting information just on the groups that you actually subscribe to.

Note that if you subscribe to lots and lots of groups, setting this variable to nil will probably make Gnus slower, not faster.  At present, having this variable nil will slow Gnus down considerably, unless you read news over a 2400 baud modem.

This variable can also have the value some.  Gnus will then attempt to read active info only on the subscribed groups.  On some servers this is quite fast (on sparkling, brand new INN servers that support the LIST ACTIVE group command), on others this isn't fast at all.  In any case, some should be faster than nil, and is certainly faster than t over slow lines.

Some news servers (old versions of Leafnode and old versions of INN, for instance) do not support the LIST ACTIVE group.  For these servers, nil is probably the most efficient value for this variable.

If this variable is nil, Gnus will ask for group info in total lock-step, which isn't very fast.  If it is some and you use an NNTP server, Gnus will pump out commands as fast as it can, and read all the replies in one swoop.  This will normally result in better performance, but if the server does not support the aforementioned LIST ACTIVE group command, this isn't very nice to the server.

If you think that starting up Gnus takes too long, try all the three different values for this variable and see what works best for you.

In any case, if you use some or nil, you should definitely kill all groups that you aren't interested in to speed things up.

Note that this variable also affects active file retrieval from secondary select methods.

Startup Variables
=================

gnus-load-hook
     A hook run while Gnus is being loaded.  Note that this hook will normally be run just once in each Emacs session, no matter how many times you start Gnus.

gnus-before-startup-hook
     A hook called as the first thing when Gnus is started.

gnus-startup-hook
     A hook run as the very last thing after starting up Gnus

gnus-started-hook
     A hook that is run as the very last thing after starting up Gnus successfully.

gnus-setup-news-hook
     A hook that is run after reading the .newsrc file(s), but before generating the group buffer.

gnus-check-bogus-newsgroups
     If non-nil, Gnus will check for and delete all bogus groups at startup.  A bogus group is a group that you have in your .newsrc file, but doesn't exist on the news server.  Checking for bogus groups can take quite a while, so to save time and resources it's best to leave this option off, and do the checking for bogus groups once in a while from the group buffer instead (see Group Maintenance).

gnus-inhibit-startup-message
     If non-nil, the startup message won't be displayed.  That way, your boss might not notice as easily that you are reading news instead of doing your job.  Note that this variable is used before ~/.gnus.el is loaded, so it should be set in .emacs instead.

gnus-no-groups-message
     Message displayed by Gnus when no groups are available.

gnus-use-backend-marks
     If non-nil, Gnus will store article marks both in the .newsrc.eld file and in the backends.  This will slow down group operation some.

Group Buffer
************

The group buffer lists all (or parts) of the available groups.  It is the first buffer shown when Gnus starts, and will never be killed as long as Gnus is active.

Group Buffer Format
===================

You can customize the Group Mode tool bar, see M-x customize-apropos RET gnus-group-tool-bar.  This feature is only available in Emacs.

The tool bar icons are now (de)activated correctly depending on the cursor position.  Therefore, moving around in the Group Buffer is slower.  You can disable this via the variable gnus-group-update-tool-bar.  Its default value depends on your Emacs version.

Group Line Specification
------------------------

The default format of the group buffer is nice and dull, but you can make it as exciting and ugly as you feel like.

Here's a couple of example group lines:

          25: news.announce.newusers
      *    0: alt.fan.andrea-dworkin

Quite simple, huh?

You can see that there are 25 unread articles in news.announce.newusers.  There are no unread articles, but some ticked articles, in alt.fan.andrea-dworkin (see that little asterisk at the beginning of the line?).

You can change that format to whatever you want by fiddling with the gnus-group-line-format variable.  This variable works along the lines of a format specification, which is pretty much the same as a printf specifications, for those of you who use (feh!) C. See Formatting Variables.

%M%S%5y:%B%(%g%)\n is the value that produced those lines above.

There should always be a colon on the line; the cursor always moves to the colon after performing an operation.  See Positioning Point.  Nothing else is required---not even the group name.  All displayed text is just window dressing, and is never examined by Gnus. Gnus stores all real information it needs using text properties.

(Note that if you make a really strange, wonderful, spreadsheet-like layout, everybody will believe you are hard at work with the accounting instead of wasting time reading news.)

Here's a list of all available format characters:

M
     An asterisk if the group only has marked articles.

S
     Whether the group is subscribed.

L
     Level of subscribedness.

N
     Number of unread articles.

I
     Number of dormant articles.

T
     Number of ticked articles.

R
     Number of read articles.

U
     Number of unseen articles.

t
     Estimated total number of articles.  (This is really MAX-NUMBER minus MIN-NUMBER plus 1.)

     Gnus uses this estimation because the NNTP protocol provides efficient access to MAX-NUMBER and MIN-NUMBER but getting the true unread message count is not possible efficiently.  For hysterical raisins, even the mail back ends, where the true number of unread messages might be available efficiently, use the same limited interface.  To remove this restriction from Gnus means that the back end interface has to be changed, which is not an easy job.

     The nnml backend (see Mail Spool) has a feature called ``group compaction'' which circumvents this deficiency: the idea is to renumber all articles from 1, removing all gaps between numbers, hence getting a correct total count.  Other backends may support this in the future.  In order to keep your total article count relatively up to date, you might want to compact your groups (or even directly your server) from time to time. See Misc Group Stuff, see Server Commands.

y
     Number of unread, unticked, non-dormant articles.

i
     Number of ticked and dormant articles.

g
     Full group name.

G
     Group name.

C
     Group comment (see Group Parameters) or group name if there is no comment element in the group parameters.

D
     Newsgroup description.  You need to read the group descriptions before these will appear, and to do that, you either have to set gnus-read-active-file or use the group buffer M-d command.

o
     m if moderated.

O
     (m) if moderated.

s
     Select method.

B
     If the summary buffer for the group is open or not.

n
     Select from where.

z
     A string that looks like <%s:%n> if a foreign select method is used.

P
     Indentation based on the level of the topic (see Group Topics).

c
     Short (collapsed) group name.  The gnus-group-uncollapsed-levels variable says how many levels to leave at the end of the group name. The default is 1---this will mean that group names like gnu.emacs.gnus will be shortened to g.e.gnus.

m
     % (gnus-new-mail-mark) if there has arrived new mail to the group lately.

p
     # (gnus-process-mark) if the group is process marked.

d
     A string that says when you last read the group (see Group Timestamp).

F
     The disk space used by the articles fetched by both the cache and agent.  The value is automatically scaled to bytes(B), kilobytes(K), megabytes(M), or gigabytes(G) to minimize the column width.  A format of %7F is sufficient for a fixed-width column.

u
     User defined specifier.  The next character in the format string should be a letter.  Gnus will call the function gnus-user-format-function-X, where X is the letter following %u.  The function will be passed a single dummy parameter as argument.  The function should return a string, which will be inserted into the buffer just like information from any other specifier.

All the ``number-of'' specs will be filled with an asterisk (*) if no info is available---for instance, if it is a non-activated foreign group, or a bogus native group.

Group Mode Line Specification
-----------------------------

The mode line can be changed by setting gnus-group-mode-line-format (see Mode Line Formatting).  It doesn't understand that many format specifiers:

S
     The native news server.

M
     The native select method.

Group Highlighting
------------------

Highlighting in the group buffer is controlled by the gnus-group-highlight variable.  This is an alist with elements that look like (FORM . FACE).  If FORM evaluates to something non-nil, the FACE will be used on the line.

Here's an example value for this variable that might look nice if the background is dark:

     (cond (window-system
            (setq custom-background-mode 'light)
            (defface my-group-face-1
              '((t (:foreground "Red" :bold t))) "First group face")
            (defface my-group-face-2
              '((t (:foreground "DarkSeaGreen4" :bold t)))
              "Second group face")
            (defface my-group-face-3
              '((t (:foreground "Green4" :bold t))) "Third group face")
            (defface my-group-face-4
              '((t (:foreground "SteelBlue" :bold t))) "Fourth group face")
            (defface my-group-face-5
              '((t (:foreground "Blue" :bold t))) "Fifth group face")))

     (setq gnus-group-highlight
           '(((> unread 200) . my-group-face-1)
             ((and (< level 3) (zerop unread)) . my-group-face-2)
             ((< level 3) . my-group-face-3)
             ((zerop unread) . my-group-face-4)
             (t . my-group-face-5)))

Also see Faces and Fonts.

Variables that are dynamically bound when the forms are evaluated include:

group
     The group name.

unread
     The number of unread articles in the group.

method
     The select method.

mailp
     Whether the group is a mail group.

level
     The level of the group.

score
     The score of the group.

ticked
     The number of ticked articles in the group.

total
     The total number of articles in the group.  Or rather, MAX-NUMBER minus MIN-NUMBER plus one.

topic
     When using the topic minor mode, this variable is bound to the current topic being inserted.

When the forms are evaled, point is at the beginning of the line of the group in question, so you can use many of the normal Gnus functions for snarfing info on the group.

gnus-group-update-hook is called when a group line is changed. It will not be called when gnus-visual is nil.

Group Maneuvering
=================

All movement commands understand the numeric prefix and will behave as expected, hopefully.

n
     Go to the next group that has unread articles (gnus-group-next-unread-group).

p
DEL
     Go to the previous group that has unread articles (gnus-group-prev-unread-group).

N
     Go to the next group (gnus-group-next-group).

P
     Go to the previous group (gnus-group-prev-group).

M-n
     Go to the next unread group on the same (or lower) level (gnus-group-next-unread-group-same-level).

M-p
     Go to the previous unread group on the same (or lower) level (gnus-group-prev-unread-group-same-level).

Three commands for jumping to groups:

j
     Jump to a group (and make it visible if it isn't already) (gnus-group-jump-to-group).  Killed groups can be jumped to, just like living groups.

,
     Jump to the unread group with the lowest level (gnus-group-best-unread-group).

.
     Jump to the first group with unread articles (gnus-group-first-unread-group).

If gnus-group-goto-unread is nil, all the movement commands will move to the next group, not the next unread group.  Even the commands that say they move to the next unread group.  The default is t.

If gnus-summary-next-group-on-exit is t, when a summary is exited, the point in the group buffer is moved to the next unread group. Otherwise, the point is set to the group just exited.  The default is t.

Selecting a Group
=================

SPACE
     Select the current group, switch to the summary buffer and display the first unread article (gnus-group-read-group).  If there are no unread articles in the group, or if you give a non-numerical prefix to this command, Gnus will offer to fetch all the old articles in this group from the server.  If you give a numerical prefix N, N determines the number of articles Gnus will fetch.  If N is positive, Gnus fetches the N newest articles, if N is negative, Gnus fetches the abs(N) oldest articles.

     Thus, SPC enters the group normally, C-u SPC offers old articles, C-u 4 2 SPC fetches the 42 newest articles, and C-u - 4 2 SPC fetches the 42 oldest ones.

     When you are in the group (in the Summary buffer), you can type M-g to fetch new articles, or C-u M-g to also show the old ones.

RET
     Select the current group and switch to the summary buffer (gnus-group-select-group).  Takes the same arguments as gnus-group-read-group---the only difference is that this command does not display the first unread article automatically upon group entry.

M-RET
     This does the same as the command above, but tries to do it with the minimum amount of fuzz (gnus-group-quick-select-group).  No scoring/killing will be performed, there will be no highlights and no expunging.  This might be useful if you're in a real hurry and have to enter some humongous group.  If you give a 0 prefix to this command (i.e., 0 M-RET), Gnus won't even generate the summary buffer, which is useful if you want to toggle threading before generating the summary buffer (see Summary Generation Commands).

M-SPACE
     This is yet one more command that does the same as the RET command, but this one does it without expunging and hiding dormants (gnus-group-visible-select-group).

C-M-RET
     Finally, this command selects the current group ephemerally without doing any processing of its contents (gnus-group-select-group-ephemerally).  Even threading has been turned off.  Everything you do in the group after selecting it in this manner will have no permanent effects.

The gnus-large-newsgroup variable says what Gnus should consider to be a big group.  If it is nil, no groups are considered big.  The default value is 200.  If the group has more (unread and/or ticked) articles than this, Gnus will query the user before entering the group.  The user can then specify how many articles should be fetched from the server.  If the user specifies a negative number (-N), the N oldest articles will be fetched.  If it is positive, the N articles that have arrived most recently will be fetched.

gnus-large-ephemeral-newsgroup is the same as gnus-large-newsgroup, but is only used for ephemeral newsgroups.

In groups in some news servers, there might be a big gap between a few very old articles that will never be expired and the recent ones.  In such a case, the server will return the data like (1 . 30000000) for the LIST ACTIVE group command, for example.  Even if there are actually only the articles 1-10 and 29999900-30000000, Gnus doesn't know it at first and prepares for getting 30000000 articles.  However, it will consume hundreds megabytes of memories and might make Emacs get stuck as the case may be.  If you use such news servers, set the variable gnus-newsgroup-maximum-articles to a positive number. The value means that Gnus ignores articles other than this number of the latest ones in every group.  For instance, the value 10000 makes Gnus get only the articles 29990001-30000000 (if the latest article number is 30000000 in a group).  Note that setting this variable to a number might prevent you from reading very old articles.  The default value of the variable gnus-newsgroup-maximum-articles is nil, which means Gnus never ignores old articles.

If gnus-auto-select-first is non-nil, select an article automatically when entering a group with the SPACE command. Which article this is controlled by the gnus-auto-select-subject variable.  Valid values for this variable are:

unread
     Place point on the subject line of the first unread article.

first
     Place point on the subject line of the first article.

unseen
     Place point on the subject line of the first unseen article.

unseen-or-unread
     Place point on the subject line of the first unseen article, and if there is no such article, place point on the subject line of the first unread article.

best
     Place point on the subject line of the highest-scored unread article.

This variable can also be a function.  In that case, that function will be called to place point on a subject line.

If you want to prevent automatic selection in some group (say, in a binary group with Huge articles) you can set the gnus-auto-select-first variable to nil in gnus-select-group-hook, which is called when a group is selected.

Subscription Commands
=====================

The following commands allow for managing your subscriptions in the Group buffer.  If you want to subscribe to many groups, it's probably more convenient to go to the Server Buffer, and choose the server there using RET or SPC.  Then you'll have the commands listed in Browse Foreign Server at hand.

S t
u
     Toggle subscription to the current group (gnus-group-unsubscribe-current-group).

S s
U
     Prompt for a group to subscribe, and then subscribe it.  If it was subscribed already, unsubscribe it instead (gnus-group-unsubscribe-group).

S k
C-k
     Kill the current group (gnus-group-kill-group).

S y
C-y
     Yank the last killed group (gnus-group-yank-group).

C-x C-t
     Transpose two groups (gnus-group-transpose-groups).  This isn't really a subscription command, but you can use it instead of a kill-and-yank sequence sometimes.

S w
C-w
     Kill all groups in the region (gnus-group-kill-region).

S z
     Kill all zombie groups (gnus-group-kill-all-zombies).

S C-k
     Kill all groups on a certain level (gnus-group-kill-level). These groups can't be yanked back after killing, so this command should be used with some caution.  The only time where this command comes in really handy is when you have a .newsrc with lots of unsubscribed groups that you want to get rid off.  S C-k on level 7 will kill off all unsubscribed groups that do not have message numbers in the .newsrc file.

Also see Group Levels.

Group Data
==========

c
     Mark all unticked articles in this group as read (gnus-group-catchup-current). gnus-group-catchup-group-hook is called when catching up a group from the group buffer.

C
     Mark all articles in this group, even the ticked ones, as read (gnus-group-catchup-current-all).

M-c
     Clear the data from the current group---nix out marks and the list of read articles (gnus-group-clear-data).

M-x gnus-group-clear-data-on-native-groups
     If you have switched from one NNTP server to another, all your marks and read ranges have become worthless.  You can use this command to clear out all data that you have on your native groups.  Use with caution.

Group Levels
============

All groups have a level of subscribedness.  For instance, if a group is on level 2, it is more subscribed than a group on level 5.  You can ask Gnus to just list groups on a given level or lower (see Listing Groups), or to just check for new articles in groups on a given level or lower (see Scanning New Messages).

Remember:  The higher the level of the group, the less important it is.

S l
     Set the level of the current group.  If a numeric prefix is given, the next N groups will have their levels set.  The user will be prompted for a level.

Gnus considers groups from levels 1 to gnus-level-subscribed (inclusive) (default 5) to be subscribed, gnus-level-subscribed (exclusive) and gnus-level-unsubscribed (inclusive) (default 7) to be unsubscribed, gnus-level-zombie to be zombies (walking dead) (default 8) and gnus-level-killed to be killed (completely dead) (default 9).  Gnus treats subscribed and unsubscribed groups exactly the same, but zombie and killed groups have no information on what articles you have read, etc, stored.  This distinction between dead and living groups isn't done because it is nice or clever, it is done purely for reasons of efficiency.

It is recommended that you keep all your mail groups (if any) on quite low levels (e.g. 1 or 2).

Maybe the following description of the default behavior of Gnus helps to understand what these levels are all about.  By default, Gnus shows you subscribed nonempty groups, but by hitting L you can have it show empty subscribed groups and unsubscribed groups, too.  Type l to go back to showing nonempty subscribed groups again.  Thus, unsubscribed groups are hidden, in a way.

Zombie and killed groups are similar to unsubscribed groups in that they are hidden by default.  But they are different from subscribed and unsubscribed groups in that Gnus doesn't ask the news server for information (number of messages, number of unread messages) on zombie and killed groups.  Normally, you use C-k to kill the groups you aren't interested in.  If most groups are killed, Gnus is faster.

Why does Gnus distinguish between zombie and killed groups?  Well, when a new group arrives on the server, Gnus by default makes it a zombie group.  This means that you are normally not bothered with new groups, but you can type A z to get a list of all new groups.  Subscribe the ones you like and kill the ones you don't want.  (A k shows a list of killed groups.)

If you want to play with the level variables, you should show some care. Set them once, and don't touch them ever again.  Better yet, don't touch them at all unless you know exactly what you're doing.

Two closely related variables are gnus-level-default-subscribed (default 3) and gnus-level-default-unsubscribed (default 6), which are the levels that new groups will be put on if they are (un)subscribed.  These two variables should, of course, be inside the relevant valid ranges.

If gnus-keep-same-level is non-nil, some movement commands will only move to groups of the same level (or lower).  In particular, going from the last article in one group to the next group will go to the next group of the same level (or lower).  This might be handy if you want to read the most important groups before you read the rest.

If this variable is best, Gnus will make the next newsgroup the one with the best level.

All groups with a level less than or equal to gnus-group-default-list-level will be listed in the group buffer by default. This variable can also be a function.  In that case, that function will be called and the result will be used as value.

If gnus-group-list-inactive-groups is non-nil, non-active groups will be listed along with the unread groups.  This variable is t by default.  If it is nil, inactive groups won't be listed.

If gnus-group-use-permanent-levels is non-nil, once you give a level prefix to g or l, all subsequent commands will use this level as the ``work'' level.

Gnus will normally just activate (i. e., query the server about) groups on level gnus-activate-level or less.  If you don't want to activate unsubscribed groups, for instance, you might set this variable to 5.  The default is 6.

Group Score
===========

You would normally keep important groups on high levels, but that scheme is somewhat restrictive.  Don't you wish you could have Gnus sort the group buffer according to how often you read groups, perhaps?  Within reason?

This is what group score is for.  You can have Gnus assign a score to each group through the mechanism described below.  You can then sort the group buffer based on this score.  Alternatively, you can sort on score and then level.  (Taken together, the level and the score is called the rank of the group.  A group that is on level 4 and has a score of 1 has a higher rank than a group on level 5 that has a score of 300.  (The level is the most significant part and the score is the least significant part.))

If you want groups you read often to get higher scores than groups you read seldom you can add the gnus-summary-bubble-group function to the gnus-summary-exit-hook hook.  This will result (after sorting) in a bubbling sort of action.  If you want to see that in action after each summary exit, you can add gnus-group-sort-groups-by-rank or gnus-group-sort-groups-by-score to the same hook, but that will slow things down somewhat.

Marking Groups
==============

If you want to perform some command on several groups, and they appear subsequently in the group buffer, you would normally just give a numerical prefix to the command.  Most group commands will then do your bidding on those groups.

However, if the groups are not in sequential order, you can still perform a command on several groups.  You simply mark the groups first with the process mark and then execute the command.

#
M m
     Set the mark on the current group (gnus-group-mark-group).

M-#
M u
     Remove the mark from the current group (gnus-group-unmark-group).

M U
     Remove the mark from all groups (gnus-group-unmark-all-groups).

M w
     Mark all groups between point and mark (gnus-group-mark-region).

M b
     Mark all groups in the buffer (gnus-group-mark-buffer).

M r
     Mark all groups that match some regular expression (gnus-group-mark-regexp).

Also see Process/Prefix.

If you want to execute some command on all groups that have been marked with the process mark, you can use the M-& (gnus-group-universal-argument) command.  It will prompt you for the command to be executed.

Foreign Groups
==============

Below are some group mode commands for making and editing general foreign groups, as well as commands to ease the creation of a few special-purpose groups.  All these commands insert the newly created groups under point---gnus-subscribe-newsgroup-method is not consulted.

Changes from the group editing commands are stored in ~/.newsrc.eld (gnus-startup-file).  An alternative is the variable gnus-parameters, see Group Parameters.

G m
     Make a new group (gnus-group-make-group).  Gnus will prompt you for a name, a method and possibly an address.  For an easier way to subscribe to NNTP groups (see Browse Foreign Server).

G M
     Make an ephemeral group (gnus-group-read-ephemeral-group).  Gnus will prompt you for a name, a method and an address.

G r
     Rename the current group to something else (gnus-group-rename-group).  This is valid only on some groups---mail groups mostly.  This command might very well be quite slow on some back ends.

G c
     Customize the group parameters (gnus-group-customize).

G e
     Enter a buffer where you can edit the select method of the current group (gnus-group-edit-group-method).

G p
     Enter a buffer where you can edit the group parameters (gnus-group-edit-group-parameters).

G E
     Enter a buffer where you can edit the group info (gnus-group-edit-group).

G d
     Make a directory group (see Directory Groups).  You will be prompted for a directory name (gnus-group-make-directory-group).

G h
     Make the Gnus help group (gnus-group-make-help-group).

G D
     Read an arbitrary directory as if it were a newsgroup with the nneething back end (gnus-group-enter-directory). See Anything Groups.

G f
     Make a group based on some file or other (gnus-group-make-doc-group).  If you give a prefix to this command, you will be prompted for a file name and a file type. Currently supported types are mbox, babyl, digest, news, rnews, mmdf, forward, rfc934, rfc822-forward, mime-parts, standard-digest, slack-digest, clari-briefs, nsmail, outlook, oe-dbx, and mailman.  If you run this command without a prefix, Gnus will guess at the file type.  See Document Groups.

G u
     Create one of the groups mentioned in gnus-useful-groups (gnus-group-make-useful-group).

G w
     Make an ephemeral group based on a web search (gnus-group-make-web-group).  If you give a prefix to this command, make a solid group instead.  You will be prompted for the search engine type and the search string.  Valid search engine types include google, dejanews, and gmane. See Web Searches.

     If you use the google search engine, you can limit the search to a particular group by using a match string like shaving group:alt.sysadmin.recovery.

G R
     Make a group based on an RSS feed (gnus-group-make-rss-group).  You will be prompted for an URL. See RSS.

G DEL
     This function will delete the current group (gnus-group-delete-group).  If given a prefix, this function will actually delete all the articles in the group, and forcibly remove the group itself from the face of the Earth.  Use a prefix only if you are absolutely sure of what you are doing.  This command can't be used on read-only groups (like nntp groups), though.

G V
     Make a new, fresh, empty nnvirtual group (gnus-group-make-empty-virtual).  See Virtual Groups.

G v
     Add the current group to an nnvirtual group (gnus-group-add-to-virtual).  Uses the process/prefix convention.

See Select Methods, for more information on the various select methods.

If gnus-activate-foreign-newsgroups is a positive number, Gnus will check all foreign groups with this level or lower at startup. This might take quite a while, especially if you subscribe to lots of groups from different NNTP servers.  Also see Group Levels; gnus-activate-level also affects activation of foreign newsgroups.

The following commands create ephemeral groups.  They can be called not only from the Group buffer, but in any Gnus buffer.

gnus-read-ephemeral-gmane-group
     Read an ephemeral group on Gmane.org.  The articles are downloaded via HTTP using the URL specified by gnus-gmane-group-download-format. Gnus will prompt you for a group name, the start article number and an the article range.

gnus-read-ephemeral-gmane-group-url
     This command is similar to gnus-read-ephemeral-gmane-group, but the group name and the article number and range are constructed from a given URL.  Supported URL formats include e.g. http://thread.gmane.org/gmane.foo.bar/12300/focus=12399, http://thread.gmane.org/gmane.foo.bar/12345/, http://article.gmane.org/gmane.foo.bar/12345/, http://permalink.gmane.org/gmane.foo.bar/12345/, and http://news.gmane.org/group/gmane.foo.bar/thread=12345.

gnus-read-ephemeral-emacs-bug-group
     Read an Emacs bug report in an ephemeral group.  Gnus will prompt for a bug number.  The default is the number at point.  The URL is specified in gnus-bug-group-download-format-alist.

gnus-read-ephemeral-debian-bug-group
     Read a Debian bug report in an ephemeral group.  Analog to gnus-read-ephemeral-emacs-bug-group.

Some of these command are also useful for article buttons, see Article Buttons.

Here is an example:

     (require 'gnus-art)
     (add-to-list
      'gnus-button-alist
      '("#\\([0-9]+\\)\\>" 1
        (string-match "\\<emacs\\>" (or gnus-newsgroup-name ""))
        gnus-read-ephemeral-emacs-bug-group 1))

Group Parameters
================

The group parameters store information local to a particular group.

Use the G p or the G c command to edit group parameters of a group.  (G p presents you with a Lisp-based interface, G c presents you with a Customize-like interface.  The latter helps avoid silly Lisp errors.)  You might also be interested in reading about topic parameters (see Topic Parameters). Additionally, you can set group parameters via the gnus-parameters variable, see below.

Here's an example group parameter list:

     ((to-address . "ding@gnus.org")
      (auto-expire . t))

We see that each element consists of a ``dotted pair''---the thing before the dot is the key, while the thing after the dot is the value.  All the parameters have this form except local variable specs, which are not dotted pairs, but proper lists.

Some parameters have correspondent customizable variables, each of which is an alist of regexps and values.

The following group parameters can be used:

to-address
     Address used by when doing followups and new posts.

          (to-address . "some@where.com")

     This is primarily useful in mail groups that represent closed mailing lists---mailing lists where it's expected that everybody that writes to the mailing list is subscribed to it.  Since using this parameter ensures that the mail only goes to the mailing list itself, it means that members won't receive two copies of your followups.

     Using to-address will actually work whether the group is foreign or not.  Let's say there's a group on the server that is called fa.4ad-l.  This is a real newsgroup, but the server has gotten the articles from a mail-to-news gateway.  Posting directly to this group is therefore impossible---you have to send mail to the mailing list address instead.

     See also gnus-parameter-to-address-alist.

to-list
     Address used when doing a in that group.

          (to-list . "some@where.com")

     It is totally ignored when doing a followup---except that if it is present in a news group, you'll get mail group semantics when doing f.

     If you do an a command in a mail group and you have neither a to-list group parameter nor a to-address group parameter, then a to-list group parameter will be added automatically upon sending the message if gnus-add-to-list is set to t.

     If this variable is set, gnus-mailing-list-mode is turned on when entering summary buffer.

     See also gnus-parameter-to-list-alist.

subscribed
     If this parameter is set to t, Gnus will consider the to-address and to-list parameters for this group as addresses of mailing lists you are subscribed to.  Giving Gnus this information is (only) a first step in getting it to generate correct Mail-Followup-To headers for your posts to these lists.  The second step is to put the following in your .gnus.el

          (setq message-subscribed-address-functions
                '(gnus-find-subscribed-addresses))

     See Mailing Lists (The Message Manual), for a complete treatment of available MFT support.

visible
     If the group parameter list has the element (visible . t), that group will always be visible in the Group buffer, regardless of whether it has any unread articles.

     This parameter cannot be set via gnus-parameters. See gnus-permanently-visible-groups as an alternative.

broken-reply-to
     Elements like (broken-reply-to