$command-names - Filtered command name list
$command-names must first be initialized 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 $command-names returns the name of the next command which matches the filter until no more commands are found, in which case an empty string is returned.
set-variable $command-names ".*" !while ¬ &seq &set #l0 $command-names "" 100 ml-write &cat "command: " #l0 !done
The following example is an alternative implementation of command-apropos(2).
define-macro alt-commad-apropos set-variable #l1 @ml "Apropos string" set-variable $command-names &cat &cat ".*" #l1 ".*" !force 0 delete-buffer "*commands*" 1 popup-window "*commands*" !while ¬ &seq &set #l0 $command-names "" insert-string &spr " %s\n" #l0 !done beginning-of-buffer -1 buffer-mode "edit" 1 buffer-mode "view" !emacro
$command-names does not differentiate between built in commands and macros.
The list of commands is evaluated when the variable is initialized, macros created after the initialization will not be included in the list.
Copyright (c) 1998-2006 JASSPA
Last Modified: 2002/01/11
Generated On: 2006/10/07