Using the Pending List
You have seen the source and argument strings are two sources of information upon which a prefix macro can base decisions. Another is the pending list.
The pending list is a list of prefix subcommands and macros that have not yet been executed. Every time the editor reads the screen, the pending list is updated (automatically) with any new prefix subcommands and macros that have been entered, each of which causes an entry to be added to the list. Each entry is associated with a specific line in the file.
The pending list is executed when it is changed. If a prefix macro returns a nonzero return code, execution of the pending list stops and all entries not executed remain pending, until the user presses Enter (or a PF or PA key).
An entry is deleted from the pending list when it is executed or overtyped on the user's screen with a new prefix subcommand, prefix macro, or blanks. For example, when the L prefix macro is invoked, it is removed from the pending list.
A prefix macro can control its execution and display or remove the pending notice from the status area of the screen by examining information in the pending list (EXTRACT/QUERY PENDING) and by adding or deleting entries in it (SET PENDING). See z/VM: XEDIT Commands and Macros Reference for detailed information on these subcommands.
The pending notice is displayed in the status area as follows:
value pending...where value is the name of the prefix subcommand
or macro entered in the prefix area, as derived from the source string
(see line 34). (If multiple prefix subcommands or macros are pending,
the first one, starting from the top of file, is displayed in the
pending notice.)
In our example, suppose the user entered the block form (LL), which is determined by line 26. First, the macro needs to know if another LL has been entered, that is, if the pending list contains a matching block entry.
To determine this, the macro examines the pending list by issuing the EXTRACT subcommand shown in line 29. This subcommand searches the pending list for a matching block entry, which must be located in the file within the range specified by the targets, that is, between the top of file (:0) and the prefix line (:pline), inclusive. If no matching entry is found, the screen is placed in a pending status (line 34).
If a second LL was entered, the pending status of the screen will not be seen because the macro is automatically invoked again as the pending list is executed. This time, the EXTRACT subcommand (line 29) finds the matching block entry, the pending notice is removed (line 31) and the LOWERCAS subcommand is executed for the block of lines (line 32).