12.6.1 Gnus Utility Functions

When writing small functions to be run from hooks (and stuff), it’s vital to have access to the Gnus internal functions and variables. Below is a list of the most common ones.

gnus-newsgroup-name

This variable holds the name of the current newsgroup.

gnus-find-method-for-group

A function that returns the select method for group.

gnus-group-real-name

Takes a full (prefixed) Gnus group name, and returns the unprefixed name.

gnus-group-prefixed-name

Takes an unprefixed group name and a select method, and returns the full (prefixed) Gnus group name.

gnus-get-info

Returns the group info list for group (see Group Info).

gnus-group-unread

The number of unread articles in group, or t if that is unknown.

gnus-active

The active entry (i.e., a cons cell containing the lowest and highest article numbers) for group.

gnus-set-active

Set the active entry for group.

gnus-add-current-to-buffer-list

Adds the current buffer to the list of buffers to be killed on Gnus exit.

gnus-continuum-version

Takes a Gnus version string as a parameter and returns a floating point number. Earlier versions will always get a lower number than later versions.

gnus-group-read-only-p

Says whether group is read-only or not.

gnus-news-group-p

Says whether group came from a news back end.

gnus-ephemeral-group-p

Says whether group is ephemeral or not.

gnus-server-to-method

Returns the select method corresponding to server.

gnus-server-equal

Says whether two virtual servers are essentially equal. For instance, two virtual servers may have server parameters in different order, but this function will consider them equal.

gnus-group-native-p

Says whether group is native or not.

gnus-group-secondary-p

Says whether group is secondary or not.

gnus-group-foreign-p

Says whether group is foreign or not.

gnus-group-find-parameter

Returns the parameter list of group (see Group Parameters). If given a second parameter, returns the value of that parameter for group.

gnus-group-set-parameter

Takes three parameters; group, parameter and value.

gnus-narrow-to-body

Narrows the current buffer to the body of the article.

gnus-check-backend-function

Takes two parameters, function and group. If the back end group comes from supports function, return non-nil.

(gnus-check-backend-function "request-scan" "nnml:misc")
⇒ t
gnus-read-method

Prompts the user for a select method.