Go to the first, previous, next, last section, table of contents.

# Starting Gnus

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 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.

- Finding the News: Choosing a method for getting news.
- The First Time: What does Gnus do the first time you start it?
- The Server is Down: How can I read my mail then?
- Slave Gnusii: You can have more than one Gnus active at a time.
- Fetching a Group: Starting Gnus just to read a group.
- New Groups: What is Gnus supposed to do with new groups?
- Startup Files: Those pesky startup files---``.newsrc'`.
- Auto Save: Recovering from a crash.
- The Active File: Reading the active file over a slow line Takes Time.
- Startup Variables: Other variables you might change.

## Finding the News

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 that are 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.

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 will try to use the machine that is running Emacs as an NNTP server. That's a long-shot, though.

If `gnus-nntp-server` is set, this variable will override `gnus-select-method`. You should therefore set `gnus-nntp-server` to `nil`, which is what it is by default.

You can also make Gnus prompt you interactively for the name of an NNTP server. If you give a non-numerical prefix to `gnus` (i.e., `C-u M-x gnus`), Gnus will let you choose between the servers in the `gnus-secondary-servers` list (if any). You can also just type in the name of any server you feel like visiting.

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 section 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` backend to read your mail, you would typically set this variable to

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

## The First Time

If no startup files exist, 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 here defined 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.

## Slave Gnusiï

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 (eg., if you are using the two different Gnusiï to read from two different servers), that is no problem whatsoever. You just do it.

The problem appears when you want to run two Gnusiï 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 servants. (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.)

Anyways, you start one Gnus up the normal way with `M-x gnus` (or however you do it). Each subsequent slave Gnusiï should be started with `M-x gnus-slave`. These slaves won't save normal ``.newsrc'` files, but instead save slave files that contains 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.

## Fetching a Group

It it sometime convenient to be able to just say "I want to read this group and I don't care whether Gnus has been started or not". This is perhaps more useful for people who write code than for users, but the command `gnus-fetch-group` provides this functionality in any case. It takes the group name as a parameter.

## New Groups

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

This variable should contain a function. Some handy pre-fab values are:

`gnus-subscribe-zombies`
  Make all new groups zombies. You can browse the zombies later (with `A z`) and either kill them all off properly, or subscribe to them. This is the default.
`gnus-subscribe-randomly`
  Subscribe all new groups randomly.
`gnus-subscribe-alphabetically`
  Subscribe all new groups alphabetically.
`gnus-subscribe-hierarchically`
  Subscribe all new groups hierarchically.
`gnus-subscribe-interactively`
  Subscribe new groups interactively. This means that Gnus will ask you about all new groups.
`gnus-subscribe-killed`
  Kill all new groups.

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 to `gnus-subscribe-hierarchical-interactive`. This is an error. This will not work. This is ga-ga. So don't do it.

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 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 backends (`nnml`, `nnbabyl`, `nnfolder`, `nnmbox`, and `nnmh`) subscribed. If you don't like that, just set this variable to `nil`.

If you are satisfied that you really never want to see any new groups, you could 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 section Group Maintenance). This variable is `t` by default.

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 & 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 any don't, 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.

## Startup Files

Now, you all know about the ``.newsrc'` file. All subscription information is traditionally stored in this file.

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 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 making exit from Gnus faster. However, this will make it impossible to use other newsreaders than Gnus. But hey, who would want to, right?

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 means 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 section New Groups).

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.

`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 off by default when saving the startup files.

## 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.

## 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 section 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 `t` 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.

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.

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.

## Startup Variables

`gnus-load-hook`
  A hook that is 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-startup-hook`
  A hook that is run after starting up Gnus successfully.
`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 section Group Maintenance).
`gnus-inhibit-startup-message`
  If non-`nil`, the startup message won't be displayed. That way, your boss might not notice that you are reading news instead of doing your job as easily.
`gnus-no-groups-message`
  Message displayed by Gnus when no groups are available.

Go to the first, previous, next, last section, table of contents.