7.7.2 Combined Groups

An nnvirtual group is really nothing more than a collection of other groups.

For instance, if you are tired of reading many small groups, you can put them all in one big group, and then grow tired of reading one big, unwieldy group. The joys of computing!

You specify nnvirtual as the method. The address should be a regexp to match component groups.

All marks in the virtual group will stick to the articles in the component groups. So if you tick an article in a virtual group, the article will also be ticked in the component group from whence it came. (And vice versa—marks from the component groups will also be shown in the virtual group.). To create an empty virtual group, run G V (gnus-group-make-empty-virtual) in the group buffer and edit the method regexp with M-e (gnus-group-edit-group-method)

Here’s an example nnvirtual method that collects all Andrea Dworkin newsgroups into one, big, happy newsgroup:

(nnvirtual "^alt\\.fan\\.andrea-dworkin$\\|^rec\\.dworkin.*")

The component groups can be native or foreign; everything should work smoothly, but if your computer explodes, it was probably my fault.

Collecting the same group from several servers might actually be a good idea if users have set the Distribution header to limit distribution. If you would like to read ‘soc.motss’ both from a server in Japan and a server in Norway, you could use the following as the group regexp:

"^nntp\\+server\\.jp:soc\\.motss$\\|^nntp\\+server\\.no:soc\\.motss$"

(Remember, though, that if you’re creating the group with G m, you shouldn’t double the backslashes, and you should leave off the quote characters at the beginning and the end of the string.)

This should work kinda smoothly—all articles from both groups should end up in this one, and there should be no duplicates. Threading (and the rest) will still work as usual, but there might be problems with the sequence of articles. Sorting on date might be an option here (see Selecting a Group).

One limitation, however—all groups included in a virtual group have to be alive (i.e., subscribed or unsubscribed). Killed or zombie groups can’t be component groups for nnvirtual groups.

If the nnvirtual-always-rescan variable is non-nil (which is the default), nnvirtual will always scan groups for unread articles when entering a virtual group. If this variable is nil and you read articles in a component group after the virtual group has been activated, the read articles from the component group will show up when you enter the virtual group. You’ll also see this effect if you have two virtual groups that have a component group in common. If that’s the case, you should set this variable to t. Or you can just tap M-g on the virtual group every time before you enter it—it’ll have much the same effect.

nnvirtual can have both mail and news groups as component groups. When responding to articles in nnvirtual groups, nnvirtual has to ask the back end of the component group the article comes from whether it is a news or mail back end. However, when you do a ^, there is typically no sure way for the component back end to know this, and in that case nnvirtual tells Gnus that the article came from a not-news back end. (Just to be on the safe side.)

C-c C-n in the message buffer will insert the Newsgroups line from the article you respond to in these cases.

nnvirtual groups do not inherit anything but articles and marks from component groups—group parameters, for instance, are not inherited.