Sams Teach Yourself Emacs in 24 Hours
Hour 20: Gnus Basics
I guess you already are using an email client and a news reader, right? And I guess that you're asking yourself, "Why should I take the time to learn a new email client and news reader?" Right?! The answer is simple; Gnus is without a doubt the best news reader available. Because Gnus is simply an extension to Emacs, you can use all of Emacs's features, including macros, incremental searching, and all the editing commands such as transposing and dynamic abbreviation. If you are not convinced, please think carefully about your normal mail clients and news readers, and ask yourself whether you have ever needed the power of Emacs.
The description of Gnus is split over two hours. This hour should give you enough knowledge to get up and running, and Hour 21, "Advanced Gnus," takes you farther and shows you some of the features that makes Gnus such a fantastic program. These include
Using a database with information about people
Ordering your group in topic
Tip - In this hour the names of the functions invoked by the keys described are not listed. The reason for this is that the functions often have very long names, and I will tell you about many keybindings in these hours. Furthermore it is unlikely that any of these keybindings are changed (compared to the keybindings for the normal Emacs use).
Caution - At the moment I write this, the newest version of Gnus that these two hours describe is still being developed. This means that there might be some points that are not correct in the book. So please visit the book's home page at www.mcp.com, for a list of changes since this was written.
Note - Windows does not come with a UNIX-style mail transport agent (MTA), and most Windows users get their mail from a remote Post Office Protocol (POP) server. To get your mail from a POP server, get the latest version of the EPOP3 package. For details, see the NT Emacs FAQ. Setup is straightforward. Read the file epop3mail.el for the details. Don't forget to prepend po: to your email address when you set it in your .emacs file.
(setq rmail-primary-inbox-list '("po:[email protected]"))
If you want to see exactly what EPOP3 is doing, add this to your .emacs:
; debug tool:
Gnus is a combined news and mail reader and, of course also a news and mail writer. At first glance, it might seem like a strange thing that Gnus does both, but the following lists of similarities and dissimilarities should make it clear that news and mail aren't that different.
The following are the similarities:
Mail and news are both concerned with messages from one person to one or several others. Common for both types is that the message does not necessarily need to be read at once and sometimes does not even need to be answered.
Mail and news can both be threaded; that is, you can write a letter (or post an article), someone can answer or comment on this, and you can later answer or comment on this letter again. This way a discussion might go on for a long time.
Without proper organization, important information can get lost. With mail, this can happen if you have hundreds of unread letters and one of them is an important note from your boss. With news, this can happen if the number of articles posted every day is more than you are capable of handling and you don't have proper tools to help you out.
The following are the differences:
Mail tends to be more personal than news (although this is not true for mailing lists).
Mail is often directed to one person, whereas news is sent to a group without knowing anything about the receiver. (Again, this is not true for mailing lists.)
The technologies and the terms used when sending mail and news are different. You, for example, talk about "sending a letter," whereas you "post an article."
It is important to study these items, because they list both why you should use the same tool for mail and news and some of the pitfalls you should be careful about. The major pitfall with using the same tool is that you might start projecting some of your habits from news reading onto mail reading, for example, the ease with which you can discard news.
In Gnus you work in four different buffers. These buffers are as follows:
The Group buffer--In the group buffer you get an overview of all your subscribed groups (see Figure 20.1). This includes newsgroups and mail folders. In fact you will seldom see a difference between news, mailing lists, and ordinary mail.
The Summary buffer--You enter the summary buffer by pressing either the Spacebar or the Enter key on top of one of the groups in the Group buffer. The Summary buffer shows a summary of all the letters in the given group (see Figure 20.2). Often, you see only the unread letters, but you have control over that of course.
The Article buffer--Pressing the Enter key in the summary buffer shows you the content of the given letter or article, from now on referred to as the message (see Figure 20.3).
The Message buffer--When you need to send a message, you are placed in a buffer where you can write the message (see Figure 20.4).
Gnus works a bit differently than other email programs (that is, other email programs not working in Emacs). When you receive a letter, Gnus copies this letter from your inbox to a special directory where only Gnus has access to it. This is to avoid all the problems that otherwise often are involved with two processes accessing the same files simultaneously, and also to make Gnus work faster.
The directory Gnus copies the file to can be chosen from one of the following:
nnmbox--This is the standard mailbox used for incoming mail in UNIX. (This is several folders in one file.)
nnfolder--This is like mbox, but each folder is kept in separate files.
nnml--This is a format specific to Gnus. Each letter is located in a separate file. This is the fastest method, but uses many files. (The number of files on a hard disk is limited!)
Each of these methods are often referred to as mail backends .
Sams Teach Yourself Emacs in 24 Hours
Hour 20: Gnus Basics
© Copyright Macmillan USA. All rights reserved.