Sams Teach Yourself Emacs in 24 Hours

ContentsIndex

Hour 21: Advanced Gnus

Previous HourNext Hour

Sections in this Hour:

 

Additional Summary Commands


It is in the Summary buffer that you can see all the messages for a given group. The number of messages can range from a few in your default mailbox to several thousand in very active newsgroups or in your archives. It is therefore quite important that you ask Gnus to help you find the messages you are interested in. Gnus can help you in several different ways, as this section shows you.

Searching Through All Your Messages

By pressing M-s or M-r in the Summary buffer, you can search through all the messages in the given group--that is, through the bodies of all the messages in the given group. C-s and C-r in this buffer are used to search the content of the Summary buffer.

Sorting Your Messages

Besides showing the messages as threads, Gnus can also sort the messages by the order of arrival, by author, by subject, or by a few other means. When using this feature, you should most likely disable threading, which is done by pressing C-M-t, because otherwise only the topmost message in the thread is used when sorting. The rest of the messages just come along with the topmost one. There is one exception to this rule, which is that sorting by score is a good idea to do when threads is enabled, because this means that the threads with the highest scores are shown first. All the sorting functions is available from the Misc menu in the sum entry called Sort.

Limiting the View

If you are searching for a message from a given person, it might still be hard to find, if a hundred messages from him reside next to hundreds of other messages in the given buffer. A solution to this problem is to limit the view to show only the messages from him and then continue the search for the given message from there on. When you have only messages from him shown, you can continue limiting the search to messages sent within the last year, for example, and finally simply search through the rest of the messages using M-s as described previously.

The menu item Misc, Mark Limit contains all the functions for limiting the Summary buffer. These functions include functions for limiting to subject, author, and age for example.

When you have limited the set of messages to a given subset in the Summary buffer and are finished with this limit, you might want to see all the messages from the Summary buffer again. This is achieved using the element called Pop Limit in the menu. This works much like narrowing described in Hour 15, "Getting an Overview of a File," where you can narrow and later widen. There is one difference, though! Using narrowing, you can narrow down several times, but only widen once, which shows you the whole buffer again. In contrast, in Gnus you can use Pop Limit as many times as you limit.

If you need to limit to something special, then you can get a long way by setting process marks on the messages that you want to limit to and then use the function Misc, Mark Limit, Articles.

Process marks can be set by pressing # when point is on a message. Process marks can be removed by pressing M-#. Finally, there are many different functions for setting process marks in the menu item Misc, Process Mark. In this menu, you find functions for setting process marks in a region or based on a regular expression.

Customizing the Summary Line

In the section "Customizing the Group Line," you saw that it is possible to customize the group line. Likewise it is possible to customize the Summary line, which shows the author, score, and subject for a given message. This line is configured the same way that the group line was configured.

One of the problems with the current Summary line format is that it is not very informative when you look at groups containing messages you sent (for example, your archive of sent messages). The reason for that is that the summary line shows the author of the messages, but all of the messages are from you and you know that already. If you make an addition similar to the following into your .Gnus file, this problem will be solved:


(setq gnus-ignored-from-addresses "[email protected]") 
(setq gnus-extra-headers '(To Newsgroup)) 
(setq nnmail-extra-headers gnus-extra-headers) 
(setq gnus-summary-line-format "%U%R%z %4i %([%4L: %-25,25f]%) %I%s\n") 
(setq gnus-summary-same-subject "-||-") 

Besides solving this problem, this addition makes the summary line much more readable when many levels of threads are shown. You can see for yourself in Figure 21.8.

Figure 21.8
This contains a readable summary line.

For the addition to work, you should replace [email protected] with your own email address. (This is, in fact, a regular expression, so the dot should have been escaped for this to be completely accurate). In Figure 21.9 you can see a description of the most interesting element from the previous formatting expression.

Figure 21.9
The formatting expression used to format the summary line.

Sams Teach Yourself Emacs in 24 Hours

ContentsIndex

Hour 21: Advanced Gnus

Previous HourNext Hour

Sections in this Hour: