Next Previous Contents

1. Header and Thread Functions

The intrinsic functions described in this chapter are available in article mode and allow you to manipulate the header window.

1.1 collapse_thread

Usage

Void collapse_thread ()

Description

This function may be used to collapse the current thread.

See Also

uncollapse_thread, collapse_threads, is_thread_collapsed

1.2 collapse_threads

Usage

Void collapse_threads ()

Description

This function will collapse all threads in the current newsgroup.

See Also

uncollapse_threads

1.3 extract_article_header

Usage

String_Type extract_article_header (String h)

Description

This function returns the article header line specified by the header keyword h of the currently selected header. The currently selected header may correspond to the currently displayed article. To get a header of the currently displayed article, use the extract_displayed_article_header function.

If the header does not exist, it returns the empty string.

Notes

This function will not query the server. If you are looking for a non-NOV header which was not stored for expensive scoring, then download the message associated with the current header line.

See Also

extract_displayed_article_header, is_article_visible

1.4 extract_displayed_article_header

Usage

String_Type extract_displayed_article_header (String h)

Description

This function returns the article header line specified by the header keyword h of the currently displayed message. If the header does not exist, it returns the empty string.

See Also

extract_displayed_article_header, is_article_visible

1.5 get_grouplens_score

Usage

Integer get_grouplens_score ()

Description

This function returns the grouplens score of the current header. If the header has no grouplens score, or if grouplens support has not been enabled, 0 will be returned.

1.6 get_header_flags

Usage

Integer get_header_flags ()

Description

This functions returns the flags for the current header. This integer is a bitmapped value whose bits are defined by the following constants:

      HEADER_READ : set if header is marked as read
      HEADER_TAGGED : set if header has `*' tag
      HEADER_HIGH_SCORE : set if header has high score
      HEADER_LOW_SCORE : set if header has low score

See Also

set_header_flags

1.7 get_header_number

Usage

Integer get_header_number ()

Description

This function returns the article number for the current header (i.e. the one assigned by the server and recorded in the newsrc file). If you want the current cursor position instead, use header_cursor_pos.

1.8 get_header_score

Usage

Integer get_header_score ()

Description

This functions returns the score for the current header.

See Also

set_header_score

1.9 get_header_tag_number

Usage

Integer get_header_tag_number ()

Description

This function returns the value of the numerical tag associated with the current header. If the header has no numerical tag, zero is returned.

1.10 get_visible_headers

Usage

String_Type get_visible_headers ()

Description

The get_visible_headers function returns the list of headers headers that are to be displayed when an article is viewed. See the documentation for the set_visible_headers for the format of this string.

See Also

set_visible_headers, is_article_visible, set_header_display_format

1.11 goto_num_tagged_header

Usage

Integer goto_num_tagged_header (Integer n)

Description

This function causes the header with numerical tag n to become the current header. It returns 1 upon success or 0 upon failure.

See Also

header_down, get_header_flags, call

1.12 has_parent

Usage

Integer has_parent ()

Description

Returns 1 if the current header has a parent (within a thread tree), 0 otherwise.

1.13 header_cursor_pos

Usage

Integer header_cursor_pos ()

Description

This function returns the current position of the cursor in the header summary window. This is the same as the ``header number'' of the article that gets displayed if the use_header_numbers config variable is turned on, so it is always a number in the range 1 through SCREEN_HEIGHT-3; do not confuse it with the article number assigned by the server (which can be obtained using the intrinsic function get_header_number). If the article pager is ``zoomed'', this function always returns 1.

1.14 header_down

Usage

Integer header_down (Integer n)

Description

The function moves the current position down n headers. It returns the number that was actually moved.

See Also

header_up

1.15 header_next_unread

Usage

Integer header_next_unread ()

Description

Goto next unread header. When reading from an slrnpull spool, headers for which the article body is not present are skipped. The function returns one upon success or zero upon failure.

See Also

header_down

1.16 header_up

Usage

Integer header_up (Integer n)

Description

The function moves the current position up n headers. It returns the number that was actually moved.

See Also

header_down

1.17 headers_hidden_mode

Usage

Int_Type headers_hidden_mode ()

Description

This function may be used to determine whether or not some headers will be hidden when an article is displayed. It returns 0 is all headers will be displayed, or a non-zero value if some may be hidden.

See Also

set_visible_headers, get_visible_headers, is_article_visible

1.18 is_thread_collapsed

Usage

Integer is_thread_collapsed ()

Description

If the current header is the start of a collapsed thread, this function will return a non-zero value. If the thread is expanded, zero will be returned.

See Also

collapse_thread

1.19 locate_header_by_msgid

Usage

Int_Type locate_header_by_msgid (String_Type msgid, Int_Type qs)

Description

The locate_header_by_msgid function may be used to set the current header to one whose message-id is given by msgid. If the second parameter qs is non-zero, then the header will be retrieved from the server if it is not in the current list of headers. The function returns 1 if an appropriate header was found, or 0 otherwise.

Example

One possible use of this function is to mark the current position in the header list and return to that position later, e.g.,

       % Save the current position
       variable msgid = extract_article_header ("Message-ID");
          .
          .
       % Return to previous position.
       () = locate_header_by_msgid (msgid, 0);

1.20 next_tagged_header

Usage

Integer next_tagged_header ()

Description

This function moves the current header position to the next * tagged header. It returns non-zero upon success or zero upon failure.

See Also

prev_tagged_header, goto_num_tagged_header, header_up, header_down

1.21 prev_tagged_header

Usage

Integer prev_tagged_header ()

Description

This function moves the current header position to the previous `*' tagged header. It returns non-zero upon success or zero upon failure.

