$buffer-names - Filtered buffer name list
$buffer-names BufferName
$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 string can contain wild-card characters compatible with most file systems, namely:-
?
[abc]
[a-d]
[^abc]
*
Note that these are not the same characters used by exact(2m) mode.
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.
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 ¬ &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 ¬ &seq &set #l0 $buffer-names "" 100 ml-write &cat "buffer: " #l0 !done
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.
(c) Copyright JASSPA 1999
Last Modified: 1998/09/03
Generated On: 1999/12/01