9 Keyword completion and abbreviation expansion

Emacs provides various standard facilities for semi-automatic completion of key words and phrases. See Completion for Symbol Names in The Emacs Editor. See Dynamic Abbrev Expansion in The Emacs Editor. REDUCE mode provides completion of common REDUCE key words and phrases, such as ‘procedure’, by typing the first few letters of a key word or phrase and then pressing Meta-TAB. (For use under Microsoft Window Miscellaneous features.) This works in a similar way to completion in other major modes; Completion for Symbol Names in The Emacs Editor.

REDUCE mode also provides abbreviations that are expanded like completions, except that they are replaced by their expansions rather than completed. Examples of the abbreviations currently defined are:

    ("ap" . "algebraic procedure ")
    ("st" . "such that ")
    ("sop" . "symbolic operator ")
    ("sp" . "symbolic procedure ")

The following symbols currently trigger structure completion:

    ("begin" . reduce-insert-block)
    ("ift" . reduce-expand-if-then)
    ("ife" . reduce-expand-if-then-else)
    ("<<" . reduce-insert-group)

They operate in exactly the same way as if the appropriate structure insertion command had been executed directly, and they receive any prefix argument entered before the completion key.

For the full set of completions and abbreviations see the customizable option reduce-completion-alist.

M-TAB
M-x reduce-complete-symbol

Perform completion on the REDUCE symbol preceding point (or preceding the region if it is active). Compare that symbol against the elements of reduce-completion-alist. If a perfect match (only) has a cdr then delete the match and insert the cdr if it is a string or call it if it is a (nullary) function, passing on any prefix argument (in raw form).