See Also

next_tagged_header, goto_num_tagged_header, header_up, header_down

1.22 re_bsearch_author

Usage

Integer re_bsearch_author (String regexp)

Description

Search backward for header whose author matches regular expression regexp. If successful, it returns 1 and the current header is set to the matching header. It returns 0 upon failure.

See Also

re_fsearch_author, re_fsearch_subject

1.23 re_bsearch_subject

Usage

Integer re_bsearch_subject (String regexp)

Description

Search backward for header whose subject matches regular expression regexp. If successful, it returns 1 and the current header is set to the matching header. It returns 0 upon failure.

See Also

re_fsearch_author, re_bsearch_subject

1.24 re_fsearch_author

Usage

Integer re_bsearch_author (String regexp)

Description

Search forward for header whose author matches regular expression regexp. If successful, it returns 1 and the current header is set to the matching header. It returns 0 upon failure.

See Also

re_bsearch_author, re_fsearch_subject

1.25 re_fsearch_subject

Usage

Integer re_fsearch_subject (String regexp)

Description

Search forward for header whose subject matches regular expression regexp. If successful, it returns 1 and the current header is set to the matching header. It returns 0 upon failure.

See Also

re_fsearch_author, re_bsearch_subject

1.26 set_header_display_format

Usage

Void set_header_display_format (Int_Type nth, String_Type fmt)

Description

The set_header_display_format function may be used to set the nth header display format to fmt. One may interactively toggle between the formats via the toggle_header_formats keybinding.

The generic format specifier begins with the % character and must be of the form:

        %[-][w]x
where the brackets indicate optional items. Here, w is a width specifier consisting of one or more digits. If the minus sign (-) is present, the item will be right justified, otherwise it will be left justified. The item specifier x is required and, depending on it value, has the following meaning:
         s : subject
         S : score
         r : author real name
         f : from header
         G : Group lens score
         l : Number of lines
         n : server number
         d : date
         t : thread tree
         F : flags (read/unread, `*' and `#' tags, header number)
         % : percent character
         g : goto a specified column
Thus, "%F%-5l:%t%s" indicates that the header window will contain the, in order: the flags, the number of lines the article contains right justified in a 5 character field, a `:', the tree, and the subject.

The g format specifier must be preceeded by a number that indicates the next write should take place at the specified column. If the column number is negative, then the column is interpreted as an offset from the right side of the display. For example, %-24g%f indicates that then From header is to be written out 24 columns from the right edge of the window.

See Also

set_visible_headers

1.27 set_header_flags

Usage

Void set_header_flags (Integer flags)

Description

This function may be used to set the flags associated with the currently selected header. See the description for the get_header_flags function for more information.

See Also

get_header_flags

1.28 set_header_score

Usage

Void set_header_score (Integer score)

Description

This function may be used to set the score of the current header.

See Also

get_header_score

1.29 set_visible_headers

Usage

Void set_visible_headers (String_Type header_list)

Description

The set_visible_headers function may be used to specify the headers that are displayed when an article is viewed. The string header_list specifies a comma separated list of headers to show.

Example

To show only the From header and headers that start with `X-', use:

     set_visible_headers ("X-,From:");

See Also

get_visible_headers, headers_hidden_mode, is_article_visible, set_header_display_format

1.30 sort_by_sorting_method

Usage

Void sort_by_sorting_method ()

Description

This function sorts the articles in header overview by the current sorting mode.

Example

This is useful if you want to apply changes to sorting_method:

     set_integer_variable("sorting_method", 3);
     sort_by_sorting_method ();

1.31 thread_size

Usage

Integer thread_size ()

Description

This function returns the number of articles in the current thread or subthread.

1.32 uncollapse_thread

Usage

Void uncollapse_thread ()

Description

This function may be used to uncollapse the current thread.

See Also

thread_size, collapse_thread, is_thread_collapsed

1.33 uncollapse_threads

Usage

Void uncollapse_threads ()

Description

This function uncollapses all threads. This is usually necessary if you want to use the header movement functions to access hidden headers.

See Also

collapse_threads


Next Previous Contents