# $buffer-names(5)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

$buffer-names - Filtered buffer name list

## SYNOPSIS

$buffer-names BufferName

## DESCRIPTION

$buffer-names must first be set to the required filter string, if the variable is evaluated before it is initialized the value will be set to "ABORT" and the command will fail. The filter takes the form of a regex.

Once initialized, evaluating $buffer-names returns the name of the next buffer which matches the filter until no more buffers are found, in which case an empty string is returned.

## EXAMPLE

The following example prints out the name of all buffers to the massage line one at a time. Note that &set(4) is used on the !while(4) statement to avoid evaluating $buffer-names twice per loop.

    set-variable $buffer-names ".*"
    !while &not &seq &set #l0 $buffer-names ""
        100 ml-write &cat "buffer: " #l0
    !done

The following example is the same except it lists only the buffers which are not directory listings

    set-variable $buffer-names ".*[^/]"
    !while &not &seq &set #l0 $buffer-names ""
        100 ml-write &cat "buffer: " #l0
    !done

## NOTES

The list of buffers is evaluated when the variable is initialized, buffers created after the initialization will not be included in the list.

Deleting buffers which are in the list, before they are evaluated, will have undefined effects.

## SEE ALSO

list-buffers(2), $buffer-bname(5), $file-names(5), $command-names(5), $mode-names(5), Regular Expressions.

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>