Next Previous Contents

3. Group Functions

The intrinsic functions described in this chapter are available in group mode.

3.1 current_newsgroup

Usage

String current_newsgroup ()

Description

This function returns the name of the current newsgroup.

See Also

server_name

3.2 get_group_flags

Usage

Integer get_group_flags ()

Description

This function returns the flags associated with the current newsgroup. This integer is a bitmapped value whose bits are defined by the following constants:

     GROUP_UNSUBSCRIBED   : set if the group is unsubscribed
     GROUP_NEW_GROUP_FLAG : set if the group is new

See Also

get_header_flags, set_group_flags, current_newsgroup

3.3 get_group_order

Usage

Array_Type get_group_order ()

Description

This function returns an array of strings that contains the names of all known groups in the current order.

Notes

This function is only available if slrn was compiled with S-Lang 1.4.x.

See Also

set_group_order

3.4 group_down_n

Usage

Integer group_down_n (Integer n)

Description

This function moves the current group pointer down n groups and returns the actual number moved.

See Also

group_up_n, group_search, current_newsgroup

3.5 group_search

Usage

Integer group_search (String name)

Description

This function searches for a newsgroup containing the string name. It also searches newsgroup descriptions. A non-zero value is returned upon success or zero upon failure.

Notes

This search may wrap.

See Also

select_group, current_newsgroup

3.6 group_unread

Usage

Integer group_unread ()

Description

This function returns the number of unread articles in the current newsgroup.

See Also

select_group, current_newsgroup, is_group_mode

3.7 group_up_n

Usage

Integer group_up_n (Integer n)

Description

This function moves the current group pointer up n groups and returns the actual number moved.

See Also

group_down_n, group_search, current_newsgroup

3.8 hide_current_group

Usage

Void hide_current_group ()

Description

Hides the current group in the group window. Hidden groups can be displayed again by calling ``toggle_hidden''.

3.9 is_group_mode

Usage

Integer is_group_mode ()

Description

This function returns non-zero if the current mode is group-mode.

See Also

3.10 select_group

Usage

Integer select_group ()

Description

This function may be used to select the current group. It returns 0 upon success or -1 upon failure. It can fail if the group has no articles.

Note that in some situations, this function will set an slang error condition. This includes cases in which the user interrupted transfer of article headers or all articles got killed by the scorefile.

See Also

current_newsgroup

3.11 set_group_display_format

Usage

Void set_group_display_format (Int_Type nth, String_Type fmt)

Description

This function may be used to set the nth group display format to fmt. One may interactively toggle between the formats via the toggle_group_formats keybinding.

The generic format is identical to the one described in set_header_display_format. The following descriptors are defined:

         F : Group flag (`U' for unsubscribed, `N' for new)
         d : Group description (needs to be downloaded once with slrn -d)
         g : goto a specified column
         h : ``High water mark'' (highest article number in the group)
         l : ``Low water mark'' (lowest article number in the group)
         n : Group name
         t : Total number of articles in the group (estimate)
         u : Number of unread articles in the group

3.12 set_group_flags

Usage

Void set_group_flags (Integer flags)

Description

This function may be used to set the flags associated with the current newsgroup.

See Also

get_group_flags

3.13 set_group_order

Usage

Void set_group_order (Array_Type names)

Description

When names is a one-dimensional array of strings (group names), slrn will sort the group list into the implied order. Strings that do not match known groups are ignored; existing groups that are not included in names remain in their current (relative) order, but will be moved to the end of the list.

Example

According to the above rule, it is possible to move a group to the top of the list by using it as the only element of names:

      set_group_order ("news.software.readers");
Moving a group to the end of the list can be done by removing it from the list returned by get_group_order and calling set_group_order on the result.

An example for a simple group sort based on this function can be found in the file gsort.sl that comes with slrn.

Notes

This function is only available if slrn was compiled with S-Lang 1.4.x.

See Also

get_group_order


Next Previous Contents